Qt's Home

The Story of a french guy discovering the world

Week 2 - Day 2 - Oop, Friends & Brothers, Battleship & Sudoku

| Comments

OOP

Development is a wide topic to learn. New ways to do everything a developer need to do appear everyday. But then, the practices, the basis behind all of these new tools is slow and moves at a steady pace.
You can take it as :
– The tools are waves.
Thousands land on your shores everyday. None is exactly the same as another, every one of them is different, and to a surfer, a fisherman, or anybody who could make us of them, every one of them could be a treasure or a pain.
– The practices are ties.
They also come, but at a very slow pace. They too are very different, and affect anybody much more than waves, but because of that slow pace, we tend to focus less on that.

Well, today was the second day of introduction to Object Oriented Programming. One could probably spend hours writing about such a notion, but I will stick to a one sentence explanation.

Object Oriented Programming is a way to work in development by modeling blocks of code in what people call an “Object”. Wikipedia, among others, explains that much more easily than I do, I encourage you to get there to check what it is about. ;)
Plus, I don’t have much interesting things to say about it so… I won’t say much!

Friends & Brothers

Yesterday, I paired with Jamie, a nice american-name, american-accent girl who does not look like her profile picture and who does NOT like country music (Hehe… Sorry for the private joke). In all honesty, it went well, and if it had been another person, I may have spent a bad time. The challenges were about things that I could not say I master, but an introduction is an introduction. We talked a lot, learned to know each other.
I find that extremely important when you spend most of the time with some people and you have to challenge, and spend most of your time in total freakout mode.

That being said, another part of the day was a bit harder. Dev Bootcamp makes you meet people that have been selected after a particular selection. Only 10% of the people make it apparently. Of course, we are selected because we have a specific set of skills, a particular mindset, and Karim and all the others in charge of admission see things in us that make them think we can make it.

Then, we get grouped with others with the same characteristics, and for 9 weeks, you work with them, play with them, more or less live with them, 100% of the time. During these 9 weeks, you are challenged everyday, stressed out to a point where most would break, and most DO break. Your challenge, just like the others, is to learn what took years or even decade to master to many. As Sherif said, that is insane. We are insane for trying that, but then we have been selected because we are, and only that combined insanity of so many people can help us make it at the end.

In our cohort, we even took it so far as to get a house for 9 of us. If spending most of our times of struggle was not enough, we now spend 100% of our time together.

I may sound overdramatic with that explanation, but my point is that your only way to win at this is brotherhood( + sisterhood, however you say that). We are one, and must stay one. All of us must succeed at the end, and if one of us breaks, we all need to do our best to “repair” him asap to get on the next step.

Yesterday, Stephen had a bad time. Pressure got the best of him for a part of the afternoon. It was not the challenges, not something that happened yesterday, but something that grew in his head that ended up getting to him.
But what happened after that is the illustration of that idea that I am trying to give you : We gathered, and make it so that it never happens again. Stephen is part of us, the entity that we have become. We can’t succeed without him, and will not let him behind. In the end most of us went to sleep at 12AM, after long talks, hugs, and mental-screwdriving.

To whoever want to join the bootcamp with any other idea that the one I am describing in here : You shall not pass. This is teamwork, and without that, none of you will pass. That is a fact, well known by those who succeeded as well as those who did not.
You will NEED brothers and sisters.

Battleship & Sudoku

I already took too much of your time so I will try and be fast on this one but : Yesterday somebody pointed me in a new direction for sudoku solving. It is called Dancing Links. I won’t explain in details, especially since I don’t think I have a good enough grasp on this, but my goal here is to try and solve the 170 puzzles I solved in 8.5 seconds, but in less than a second this time. I’ll tell you more when I can.

And about Battleship : A few of us finished the challenge that said we had to make a battleship game in Ruby. We thought we could share that knowledge, so we got an idea and we are organizing a Battleship contest. We will build a core game, and a way for people to develop their players behaviors. We will be around the whole way and help those who could not finish it at first. Then after that we will just compete… But then again, we don’t have the rules yet so… See you tomorrow!

Week 2 - Day 1 - a New Partner, Experience vs Mastery, Sudoku Solving

| Comments

A new partner

