Javascript Includes
Posting mostly for my own reference…
Quite often I seem to find myself googling for how to include a javascript file from another javascript file. I’m posting this here for easy retrieval the next time I need it.
function include(scriptFile) { var headTag = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribute('language', 'javascript'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', scriptFile); headTag.appendChild(js); }
Wherever you need the javascript, you simply call: include('scriptname.js');
Contrasted with the other way of doing javascript includes (building up a script tag and document.writing it into the html, this seems to be the more correct way of doing the include.
Hope you find this useful…
The No Asshole Rule
I just finished reading this little gem by Bob Sutton called The No Asshole Rule: Building a Civilized Workplace and Surviving One That Isn’t. This book is a fantastic, quick (under 200 pages) read that helps you understand, counteract and avoid becoming an asshole.
Note: I generally dont like to use profanity on this blog, but in this particular case, I feel that the word asshole completely embodies the type of behaviour described within the pages of this book. Therefore, I certainly feel that the word is appropriate through this post.
Bob defines an asshole as a person that, after interacting with them, leaves you feeling worse about yourself. The second “asshole test” is to see if the candidate routinely picks on people that have less power than they, rather than picking on superior people.
The No Asshole Rule has chapters that talk about how to spot an asshole (subtle putdowns or sarcastic jokes as insult delivery systems) as well as self-tests that help you determine whether or not you are a “certified asshole”.
Other chapters in the book center around tools that managers can use to eliminate this kind of unproductive behvior. Great case studies are throughout the book, including how a Southwest Airlines executive took a passenger that was demeaning an employee and bought him a ticket on another airline, and how nasty emails can make a company’s stock plummet.
This book is intended as a starting point to help managers fight back at the assholes that criticize and sap the energy of others, which can transform the organization you work for into a much more productive, satisfying place to be.
Even if you’ve only been a victim, or just been a “temporary asshole”, I’d recommend that you read this book because it can help you understand that you’re not alone, and that there are definately things you can do about it.
Identifying Memory Leaks
I found a great article on the MSDN website that discussed how to identify and prevent memory leaks in managed code. There’s certainly a wealth of information available there, including how to use perfmon to actually find what type of leak you have, before you start going further.
I’ve run a memory profiler before, but I end up looking at it like a monkey trying to do a math problem. I’m not sure how to interpret the information presented to me.
I realize that this is a space that I know very little about, and therefore ask you, kind reader, to point me towards tools/techniques/documentation that I can use to become more proficient at solving performance types of problems.
COM Interop and .NET
Sometimes, you still have to use COM objects from your .NET 2.0 code (*groan*). However, when you do this, its usually not a bad idea to remember the System.Runtime.InteropServices.Marshal class. The Marshal class has a method on it called ReleaseComObject(object), that can aid greatly in reducing memory usage running rampant.
I’ve added this call and my private byte usage in the application has gone from an exponential line to a pretty much flat line.
Resizing your Parallels Drive
Parallels Desktop is a fantastic virtualization package for Mac OSX. Features like Coherence and Bootcamp integration are certainly giving established players in the virtualization market a run for their money (VMWare and MS Virtual PC).
The only drawback that I’ve found with Parallels (and with VMWare for that matter) was that your hard drive size, once established, was fixed. If you got close to running out of room, you were pretty much SOL.
Until now, that is…
Parallels includes a great program called the “Parallels Image Tool” which lets you resize your virtual hard disk file on the fly. To get Windows to actually know about the size increase, you’ll have to follow some steps. Certainly not hard, but to make sure you dont lose your data, make sure you follow the instructions.
Update: If you’re using the latest beta bits of Parallels, you’ll also need to go into the VM configuration (Edit | Virtual Machine) and click on the Options resource and the Advanced tab. In this tab, make sure you uncheck Enable Intel VT-x support. This was what was needed to allow the GParted LiveCD to boot on my Intel Core Duo iMac.
Tracking hours using SCRUM
It has occurred to me recently that business folks in an agile development shop are very anxious to put hours to tasks. Business folks need this data to estimate completion of a certain feature set. However, the data for this comes from the development team. I certainly see why the business needs to have this, but I would propose that what is being asked for is different than what is actually needed.
The business requires hours, however, the developers themselves probably do not care one iota about them. The developers will typically only care about whether or not a task was completed. Having developers track time for agile projects is a major violation of the Development Abstraction Layer.
Therefore, I’d like to remind people what the business people are actually asking for… and that is a team’s velocity. This velocity can be measured using whatever economy that team feels comfortable with (acorns, golf balls, story points, tasks, etc). A team will be outputting a certain velocity during the course of its iterations and hours can always be determined from that velocity.
For example, let’s say a team of 5 does 42 “golf balls” during the course of a 2 week iteration. There are 80 developer hours in 2 weeks (a 40 hour week multiplied by 2). 5 developers multiplied by 80 developer hours totals 400 work hours over the iteration. 42 “golf balls” into 400 work hours means that 1 “golf ball” translates into 9.52 hours. Wow! That was easy, and the development team did not need to get into the minutiae.
Will this technique be completely accurate right away? Of course not, as with any sort of estimation, practice needs to be had to make them accurate. Likely, you’ll encounter some wild swings as the velocity stabilizes, probably over the course of 3 or 4 iterations.
Please dont confuse hours for velocity… Let the developers focus on what they should be focusing on, which is developing high quality software, and not tracking hours. The people that are interested in obtaining hours can do so from the velocity and economy that the development team has chosen.
Developer/Testers and Tester/Developers
Jeffrey Palermo posted some links to articles that dig further into a discussion about developer/testers and tester/developers.
One thing that becomes apparent fairly quickly when running in an efficient agile environment is how the roles almost fade away in a given team. My hope for our group here was that testers would start writing code, probably not at the same level as the developers, but perhaps enough that they could fix certain issues that they find.
On the flip side of that, we’ve also gotten very good at developers testing their own code. Unit tests and automated acceptance tests (via Fitnesse) are becoming second nature around here now.
I think the key to making this happen is to put focus on the team, and help the team understand that collectively, they are responsible for the doneness of a given story. It’s not going to go through a round of development and then tossed over the proverbial fence for someone else to test.
The quality of product that comes from a team that understands that they are all accountable for the success of a story is amazing. Help the teams to blur the roles, and watch what happens. :)
Great error messages
Lately, it seems like at least once or twice a day, I get a great little error message when I load up google reader. It simply says, “Oops! That wasn’t supposed to happen.” Isn’t that a fantastic, reassuring message?
Stikkit’s error page says something along the lines of “infernal server error” and “erp. The server burped processing your request”.
Good to see a little humour, but still in what I would almost consider critical applications, I’m not sure Im in the mood for an “oops” and a “burp”. I just want to know that my data is ok.
Stikkit
For the past few days, I’ve been using this sexy new web application called Stikkit. I first heard about Stikkit from Merlin’s 43 Folders, and was really intrigued by the ability to do stuff based on natural language. I’d suggest reading Merlin’s post on how the magic words work. It’s pretty fantastic once you wrap your head around it.
There are some fantastic screencasts on the home page that show you how stikkit can work with your “peeps” (stikkit slang for contacts), as well as planning a meeting or trip, and sharing stikkits with others.
Bottom line: I love the idea that is available here. However, it does seem like the 43 Folders effect (not quite the same level as being Slashdotted) has hit the stikkit website. Some portions of the website time out, making it difficult to use. I really hope they get this figured out soon. This application could easily become an indispensible part of my GTD workflow.
TextMate for Windows
Ok, so now that I’ve got your attention…
TextMate is not coming out for Windows. However, I just stumbled across what looks to be a very promising new text editor based on TextMate.
Intype is extensible in the same manner as TextMate, with the concept of bundles that contain snippets of text that expand out into full text. Intype comes with HTML, CSS, PHP, Ruby and many other bundles installed out of the box.
Intype is still in early beta, and not nearly as mature as TextMate. However, this looks to be the closest thing that we have on Windows so far. It’s only a matter of time before the features are there.
Intype is free during the beta, but after its gone final, I expect that we’ll end up having to shell out about $50 for this editor. Not a bad price tag… I’d gladly pay it to have TextMate-like functionality on my Windows PC.


