Advanced Certification

March 18th, 2012

Advanced Scuba Certification

Got it done this weekend. Also took the Nitrox test this week.

4 dives in Travis, 2 Sat 2 Sun. 3/17 & 3/18, 2012

Water temp about 57. Outside low 70s. Had complete thick (6 mil?) suit on actually it was a wader type bottom which covered ankles to chest then a top half that covered head to knees so it was doubled up. Then had booties/fins and a hoodie. Only thing not covered was hands and they were fine. I was almost toasty warm the whole time.

Visibility: almost nothing at times, almost total brown out at other times. Great experience.

Made it to about 60′ or just below that each days 1st dive. Was trying to get down to 80 or 90 or what ever, but silt avalanche followed us down (rookies) and instructor aborted descent.

Dove Shaker Plant site both days. Old construction area when damn was built. Just a bunch of old pillars, concrete blocks, timbers, big crap laying around you have to watch out for. They’ve got a bunch of lines tied to follow around.

My first dive was a helluv an experience. Definitely pushed out of my “Cozymel” comfort zone ha ha :-)

Because of numerous rookies they/we quickly stirred up tons of silt on the bottom and what would have been maybe 10 feet of vis quickly degrades to almost nothing at times. Most of the time it was several feet and you could definitely see the other flash lights for the most part as long as we were together. Or I’d be able to see the fins kicking in front of me but couldn’t see the upper body connected to them. Several times one of the group would get “lost” not really lost but gone out of site and the instructor would go chase ‘em and get ‘em going back in right direction. One time I pointed out to him that we’d lost one of the group and he went and got her.

It’s very interesting how being nearly blind so dramatically changes the experience. I visualize the dive site of the areas we were diving and imagine it was only an area of say 100 feet square, or maybe 200 feet, I’m not sure but not that big an area. This would be nothing in blue water as you’d be able to see the whole area from one spot and thing nothing of it. But remove vision and it’s an amazing experience. Like being in a maze of twisty little passages. You don’t know what you’re swimming up to until you’re right there. Kinda spooky at first but 2nd day I was all over it.

I dove in groups of 3. Instructor and 2 advanced students each dive. We dove off of Giant Stride pontoon dive boat.

We’d drop down, follow lines around down to around 50 or 60 feet to see if we could attempt a deep dive to 90 or so. Plan was if viz was ok we’d descend down but each time we tried the rookies kicked up too much silt and viz got poor so we couldn’t go down further. So, we’d just swim around practicing staying together, following the lines and staying close and practicing communicating - which were all a real challenge given the very short visibility.

It was a real challenge is several ways. You really can’t see where you are, the bottom or anything much of the time. So, you have to rely on your gauges for your depth and controlling your buoyancy. This was very new to me. I did much better 2nd say than 1st. It was good to have a day between - I thought about it a lot and figured out what I needed to do.

Also did a navigation exercise where I was to swim a square by following compass N-E-S-W 3 mins each leg. 1st day tried it and it was quite difficult as I hadn’t ever tried anything like this before. You have to constantly watch your gauges, clock, compass, depth and adjust and control all 3 concurrently - all without being able to see any bottom or features for reference - imagine being in a white out blizzard except this was more like a mud out.

First attempt I didn’t do well. I was having trouble controlling my neutral buoyancy, then I’d get neutral and find I was 90 or 120 degrees in wrong direction, etc. 2nd day (today) I nailed it. Had total control of my buoyancy and direction. I felt like I really swam in correct direction and depth each of the 4 legs and I believe that’s the case. What I didn’t factor though was my timing was off on 1 or 2 of the legs and so I didn’t end up exactly right back at the boat. Idea was to pop up when done with the square and I’d be right behind the boat where I started. Great drill. Would love to do it again.

I believe we had to perform 3 out of a number of different tasks in order to get the advanced cert, though that wasn’t made clear to me. So I got deep water (anything beyond 60 is deep), low visibility, and the navigation component.

I totally appreciate lake diving now. It’s not about scenery. It’s about mastering your diving skills, at least this was. I loved it. I’d like to do more of this kind of stuff. I’ll have to look into the Master Diver program.