Sometimes, you meet people and you feel that it is just right. Yesterday I was to pair with Irene. There are not a lot of people I did not work with, but Irene was one of them. I was looking forward to pair with her, her experience with web dev, and the examples of work she had accomplished is just impressing to me (Like this for instance : Iren So, we paired and it was a very fulfilling pairing session, in terms of partnership mainly. e’s Site)). Plus, so far I only heard nice things about her! In the end, I just loved my day, but you’ll see more about that in the next paragraphs. Plus, she knows a bit of french (Every time she tries some french words I realize she knows even more than I thought, very impressive). Some would say that I should not have been intimated, or even go as far as saying things about great minds thinking alike… But I don’t think so.

Experience vs Mastery

For me, people make experience when working the right way, learning, experimenting, on one particular topic. There is no limit to how far you could go in such a topic, and broadening your learning will always take you to strange places, more skills, more experience, and for me, more fun!

Now, I do have some skills. I won’t brag about it, but I don’t see any reason to have some false modesty. I have, indeed, been playing with computers for 27 good years so far. I have been developing, at a slow pace for 2 years now. My job has also been to spot and maybe fix bugs in the program my company was making for the lat 2 years.
But all that does not make me a genius. The only thing it gets me is experience. No mastery, no great mind, nothing like that.
Irene has been doing some web development for a while, and that also does not make her a genius. She is, however, much more experienced than I am in web development, and web design. If you take Stephen, he is much more experienced in video games, and Armando in asian cuisine!
In the end, people have experience, and every experience is different. There is no shame in having none in one topic, and lack of experience should just push you to want to learn more.

In the end, I was too impressed by Irene, and I should not have, but we also both had that feeling that people tend to put us on pedestals because of some of our experience, sometimes. She was apparently just as intimidated, and in a way I think that helped us connect much more easily. All in all… Good times and a awesome pairing session, Sacrebleu!

Sudoku!

So, I made code that solves sudokus. Hunter had been working on an algorithm thought by Peter Norvig, former director of search quality at Google. As with the experience I was talking about in the 2nd paragraph, Hunter has much more than me in math and algorithm thinking and design.

The idea is that :
– You first fill in every cell that has only one possible value.
– You then take all the boxes, rows, and columns, and try to find if any possible values can take only one location in one of these groups, and then set it to this cell.
– If you did not find anything, just guess one number, taking all the cells with the smallest number of possible values, and fix them one by one, before calling the first step again. If it did not work, you get back on this part, restore the board, and fix the next one.

I could spend hours talking about that, but in the end… I solve 170 puzzles, among which 95 “hards”, and the 11 harvests, all that in 8.5 seconds.

If you want any more info, don’t hesitate to ask. I think I’ll be showing how I did to my cohort very soon anyway.

Day 5 - Week Review, Sudoku Day!

| Comments

Week review

Ok so, it was the last day of the week, everybody is pretty messed up thanks to the huge amount of content, to the Engineer Empathy, etc…

Yesterday, we started with a review session with Sea Lions, the cohort prior to us who’s on the bootcamp with us. During that session, what came out was :

  • Sea lions are happy to be around us
  • Week 1 of Phase 2 was awesome
  • Week 1 of Phase 1 was awesome, even though it was a bit overwhelming
  • Engineer Empathy affected every one of us, big time

I could explain more right now but I think I’ll just do a quick recap during the weekend if I can.

Sudoku day!

So, today was the last day of this first week of DBC. One of the “initiation rituals” of that first week seems to be that first friday theme : Sudoku. The idea is that we worked hard all week on challenges here and there, and on this friday they gave us the “Ultimate challenge of the week”. For this challenge, you have 2 assignments :

  • In the morning, you have to write code that reads a sudoku data line, then builds a grid and solves it without guessing.
  • For the rest of the day… Implement guessing!

I was to pair with Nic, a guy who chose to redo phase 0 to make sur he got all the knowledge he could get from it. But then, Nic already completed that challenge on the last cohort. So the rules we went for were :

  1. We don’t check any of the code he did before
  2. His thoughts may very well just end up being guided by what he already did, so I found the suggestions, he would just comment, agree, debate, etc…

Let me tell you guys : That went well! We ended up implementing an object-oriented piece of code that actually ran faster (50%) than the one he had last year!

If you want more info on that :

