The man who happened to have legs

Posted by – July 17, 2010 at 4:37 pm

One of the first strange things to ever happen was when a man was born and turned out to be nothing more than twelve legs coming from a cloud. When people saw him, they usually ended up thinking that he was David Blaine or some other magician pulling a stunt.

So David Blaine got a really bad rap about it and people started putting a lot of pressure on him to do regular card tricks that just told a story or something.

Ajax search execution interval

Posted by – July 11, 2010 at 9:28 pm

Nerd Talk

Search functionality can be done in two ways, (1) the usual form submit that reloads the page to submit the query and (2) through Ajax, doesn’t require a page reload because it sends the query in the background which is cool. If you’re working on a search functionality it is best to always optimize the process because every time the user hits the submit button your server gets hit in the head to perform the request. As we know, searching requires database query and we don’t want to request from the database that often because it’ll bite you in the ass when there’s a lot of searches going on. In this post I won’t be providing tips on how to optimize search queries or any caching methods but this is a start for an optimized search functionality. This is to help you save server requests if you’re working on a similar search functionality.

If you’re working on a search functionality that triggers onkeyup:

You know, the kind of search functionality where you submit the request to the server when the user stops typing the keyword to save them time clicking the submit button or if you don’t have a submit button at all. When doing this we must make sure that we only submit or send the request to the server once the user had stopped typing. So if the user wanted to search for ‘krispy kreme’, take note if you’re using onkeyup event, your Search() function will get triggered every time your user lifts his finger off the keyboard key. Imagine the amount of request you’re sending to the server when searching for ‘krispy kreme’, that’s 12 characters, 12 Ajax requests. Code below will help to only send a request to the server when the user had stopped typing, we assume that the user already finished typing the search keyword.

// initial interval value
var SearchTimeOut = 0;
// how long before the execution starts; in milliseconds (1000 = 1 second)
// just the value i'm happy with, not too fast or slow
// increase value if you think users type 1 ltr (letter per second) >:)
var Interval = 333;

// stores the search keyword
var CurrentSearchKey = '';
var Search = function(obj) {
	// get the keyword from the field
	var keyword = obj.value;

	// cancel the previous search
	// SearchTimeOut contains a value more than zero when assigned with
	// a setTimeout()
	if(SearchTimeOut > 0)
		ResetSearch();

	// we only start a request when the search keyword is different from
	// the current keyword
	if(CurrentSearchKey == keyword)
		return;

	// the magic, we attach the search process to setTimeout to put in an
	// interval every time the Search() is executed
	// setTimeout() returns a value assigned to SearchTimeOut everytime
	// it's called since SearchTimeOut now holds whatever StartSearch()
	// is doing when we do a keyup event, everytime we execute Search()
	// we will cancel SearchTimeOut and start a new one, that's what makes
	// sending a request to the server lesser because we only do a request
	// to the server when we stop typing a keyword
	SearchTimeOut = setTimeout("StartSearch('"+keyword+"')", Interval);
}

// the actual search function
var StartSearch = function(keyword) {
	CurrentSearchKey = keyword;
	// here is where you put your Ajax request code, regardless if you're
	// using jQuery, Prototype JS, or the conventional way of doing Ajax
}

// cancels the previous search interval
var	ResetSearch = function() {
	// this is what cancels the setTimeout interval assigned
	// to SearchTimeOut
	clearTimeout(SearchTimeOut);
	SearchTimeOut = 0;
}

There you have it, hope that helps! :)

So Nyuh Shi Dae

Posted by – July 10, 2010 at 1:20 pm


The color of their shirts matches the color of my logo. I just love these girls ;p

Windows 7 Loader

Posted by – June 26, 2010 at 7:08 pm

Activate your Windows 7 in no time! Use this tool to activate your Windows 7 and get rid of that pesky notification that tells you to activate your OS. http://forums.mydigitallife.info/threads/8632-Program-based-Windows-7-loader. I’ve used it myself and it’s working like a charm. Kudos to Daz, freakin awesome programmer.

Sharing is caring ^_^

JavaScript prototype object not working

Posted by – May 15, 2010 at 2:46 pm

If you happen to be working on a custom object and using the prototype property of JavaScript to add custom methods but it doesn’t seem to work, the solution is simple, you just need to instantiate your custom object by using the new keyword so all the custom methods through the prototype object are added.

// Sample custom object
var CustomObject = function() {
	this.props = {
			property: 'value'
		}
}

CustomObject.prototype = {
	CustomMethod: function() {
		alert(this.props.property);
	}
}
// Instantiate the custom object
var foo = new CustomObject;
// Doing that enables you to do this
foo.CustomMethod(); // alerts 'value'