The Nitrox certifcation is just basically all about Nitrox, which is pretty straightforward with a few details. It’s getting more popular and available, extends your dive time and so need to be able to use it.

CS371P #14

December 2nd, 2011

Oops, one more blog. *this is the last one.

Today was the last day of the semester. Took the final test today. I found it to be shorter than exam 2, which helped. I was able to finish the test and go back over and check for mistakes. I’m sure I did well enough. I’ve always found written programming tests to be a pain, unrealistic and not something I am particularly great at. My strengths have always been in design and development. I scored well on the projects. As I should. I should do well on tests too. But that is my weakness. All of the extra credit raises the grade by 9% - almost a full letter grade. So for that reason I’ll get my grade.

I’m sure that having written test skills works in advantageous ways for those who have them. But it’s not the only way to succeed as a developer. I’m proof of that. It appears that our instructor is somewhat in tune with that as evidenced by the weighting of the projects and the ample extra credit. I don’t think all instructors are tuned in that way. I got lucky choosing this class.

Still I want to believe that test taking is a skill set that can be improved upon and I am challenged by it. I consider myself good at what I’m doing and so I ought to be able to do well on tests. So, I intend to look for information in this area, improving test taking skills that sort of thing. Especially as I’m considering grad school.

I enjoyed this course. Our instructor has obviously refined his teaching techniques over many years. He really maximizes the classroom experience by causing everyone to be 100% engaged every day in class. The short quiz every day. And the system he has of calling on people to answer questions really keeps everyone on their toes - lest they be humiliated in front of their peers. It works well sort of like a C++ boot camp. I didn’t like it at first but I came around.

I am pleased with my new C++, java & OOP knowledge. Most of the OOP was review for me and the programs were mostly trivial. But all the C++ ins and outs, corners and nuances I enjoyed learning. I will be putting it to practice soon.

Enjoyed meeting a few of you guys. See you around.

Favorite quotes

November 28th, 2011

“Nothing in this world can take the place of persistence. Talent will not; nothing is more common than unsuccessful people with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent. The slogan “press on” has solved and always will solve the problems of the human race” - Calvin Coolidge

CS371P #13

November 28th, 2011

Last week of the semester and this is the last blog. I did manage to get quite a bit of studying done over the break though not as much as I had hoped.

This my first semester back to school has been an interesting and fun experience. I’ve learned quite a bit of C++ that I never knew. Which was a surprise, I thought this class was going to be mostly java. I plan to do more studying of C++ in the near future. And I hope to use java at some point for an extended period of time so I can become fluent with it.

I enjoyed this class and I’m glad this is the one I chose to take as my last CS course. I enjoyed working with the partners that I had. Chances are some of us will run into each other in the future. I look forward to that. Look me up on LinkedIn, Facebook or Google+.

Always do equality check with rvalue on the left

November 23rd, 2011

A common error in many languages is accidentally omitting an equals sign where a comparison was intended. Example;

void somefunc(int i) {
   if (i = 2) {     // was supposed to be "(i == 2)"
      // ...
   } else {
      // ...
   }
}

What makes it easily missed is that it compiles and executes just fine in many cases, albeit erroneously. Bugs like this can live in the code for long periods of time before being caught.

An easy habit to get into is to always put the rvalue on the left side when doing == comparisons. E.g.

void somefunc(int i) {
   if (2 == i) {
      // ...
   }
}

this way if (when!) you do accidentally omit an = then the compiler catches it for you.

Q: “Is Java the language you would have designed if you didn’t have to be compatible with C?”

November 22nd, 2011

Bjarne Stroustrup: “No. Java isn’t even close. ”

http://www2.research.att.com/~bs/bs_faq.html#Java

Top 10 Idea Killers in Software Development

November 21st, 2011

http://www.computer.org/portal/web/buildyourcareer/Nosce-te-Ipsum/

CS371P #12, summary of git observations

November 18th, 2011

As requested here is a summary of my git observations after having used it a little this Fall semester 2011.

