Author Archives: admin

Change Folder Icon In Windows

Sometimes, you may want to change the icon of a folder for aesthetic purpose or you need to make the folder more noticeable. Changing icon of a folder is simple. It can be done in a few steps:

1) Right click on the folder that you would like to change. Click Properties.

Change Folder Icon

2) From properties dialog box, click Customize tab.

Sometimes, you may want to change the icon of a folder for aesthetic purpose or you need to make the folder more noticeable. Changing icon of a folder in simple. It can be done in a few steps:

3) Click Change Icon. You will see icon selection dialog box appear.

Change folder icon

 

4) From icon selection dialog box, select your desired icon. Click OK.

Change folder icon

Done.

Showing Underline When Hovering A Link – Simple Stuff

Showing an underline for a link on a website is simple. Here are the steps:

Demo: http://kennykee.com/demo/css-underline

1) Within <head></head> of your HTML page, create <style></style> if not exist. For example,

<head>
<style></style>
</head>

2) Let’s say you have a link <a class=”mylink” href=”http://kennykee.com”>My Website</a>. Note the class=”mylink”. We need this to show the underline effect.

3) Update your <style> tag to following:

<head>
<style>
.mylink{
text-decoration: none;
}
.mylink:hover{
text-decoration: underline;
}
</style>
</head>

Done. http://kennykee.com/demo/css-underline

Full code below:

<!DOCTYPE html>
<html lang="en">
  <head>
    <style>
  	    .mylink{
            text-decoration: none;
			font-size: 50px;
			font-family: arial;
			margin-left: 20px;
		}
		.mylink:hover{
			text-decoration: underline;
		}
    </style>
  </head>

  <body>
	 <a class="mylink" href="http://kennykee.com">My Website - Hover Here</a>
  </body>
</html>

Windows Live Mail Keeps Work Offline – Simple Solution

If you are using Windows Live Mail, you may encounter the following error message:

“You are currently working offline. Would you like to go online now?” Even though you keep clicking Yes, the pop-up will keep coming up.

Windows Live Mail Offline

So how to solve this? The solution is simple.

1) Open Internet Explorer browser.

2) From the menu bar, click File. (If menu is not shown, press “Alt” button on your keyboard)

3) Uncheck “Work offline” by clicking on it.

IE Work Offline

4) From Windows Live Mail, click Send/Receive button. If you are being asked to go online, click Yes.

Problem solved.

Additional information on showing menu bar – http://kennykee.com/304/internet-explorer-10-show-menu-bar/
__________________________________________________________________________________________________

Please like or comment below if this helps you :)

Drawing Arrow Shape In Photoshop

Drawing arrow shape in Photoshop is simple.

1) From Photoshop Tools Pallete, click on Custom Shape Tool.
See image below:

Arrow-Box

2) From custom shape tool menu, click on shape selection. Click on your preferred shape.
See image below:

Shape

3) Drag onto the canvas to create the shape.

Hint: More custom shapes can be found online. Just Google it and there will be a lot of free shapes available.

2 Database Configurations That You Should Notice When Migrating WordPress

Are you facing 404 error or page not found when changing your hosting server for your WordPress? Is your wp-admin link not found after installing WordPress. Try to check the following configuration:

1) siteurl configuration

This is the configuration in your database. Login and navigate to your WordPress database. Open table wp_options. Look for option_name “siteurl“. See the image below:

Wordpress Siteurl

Configure option_value for “siteurl” as following:

If your blog URL = http://www.myexample.com then siteurl is http://www.myexample.com
If your blog URL is inside a folder = http://www.myexample.com/wordpress/ then siteurl is http://www.myexample.com/wordpress/

2) home configuration

Similar to above, “home” option_name is inside “wp_options” table too. Look for “home” keyword and update.

home

Configure option_value for “siteurl” as following:

If your blog URL = http://www.myexample.com then home is http://www.myexample.com
If your blog URL is inside a folder = http://www.myexample.com/wordpress/ then home is http://www.myexample.com/wordpress/

