Blogvaria

This page is brought to you by Blogvaria (http://blog.evaria.com).

To obtain more information, ask questions and interact please visit our website.

Back to Blogvaria landing page
Feedback
Subscribe
   
Blogvaria

 

The personal pages

Archive for Programming

If God was a programmer

Came across this funny example of how things might have looked if God went through his initial 7 days using a PC…

It’s a bit nerdy and takes a few minutes - but if you’ve got time to spare you should see it!

Show me :)

Filed under Humour, Programming | No Comments

MySQL; Update all rows in a second

I’ve just converted an Excel sheet to MySQL to import numerous data for a new client project. Afterwards when I verified the data all the “Room” numbers was written with an extra .0 at the end besides a few other smaller issues.

So how do you clean up a few hundred rows quickly? You simply write a tiny PHP script to do the job for you:

$query = "SELECT * FROM Table";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while($row = mysql_fetch_assoc($result))
{
    # Assuming you have an auto_increment Field named ID
    $ID = $row['ID'];
    # Replace the unwanted text with new text
    $updateRow = str_replace("before","after",$row['FieldName']);
    # Update your table with the new value
    $UpdateRecords = "UPDATE Table SET FieldName='$updateRow' WHERE ID='$ID'";
    $Update = mysql_query($UpdateRecords) or die("Query failed: " . mysql_error());
}

Could prove useful to you as well someday - it sure did for me :)

Filed under Programming | No Comments

How to compress your JavaScripts

Dean Edwards has written and released a most useful tool that allows you to both compress and also obfuscate your JavaScripts source code. Not only will your page load quicker (smaller filesize) but your scripts are harder to steal as the source is difficult to read (to humans).

You can download the “packer” or use the online version.

Packed scripts should successfully unpack on all browsers that support JavaScript. Only basic JavaScript functionality is used to decode the packed script.

Some browsers may not support the packer itself. The web interface requires DOM support. Legacy browsers will display a disabled interface.

Among the more known users of this tool is jQuery, which is a great library with numerous plugins ready to use.

Filed under Programming | No Comments

Introducing SWFObject

Formerly known as FlashObject, SWFObject is a small JavaScript file used for embedding Adobe Flash content. The script can detect the Flash plug-in in all major web browsers (on Mac and PC) and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents*, and is forward compatible, so it should work for years to come.

SWFObject is released under the MIT License.

Download SWFObject - Zip file, includes swfobject.js and the example html templates.

Filed under CSS & Design, Programming | 1 Comment

Password Strength Meter

Password strength meters are becoming more and more popular amongst web services. Google uses one when creating a Google account.

One can argue how useful these meters really are, but non-the-less they are fairly cool for users.

Password Strength Meter

So how does one go about making one of these meters? Well it’s fairly straight forward.

Filed under Programming | No Comments


Page 4 of 12«12345678»...Last »

Quick links - Blogvaria time links [ sitemap ]

2008 | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec

2007 | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec

2006 | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec

Akismet has protected Blogvaria from 71,725 spam comments. Design by Evaria.com. Powered by WordPress.
Our beloved and trusted server has rendered 3.343 pages so far today, an amazing 4.008 pages yesterday
and even more astonishingly 102.993 pages since 12 September 2008 alone without dropping a byte nor a pixel.

Close
E-mail It