[Super Tip!] How to loop or iterate over an object’s key/value pair.

| No Comments »

Problem: Help! Is it possible to loop or iterate through each object’s key/value pair like an array? Answer: A very useful trick for iterating over objects is the use of (for x in object), with this you can completely use objects as array!

myObject = {
“this” : “value1”,
“is” : “value2”,
“awesome” : “value3”

for (x in myObject)
alert(‘key : ‘ + x + ‘ / value : ‘ + myObject[x]);

How to: Remove those nasty question marks with a diamond symbols that appears in your website


Problem: Help! I’ve pasted some text from Microsoft Word and saved it to my SQL database! Now whenever I print my text there’s a bunch of diamonds with a question mark symbols appearing!

Solution: You are trying to display characters that are outside your page’s character set, you have to tell your browser that you need to display characters from the iso-8859-1 set so it will know how to render them correctly.

Simply put the following inside your website’s <head></head>

<META http-equiv="Content-type" content="text/html; charset=iso-8859-1">

and in PHP(or any other similar language), simply put this at the top of your page(for other languages, look for an identical function):

<? header("Content-type: text/html; charset=iso-8859-1"); ?>

and voila! Your characters should now be displayed correctly.

So I have decided to Blog

| 1 Comment »

This page is under construction

Blog: to read, write, or edit an on-line journal

With the pool of blogs out there, you might find yourself wondering – “Why should I even bother blogging?“.

First, let me introduce yours truly, I am Cyber Valdez – a programmer, and a technology enthusiast but more importantly – another human being. I make a lot of mistakes and by a lot I mean… a lot. My reason for blogging is simply because I have a story to tell. Of course there is a lot of reasons to blog(or in some cases, why you shouldn’t even bother blogging at all) but mine is as simple as that.

This blog is all about that, mistakes mistakes mistakes and sometimes even triumphs.

So have you decided to start blogging as well? Or maybe you already have a blog? Care to share what made you go into that decision?