Hint: “siteurl” and “home” table entry should be at record ID 1 and 36 respectively.

Good luck and have fun in debugging.

Natural Aura Represents Your True Mind

Every living entity in this world emits aura naturally. This form of aura is a kind of magnetic field or “Qi” that revolves around our body. It emits information about your mind and your inner personality.

If a person is a kind-hearted person, then this person will emit aura that makes people around him or her to be very relaxed, safe and comfortable. On the other hand, an evil minded person will emit threatening aura and makes people around him or her uncomfortable. Have you came across a situation whereby you feel instant attraction to a stranger that you just get to know. Or you feel fear and shivering to it. All of these are the result of your natural aura detector within yourself. This theory works regardless of appearance or clothing of a person.

Most people don’t really know its existence but naturally, everyone has the ability to feel it. It is a natural ability or instinct for every human being.

People living in modern city especially those with higher corporate position tends to hide their facial expression and emotion. They are good in acting and pretending to hide what are they thinking or any negative plans. Yes, they might be able to hide themselves but not for long. When people around him or her sensed that the facial expression and the aura emitted don’t match, it will only makes the fake-face more obvious.

To me as always, be sincere and appreciate things around you. With this, you will be emitting positive aura straight from your heart naturally. Make it as a norm and you will see a brighter and happier life.

Wisdoms and The Modern Mind

Money, power, and woman are perhaps man best desires. Possessing one of them gave a man the most fascinating fantasy. The feeling is so gratifying till almost no man on earth could resist it. It is powered by man’s most basic of engine, greed. With it, a man loses himself and eventually surrenders its wisdom. In modern society, we can observe lots of these scenarios around our daily life. Cheating, scams, politics in work place, and engaging in indecent act to multiple women.

On the other hand, wisdom gave a man the ability to see thru the great wall of greed and beyond a normal eyes would do. It is a simple concept and yet not easy to attain it. Employing wisdom into our daily life is like revealing a Russian doll. There is another doll inside a doll. Wisdom allows a man to see the effect of an effect in another effect (butterfly effect).

As example in work place, a typical boss would squeeze an employee to his or her maximum strength and sometimes beyond it. A boss with wisdom would allow an employee to take a short nap after lunch so that he or she able to concentrate better on work. Tho, this may sound strange to some people. Every human has a soft point within the heart. A wise person will find out what and where is the soft point or what i call it the ‘dragon energy’ of a human. Once you get hold of it, he or she will be willingly to execute tasks from the heart and perhaps the best output. Social intelligence is a very good example of this.

Learn to gain wisdom. See things from a different perspective. And there shall be world peace that last forever.

Update Another Drop Down Options Based On Another Using jQuery

Changing a drop down options list based on another selected drop down is easy by using jQuery framework. See demo below:

Demo: http://kennykee.com/demo/dropdown/

Note that there are 2 ways to achieve this. First is to use jQuery framework and jQuery Metadata plugin. Second method is to use HTML5 “data-” attribute. This post will show you the jQuery method.

Explanation of concept
For each <option> tag, we add in metadata. For example

<option class=”option_data {color:’blue,green’}”>Colour Style 1</option>

The data is inserted into the curly bracket next to option_data class. Using jQuery metadata plugin, we can retrieve the “color” variable data. The data will be “blue,green”. Next, we convert this comma separated data into an array by using JavaScript split function. Now, we can create a new drop down with option data using metadata retrieved. We can create new drop down using jQuery. See code example below:

Full Code:

