Mar 28 2010

Check if Someone Hacked Your GMail Account

The Chinese government might not be trying to hack your Google Mail account but maybe your ex has. The most common security violation is a significant other or an ex hacking into, logging into without authorization, into a email account. Google Mail has a small feature that allows you to check the activity for your GMail account to see if there are unauthorized logins.

Once you have logged into GMail, scroll all they way to the bottom, between the Google copyright and the available storage capacity you will see a line that reads like the following: Last account activity: 33 minutes ago on this computer. Details.

Clicking on the Details link will popup a window that shows you activity history for your GMail account. The Details page will list the IP address of each time you account was accessed, the date/time of each login, it will show the number of logins from the current session.

You will get a different session each time you login, for example when you use a different computer, etc. Since you can track the date/time, IP address, and session for each login you should be able to verify the activity of your GMail account. This should be enough information for you to spot irregular activity.

From the account activity Details page you can log out from all sessions by clicking the “Sign out all other sessions” button. This will log out all sessions from all computers, for example if you forgot to logout from your schools computer, etc. Signing out from a session would require users to sign back in with your username and password. If you spot irregular activity in your mail account, you should consider changing your password.

If you find mysterious IP addresses in you account activity you can Google for any number of web sites that can track an location to your IP address. These services are not accurate to the city, it might report a city 20 miles away from the actual location but location to IP address services might provide additional hints to track down the location of where your account was accessed.


Mar 14 2010

Zombie Code

In this conversation tweet snippet I rant about dead code when someone noted that in a Murphy’s Law sort of way, you don’t need dead code until you delete it. Thank goodness for version control systems.

Zombie Code

  • @techknow: It is a dead end maintaining dead code, unused, and unreachable code.
  • @archiloque There is something schrödingerian about dead code: it is often unreachable *until* you remove it.
  • @techknow: LOL my question is, if you have dead code in a live site is that considered zombie code or sleeper cell code?

Here I question how evil Google really is when a friend warns me that whatever you say about Google may be used against you by going viral. Google is big brother and it’s CEO thinks we can place our trust in it before our governments. I can’t wait until Google hires Hilary Clinton as the Senior Vice President of the Division of State at Google.

Indexable

  • @techknow Google, if you are not evil why you have to make that your motto? Who are you trying to convince?
  • @vladgur: Don’t hate Google on an indexable medium.
  • @techknow: Good advice, Google’s cache does not forget.

Spaghetti Code is when the code is so convoluted that it’s code path resembles a plate of entangled spaghetti. Here I rant about working with code base that smells like a bad plate of spaghetti.

Code for Dinner

  • @techknow: It is possible to make Spaghetti Code out of Obeject Oriented Programmmmmming. Om nom nom.
  • @mcory1: Possible? Heck, its pretty easy sometimes, even if you know what you’re doing ;)
  • @techknow: I’m working on some code that looks like a cross between Spaghetti Code and Lasagna Code. I need a bottle of wine to digest/debug this.

Chat Roulette is one of those ideas that are so simple that they are genius. Here a friend and I compare and contrast between Chat Roulette and the MTV television show Jersey shore.

Jersey Roulette

  • @techknow: MTV or VH1 should do a reality show based on chat roulette.
  • @jzy: It’s called Jersey Shore.
  • @techknow: LOL from what I have seen of Jersey Shore, I would think they used chat roulette to cast the show.
  • @jzy: I was just joking of course, no offense to Chatroulette.
  • @techknow: All kidding aside, I think chat roulette is a great idea. It reminds me of the early days of Twitter, I wish they had an open API.

Mar 8 2010

Top Worst Java Errors

I’ve had my fair share of Java bugs. There is a stage in a programmer’s career that he or she either knows that they rather manage a convenience store or that they can debug common Java errors just by the way the code smells. Here are my list of worst common Java bugs I have been frustrated to solve. These issues have come up more than once, most often in code that I inherited, and had to fix under a time crunch or tight deadline.

mkdir
I’ve had to fix a few bugs related to the mkdir() method in the File class. The mkdir() method creates or makes a new directory. The mkdir() method only creates one directory. But in many situations, especially if the end user is supplying the path of the directory to be created, you will need to crate a whole new directory hierarchy. Often times you will create a directory and subdirectories at one time. In these situations, you want to use the mkdirs() method instead.

