Blog

Stack Overflow

January 19th, 2009

While browsing for a JavaScript question, I happened to come across stackoverflow.com, a site out there that deals only with programming questions. Brilliant! One to remember when you’re stuck with one of those annoying bugs in the middle of the night…

Setting Geo Data on Photos

December 5th, 2008

I got most of these ideas from trippermap.com and earthalbum.com:

Some cameras and phones set the geo data in the EXIF part of a JPEG photo. This is very handy but far from common. To get around this Flickr have developed their own mapping tool (go to the Organizer and select the map tab). This tool will allow you to drop your images anywhere on the world map. It’ll then obtain the geo data of the point dropped and adds it as a tag to your photo.

Once your photo has this information in it, you can submit it to various sites (or build you own) to place it in its correct location in the world map (can use Google or Yahoo maps who provide APIs for this).

In Flickr you can also add geo data tags manually provided you know the location yourself. Simply add the following tags to your photo:

geotagged
geo:lon=xxx.xxx
geo:lat=xxx.xxx

Another way to get geo data is to look up the location the photo was taken in a database (try Google maps or geonames.org). This is a little harder as you need programming knowledge on how to get the info back from these sources.

Finally you can use a host of desktop tools which will allow you to write EXIF data directly into your image.

Here’s a list from trippermap.com:
WMMX Location Stamper (Win)
GPSPhoto (Linux)
GPSPhotoLinker (MacOSX)
iMagine Photo (MacOSX)
EXIFutils (Command line)
itag (Win)

Let’s say you are a boss of some developers. And you’ve got this one guy who is way too motivated. He is making everyone else look bad. You want to force him to quit. I have no idea why you’d want to get rid of your one motivated good programmer, but you boss-type guys pull this kind of crazy stuff all the time, right? Anyway, let me explain how you, the boss, can suck the ever-loving life from this programmer and make him hate his job.

Some valid points made in this article. If you’re a programmer and love/hate your job, read the full post here. From lbrandy.com

Scott Hanselman’s Computer Zen

September 12th, 2008

Scott Hanselman’s 2007 Ultimate Developer and Power Users Tool List for Windows

A great site for hi-tech Windows developers. Check his Tools List for Windows-based applications used for programming.

Saving a Failing Project

August 14th, 2008

Many good points on how to tackle difficult programming jobs gone wrong.

There’s mention of Richard Whitehead‘s book “Leading a Software Development Team” which I should deffo have a look at very soon.

Read the full post here.

From a discussion on reddit.com.

A modern version control system has three clear benefits over the “folder backup” method.

  1. File space. Let’s say your code changes 10% each week. Under the “folder backup” method, each week you’re saving 100% of the code. Using a proper VCS, you’re only saving 10% of your code. I know hard drive space is cheap, but it’s not free and I never seem to have enough.
  2. History. The key to VCS, in my opinion, is being able to document your changes in more granular level than a file called “Changelog.txt” that might not get changed whenever you work on your code.
  3. Bug-location: Let’s say you find a bug in a method. You search the history for that file and let the VCS runs the diffs for you.
  4. Complete freedom to change code. You don’t have to worry about breaking something, or removing possibly useful code. Before I moved to VCS, I used to comment out old code liberally but keep it ‘cos I might need it. This quickly becomes a PITA.

That being said, I’ve got some caveats too.

  1. You’re still going to want to backup the version control folder
  2. You’re entrusting your entire code base to a program that may itself be buggy. You’re going to want to make sure (a) it’s reliable (no bleeding edge releases) and (b) you understand how to work it

Popular systems:

  • Git
  • CVS
  • VCS
  • Subversion
  • TLA
  • Darcs
  • Mercurial

GIT seems to be very popular.

Article on How to set up a personal home Subversion server.

From htmlist.com by Edgar Hassler.

I started getting “serious” about development because I had a desire never to write lengthy, wandering streams of code again.  It was not for any reason but unadulterated laziness—the kind that so overpowers the better senses as to force a person to spend hours in a chair with the express goal of not spending hours in said chair.  It’s a wild, consuming laziness that seems to know no bounds.

Read full post here

To remove a foreign key constraint from a Postgres database, you must copy the table,  delete it,  and then re-create it!

e.g. if you have a table called ‘log’ with a foreign key ‘fk’ – I tried using:

ALTER TABLE log DROP CONSTRAINT fk;

This does work for check constraints but not for foreign key constraints.

It took a while to find this out and reiterated the fact that I don’t like Postgres!

In MySQL you can use:

ALTER TABLE log DROP FOREIGN KEY fk;

So this is what you’d do for Postgres:

CREATE TABLE temp AS SELECT * FROM log;
DROP TABLE log;
CREATE TABLE log AS SELECT * FROM temp;
DROP TABLE temp;

Link from postgressql.com

From groovymother.com:

A few months ago, I was in the pub with a couple of geekchums. The topic of job interviews was going round the table, in part because I’d been talking about my goal of getting a job and moving to the Bay Area. Someone mentioned that they’d interviewed at Google, had read Programming Interviews Exposed the night before the interview, and nearly every question they’d been asked was pretty much out of the book.

Not that I’m looking for a new job but I do think I should shape up a little and learn stuff!

From Pro-Phi-Psi:

I was reading Artima today when I came across this article on C++. The article talks about some new feature of C++ called rvalue references. I tried to read it until my eyes glazed over. I went back to the top to look for the tell tale reason, which exists in almost all publications on C++, for why I didn’t understand the article and why I didn’t care that I did not understand it. Here is the money quote: Rvalue references is a small technical extension to the C++ language….They are primarily meant to aid in the design of higher performance and more robust libraries.

Read more