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.
Posted in Programming, Rant, TechKnow | Tagged , , , , , , , | Leave a comment

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.

Posted in Java, Programming, TechKnow | Tagged , , , , , | Leave a comment

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.

Posted in Rant, TechKnow | Tagged , , , , , , , , , , | Leave a comment

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?
Posted in Programming, Rant, TechKnow | Leave a comment

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.

Posted in TechKnow | 13 Comments

Buzz Overkill: One Day with Google Buzz

Aside from my initial shock of Google’s blatant privacy oversight, I immediately jumped on the bandwagon. I learned that if you can’t beat them, join them, and if you going to join them might as well try to get some new followers in the process. Using a Google Mail account that I do not user as my primary private emails, I updated my public profile and began following as many technology influencers as possible. During the course of a full day of using Google Buzz, I buzzed mostly about Google Buzz. Here is what I was buzzing about the first day of using Google Buzz.

  • With any new service there is always a land rush for the vanity url, profile name, and followers?
  • The short for Google Mail is GMail. The abbreviation for Google Voice is GVoice. Will Google Buzz be shorten down to GBuzz? What about Guzz?
  • Google Buzz is a new opportunity for the race to reach 1,000,000 followers. I hope @aplusk hasn’t heard of Google Buzz yet as it would give me a head start.
  • I expected Microsoft to blatantly copy Twitter, Facebook, and Foursquare before Google.
  • When Twitter first came out Leo Laporte and Kevin Rose had the most followers for the longest time because the early adopters where mostly technologists. But once celebrities and mass media discovered Twitter, and after the stop laughing at the concept, they quickly gained the most followers and brought on new users. Leo Laporte currently has over 6K++ followers. Just wait until Britney Spears gets her buzz on.
  • I am not sure how Google will combat the additional spam I expect because of Google Buzz and Google Profiles. But I imagine, spammers and marketers are already hard at work developing spam bots that will follow everyone possible and then it is very easy to figure out peoples email address by adding at gmail.com at the end of you profile user name which is public, visible, and searchable.
  • That is the plural of buzz? Buzzes?
  • What is the verb of using Google Buzz? Buzzing? Like, “I can’t talk cause I am buzzing right now.”
  • What I like about Buzz is that it has not been taken over by marketing and SEO bot accounts, just like the early days of Twitter.
  • Does anyone else notice that when you are commenting on a Buzz post the page jumps up and down, kinda like flickering, due to all the updates happening around where you are commenting? There are soo many updates below and above other posts that my comment text box jumps to fit in storm of other comments around it.
  • If you don’t like the flickering, I get’s me dizzy after a while, click on the post’s time stamp in the upper right corner. The link is to the page for this one post and it does have the jumpy flickering visible when commenting in the middle of your stream.
  • I think that Google and Facebook are in a battle for your friends. But it feels more like a Belfast brawl cage fight… Google and Apple are battling it out in in the mobile space with tit for tat guerrilla warfare… i.e. you can use the word ‘Android’ to describe you app on the Apple App Store. Now Google will suck a lot of the hot air valuation from Facebook. I think Jason Calacanis stated that Facebook lost half it’s value because of Google Buzz… and Microsoft is trying to pick a fight with Google in the search space with Bing but it is not getting much traction.
  • I still have not connected my other services into Buzz. I see some people have but they get multiple buzzes (buzz posts) for the same content. It seems like some sort of feed recursion, where the Facebook comment get’s read in by FriendFeed, then read in by Twitter, then feed into Buzz two or three times for each original post, sometimes one buzz post has the same content duplicated. I feel like I need a network architect to help me sort it all out… LOL.
  • Following along and contributing to a conversation is so much easier on Buzz than Twitter, Facebook, MySpace, etc.
  • Not missing Farmville updates on Facebook. This is the longest time I have gone without finding random alien cow on my wall.
  • Now that I filter out Buzz messages in my inbox, I can’t find the buzz threads I commented on.
  • I’m going to buzz my facebook to tweet my tumblr post on myspace and blog about it.
  • Remember when following someone meant stalking… Now it means, friending.
  • Having a buzz attack.
  • My tweets are still no popping up on my buzz.
  • Not liking how tweets show up on my buzz stream, a bunch at a time, in the middle of the night, hours after they were first tweeted. I thought Google had ‘realtime’ access to tweets. I thought Google has access to Twitter’s firehouse.
  • There are a few reasons why I like Buzz over Twitter. The ability to edit buzzes after they have been posted and commented on, and the ability to post more than 140 characters at a time. What I don’t like is that, unlike Facebook, you can’t delete comments left on you posts from trolls or stalkers or folks buzzing on their own supply. Even after you block spammers their comments are still visible in your posts.
  • There is a lot of negative reaction regarding the privacy failures with Google Buzz. I think that the problem with Google Buzz is not that it is integrated in GMail. The problem is the defaults of Google Buzz, including auto-follow, and public profiles, and the inability to use a public profile name other than your private GMail user name, the blocking functionality does not seem to work, etc.
  • Google pulled a Facebook move in terms of privacy… Their motto of ‘do no evil’ did not stop them from doing something so stupid.
  • How does one get verified on Google Buzz/Profile? I certify myself. Does my mom need to call Google to verify my identity? What else will Google verify? What I really need is an alibi and some receipts from a convenience store in Albuquerque, New Mexico for last night.
  • Ansel Adams would not have had used Flickr, Shakespeare would not had has used Twitter, Ghandi would not have had used Facebook, and Columbus would not have had used Foursquare.. But I am sure they would all have had used Google Buzz.
Posted in TechKnow | Tagged , , , , , , , | Leave a comment