We created a cell object that had the value for that cell, and all the info about its position as its attributes. This way, a simple call and we got all the cells in this array, in this row, or in this column.

Geek talk : My take on people’s solutions

People actually implemented the same algorithm over and over again. To sum it up I’ld say :

  • Select a cell
  • Get the values of the non-empty cells in the same row, column, and box
  • Subtract the values you found from an array of the possible values (1 to 9)
  • If there is only one remaining possible value, assign it to that space
  • Do it again until all the spaces are taken

That was common for every one of us that I saw. But then the huge difference was : The data structure. You had to make a choice there that would make the code change big time, but let me explain that :
This data structure can be put in one of 3 different groups.

  1. Nested array. You make arrays in an array, and so you get a 2D array
  2. Something hybrid from 1 and 3
  3. Cells as an object that you put in an array

Obviously, the 1 is the easiest way to go to put and get the data, right? And the last one may just end up being the most complicated one (What do I need my object to know? How do I create it? And how do I call the attributes of that object? Do I calculate them on the go? …).

Now, the interesting part is that, for this problem, the easiest the data structure, the hardest the rest of your code will be. Because when you have a nested array, how do you call a block? How about a column? How do you check if all the blank spaces have been filled? Do you do some kind of nested loop to go through your nested arrays?

But then if you chose the 3, this method just ends up selecting whatever you need in one line.

In the end, since the rest of the code was basically the same, the main difference was there.

If you check the code of people in the cohort, most of the people chose something around 2. Some were pushing in the direction of 3, some in the direction of 1, but mostly doing 2.

One did go through with 0 (Way to go Armando and Chermaine!), and one did actually do something that could be a “0” in my list : A simple array. You calculate the row,column and box from the index every time you need one of them.

Anyway, that was what I found and I would be happy to share more if you have any more question!

I’ll just end this post with this very profound quote : “Today was a good day”

Day 4 - Games! And Solutions!

| Comments

Games

Yesterday was a day when we had to start and implement games. We went from a simple piglatin creator to a boggle board solver.
For this day, I had to pair with Eric. Eric is nice, and fun. But then I just navigated, pointed the pair to a place where the waters were much too deep, and we ended up just trying to figure some things that we’re supposed to care about in a few weeks out. That was not pretty, we learned a lot but ended up not finishing the exercises when others did / we had to get to the next one.

No biggie though, we ended up just climbing back and finishing the exercises, or at least most of them, in due time.
I do feel sorry for pushing the pair into places we should not have been, and so maybe take time off or learning some valuable info that we should have at that point, but I hope I made it up by being extra precise and helpful if I could for the next part… I’ll have to see that with Eric I guess! Feedback, here we are.

Solutions

It was the day I got a few solutions.

First solution : We solved that f**king problem, Rao is really awesome!
Check the other blog posts if you want to know what I’m talking about!

Other solutons : The exercises were not all very hard, they just needed to be taken the exact right way, or you’ld just get lost in deep non-understandable stuff that take too much time. We code from 8AM to 11PM, and have 9 books to read… All that by the end of the week. Let’s just not take that path.

Anyway, I said I navigated, pushed the pair to a wrong place that just got us stuck. While doing that, I like to take small times off that coding, review what the others are doing, and try to help others. In my mind, finding the solution for somebody’s challenges just makes me trigger some kind of chain events that take me to the point when I can solve mine.
So that’s what I did. That did not really helped me work things out on the problems we were having, not at the end at least, but that helped me figure out exercises in advance by helping people that were on 2 while I was on 1.

And THAT helped a lot. In the end, when we got back to our exercise, we just have to recapitulate, check the things I told the others about, and if we agreed on that : Implement. Thanks to that, exercises that could have taken hours to solve just took a few minutes and nothing else!

Anyway, today is Sudoku day. Apparently we have to make a sudoku board creator, and a sudoku game solver… That’s gonna be fun! See you after that!

Be Careful With Ruby’s Assignment Methods

| Comments

The context

So, I am in Dev Bootcamp. Yesterday, while trying to implement a customized class, I tried to make ruby respond to :

1
myClass[index]="new_value"

My buddy and I were trying to get used to Test-Driven Development (If you want more info… Thanks Wikipedia!). So I had a very simple test method that tested if 2 things were equal.
I was testing that this code would return true, just to make sure the whole code of my method was executed.