Disclaimer: I have only minimal experience with git and yet here I am writing up an evaluation - reader beware. There may well be functionality in git that address these issues that I do not know about. There is definitely some amount of git functionality that I am not aware of as I have not set about making an exhaustive evaluation of git. At best I have limited git experience after having used it on 6 small projects and these are my observations.

- The distributed model of git is good. I can’t think of anything negative about this. Seems many SCCSs are going this way. I don’t think it’s particularly new but seems to be getting traction. The obvious advantage is that once you get your copy you can go offline, do commits, branching etc all without updating to/from the repo. Even status checks could take a long time (in the centralized systems) and were always slow compared to git. There’s a hidden bonus too; new and improved commit semantics. See below.

- Content addressable rather than filenames. This is cool. Cvs is brain dead when it comes to renaming files and paths. Not git. Basically everything is keyed by the content rather than by the file names. Not only that but… found this comment;

Git is content-addressable: files are not stored according to their filename, but rather by the hash of the data they contain, in a file we call a blob object. We can think of the hash as a unique ID for a file’s contents, so in a sense we are addressing files by their content. The initial blob 6 is merely a header consisting of the object type and its length in bytes; it simplifies internal bookkeeping.

Thus I could easily predict what you would see. The file’s name is irrelevant: only the data inside is used to construct the blob object. You may be wondering what happens to identical files. Try adding copies of your file, with any filenames whatsoever. The contents of .git/objects stay the same no matter how many you add. Git only stores the data once. By the way, the files within .git/objects are compressed with zlib so you should not stare at them directly. Filter them through zpipe -d, or type:

$ git cat-file -p aa823728ea7d592acc69b36875a482cdf3fd5c8d

- Branching. It’s been so long since I’ve done a cvs branch (which is a good thing) that I don’t really remember how ugly it is or exactly what makes it ugly. But everyone will agree who’s done it that it’s a PITA and people tend to avoid it. In any case it’s pretty painless in git. Create a branch, switch to it, and back, lickity split. Interestingly, git’s easy branching illuminates another issue with regard to the semantics and conventions of committing. Explanation in just a sec…

- Polishing needed. IMHO the interface is a little hodge podge. Not too bad mind you. Just one of those things. I suspect that as young as it is they wanted to remain backward compatible with previous versions and didn’t make interface improvments when they could and should have. For instance I would think that when you go to upload or download your stuff to/from a repo it would push/pull everything by default. It does not. Simply doing a ‘git pull’ or ‘git push’ does NOT push all branches nor tags (what else?). You have to add a ‘ –all’ to the pull or push. I think that’s only necessary once, and from then on it pushes and pulls all branches from then on. Minor nit pick.

When you want to view a change or revert to a commit you have to copy and paste that 40 byte hash string identifier. PITA! What the hell is wrong with a reference counter? Just number the commits and allow the user to refer to them by number i.e. “1, or 2, or 1002″.

- Tags. I experimented with the tagging facility a little bit. But I either didn’t figure it out or it is pretty lame. It didn’t do at all what I expected. In cvs for example applying a tag actually sticks a tag to everything in the repo at that moment in repo time. Then you can always pull out everything with tag and retrieve exactly that state. Well, I couldn’t get that to work in git. Probably I just didn’t spend 5 more minutes to figure it out. If you know how that works email me and I’ll add it here.

- Modifying git deltas. I did a bit of reading up on how to modify the git change history in a repo. Seems that it’s pretty locked down. I suppose that’s good and bad. I remember in cvs that you could go in and muck with the deltas to your hearts content if you wanted to. Ran into a situation with git where I wanted to 0 out the commit history on a big file, cause it was eating up a whole bunch of space having multiple copies of a large file. I didn’t look too hard but found a few posts describing how to flatten a history. Might be handy if/when needed.

- New “commit” semantics and/or a new level of “staging”. So in the old centralized systems (cvs, svn, perforce) a commit pushed your changes out to the central repo. This was a big deal. You didn’t commit changes willy nilly. When you committed it was the real deal. Therefore everyone treated the commit with a certain degree of respect, by convention.

