Thursday, October 27, 2011

Netbean chinese character problem

Probably happen in my pc (Window XP Home)
Create a new .php file, then when I paste the chinese character it show all right

Problem rises when the display (like export into PDF)
This is because the character encoding for the netbeans (NetBeans IDE 6.9.1) is not UTF-8

So simply fix this problem by changing the file type. As for me, I'm using notepad2 to change to file type into UTF-8. Below is the example


http://localhost/search/

Limit download speed Free download manager

*21 September 2013 Update
If you using web browser to download and unable to use "Free download manager"
The alternative will be NetBalancer at http://seriousbit.com/netbalancer/
This is much advance technique where you need to limit manually "Firefox.exe" application into 100kbps as example



If you live in a "shared internet" environment and you don't want to be selfish by hogging all the bandwidth for download you can always cap the bandwidth

If you are using Torrent, be default they allow you to do so

But if you want to use normal download, you have to use download manager
Here I would recommend FDM; Free Download Manager

Download link here : http://www.freedownloadmanager.org/

They have a feature for limit the bandwidth but you have to set the speed manually
Basically I set

  1. Light mode = 20kBps max
  2. Medium mode = 50 kBps max
  3. Heavy mode = No limit


In Malaysia (normally or at least in my case)
20kBps download speed means you can play online game without lag or delay
50kbps download speed means you will lag in game, while okay for surfing website

Monday, October 24, 2011

Get element style in string

You have an element. You want to get the style applied into it. Where the format is string

eg: <a id="hupla1" style="width: 300px;">HELLO</a>

So you want to get "width: 300px;"

I refer from here http://objjob.phrogz.net/css/object/243 maybe you can find better solution and any alternative.

But my solution is document.getElementById('hupla1').style.cssText

Wednesday, October 19, 2011

Using mogrify

Is a tool (using ubuntu) to manipulate image in a batch. For an example is resize the image

Frequent command that I always use
mogrify -resize 800x600 -format jpg * MYIMAGE/*/*/*

This is to resize a folder whith a subfolder (it has 2 subfolder)