Come this test, we found out that it wanted a method called “[]=”, so we did. Our method looked something like :

1
2
3
4
def []= index,new_value
  #Do some stuff
  true
end

The problem

So, we got this method, this test, so far so good. Now, we launch the test to check if the result to that first expression is true and… No. The test said that this method just ended up returning the value that we were passing it (In this case “new_value”).

Maybe that method was not doing what it should, so we used the Debugger gem (Docs). With that we just checked step by step what it would be doing.
– First : It is calling the method. The debugger throws us right there in the middle of the method.
– Second : It is actually doing what we want. The data is changed, and it goes through the last line that returns true.
– Third : It does not care about that because on the very next step, the trace you have of this method and what it returns already became “new_value”

We then asked more experienced boots, and came up with a test where we’ld be calling the method like this :
ruby myClass.[]=(index,"new_value") Conclusion of this test : SUCCESS!
This calls the method without any problem, and that is done exactly how we want.

So at that point are conclusions were :
– The method is called
– The method does what it should, even the return
– Its behavior changes when we call it with ruby’s “shortcut”, or syntaxic sugar (More info) and we end up having the return value disappearing, and the second argument becoming that return value.

Assignments methods

Let’s pause on that particular problem for a second to talk about assignment methods.

Assignment methods can be used to assign a value to a particular item, like the name says. But in Ruby, everything is object. So assignment methods are actually methods, simple ones defined just like an initialize. What differenciate them mostly is :
– An assignment method can has any number of spaces before its = when it is called.
– When you call it with the “shortcut”, the behavior will be neglected and replaced.

Now, the important thing… Let me rephrase that : The IMPORTANT thing is how ruby selects what is and what is not an assigment method.

The answer is : It takes the last character of the name of the method, and checks if it is an equal.
If it is, your method will be considered an assignment method.

If we take our problem, the method can clearly be detected as an assignment method. That means that it can be called with spaces between the brackets and the = sign, and even more because ruby has a special shortcut for the methods with such a name (The one we used).
That also means that the behavior will be transformed.

Well, do you want to guess what behavior is the principal one concerned by that statement? You’re right, it’s the return. The rubydoc tells us that using an assignment method, so the shortcut we are talking about, will always return the argument.

So, our code did work. It did do what we wanted it to do. But unless we wanted to redefine primitive ruby behavior by diving in Ruby’s source, there is no way we can make an assignment method return anything else than the thing on the right.

So, guys, be REALLY careful when you call your method with an =. That may help you in some parts, but it may also leave you and your friends, coworkers, teachers craving for answers ;)

Day 3 - Data Structures/types, Testing, and a Brain-teaser

| Comments

Data Structures/types

Yesterday was the optionnal solo day, the day when we choose if we pair or not and work on some challenges. The code of the day was about Data Structures. I wont go as far as to try and explain all of that in detail in this blogpost but the idea is that you have all these data types in languages.
For example, a String is a chain of characters. It has a length, characters at specified index, and methods to compare Strings together, to change some character, and all the other operations you would want to do on such an object.
Once you get that far, it is what you call Abstract Data Structure. Then you implement it into a Data type, or a Data structure, according to if this ADT is a chain of separable elements, or an element in itself.

So, in short, we spent most of the day working to understand that 100%
And if you are curious about if I chose to work alone, I did not. I chose to work with the “Brother from another mother”, Armando.

Testing

In our lunch talks, Shadi introduced us to Test-driven development. The idea is that when you have an idea about what you want to do, and no matter how strong the feeling that you can code that is, you will just write tests to verify all that first.
Your algorithm will not work (Duh… You did not write any code yet), but you then just launch your script, and jump from error to error, deciphering and correcting them on the way, one by one, never thinking about the big picture. Then when you finish that, you check if the code does exactly what you want. If not, you write more specific tests.

Contrary to popular beliefs, people are really bad at multitasking, and so doing that allows you to complete simple tasks one by one, without multitasking, and empowering your debugging skills on the way.

So, Test driven development, I love you. (Not as much as my fiance of course, but we’re getting close)

A brain teaser

So, we worked on data structures, while using test-driven-development. While doing that we ended up redefining a method whose syntax is recognized and transformed by ruby’s Syntaxic sugar :

1
2
def []= (index, data)
end