<!DOCTYPE HTML>
<html>
<head>
	<script src="jquery-1.9.1.js" type="text/javascript"></script>
	<script src="jquery.metadata.js" type="text/javascript"></script>
	<style>
		.kennykee-styles{
			font-size: 20px; 
			font-family: Arial; 
			margin: 10px; 
			font-weight:bold;
		}
		#main-style, #result-box select{
			font-size: 50px;
			float: left;
		}
	</style>
	<script type="text/javascript">

		$(document).ready(function(){

			$("#main-style").change(function(){
				$("#main-style option:selected").each(function(){
					var colour_data = $(this).metadata();
					if(colour_data.color){
						var color = colour_data.color;
						var selectObj = $("<select></select>");
						var colorArray = color.split(",");
						for(var i = 0; i < colorArray.length; i++){
							selectObj.append("<option value='" + colorArray[i] + "'>" + colorArray[i] + "</option>");
						}
						$("#result-box").html(selectObj);
						$("#result-box").show("slow");
					}else{
						$("#result-box").hide("slow", function(){
							$("#result-box").html("");
						});
					}
				});				
			});
		});

	</script>
</head>
<body>
	<div class="kennykee-styles"><a href="http://kennykee.com">KennyKee Styles</a></div>
	<select id="main-style">
		<option>--Please Select--</option>
		<option class="option_data {color:'blue,green'}">Colour Style 1</option>
		<option class="option_data {color:'red,white'}">Colour Style 2</option>
	</select>

	<div id="result-box" ></div>

</body>
</html>

Demohttp://kennykee.com/demo/dropdown/

Smart Boss vs Stupid Boss

WTF! 8 months bonus! Holiday trips to renowned resort! Good company welfare and benefits may be your first triggering point during a discussion with your friends about your employment. You may start to realize how smart or how stupid your boss is. Bosses or employers are the company top managers and leaders who make decisions that are determining the fate of a company. However, not all bosses are great leaders.

Some may think that a boss throwing tantrum or anger with or without any reason to its employee is normal, purely just because they pay your salary. NO, it is not normal. In modern business world, throwing temper, threatening, provoking conflicts or even humiliating employee isn’t in the picture at all. Doing so is no different with injecting venom into the company slowly but deadly. Here’s the different between a smart boss and a stupid boss.

Stupid Boss Smart Boss
Creates fears to force employee to work. Inspires and motivates employee to strive the best.
Creates followers. Creates leaders.
Be quick, do faster! Try your best. I am confident that you are able to achieve it. I will be always around to support you.
Uses plain insincere and repeated keywords such as “thanks”, “thank you”, and “good job”. Express sincerely on how he appreciates the work of its employee and with physical rewards.
Employee == cost Employee == company most important assets
Uses vulgarity in conversation. Speaks politely.
Only productive employees are useful. Others are burden. Every employee is important to the company and every employee has its talent. The smart boss will be able to cultivate them.
Self-centred and self-absorbed. Respects employee’s needs.
Pay peanut but wanted the whole world. Money is not a problem. It is how much the employee can strive.
characters_03
Squeeze you dry and let you die.
characters_07
Mutual benefits. I help you, you help me.
Promises are just a game of words. Make good promises and always keep promises.
Scold first, blame later. Open communication to help change the way we see the problem first, in order to effectively solve it.
Red light strategy. Green countdown strategy.
Think he is the smartest and others are dumb. Keep learning to better one.
Like to work longer hours without efficient manner. Work longer hours can earn more? Work smart and deliver results within stipulated timeline effectively.
Employees want to kick the boss from behind when see him from the front. Every employee likes to work closely with the boss.
Likes to compare between employees in front of another. (This is a politically motivated and provoking conflict tactic). Respect every employee’s strength and weaknesses.
Utilizes corporate power to conduct frequent unproductive meetings beyond office hours with subordinates. Guide employees to strive and on decision making ability. Only conduct necessary meetings at a suitable time-interval.
Mixing personal emotion, purpose and private issues in work. Displaying professional ethics when making decisions. Clearly differentiating between private and work matters.
Vengeful against employees. Admit mistakes.
Practicing monarchy and authoritarian. Practicing democracy and meritocracy.

So which employer you wish to have? It is all within your own decision.

CodeIgniter Resize and Crop Image To Fit Container Div Example

When a user uploads an image to be displayed on a webpage, we need to make sure that the image has the following:

