Source Code Control and Release Management

Two concepts that are never touched on in college, yet are highly important in business (and academia for that matter) are source code control and release management.  Yes, everyone knows that it should be done, yet I’ve never really seen a good primer on it until recently.  The funny part is, these primers came from The Daily WTF (which I guess is appropriate when one thinks about it).

The source control primer goes from the ground up describing exactly what source control is and covers many of the common operations done in source control: gets, puts, merging, branching, labeling and even shelving.  The release management primer is also quite good and gives a good idea of how release management should work and even provides a nice example to help follow along with the concepts of release management.

These two articles definitely helped codify a few concepts in my mind about source code control (more than just use it) and release management (more than just: don’t break the build) and it should help you as well.

Are there any other articles out there that are worth reading about source code control and release management that might add some more insight that was missed in these two?  Let me know.

VLC Media Player

Recently, I’ve been thinking about doing a wood working project and had been searching the tubes for any ideas or help I could find on how to accomplish my task.  Well, as luck would have it, I found a site devoted to what I wanted to do and it had a ton of videos for download on how the person went about accomplishing the task.

So, as any rational person would do, I downloaded all the videos to my hard drive in order to watch them when I had the time (and because you never know when the person will decide to take down the videos).  Anyway, I decided to make sure that the videos downloaded correctly and double clicked on one of them only to be given a wonderful error message from QuickTime.  QuickTime couldn’t play MPEG2 video without spending $20 on a codec download from Apple.  Even worse, the codec itself was not getting stellar reviews from people on the Apple site.  So that was two strikes against QuickTime and it already had one since I don’t like it in the first place.

At this point I needed a video player that was free and played MPEG2 and hopefully didn’t suck.  Then I remembered VLC.  It was a staple program on all of my pcs and I hadn’t just gotten around to downloading it to my new iMac.  VLC is hands down one of the best video players you can get.  It can play almost every format without any additional codec downloads, it has a small footprint, and is extremely quick to load.  I downloaded VLC, got it installed (as simple as dragging the application to the Applications folder (thank God for simple software install on a Mac) and then double-clicked the icon and I was on my way.  I tested the videos and they played without a hitch — I can work on planning my project a little bit more (while doing my PhD work and regular work and having a social life :)).

Iif you need a video player, don’t rule out VLC, in fact, I’d make it your go to choice when watching videos or DVDs on your computer.

Chocolate Dulce de Leche Flan Cake

After a weekend of experimenting with some recipes (and failing mightily), my sister suggested that I try this Chocolate Dulce de Leche Flan Cake from David Lebovitz (his book Ready for Dessert also has some great recipes).  I have to say it turned out wonderfully and much better than my attempted Goat Cheese Cake for diabetics.  Yeah, the nutritionist and Endocrinologist would cringe at the sight of me making and eating this, but it was really, really tasty.  It tasted great after it had cooled down to room temperature, but I found it even better after letting it sit in the refrigerator for a day and serving it cold.  The cake layer stayed moist and the flan and dulce de leche seemed to taste much more vibrant (if that is a term to describe flavors) when cold.

I think I’ll have to add this recipe to the list of recipes I have on my site here in the next few days.

Modifying CSS in the LightWord theme for WordPress

The theme that I am currently using on my website, LightWord, is generally very nice and I love it.  However, there are a few issues with it, luckily, LightWord offers a nice way to correct some of the formatting issues without actually having to update the theme itself through the LightWord Settings page.

To access the LightWord Settings page, go to the Appearance -> LightWord Settings choice on the left side menu in the WordPress admin dashboard.

In this page, scroll down to the Custom CSS settings text box.  At this text box you can enter any additional CSS and it will be inserted into every page on your blog.  I’ve used this to fix a few issues that I have with LightWord.  First, I wanted my blog title to appear in a different color.  I changed this, with the following bit of CSS:

h1#logo,h1#logo a{color:#FF6600;}

Secondly, I wanted a different background; which was solved with this snippet:

body {background:url(‘wp-content/themes/k3290370.jpg’) repeat;}

Lastly, the drop down menu background was too small for some of the titles it was displaying so it would cause them to overflow.  I did a quick change that expanded the size of the menu drop down background, like this:

