Archive for March, 2008

The Computer Bed

// March 26th, 2008 // 2 Comments » // Fun, Miscellaneous

I want one !!!

Computer bed

More pics at flyingbeds.

One way to determine code quality

// March 21st, 2008 // No Comments » // Fun, Miscellaneous

My good friend and colleague Christian Bradford sent me this link earlier today and i thought it was funny.

You can judge the quality of someone’s code just by the number of times you go “WTF??” when you read through it.

WTFs per minute

Fire people who are not workaholics (sic) – Jason Calacanis

// March 8th, 2008 // No Comments » // Pet projects, Textpattern

Mahalo founder Jason Calacanis had an interesting post offering some useful tips on how to run a startup company. 17 tips to be precise. Now some of them were really controversial and drew a lot of negative attention and criticism.

Here are the tips from his list that IMHO, made him look like a cruel slave-master.

Fire people who are not workaholics…. come on folks, this is startup life, it’s not a game. go work at the post office or stabucks if you want balance in your life. For realz.

You see my problem with this “tip” is not the fact that he wants people to put in 80 hour weeks to keep their jobs at his infamous startup but his condescending comment about people that are not workaholics. What is he suggesting? That people that deliver your mail or sell you over-priced coffee with names and sizes (in Italian) are the only ones that lead a balanced life? Really? For some reason, i think if you analyze that statement a little deeply, you might think that even the PO and starbucks employees might feel offended (for not being considered workaholics or passionate about their work? I don’t know.) On a side note, i guess it’s funny he thinks post office employees have balance in their life. May be he hasn’t heard about the American Slang term “going postal”.

Another tip (first one in his list actually).

Buy Macintosh computers, save money on an IT department

:) :) :)

Here’s a good one.

Buy everyone lunch four days a week and establish a no-meetings policy. Going out for food or ording in takes at least 20-60 minutes more than walking up to the buffet and eating. If you do meetings over lunch you also save that time. So, 30 minutes a day across say four days a week is two hours a week… which is 100 hours a year. You get the idea.

Yeah…may be you could chain their legs to the tables. Oh wait..that brings us to his 4th tip.

Buy cheap tables and expensive chairs. Tables are a complete rip off. We buy stainless steel restaurant tables that are $100 and $600 Areon chairs. Total cost per workstation? $700. Compare that to buying a $500-$1,500 cube/designer workstation. The chair is the only thing that matters… invest in it.

(Not a terrible idea, as a matter of fact.)

The cheap tables may not hold up when the employees just snap one day and decide to take off, dragging the computers and all other office stationery on the table, down to the floor.

Now to be fair, let me also mention a few good tips from his list.

  • Don’t buy a phone system. No one will use it. No one at Mahalo has a desk phone except the admin folks. Everyone else is on IRC, chat, and their cell phone. Everyone has a cell phone, folks would rather get calls on it, and 99% of communication is NOT on the phone. Savings? At least $500 a year per person… 50 people over three years? $75-100k
  • Buy second monitors for everyone, they will save at least 30 minutes a day, which is 100 hours a year… which is at least $2,000 a year…. which is $6,000 over three years. A second monitor cost $300-500 depending on which one you get. That means you’re getting 10-20x return on your investment… and you’ve got a happy team member.
  • Don’t buy everyone Microsoft Office–it’s too much money. Put Office on three or four common computers and use Google Docs.
  • Allow folks to work off hours. Commuting sucks and is a waste of time for everyone. Let folks start at 6am or 11am and you’ll cut their commute in half (at least in LA).

My first company Bright Corner was a startup. A bunch of smart guys that used to work at Sapient, got together and started a consultancy services company and they did pretty good. We did great, in fact. We were all workaholics back then and still are. Up to this date, I spend 12-14 hours in front of the computer every day. But i don’t think i was ever given the idea that if i was not a workaholic, i ran the risk of being fired. I worked hard because i wanted to not because i was threatened to.

Not all 9-5′ers are slackers and not all 80-hours-a-week ‘ers are the most productive.

Seems like he has updated his post now after all the criticism.

“Run tests” option not available in the right click context menu

// March 1st, 2008 // No Comments » // Visual Studio.Net

I’m working on a high-profile project right now that uses some pretty cool advanced frameworks and tools in the business. Can’t reveal too much but here’s a lil’ list.

  • Windsor Container
  • Inversion of Control / Dependency Injection
  • LINQ (to SQL)
  • Continuous Integration (using Team Build)
  • ASP.NET MVC framework
  • Rhino Mocks
  • VS2008 Team Edition for Devs
  • MSTest (unit tests)

Jealous much? ;)

Anyways, so i was working on this unit test case to make some minor changes and after i was done, i tried running it by right clicking in the code window, and hoping to click on the “Run Tests” option in the context menu. Here’s what i was hoping to see.

Context menu with

But i didn’t see that option. Hmm….time for a little investigation.

So how does Visual Studio know when to provide “Run tests” option in the right click menu? How does it know not to display it in a ASPX file or any other normal class file?

There must be some kind of identifier it uses to recognize a file/class as a test class and hence enable the option in such cases.

The test class files are C# files just like any other files in the solution and so you probably are not going to find a lot of differences comparing a test file with a non-test file besides the code it holds, of course.

So the next step is to compare the projects that hold these files. Let’s compare a non-test project and a test project. (I used ExamDiff to compare the .csproj files)

And here’s the result of the comparison. The one on the right is the test project (click on the image below for better resolution).

difference between a test and non-test project files

See where the red arrow points? The test project has a ProjectTypeGuid as shown below.

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

So that’s what differentiates a test project from a non-test project.

And that’s how Visual studio understands whether or not to show the “Run tests” option in the right click context menu for a class under a project.

Coming back to our oriignal problem, why was it missing in the class i was working on? The developer that created that project did not create it as a “test” project – instead he chose the “class library” option in the create new project dialog.

Fixing the problem was easy. Open the csproj file in some text editor and add the ProjectTypeGuids element where it belongs and you are done!

I feel like Sherlock Holmes sometimes….