Printing code and making it look pretty

If you are on Linux and want to print some code and also make it look pretty then check out a2ps (Any to postscript filter). Of course if you can avoid printing in the first place and saving paper and trees and make it greener that is ideal - however there are times that is not possible. I tried printing from CDT, but the printing options from CDT just looks plain ugly and big fonts and can spread over 10 pages for a simple code file (spanning 293 lines). Sure I can tweak the font in CDT, but that is the only option available - enter a2ps . It seems to have more options, but I have not had a chance to play with those. ...

March 1, 2010 · Amit Bahree

Getting MOOS linking

I started a brand new project in CDT where I was using MOOS and I could not get my simple program to link. While everything looked fine on the surface I just could not get the IDE to link to the MOOS libraries. I know the OS and MOOS itself was not a problem as I had other projects in the same workspace which did link correctly. The only difference between those and this was that I setup this project from scratch, whilst the others I had not. It took me a while to figure it out, but in the end I had to resort to explicitly add the locations for the libs in the C++ project properties in CDT as shown in the screenshot below. ...

February 28, 2010 · Amit Bahree

Host files on Ubuntu

If you are newish to Linux (like me) from Windows, then some of the simple things which come quite naturally to you on Windows is a little embarrassing and challenging. For example, I got a new WHS and wanted to mount the music drive and wanted to create a new host file entry to point to the new WHS. Now on Windows this is quite simple and can be found in YOUR-OS-DRIVE\Windows\system32\drivers\etc\hosts. But on Linux you will find this in \etc\hosts. If you want to edit it you will need to type something like this a shell: ...

February 28, 2010 · Amit Bahree

Interesting Find #20

The next post in the interesting find series. Top 25 ‘most dangerous’ programming errors for 2009 – interesting read as always. :) The 100 essential websites – from the Guardian. Please Rob Me.com – the dark side of geocoding . SSD Optimisation guide - a must read if anyone is thinking of buying a SSD drive. 37Signals – simple web based apps (instead of bloatware) covering things like managing projects, tracking contacts, organizing your business, etc. (Not free in case you were wondering). Never reboot Linux - even when updating the Kernel. When can Windows have this? SSD Tweak Utility - if you still want to tweak more things after reading the SSD optimisation guide above. FsUnit – Test F# with F# - I think the name says it all. devZing - No hassle open source project management hosting (from $10 / month); though I wonder why you can’t use google for this. Jollat – a cool GUI for you AWS (Amazon Web Services) which allows you to manage S3 and EC2 on Amazon – runs on Windows, Linux and Mac. Podcasts from MS – the name says it all. Digging for Sensitive information – how to get details on someone you know. Panopticlick — How unique, and trackable, is your browser? My browser fingerprint appears to be unique among the 641,692 tested so far which is quite scary! SideShow for Windows Mobile Developer Preview – only works with Win7. Large Query performance stats from SQL 2K to 2K8 – quite interesting and covers both x32 and x64. PresentationFx – provides free PowerPoint templates and artwork. Making a cool Vista Screensaver – this should also work on Win7 (not tried this btw).

February 18, 2010 · Amit Bahree

Facebook and Security again

Facebook and my views of it in the context of Privacy and Security are well known. This conversation with one of their (anonymous) employees detailing a few internal processes and tools is actually quite scary. Now, I don’t know if this is true and how much of this is true; but if I was working for Facebook then all of this is quite logical and makes sense. And, technically all the things talked about is very feasible and not too challenging (of course am over simplifying here). ...

February 17, 2010 · Amit Bahree

Ten commandments of Programming

I came across the Ten commandments of Programming while looking at a question on StackOverflow and I can’t believe I have not seen these before. I think every developer, lead, architect, dba, pm, whoever should print this out! 8-) Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry, so we can, and should, learn, laugh, and move on. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered. No matter how much “karate” you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed. Don’t rewrite code without consultation. There’s a fine line between “fixing code” and “rewriting code.” Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer. Treat people who know less than you with respect, deference, and patience. Nontechnical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don’t reinforce this stereotype with anger and impatience. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, not as some serious inconvenience to be fought. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect—so if you want respect in an egoless environment, cultivate knowledge. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you do turn out to be right, don’t take revenge or say, “I told you so” more than a few times at most, and don’t make your dearly departed idea a martyr or rallying cry. Don’t be “the guy in the room.” Don’t be the guy coding in the dark office emerging only to buy cola. The guy in the room is out of touch, out of sight, and out of control and has no place in an open, collaborative environment. Critique code instead of people—be kind to the coder, not to the code.As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

February 17, 2010 · Amit Bahree

Windows Phone 7

So you would have heard what all the buzz (not Google!) is about. Check out the feature video for Windows Phone 7. I have a Zune HD and the UI is very similar and I cannot wait for it! After a lot of disappointment with WinMo’s and becoming the joke in my friend/nerd/geek/co-worker circle for still have a WinMo phone, would love to see everyone’s faces when I get this. :) ...

February 15, 2010 · Amit Bahree

Bing Maps adding Flickr images, live video, stars

Bing Maps adding Flickr images, live video and stars - very cool. Update: The official TED video below is quite cool and in addition to the one above, also adds more interesting features such as video – check it out.

February 14, 2010 · Amit Bahree

Colourful India

Awesome photos of Colourful India.

February 6, 2010 · Amit Bahree

Interesting Find #19

Wow it has been a while since I posted an Interesting find and instead of the usual list I though I will keep this especially for timers. Timers Galore! So I was looking for a simple countdown timer that I can run on my laptop to keep tracking of a few things and I found a few very interesting things. If you prefer to download an app and run it from your desktop (Windows) then check out Timer from Orzeszek. There are a few other interesting dev projects there such as transferring large files over http . ...