a) fits correctly into a fixed height and width container without overflowing or any blank space.
b) displays in full image resolution (without shrinking or expanding image using CSS width and height).
c) image displayed is not skewed or distorted and keeping image ratio.

References to CodeIgniter libraries:
http://ellislab.com/codeigniter/user-guide/libraries/file_uploading.html
http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html

By using CodeIgniter framework, I manage to achieve the above.

Workflow:

1) Upload the raw image using standard file upload form. Upload handling backend:

$config['upload_path'] = './data/product/';
$config['allowed_types'] = 'gif|jpg|png';
$config['file_name'] = 'product.png';
$config['overwrite'] = TRUE;
$config['max_size']	= '0';
$config['max_width']  = '0';
$config['max_height']  = '0';	

$this->load->library('upload', $config);

if(!is_dir($config['upload_path'])){
   	mkdir($config['upload_path'], 0755, TRUE);
}

if (!$this->upload->do_upload("file_upload")){ //Upload file
			redirect("errorhandler"); //If error, redirect to an error page
		}else{
  ...

2) Next, we will do image resizing. Set the configuration as below:

   
$upload_data = $this->upload->data();
$image_config["image_library"] = "gd2";
$image_config["source_image"] = $upload_data["full_path"];
$image_config['create_thumb'] = FALSE;
$image_config['maintain_ratio'] = TRUE;
$image_config['new_image'] = $upload_data["file_path"] . 'product.png';
$image_config['quality'] = "100%";
$image_config['width'] = 231;
$image_config['height'] = 154;
$dim = (intval($upload_data["image_width"]) / intval($upload_data["image_height"])) - ($image_config['width'] / $image_config['height']);
$image_config['master_dim'] = ($dim > 0)? "height" : "width";

$this->load->library('image_lib');
$this->image_lib->initialize($image_config);

if(!$this->image_lib->resize()){ //Resize image
	redirect("errorhandler"); //If error, redirect to an error page
}else{
     ...

Explanation: “maintain_ratio” parameter is set to TRUE. From code above, the container size used for this example is (231px × 154px) (W × H).

Before resizing, we need to know whether to use width or height edge as the hard-value. After the original image has been resized, either the original image width’s edge or the height’s edge will be the same as the container width’s edge or the height’s edge respectively. The one that is same has the hard-value length. We determine this using calculation below:

Ratio = (Original Image Width / Original Image Height) – (Container Width / Container Height)

If the ratio > 0, then original image has longer width than container width. Hence, we take the height as hard-value as it has shorter height ratio.
If the ratio < 0, then original image has longer height than container height. Hence, we take width as hard-value as it has shorter width ratio.
if ratio = 0, both width or height can be the hard-value.

The purpose of doing this is to ensure resized image is able to fill the container completely without white spaces.

See visual description below:

Compare

Above shows container and image with different sizes.

Overlap

To determine which edge to be used as hard-value, we overlap the container and the original image. We will shrink the original image while keeping its ratio. The arrow indicates the shrinking direction. The edge of the image that first matches the container edge length will be the hard-value.

Image_07

When either one of the edge matches the container edge, we stop resizing. The orange box represents the final image.

3) After resizing the image, we will crop it to fit into the container. Set the configurations as below:

$image_config['image_library'] = 'gd2';
$image_config['source_image'] = $upload_data["file_path"] . 'product.png';
$image_config['new_image'] = $upload_data["file_path"] . 'product.png';
$image_config['quality'] = "100%";
$image_config['maintain_ratio'] = FALSE;
$image_config['width'] = 231;
$image_config['height'] = 154;
$image_config['x_axis'] = '0';
$image_config['y_axis'] = '0';

$this->image_lib->clear();
$this->image_lib->initialize($image_config); 

if (!$this->image_lib->crop()){
       	redirect("errorhandler"); //If error, redirect to an error page
}else{
	redirect("successpage");
}

Note that ‘x_axis‘ and ‘y_axis‘ are set to 0. We don’t need to crop away any parts. We will use width and height parameters to generate the image part that we need.

Final

Image resizing and cropping to fit into container is done.