#front_menu ul {width:300px;}

Of course, you can override all the CSS you want within this text box, so if you wanted to change the color of links or whatever, you can do it right here without modifying the actual LightWord theme.  In addition to the Custom CSS, the settings page also allows you to add in additional scripts, headers, and footers.

Debugging JavaScript in a browser

Debugging is one of the most time consuming tasks one can do while programming in my opinion.  Debugging JavaScript that runs within a browser is the most time consuming and annoying tasks one has to do, period.  Which is why I’m all for finding better ways to debug JavaScript within a browser.  Here I’ll talk about some of the tips and tricks that I use to make debugging JavaScript within a browser a little less tedious and annoying (I’m not going to say fun, since debugging is rarely fun:)).

The first technique I employ is using alert statements.  The alert statement pops up the dialog box with a message, that you as the programmer have inserted into the code.  I use these to pinpoint where in the JavaScript code the script is failing so I can quickly get to the problem segment or method within the code.  This makes a great first pass since you don’t need any specialized tools or add-ons to your browser for this to work.  The problem is, you’re always rerunning your code in order to see where it fails once you make a change or in order to further pinpoint the problem section.

The second method I use is the Web Developer tool bar add-on for FireFox and Google Chrome.  The Web Developer tool bar lets you inspect each element in the HTML and see all of its properties.  This is extremely handy when scripts are changing properties of HTML elements; using it you can see if an element has changed it’s properties or not or if the property you’ve added has actually been added.  The only downside to the Web Developer toolbar is that it doesn’t seem to work in real time.  If you’ve made it display form details then run a JavaScript script that modifies the form details programmatically, the updates won’t be shown until you hide then redisplay the form details.

The third option, and the one I’ve grown most fond of recently, is using Safari and WebKit add-on.  I’ve found this to be the nicest real-time debugger for JavaScript.  With a simple selection of Develop->Start Debugging JavaScript from the menu button, a fully functional debugger is added to the bottom of the window and it allows you to set breakpoints, see the call stack and inspect all the elements being used within the JavaScript code being run.  This has been the most helpful when I’ve located the method in which a problem is occurring, but can’t figure out why exactly it is happening.  All it takes is setting a breakpoint, running the code to the breakpoint, then stepping through the code line-by-line and watching all the scope variables to see if one does not have the value I think it should.  More often than not, I find out a variable is null or undefined when I thought it should have had a value.

The fourth option, I’ve used when debugging AJAX methods within my code.  Using a tool called Fiddler, a web debugging proxy, I can intercept all messages being passed between the server and the browser and see exactly what is being passed in the AJAX commands.  I’ve found Fiddler to be the most helpful when used in conjunction with another tool, like WebKit’s JavaScript debugger.

These four options do a very good job of helping me determine where errors are within the code and fixing them.  When it comes to speeding up JavaScript, a JavaScript Profiler is what is needed.  Safari with WebKit has a nice one that can be started with the Develop->Start Profiling JavaScript menu choice and FireFox has a nice one with the YSlow plugin.  In the case of profilers, I find YSlow to be a bit nicer since it will profile the page and return hints on how to speed up the loading of the page.  However, that doesn’t mean that Safari’s JavaScript profiler is worthless — I’ve used it an awful lot too.  It does a very good job as well.  Lastly, Fiddler has a very good profiler for determining the time it takes for various elements within the HTML to be transferred from server to client.

Hopefully these four options I’ve shown will give you a better idea of tools that can be used to debug and profile JavaScript in order to have bug-free code with a swiftly loading web page.  If there are any other tools that I’ve missed, or debugging methods that you’ve found helpful, let me know in the comments section and I’ll update this page accordingly.

Programming Classes in Javascript

After mucking around in all sorts of Javascript problems, I’ve come to the realization that not many people know how to write Object-oriented code in Javascript.  Initially I had written out a fairly simple Math class in Javascript that people could see how to do all of it.  Then I saw this article on Mozilla’s web site, which pretty much made my attempt worthless. So, even though it is a few years old, it is definitely worth the time to read the article.