Index Of
Most software bugs are caused by assumptions made by the programmer. One common assumption I see developers making is that file names have only one period to separate the file name from the file extension. It is common to see code that finds the first period and everything after that period is assumed to be the extension. Other assumptions regarding file names include that extensions are three characters long or that the file name does not have special characters. The following code snippet is a dramatization of code I have seen in the field, which incorrectly tries parse the file extension.

String filename = "a.file.path.ext";
int index = filename.indexOf(".");
String extension = filename.substring(index);

A different approach, which would have the desired result is to use the lastIndexOf() instead.

Null Equals
I’ve seen a whole slew of null pointer exceptions due to this sort of Java bug where a possibly null object reference will be used to check the equality of a hard coded constant. Here is the code snippet of what I mean.

boolean equals = maybeNullObjectReference.equals("CONSTANT");

The object reference may be null, so you need to check for null values. I found that if you switch your thinking, you can write less code and still achieve a better solution that having to constantly check if the object is null. A safe approach is to use a object that you know is not null, the constant value.

boolean equals = "CONSTANT".equals(maybeNullObjectReference);

Equals
Yet another Java bug that can be easy to miss is the use of the Java equals operator instead of the equals() method. The equals operator returns true if the two object references you are testing point to the same object instance. The equals operator compares the equality of the object references, not the object values but since it reads the same it is easy to overlook.

Map Key
The worst Java bug that I had to ever deal with involved the use of mutable objects as keys in hash maps. The implementation of the Java HashMap is really simple, the hash code of the key is used to locate the bucket in which to store the map entry, which consists of the key/value pair. Once you put a key/value pair in a hash map you should not change the value of the key, ever, in any way that changes the hash code. If the key is changed where it generates a new hash code, you will not be able to locate the correct bucket in the HashMap that contains the key/value pair. I had a scenario where key/value pairs were stored in a HashMap, then the keys where updated generating a new hash code, and there after the value was not able to located.


Mar 8 2010

Facebook, Zuckerberg, and Plain Text Passwords

Speaking about the public allegations that Mark Zuckerberg, alleged founder of Facebook, hacked into Harvard school email accounts of rivals and school journalists Kevin Rose said that the allegations don’t even sound technically possible. The way the allegations are described, Mark Zuckerberg used the passwords of Facebook users he wanted to track on other systems. Since many online users tend to have one or two different username and/or passwords, if you have the password for on online service you might guess a the login password to another service for that same user. Clear text passwords are a real security concern. On This Week in Tech # 238, Kevin said, “I doesn’t make sense, I don’t see it happening. … Nobody really stores passwords in plain text anymore, I can’t imagine Facebook would have done that.” I’m a fan of Kevin’s Diggnation podcast but I have to call him on this social media bullshit on technical grounds. It might be that his social graph is clouding his judgment. The sad truth is that even today, some large companies have be called out for storing passwords in clear text. In fact, a long time sponsor of Diggnation, Go Daddy was recently accused of storing passwords in plain, clear, simple to read text. Surely, he must have known or heard of the Go Daddy privacy mishap. His explanation that no one really uses clear text passwords anymore is very naive, it sounds like the advice given in the many tech conferences that Kevin is known to attend. I very much doubt that some “copy and paste” programmer in some college dorm room in 2004 would develop a website with 2010 best practices and user experience.

I would hope that Facebook does not employ practices such as these now, but I sure don’t trust them with my account and do the bare minimum on Facebook that is required to keep up with friends. An anonymous Facebook developer in an interview stated that any Facebook developer can impersonate any user and all data is unencrypted so any developer can possible run SQL queries to look up your data.

You have to think about it, for a social networking site, why can’t you befriend it’s founder, Mark Zuckerberg, like in other sites. I mean, Tom is in my top eight on MySpace. Don’t trust the 800 pound gorilla as far as you can trow it especially if it is riding the elephant in the room.


Mar 6 2010

Retweet February 2010

From time to time I just blast tweets about software development, project planning, team dynamics, or whatever else comes to mind. Here is a synopsis of recent tweets and rants. If you want to follow the conversation follow me at techknow and/or juixe and I’ll be sure to follow back.

