Descriptive comments

When you write code, you need to comment it so that when you or somebody else comes back to this code few years/months/days/hours from now, they will be able to figure out what the code does. Here is the comment I saw one of my interns write:

// This function divides Numerator by Denominator

Really? I thought numerators and denominators are usually multiplied!

ATM Skimmer

Found this on Brian Krebs’ blog (got there through Bruce Schneier’s page) . I know, I’d fall for it.

Sidenote about Brian Krebs’ blog: Krebs states on his About Page that he does not have technical background and got into security by accident. But from his postings in Washington Post’s Security Fix Blog you can tell that he’s very knowledgeable in the area. Definitely an addition to my daily read, right next to Bruce Schneier.

Sidenote about Linux: On the same About page, he mentions that he had been monkeying with a Red Hat box, as I read this, I felt an urgent need to fire up my old SUSE box and play around a little.

Google Sync / Blackberry / Multiple Google Calendars

I find Google Calendars quite useful and I use them quite a bit. I have multiple calendars, one for personal items, one for my work, one for activities, etc. When I just got my Blackberry Storm and installed Google Sync on it, it worked perfectly fine and allowed me to sync all of those calendars. However, somewhere between upgrading firmware I realized that Google Sync stopped syncing any of the calendars except for the default.
Searching for answer on forums only lead to suggested answer:
Go to Google Sync > Options > Calendars and choose the calendar from the list.

The problem is that I had only one calendar on that list – Default Calendar (which is not even the name of my default calendar – it’s called Main Calendar)

I tried upgrading Google Sync, reinstalling it, resetting sync – nothing helped.

Just for kicks, I decided to sign into Google Sync using not my usual email, but the gmail email (which i’m not using, yet it was created, since i’m using multiple Google services). And voila! The calendar list got loaded and events from all of them synced!

Also, while in the process on the new firmware for Storm and Storm 2, it appears that Google Sync starts running in Compatibility Mode, which prevents people from being able to log in (user can type in the email, but not the password, and only portrait mode works), the solution there is to go to Settings > Applications > Google Sync and check Disable Compatibility Mode

Hopefully folks at Google will work out these bugs, until then, I hope this helps

Orphaned .msp files

Today got a call from a client of mine – one of the machines has full hard drive. You’d think – what can be more obvious – you pile up files, the hard drive gets full! Something seemed odd though – that computer has a lot of space on hard drives. So i decided to investigate. Downloaded WinDirStat, ran it and saw that 2/3 of the space is occupied by a bunch of 100Mb files which are located in C:\Windows\Installer folder. Odd. Started digging, and here is what I found: those are orphaned installer files – microsoft update program had failed repeatedly for some reason (happened to be failing on Office Service Pack 3, a 100Mb pack), and computer had automatic update “on”. Which means that every day for a few months the update program would go, download the file and try to install it, fail, complain in a form of a small pop-up, yet do the same thing next day.

Solution (found here):
a) Download what is known as Windows Install CleanUp Utility which includes program called msizap.exe (this program is also included in Windows SDK, so if you have SDK, no need to download the CleanUp utility)
b) Run the msizap.exe with parameter G! (stands for “delete orphaned packages silently”)

Voila! 2/3 of hard drive space is available!

Hitachi SimpleTough 500 Gb Drive

As I started preparing for my trip to AZ, I decided to check my Hitachi SimpleTough 500 Gb drive that I bought back in August. And here, as they say, things got interesting. My laptop cowardly refuses to see the drive when i plug it in! LED is on, I can feel vibration, so the drive is getting power, but I cannot see it neither in USB “Safely Remove Hardware” window, nor in Disk Management utility. I also tried it on my Dell Precision workstation with exactly the same result.
SimpleTech’s Support site is not particularly useful. The FAQ section lists this useful blob:

1) I have the drive plugged in but I cannot find the drive in “My Computer”, why? The most likely cause would be not enough power provided by a single USB port on your computer. Unplug the portable drive from the cable and unplug the cable from the computer. Now, plug the cable into 2 USB ports directly on your computer. (If you have a desktop, you should plug the USB cable directly into the USB ports on the back of the computer. If this is a laptop, you should plug directly into a USB ports on the computer. Do not plug into a USB hub or docking station). Then plug the drive into the cable. In a few seconds you should see the drive listed in the “My Computer” window as a SimpleDrivePS.

Granted that there is no FAQ for SimpleTough drives (these come with USB cable permanently attached to the drive (photos later tonight), and adjusting for the difference in cables, we are still stuck with a recommendation to plug drive into 2(!) USB ports. One of my first portable USB drives (it was some generic brand) came with an adapter like that – there were two male USB connectors and one USB female. One of the male connectors was the main and second one was only pulling power. I bought that drive some time in 2006, and it died on me in a matter of year or so. I expected a little better from SimpleTech/Hitachi.

I’ve placed a support inquiry, so we’ll see what comes out of it.

The interesting thing about this particular drive is that there is a DC connector that is visible right underneath the rugged cable, though the drive itself does not come with a DC adapter (well it is a PORTABLE drive, right?). I can see support response being something along the lines of “you need to buy a DC adapter in RadioShack (support site even lists a particular model) and then it will work”. I don’t know about you or folks at SimpleTech, but to me, having an additional cable and/or dual USB cord with a portable drive really outweigh thebenefits of portability. I’ve bought this drive because i needed a portable drive that i would not be afraid of tossing around a little, when I’m on a run.

Photos and updates to follow.

Ads

Running a file

Double-click an executable file…
“You seem to want to run this  program – are you sure?”
“Yes”
“Really?”
“Yes”
“Like, totally, really sure?”
“Yes”
“Are you sure you dont want to delete it instead?”
“No, just run it, please”
“You know that this little programmy thingy can hurt you, right? You wouldn’t want to have a boo-boo”
“Yes, i know, I am also sure it will not, i’ve ran it many times”
“But you never know. There are many things out there in the big and scary Internet, why don’t you stick around with the small and cosy world of our company?”
“Ok, how about this – i’ve been doing this stuff for NN years, i know what i want, just run the program?”
“Would you like this little cute puppy on your screen?”
“No. just run the damn program!”
“Hey, no need to be defensive i just want to let you know that our company also has this great suite of flashy software that does all the same stuff this program and does also offers counseling and hand-holding. Want to try this one instead?”
“No. Could you please, start the program?”
“Look at that puppy, look at him! Isn’t he adorable? I used to have another cute pet – it was a paper clip. It loved to ask questions and offer help… Some people didn’t get it though, I guess. He was sent to recycling… Life is a funny thing, you know… I remember this one time I was updating myself and … “
“Ok, how about this – we are just going to just forget that I ever double-clicked anything, ok?”
“Ok, just for you and just today. By the way, there is this offer for this security software our company produces – it will make sure that you will not start any bad software on your computer”
“Oh… thanks. Awesome. Really… Yeah”
“And, btw, i already started that program you double-clicked 20 minutes ago”
“Huh?”
“Yeah. It was asking a lot of questions, so i just said Yes, so that it wouldn’t distract you from our conversation. I also changed the default e-mail client back to our flashy client. It came in the bundle, so if you are using the other programs from that bundle, I know you really want to use that one instead of your old one, right?”
“Ok. just whatever. Nice talking to you”
“Yeah! Any time! Hey, could you do me a favor – restart me please? See, you moved your mouse, you need to restart your computer for changes to take effect”