People I Admire

There really is no particular order in this list:

  • Randy Pausch
  • Albert Einstein
  • Stephen Hawking
  • Sun Tzu
  • Bruce Lee
  • Jet Li
  • Stephen Chow

Today, I after watching Stephen Hawking lecture on “The Big Question”, I found a new appreciation for this man. He can only communicate through twitching his cheek, the other parts of his body is rendered completely useless. This man takes roughly 7 minutes to write 20 words. Yet, he finds the ability to give full-blown lectures, books, and to be optimistic about his situation. He states that his conditions actually gives him a lot of freedom to pursue one of his greatest interest in life; Solving the mysteries of the universe. I admire this man not only for his intellect, but his bright-facing outlook, and his ability deal with the countless problems in his day to day life. People like Stephen Hawking make me realize how strong humans can be, how they look adversity in the face and overcome it.

The question is “How does this tie into programming?” If Stephen Hawking can overcome the challenges he faces, the problems we face in the computer world seems trivial in comparison. Men like Stephen Hawking gives me strength tackle monstrous applications and crazy product requirements with great confidence that the problems I face can be overcome.

Invisible Tracking Pixel

There already tons and tons of articles on this topic, but I think this knowledge is definitely nifty, so I decided to repeat this information in my blog.

A tracking pixel is a script that is disguised as an image. Each time the image loads, the script does whatever it was coded to do, but at the same time returns an image. This image doesn’t need to be a pixel, but a pixel is the smallest graphical information you can return. The pixel doesn’t need to be transparent either, but I just think it’s annoying to see an out of place pixel sitting on the edge of the page. So for all those who are like me, we like to implement something called a transparent pixel. Without further ado here is the php code for a transparent pixel:

header('Content-Type: image/gif');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " PST");
header("Pragma: no-cache");
$img = imagecreatetruecolor(1,1);
$color = imagecolorallocate($img, 0, 0, 0);
imagecolortransparent($img, $color);
return imagegif($img);

The header code is telling the browser that the file is a gif and to not cache it. If you want your tracking pixel to work well, it’s best for you to include it.

For those hardcore nerds out there, you can save the generated gif into a file, check if the file is there, and if it exists, use that existing gif instead of creating a new one. Not only does this method prevent regeneration of the gif, it also allows you to pass file size information through the headers.

For those even more hardcore nerds out there, you can simply print the string that represents a transparent pixel, it’ll save you all that image creation code. Although you’ll sacrifice readability, since only a handful of us can look at a string of bytes and is able to tell exactly its supposed to be.

Myspace and Flash

I know flash objects could be listed on MySpace pages for quite some time, but I didn’t really understand what this meant for MySpace pages until I went to a friend’s site. I’ve noticed that my friend’s MySpace on, well, MySpace looked and behaved absolutely different than any other MySpace I’ve seen so far. Being the code monkey I am, I decided to investigate. It turns out, her MySpace page has been pretty much replaced by a massive flash file, and everything else is hidden away. I thought this was very interesting, and opens a lot of possibilities for further development of MySpace pages.

I love tinkering with the technology and creating my own version of it, but for those who don’t want to do that, here’s a link to the page that does it for you: http://www.lovemyflash.com/

A simple way to defeat web annoyances

Today, I stumbled upon a very annoying page. It had an overlay that simply had no options to close it. I could follow the instructions on the pop-up and fill out the 5 minute survey to get to the underlying page, or simply turn off JavaScript. I did the later.

Although JavaScript functionality is pretty much assumed now and days, JavaScript can also allow pages to be VERY annoying. There are times where you need to leave it on, and there are times where it’s best for your surfing experience to leave it off.

There is a practice that I see a lot of web-based applications moving away from and that’s the practice of graceful-degradation. It’s the practice of having fall-backs in case certain technologies don’t exist. This is a practice I think all professional products should strive to have, this way, even if JavaScript is turned off, it wouldn’t prevent a user from being able to access the product. Also, these annoying pop-ups are probably one of the reasons why JavaScript might be turned off in the first place, and if advertisements starting moving towards this direction, I wouldn’t be too surprised if we see more and more javascript-disabled browsers.

Professional Development Environments

In a professional setting, you’ll need at least 3 environments, a development environment, a testing environment, and the live environment (when the product gets released).

The development environment is the environment in which code gets developed. It is the scratch pad, drawing board, sandbox, and etc. The development environment is the birth place and weeding environment of good and bad code. You’ll want to have this environment to weed and destroy all the bad code before you release it into the testing environment.

The testing environment is an environment that isn’t live, it is isolated from live, but as close to being live as you can get. This is the environment where you take the code generated from the dev environment and test it one last time to ensure that the code is behaving properly before you release it out into the live environment.