Well with this decentralized model commit is different. No longer are you committing your changes to the central repo. You’re only committing them to your local copy of the repo. There was no equivalent of this in cvs or perforce. There you just made your changes then committed them to the central repo.

This new commit semantic changes things in several ways. For instance branching. When using the new and easier git branching it quickly became apparent that in order to take advantage of branching, you really have to commit everything before you can switch branches. But what if your mods are not in a working state, or not even compiling? Well if you want to switch branches you have to commit everything. This quickly leads to committing mods that are not solid, not functioning, not even compiling. This is a change in the concept of commit.

I experienced a similar thing while working with partners. We’d want to share changes back and forth via the repo and so we’d commit stuff that wasn’t in any final sort of “committable” (old definition) state. In this case we did actually use our central repo to transfer our incomplete mods back and forth. We could get away with this since we were the only two people involved and because we were doing pair programming. In a larger team setting this would be verboten.

So this new decentralized commit adds a new layer of functionality to the mix. It’s nice that you can commit your changes yet keep ‘em local. This way it’s easier to make more, smaller commits, even if they are interdependent/incomplete mods, without pushing to the central repo and therefore without directly weakening the integrity of the code base. With the centralized cvs system, you sometimes would have to make larger sets of mods in a single commit, in order to keep the code base intact and consistent. The decentralized system seems to encourage more frequent commits containing smaller mod sets, which is good. But at the expense of potentially weakening the integrity of the code base, if not dealt with sufficiently. Explanation follows.

Notice that, even though you may choose to not push a set of commits out to your central repo until you’ve completed your mods, that your complete commit log will get pushed to the repo when you do finally push it. There’s an important subtlety here.

As I’ve said in cvs each and every commit in the log represented a complete set of changes that maintained the integrity of the code base (by convention of course). So you could for instance checkout any commit in the history log, and that would give you a complete, consistent and buildable version of your code base. For this discussion I’ll call that idea commit compete since each and every commit refers to a complete, consistent version of the code base. I.e. you could checkout out the code base at any commit, and get a complete, stable, buildable code base. Each commit of course was a different version of your code base. But each commit version was complete and safe to build and run.

But, if using git in the way I’ve described which seems to be the way git is encouraging us to use it, where you have smaller commits that do not retain code base integrity, then we are no longer following commit complete semantics. This will be important when looking through the git log when for instance you’re looking for the right spot to back up to, while troubleshooting a bug or the like. For this reason I foresee a convention of tagging each push to the central repo. This tag should be an indication that a set of commits is, at this point, complete. Each push could have a simple tag so that someone later can easily see the spots in git log that would be safe to revert to and those that are not. Maybe git tags will work here or maybe a convention in the commit comment will do. But the point is that, if we are going to take advantage of git’s decentralized repo and use commits for less than complete changes aka not commit complete semantics, then we need to somehow distinguish these incomplete commits from the complete commits in the git log.

So what I think has happened is that someone has changed the definition of commit. What used to be commit is now called push. Ok then. I can handle that. Someone should have said so. Done.

One last thing I’ve been thinking about but haven’t had the opportunity to experiment or read up on it. Has to do with large projects and/or multiple projects. With cvs and others, you have your centralized repo and inside of it there you can have numerous modules where each module could logically be a different project, product, library what have you. In the one repo there was an hierarchical name space and the ability to conveniently store multiple products and projects.

I don’t think that git is designed to use a repo for more than one product, or project, or module or what have you. It seems that a repo is necessarily a single one of those entities. I noticed this a while back and I did read a post or two about it but I’m not sure what the answer is. For instance what if you want to have nested git repos in your src tree? That is say you have a 3rdparty library you need to have sitting inside of your product tree. Or what if you have a dozen git repos all living in the same 3rdparty dir. In cvs you could get all updates with one single command if you laid things out right. I’m not sure how git is going to handle it. It might be fine I just don’t know yet.

Overall I like git just fine. Will I use it next time I have to make the choice? Probably. I can’t imagine wanting to use cvs instead of git if I had the choice.