Software Development

  • Androids dream of electric sheep and I of bytecodes.
  • A large number of performance issues can be tracked to overuse of for loop, sequential search.
  • I hate it when a fatal critical defect gets assigned to me after 5:30PM. I think QA does this on purpose, some sort of revenge.
  • Carpenters’ rule: measure twice, cut once. Programmers’ rule: design twice, code once, refactor as many times as necessary.
  • You can’t do real-time software engineering where you fix bugs as they are discovered.
  • Compilation cycle costs productivity.
  • It is unbelievable the amount of work, time, and meetings are dedicated to features that are useless in the field and limit usage.
  • SEO Secret Sauce: Always be writing good content.
  • I consider an interview good where the interviewee talks more than the interviewer, and where the answers are more profound than the questions.

Team Leadership

  • To be a leader be easy to follow.
  • Inspiration has no expiration.
  • The recipe to success is that when you are missing one ingredient in that recipe, you don’t quit. Improvise and make the dish your own.
  • Waiting until the last possible moment is not a plan.
  • Strategy, execution, luck. Pick any two.
  • Profits, Passion, Purpose. Pick any two.
  • Imagination is a renewable resource.
  • New Motto: Heads Down, Focus Up!
  • Doing a thing does not preclude you know what you are doing.
  • When things get tough, get smarter then tougher.
  • The worst thing you can be on a team is being inconsistent.
  • Right understanding, with right effort, on the right direction, at the right time makes for the maximum results with the least effort.
  • Build up your immunity to failure, just like you build up your immunity to the cold flu.
  • If you can find joy in a dilapidated studio you will find joy in a palace.
  • If you are still trying you haven’t failed yet.
  • The only response to fear is no fear.
  • If you love what you are doing, you are successful.
  • If you believe you can’t, most likely you won’t. If you believe you can, you might.

Product Placement

  • Is Google working on a GPad based on Android?
  • Google, if you are not evil why you have to make that your motto? Who are you trying to convince?
  • A more appropriate name for Chipotle Mexican Grill is Burrito Factory, since is not Mexican or a Grill or have chipotle salsa.
  • Will the iPad make a better kindle reader than the Kindle?
  • The iPad will be the Gitmo of gadgets.
  • Why is Tumblr so slow? Is Tumblr the Goecities of our generation?
  • The should have American Idol for bad comedy and acting… Oh they already have it, it’s called Saturday Night Live.
  • It used to be that people stop and smell the flowers, now if at all, people stop, take a picture, and post it on Facebook.

Question

  • Was the crotch bomber a false flag?
  • Is the US a mute-cultural smorgasbord or a assimilating melting pot?
  • Is life an individual sport or a team sport?
  • Why would a fully charged cell phone that was turned off for a week have it’s battery drained?
  • What does SEO stand for? Spam Engine Optimization?
  • If love is supposed to be patient why do people rush into love?
  • Is life a journey, adventure, game or scoreboard?
  • Are you a samurai or rice farmer?
  • Is God from outer space or from inner space?
  • What is the secret sauce to your success?
  • which is your favorite bear: yogi bear or pooh bear?
  • If everyone cheats is it still cheating?
  • If everyone cheats are you cheating yourself if you don’t?
  • Does God have Buddha nature?
  • How much Buddha nature does the Buddha have?
  • Which is more satisfying, physical joy or spiritual joy?
  • Is there duct tape for the heart or super glue for the soul?
  • Do you think dogs suffer from autism?

Mar 4 2010

US Patent: Linked List

The Linked List was recently patented… no, not by Donald Knuth or some one working with Godfather of Computer Science. No, the Linked List was patented by a Ming-Jen Wang of LSI Logic Corporation in 2006.

The patent abstract says,”A computerized list is provided with auxiliary pointers for traversing the list in different sequences. One or more auxiliary pointers enable a fast, sequential traversal of the list with a minimum of computational time. Such lists may be used in any application where lists may be reordered for various purposes.”

That is the same exact description of a pointer given in my college textbook, before this patent was filed. It is clear that there is a patent land rush. For would be inventors, the patent system is the best thing since sliced bread, and I’m sure this Ming-Jen Wang has that patent pending for sliced bread.

I’m going to patent the Linked Hash Map, because this guy patent’s that too. Someone should patent the pointer, if that is not already patented. If there is an ambulance chasing lawyer that would like to work pro bono, I think we should patent something critical to civilization, like calculus or pottery.

It is clear that omitting prior art is an art in itself that some have perfected to a science.