The live environment is where the final product is released. Hopefully, if the code made it this far, it would be bug free.

Having at least these environment ensures that the code is somewhat thoroughly tested before being released into the live environment. Obviously, the less you test the code, the harder it is to ensure that it won’t break anything or behave in an unintentional manner. Thus, one of the worst environments to have is one where the development, testing, and live environment are the same thing. Remember, the more layers we have the more bug screening the code will go through before it goes it is shown to the public. That’s why having at least a development, a testing, and a live environment is the least a professional development environment should have.

Optimize code or cache?

Should we optimize the code so it loads faster, or should we cache it so that it loads faster? The question really shouldn’t be which one you should do, but in what order you should do it. To properly explain the difference, I’ll have to first clarify what I mean by code optimization and caching.

Code optimization is done by doing away with inefficient, memory, processor, and bandwidth consuming practices. While driving, can make forward 1 block, and make 3 consecutive rights, or 1 left. In this example you’re saving mileage on your car, gas, and time.

Caching is done by storing a copy of the data, and when that data is requested, the copy is used instead of re-generating the files. This applies to server result caching, browser caching, gateway caching, and etc. A non-programming example would be like coca-cola. Originally, it was hand brewed, and eventually the cola was copied, and now its machine brewed. A browser cache grabs the data from the server, copies it into a storage location, and then whenever you request that same file, it’ll access the storage location instead of grabbing it from the server.
Continue reading “Optimize code or cache?”

Websites and APIs

Anyone who’s anyone has an API. What is an API? API is an acronym for Application Program Interface. It’s a way for developers to access information in a manner that is different from how most users perceive it. For example, most users see Google Maps as a map interface, but the API for Google maps might provide coordinates, path information, and other information that is normally deemed too detailed for normal use, but not too detailed for developers who want to develop applications which might supplement this information. Perhaps some developer somewhere might want to develop an application that lists all major points of interest across the shortest distance between two locations, he might be able to do that with the help of Google’s API.

I believe that after a web company reaches a certain scale, APIs is the next step. APIs generally allow bulk and instantaneous transactions to be done over an automated interface instead of a ton of manual clicking and etc. Imagine if you were able to purchase Amazon products via an API, it’s very possible for a person to buy out every single Xbox 360 in a blink of an eye if he chose to do so, even if it’s unlikely to occur.

The web is evolving, companies, and the programming industry is evolving with it.

The Growing Importance of the Web

Ever since Google, the web and the world itself will never be the same again. As long as search engines exists, and as long as they’re still important the web will remain important. If search engines grow in importance, the web itself will also grow in importance, and from growing reliance on search engines I would venture to say that the importance of the web is also growing.

The ways to advertise to consumers have grown. It grew from word of mouth to paper, then to radio, then to TV and movies, and finally the internet. I’m sure as the media evolves so will advertising methods.

Now and days, before we go anywhere, watch anything, or buy anything, chances are, we’ll Google it. Heck, before we hire a person, we might even try to Google up that person’s name to see what the web has to say about him/her. This is a sign that search engines are growing in importance which means that the content on the web is also growing in importance.

It’s the content of the web is what shows up in the search engine. The better your content, the better the effect it’ll have on the end-users who land on your site. There is a growing need for professional websites because consumers demand perfection in everything for a company; presentation, service, quality, cost, and etc. It’ll be unacceptable for a major multi-billion dollar company to have a cheap poorly constructed website. The web in a way has just as important as the storefronts and in some cases IS the storefront.

The importance of search engines is constantly growing. The importance of what we put on the web is growing on a daily basis, our standards for it is growing as well. As long as this trend continues, the web will continue to grow in importance.

Employee Optimization

From a company’s prospective, employees are fixed cost resources. While they’re working, they’ll contribute to the product that they’re working on, but what about when they’re not working? A simple way to test is to come up with estimates for a product, use a weighted system such as a system which factors in experience, accuracy in estimation, and etc., to come up with the estimates. Then you apply changes to that worker and see what the effects are. If you see an increase in productivity keep it, if you see a decrease in productivity remove it. Now in order for the experiment to properly execute, you need to control for all the other factors that might affect the worker. As in, you need to prevent anything other than the said changes to affect the worker, this way, if there is a change, you know exactly what caused it. If you introduce too many variables at once, you have no way to figuring out what contributed to what. The combination of factors that might’ve worked for one worker might not work the same way for the next, which is why in order to best figure out what works and what doesn’t, you need to limit the things you’re introducing.

I think open communication is key to employee optimization, you need to figure out what works best for the employee. If at any time the employee feels that there are reasons for him to not openly communicate, then all forms of communication will start failing, and you’ll no longer have the insight to optimize the employee as you did before.