// will not work because the object is not created as a new instance
// prototype methods not yet added to CustomObject
CustomObject.CustomMethod();

HTH :)

Dress for the job you want

Posted by – April 25, 2010 at 11:00 am


Credits to Shoebox Blog.

Man in red

Posted by – April 11, 2010 at 7:29 pm

Hopping along was the man in red,
collecting coins and shrooms.
Stomping enemies right on the head,
from morning to dusk til noon.
Still hopping along, the man in red,
busting up blocks and turtles.
Holding down B, he dashed and he sped,
through all the pits and hurdles.
Reaching the fortress, the man in red,
caught sight of the Princess and Bowser,
Eating a shroom, they went head-to-head,
in a valiant effort to save her.
Saving the Princess and with Bowser dead,
victoriously stood the proud man in red.

~The (B) button

03.20.2010

Posted by – March 20, 2010 at 11:51 pm

Hey blog, sorry I’ve been busy lately and haven’t posted in a while I hope you understand. Are we cool? Alright, cool~

Flashback: old home pages

Posted by – February 27, 2010 at 4:30 pm

I was checking my files on the server and I saw my old home pages that I’ve created before and thought I have deleted them already. Here they are: (click on the image to see the actual page)

Booo! Nothing here!
Home page when I have completely nothing setup yet.

Open 24/7. Free Admission. No Hidden Charges.
Blog splash screen when I first used Japanese characters as main elements for design. Page will redirect to the blog after 15 seconds.

Agyuku.net
Home page when I decided to close my blog for a while because I got super lazy to update.

Hello! Welcome~
Changed the home page again, I decided to make it blue this time with my in-game character in GoonZu (MMORPG) named agyuku (with his pink pet bunny). This is more like an under construction page because I planned something for my home page and make the blog just a part of it but it didn’t work out. Blog is back up when I used this one.

Lost keys

Posted by – February 26, 2010 at 1:46 am

It’s almost 2AM and I’m stuck outside our room at the condo because I lost my keys. Not so sure if I really lost it or I just misplaced it. All I can remember is I still have it before heading home from work. We played PS3 in our lobby for a bit probably I dropped it on the couch or I put it somewhere. This totally sucks. I even called my office mates if they have it but no luck. When I got in our unit good thing when I knocked someone is still awake in the living room. Now just to get inside our room is my problem. I hope someone I texted that collects our bills can bring extra keys.

Update: Nvm I got in already xD

Quick Post

Posted by – February 25, 2010 at 1:06 am

So quick that I have to hurry typing because I’m running out of load..kthanxbye xD

Update 02.20.2010

Posted by – February 20, 2010 at 9:34 pm

Ahhh, today I’m not lazy busy so I kinda spent a little time on my blog. Few noticeable changes particularly with header texts, box border / background, and page links while keeping simplicity. I don’t want to completely change everything but adding some colors should give this place some life ^_^

And oh, I’ve added the real me on my sidebar so that guy is me and the japanese characters on the left is my name - lloyd irvin ^_~

Windows 7 know how

Posted by – February 20, 2010 at 4:20 pm

TIP: If you forgot the password or don’t know the default Administrator account password in Windows 7 Ultimate, use an account with an administrator priviledges and then go to user Accounts > Manage another account and choose Administrator - you must enable it first for it to appear - Run > Type cmd > type in net user administrator /active:yes and should enable the default Administrator account. So, assuming that Administrator account is already enabled and you forgot the password or have really no idea what it is, just select it in User Accounts and click on Change password. Type in the new password and confirm. Log off your current user and log in to the Administrator account using the password you set.

Just found out today (not sure if this is really a solution or I’m just a dumbass) because I didn’t know the password of the default admin and to my surprise you can actually change the password of the default admin using another admin account - which I thought that it shouldn’t be able to since default admin is the Admin of all admins in windows. But thankfully I was able to change it or else I would’ve re-installed again if I wasn’t able to access the default admin account. Sick.

Weekends

Posted by – February 20, 2010 at 10:45 am

Right, I love weekends because I can rest and not think too much but I just can’t stay away from the computer. Early in the morning before anything else first thing to do is check Facebook, my email, log in to YM and talk to some friends. Sigh. Still tiring xD

Today I have to get rid of comment and trackback spams and improve search engine optimization (SEO) of this blog. Will do some work now!

3:03am

Posted by – February 18, 2010 at 3:03 am

What’s more stressful than being stressed? Going home late like this is like..stressful.

Update (06-26-2010): Fuck it, stress is nothing but a mere thought. I realized during my working hours that me and my teammate at work is actually putting stress to be stressed, muhaha, we can’t be beaten. >:)


^ Back to Top