February 2, 2010 · Amit Bahree

Geeky Joke #1

I am going to start posting the geeky jokes I find as a series. These are more for me to make them easy to find, as I cannot seem to recall any of them when I need to. Here is the first one which I also tweeted: Yo mama’s so slow and dumb that she can be emulated on a 286.

January 31, 2010 · Amit Bahree

Thinking of a new WHS device/machine

Not sure how many of you know, but I run my WHS on a old Dell Desktop (its about 8ish years old) which ran out of available USB ports sometime back and all my attached drives are also filling up and I am now running low on space. I was thinking of getting a dedicated WHS device/machine (not sure what to call it), such as HP's MediaSmart Server or Acer's easyStore . ...

January 31, 2010 · Amit Bahree

CNR

CNR [ via xkcd.com ]

January 29, 2010 · Amit Bahree

Win 3.1 experience in your browser

If you ever wanted a Win 3.1 experience in your broswer (why I cannot imagine - despite me running a VM ), then check out michaelv.org . The irony of all of this is that there is a modern browser in that which seems to be compliant with the standards (it pases the ACID2 tests; fails the ACID3). 🤨

January 24, 2010 · Amit Bahree

Copying strings in C++

Here is a good example on why either you love C++ or hate it with such terse expression oriented code; I think its pretty cool. If you want to copy one string to another, one option can be something like this. 1 2 3 4 5 6 void mycopy(char *p, char *q) { int len = strlen(q); for(int i=0; i<=len; i++) p[i] = q[i]; } However this achieves the same thing as above and is more efficient: ...

January 23, 2010 · Amit Bahree

Geek moment of the day

(: ¿ɥǝ sıɥʇ sı looɔ ʍoɥ

January 15, 2010 · Amit Bahree

Qt Eclipse Integration

If you are working in CDT and Qt then the Qt Eclipse Integration is quite handy and in my opinion much better than using the standalone Qt designer. Installation is pretty straight forward as described here .

January 13, 2010 · Amit Bahree

A Song of Silicon Valley

Ah, this brings back fond memories of my time in the valley – awesome! :) Credit goes to this post of the NY Times.

January 11, 2010 · Amit Bahree

‘QPainter painter’ has initialiser but incomplete type

If you ever got an error something like [some-class] has initialiser but incomplete type, it basically means the compiler cannot understand the type and you need to add the include for it. 1 2 3 4 5 QPixmap pixmap(20,10); pixmap.fill(Qt::white); QPainter painter(&pixmap); QPen pen(Qt::blue); Take the code snipped above when you compile it you might get an error something along the lines of the following for line 4. ...

January 10, 2010 · Amit Bahree

Permalinks don't support quotes?

I don’t know if this is a feature or a bug or a configuration issue either with WordPress itself or how the web server is configured where this blog is hosted. I just posted something about compiler errors where the permalink had a single quotes in its title like : ‘qpainter-painter’-has-initialiser-but-incomplete-type. While this was handled fine by WordPress (I could successfully preview the post as well), once it was published I got the generic 500 Internal Server Error as shown below. So the question is what is wrong (if anything)? What is the expected behaviour? The only way for me to fix it was by removing the single quote in the permalinks as now you can see in the post . ...

January 10, 2010 · Amit Bahree

WordPress ping list

I updated the ping list for the blog based on the suggestions from Vladimir which I found via WordPress's documentation site . Not sure if it is of any help or not, but I guess I will find out.

January 7, 2010 · Amit Bahree

Is it time to relook at Facebook again?

I still don’t get Facebook – despite being on it. If I want to talk to someone I will call them, email them, text them, meet them, have dinner with them - get the picture? I am quite worried about the security and privacy elements of it – or rather the lack of it. Those who know me well (anyone?) :-) know I was not always this paranoid but after attending a few Security courses – I cannot bury my head in the sand anymore. ...

January 6, 2010 · Amit Bahree

Media Centre Pictures

Sorry this took so long (been extremely busy lately), but as promised here are pictures of the media centre during the various stages of being built. Clicking on the thumbnails below, will show you a larger version of the photos. Also given my previous experience with the MCE , the wife is always very sceptical whenever I say anything about ‘fixing’ the MCE. Moral of the story (as I learned the hard way) the MCE is a ‘production’ class machine which does not get touched without adequate planning with fall back options planned. ...

December 31, 2009 · Amit Bahree

Eclipse CDT Blues

Sigh, why is Eclipse CDT to flaky? Well, there might be a slight exaggeration in that but nevertheless, I did not have so many issues with Visual Studio / VC++. :roll: I have uploaded this particular log file here if anyone is interested. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # SIGSEGV (0xb) at pc=0xb263d1f7, pid=20331, tid=3085625024 # # JRE version: 6.0\_16-b01 # Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 ) # Problematic frame: # C \[libQtGuiCppIntegration.so.4+0x6531f7\] \_ZN16QtCppIntegration12QLineControl18removeSelectedTextEv+0x27 # # An error report file with more information is saved as: # /home/amit/hs\_err\_pid20331.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #

December 24, 2009 · Amit Bahree

Upgraded to WordPress 2.9

I just upgraded to WordPress 2.9 and wow what a pleasant experience compared to Community Server 2007! Excluding backing up the DB and the site, the actual upgrade took only a few seconds and was so painless! Such a different experience from Community Server 2007, which was so much more difficult. Loving WordPress and all the add-ins and the goodness of the communities! :mrgreen:

December 24, 2009 · Amit Bahree