The Anatomy of the Assignment Operator

November 17th, 2011

Good article:
http://icu-project.org/docs/papers/cpp_report/the_anatomy_of_the_assignment_operator.html

CS371P #11

November 13th, 2011

Only 3 weeks left in this my first semester back. After this I only have 2 classes left to have my BSCS (a math and a physics) which I began in 1980. I was this close 20 years ago (after leaving campus, working for a while then going back to school the first time). But life, work got in my way and I quit with only 2 classes left. 20 years later a couple of requirements changed and caused me to have to take 2 additional classes. Not too bad really.

But now I’m giving serious thought to continuing on to grad school. I’ll take the time over the holiday break to decide but I know I’d enjoy it. I have the time. So why not? When I was last working my peers all had graduate degrees where as I didn’t even have my BS (even though I only lacked a single CS course, which this OOP class is taking care of). Even though I held my own just fine next to them (thank you very much) and, I never would have admitted it but, I think I sometimes was maybe a 1/2 a step behind them.

So it’d be cool to get a grad degree. Plus, I still really enjoy programming and computer science after ~30 years of it. Of course I don’t have to go to school to continue learning. Easy enough to get the books and just learn it. One has to do that anyway. I recently acquired a copy of Knuth for the first time. But, it’s fun being on campus, the course experience and why not get the cert. Still it’s a lot of work so I’ll have to take a hard look and see if it’s what I want to do. My experience being back in school this semester leads me to conclude that I would enjoy it. I remember being a young undergrad. All the time I was studying then it felt like it was a chore. Something that I wanted to get done with and be able to get on to better things. Now, school is one of the better things. Funny how things change.

Seeing the extra 20 pts from the Darwin project sinks it in even further just how much extra credit there is available in this class. 70 points on the projects plus 20 more for blogs 90/1000 = 9% basically a whole letter grade. That’s cool. What’s cool about it is that it puts the projects on equal weighting with the exams. But notice what most of the extra credit is for: pair programming. Interesting.

My grade is important to me. Not only is it a matter of pride but also my gpa needs all the help I can get it now that I’m looking at grad school. (I wasn’t a great student when young. Thought I knew everything and plus partying was much more important than grades). I’ve seen in some a lack of desire to do that little bit extra to try and get full credit on the projects. That just doesn’t make sense to me. It’s worth it to me to spend an extra couple of hours adding more unit tests, a few extra paragraphs of wiki, or what ever to get full credit. Getting full credit on the projects is like low hanging fruit. It’s there just grab it. But that’s me. If I were taking a full load I’d probably feel differently. But the point I’d make here is that I learned early on how true professionals distinguished themselves. One very distinguishing characteristic is going the extra mile, or 10 miles if necessary to carry an answer to a question or a task to it’s logical conclusion. Tenacity. I picked up on that early in my career and it stuck with me in all parts of my life.

I figured out that for the last few weeks I’m going to practice writing little code snippets without the aid of the compiler, like on exams. I found that on the exams I tend to make mistakes that would be caught by the compiler, or a unit test. I suspect that I’ve grown used to that after working and not taking exams. Consequently I don’t necessarily try very hard to type in code without errors. Anyway, I will be practicing that and hopefully I can improve a little. My idea is to try and get the code perfect by eye balling it, then go to the compiler and see.

I have most of the code I’ve ever worked on even as far back as the 80s and even some of the classes I took then. I recently stumbled on the code/projects from my compilers class cs375 in the late 80s. It was Mr Mok’s class. We wrote a (simple) pascal compiler in C. I see the lexer, parser, tokenizer, etc. I vaguely remember doing it. I sometimes find myself referring to old code to remember how to do something like make a certain api call or what ever. Not that I’ve ever referred to that pascal compiler. But it’s kinda cool to have it and be able to look at what I did a long time ago. I like all the examples we’ve been handed in this class. We’ve learned so many subtle nuances of C++ so I’m glad to have the examples to refer to later. Might come in handy. I doubt you can find a book with all these issues gathered in one place.