which transforms into :

1
thing[3] = 4

So far so good.
Now, the problem we find is that in Ruby, even if you make that method return something, the second expression, the after-SS one, is returning 4.
I will tell you more when I realize what happens and why, but let’s say other cohorts did not know, coaches did not know, Sherif did not know, and we have to know… So let’s hunt for that!

Day 2 - Cries, Laughters, and Code

| Comments

Cries

So today we started Engineer Empathy courses. The idea of this course seems to be that the better you are with yourself and the better your ability to work with others, the better engineer you will become.
Now, just like everything else in this program, EE is freakingly intense.
Yesterday we had a session about the Superego and how to recognize attacks from it and defend. That does not sound much but… I just ended up almost in tears thinking about strange attacks against myself. Sometimes we just don’t really think about the things we put ourselves through, but then when these come back, that’s when you have a bad time. Well, let me tell you that people who are crazy enough to join Dev Bootcamp have a lot of

Now if that was not intense enough, I had decided to run a bit too far 2 days ago and so now I just look like a 3rd age dude having a hard time walking all around. That brings some tears too haha.

Laughter

Today they gave us a pairing buddy for the whole day. Mine was … Matthew!
I spent most of the day enjoying what I was doing, at least for the fact that I was doing it with somebody I appreciate and really have fun with. We joked all around, and even though some may say that it is quite counterproductive, we finished the challenges right at the same time as others, and I got the feeling we learnt exactly enough!

Code

So, today we spent the morning reviewing the code some used to complete the challenges of yesterday. We ended up comparing hashes + #each with no data + if (The if waterfall seems to be faster…), and all that with or without recursion. In the end, we can say that in this small exercise, recursion was a waste of time, and not maintainable, hashes + #each keeps the code organized so maintainable, but then the If waterfall was just horrible to watch but a bit more efficient… The world of code is a strange place, guys…

In the afternoon we worked on sorting algorithm. After a bit of time going crazy over explanations not explaining much and hurting our brains and souls, Rao, a coach with a nice and funny meow-like name gave us some more options and we found out how to do all that. We implemented the merge sorting algorithm and that did not take us much time from here. The funny surprise though was that at the end, we cleared the 3 170k words files in around 1.5 seconds each… While every other algorithm just took at least 10 minutes. Some even calculated that theirs could last for a day just sorting one of the files. Algorithms are crazy and are to be known!

Now, time to go back and code guys, see ya!

So It Begins…

| Comments

I won’t go as far as to tell everything since the last post. Challenges went by, I continued pairing with Armando, working at my strange company that just ended up closing, and then the closer I got to my 8000 miles travel, the busier I got…

Plus, I just ended up taking all the time I could get to see my fiance. And let me tell you guys : That was worth it, and a very good idea !

Then, 3 days ago I arrived in SF. I just had time to discover simple things here and there, get an account at the bank, a mobile line, and all the things you need for a simple life nowadays.

Now, up to the main topic :

The program started

So, yesterday, we were expected at Dev Bootcamp, just at the entrance of Chinatown, for 9AM. We met the last remaining people of the cohort that we had not met before, and waited there, anxiously waiting. At 9AM sharp, shouts and claps started right behind that little door we had not passed yet…

They opened the doors, and things went wild. I won’t go as far as to explain everything in details, but for this first post in a while I’ll just sum it up as :

  • People are awesome. Teachers, Coaches, other students, other cohorts, everybody!
  • We should be expecting 60-80 hours weeks, and even there we probably won’t get over everything anyway.
  • Sherif, one of our teachers, is really eloquent… You can hear pure knowledge come out of his mouth… That’s insane
  • Sherif told us repeatedly : We are insane for thinking it is doable. But the common insanity is what bounds us and may end up making it possible.
  • We are guinea pigs. The program we will be living will be a bit different than the others, but then I’ll explain that later.

All in all, I can say that we are joining a program that shows us how to work and let us do the job and find about what to do and how, assess our learning,… We are basically the ones making it possible. Teachers guide us, but that is all.

Now, time to head up to DBC again, cheers!

Welcome to Dev Bootcamp

| Comments

I created this blog as a part of the Dev Bootcamp, mostly. But what is it? How does it work?
Time to give you guys a bit more info, at least about what I know so far…