How to unblock the internet using proxy

Step 1: search on any unlocked available search engine with this term “free public proxy server ip”, you will be looking for a website that lists public proxy server ip, for example: http://www.cool-proxy.net/proxies/http_proxy_list (choose the highest download speed) copy IP Address and Port

Step 2:  Click Options -> Options

Step 3: Click  Advanced -> Network -> settings

and finally Step 4: paste IP Address and Port that you copied at step 1

Click OK and restart browser. Enjoy the free world!

Posted in Tips & Tricks | Tagged | 1 Comment

GUI Client tool for Closure Compiler

Google built some excellent tools for JavaScript development. One of them is the Closure Compiler. A common development scenario is at the end of every project when we finally deploy the code in production we usually minify and merge all .js files into single or fewer numbers of files. To do this I normally use Closure Compiler, but there is a small problem like if you use the closure compiler’s online version you can’t actually minimize the .js files on your local machine, there is of-course a offline version of the compiler but you have to use that from command line, and which is not much user friendly specially if you are in a hurry or not using any automated build tool, So I decided to fill this gap, and built this GUI wrapper for the great Closure Compiler.

You can use this from your pc, to run this you will need java (jre) in your pc, i built this using java 7 so earlier versions of java will NOT be able to run it.

Download:

No installation required just download and click. Grab the tool from here, the jar version is for all operating system, but i also built an exe of it but it will still require java. (jre 7)

How it works:
At first i tried to reverse engineer the whole compiler just like i did for the css-minimizer but well its a huge thing, thousands of Classes inside it. I felt lost, but there was a easy way out, Google provides a REST api for it, and I decided to use it. So that means this GUI tool can’t work offline (unless you select the merge option), when you select .js files and press the compile buttons it merge all the js files and requests Google and then saves the response.

One important thing, closure compiler checks for errors and warning. So if there is any error or warning in your JavaScript it will be included in to the response. So always check the compiled file before including into the project.

Tips: Hold Ctrl button to add multiple JavaScript files in the list.

Okay now try it. and give me feedback and suggestions. Thanks

GUI tool for Google Closure Compiler
Requires Java 7 to run.

Posted in Google, Java, JavaScript, web design | Tagged , , | 6 Comments

Eclipse Open Source Developer Report 2012

Posted in interesting, Java, php | Tagged | Leave a comment

Oracle vs Google! (opening slides)

Here is the Oracle’s 91 page Opening statement:

and here is Google’s 71 page Opening Statement:

Posted in Google, Java | Tagged , , , , , | Leave a comment

Bangla Pad Updated

Bangla Pad 1.3 Released!!. It contains some minor bug fixes. Please update if you are already using any prior version.
————————————————–
I wrote a software few years back to write bangla easily with phonetic based layout. It was working good till now, though it had few issues with this new update i tried to resolve most of them.

Beside fixing the issue with this new update i embed the Unicode font with it, so now any computer without a bangla font can now write bangla with it. Read the full description here.

You can get it from here, no installation required just download and run. Only thing just make sure you have the jre 1.6.0_33 or later 

Key Layouts: (For writing join character use the + sign) For any question about any specific spelling or character please feel free to ask me in the comment section.

অ → ao
আ → A
ই → I
ঈ → II
উ → U
ঊ → UU
ঋ → WR
এ → E
ঐ → Oi / OI
ও → O
ঔ → Ou / OU
ক → k
খ → kh / K
গ → g
ঘ → gh / G
ঙ → Ng
চ → c
ছ → ch / C
জ → j
ঝ → jh / J
ঞ → NG
ট → t
ঠ → th
ড → d
ঢ → dh
ণ → N
ত → T
থ → Th
দ → D
ধ → Dh
ন → n
প → p
ফ → ph / f
ব → b
ভ → bh / v
ম → m
য → z
র → r
ল → l
শ → sh
ষ → S
স → s
হ → h / H
ঃ → HH
ং → ng
ঁ → ^ / NN
ৎ → tt
া → a
ে → e
ো → o
ি → i
ী → ii
ু → u
ূ → uu
ৈ → oi
ৌ → ou
্ → + / w
ৃ → wr
৳ → $
ক্ষ → k+S
হ্ম → H+m / h+m
দ্ম → D+m
জ্ঞ → gg / j+NG
ঞ্জ → NG+j
ষ্ণ → S+N
হৃ → Hwr / hwr
হ্ণ → H+N / h+N
হ্ন → H+n / h+n
ক্স → x / k+s
——————————
কৃষক → kwrSk
চট্টগ্রাম → ct+tg+ram
মধ্যাহ্ন → mDhYaH+n
অপরাহ্ণ → aopraH+N
হৃদয় → HwrDy
সহিষ্ণু → sHiS+Nu
অঞ্জন → aoNG+jn
বিজ্ঞান → biggan / bij+NGn
ব্রাহ্মণ → b+raH+mN
সহজ → sHj
বাংলা → bangla
ঐতিয্য → OiTizY
কোদাল → koDal
চাঁদ → ca^D
ব়্যাব → rYab
কার্য → kar+z
কক্সবাজার → kxbajar
পদ্মা → pD+ma
গঙ্গা → gNg+ga
ঈদ → IID

Bangla Pad version: 1.3

Posted in Java | Tagged , | 7 Comments

CSS Minimizer

Update 5 April 2012:
One more algorithm added. Now CSS Minimizer is powered by Closure Stylesheets Compiler developed by Google.
————————————————————————————–

In my earlier days when I was very new, i worked on some amazing web apps, those are still running, because as i am learning more and more everyday I continuously updated those project’s back-end  code with the technique that was best at that time in my knowledge. But problem remain with the front end, because I can’t replace the front end with fully new layout because its a huge task, to update the layout when i opened the CSS file i felt lost, the front end css i wrote then was horrible, and with continuous tweaking css became huge in size and tons of duplicated rules.

So I decided to make a CSS optimizer or minimizer whatever you call it. Its a two part project I just finished the first part. You can try it here http://css-min.appspot.com. Second part is a site analyzer, that will analyze the whole site and tell you which CSS selectors are obsolete (pretty amazing huh?!)

How CSS Minimizer works:

It takes a css url then it grabs that css for analyze. The analysis proses is somewhat complex but to say in simple way “it reduces all duplicate rules”. Unlike other css minimizer it just doesn’t remove the white-space and newline character but it rewrites the whole css in a very optimized way.

For example:
Suppose this is your original css:

.sel_a{font-family:'arial';font-size:10pt;}
.sel_b{font-size:10pt;}
.sel_c{font-size:10pt;letter-spacing:1px;}
.sel_d{padding:0;margin:0;}
.sel_e{font-weight:bold;text-decoration:underline;}
.sel_f{font-family:'verdana';}
.sel_g{font-weight:strong;font-size:12pt;}
.sel_h{font-weight:strong;font-size:12pt;}
.sel_i{font-size:13pt;}

Minimizer will rewite it this way:

.sel_g,.sel_h{font-weight:strong;font-size:12pt}
.sel_i{font-size:13pt}
.sel_d{padding:0;margin:0}
.sel_c{letter-spacing:1px}
.sel_f{font-family:'verdana'}
.sel_e{font-weight:bold;text-decoration:underline}
.sel_a{font-family:'arial'}
.sel_a,.sel_b,.sel_c{font-size:10pt}

Look carefully how the selectors have been rewritten by minimizing the duplicate rules.

In minimized CSS ofcourse white-space, newline character, comments etc those will be removed.

CSS minimizer can’t dramatically reduce the amount of code like JS minimizer, because we can’t rename the selectors or style rules, but you can follow some techniques for that like use shorter class, ID names, never use long nested selectors AND of-course always check your css with CSSLint (an Amazing tool).

I hope you will find this tool useful. Please do comment and give me feedback here, that will help me to improve this tool.

NOTE: As this is the alpha version of this minimizer, there are few known issues with of-course with some unknown issues too. So i recommend take cautions before using its minimized css with your production level code.

Posted in misc | 8 Comments

We’ll never see another Steve Jobs.

Rest in Peace

Steven Paul Jobs (February 24, 1955 – October 5, 2011)

Posted in misc | Tagged , | Leave a comment

OSCON Java 2011, Talks

“Java: The Good, Bad, and Ugly Parts” by Josh Bloch

JDK 7 in a Nutshell by Joe Darcy

On The Cusp Of A Java Renaissance by Bob Lee

Twitter: From Ruby on Rails to the JVM by Raffi Krikorian

Who Needs Standards? by Patrick Curran

Open Source, Java, and Oracle — Cracking the Code by Steven G. Harris

Working Hard to Keep It Simple by Martin Odersky

Posted in Java | Tagged , | 1 Comment

Tips & Tricks: Photoshop CS5

Symptom: While designing/editing with photoshop color picker is not picking exact color or applying filter effects are not working or similar issues.

Solution: Photoshop is a heavy software, i really don’t know what exactly cause this issue, but i found a quick fix for this, and here it is:

Step 1: Click on the photoshop icon, and immediately press Ctrl + Alt + Shift. (You need to press these keys real quick just before the splash-screen shows-up)

Step 2: If you able to press those keys correctly, then a small window will open (asking “Delete the Adobe Photoshop Settings File?”) like this:

Step 3: Click yes and you are done. Enjoy!

What i think is there is some kind of cache or similar thing saved in that settings file, and when it gets corrupted then photoshop make troubles.

Posted in Tips & Tricks | Tagged | Leave a comment

Google Bangla Dictionary [updated 14 sept 2012]

Update (14 September 2012):
Google has deprecated some features in appengine so Those who are facing trouble with the bot (eng2ban@appspot.com) like not responding or other issues please add the new address eng2ban-hrd@appspot.com 
———————————————-
I had a dictionary software on my desktop. but after upgrading my OS from xp to 7 it just don’t work anymore. and from then i was feeling need of a good dictionary.  So i built one. Well it’s not quite a desktop software but it is a gtalk bot. Just add (eng2ban@appspot.com) it as your friend on gtalk and it will answer your all query in bangla. This bot is using the google’s dictionary api as its word bank. So you don’t need to worry about its word collection it just knows a lot.

Update (27 December 2011):

As you all know google finally stopped its dictionary service and api from this month so this bot was not able to fetch Bangla meaning from last few days. So I wrote a new hack, now it is better then ever before.

It can now work as a english to bangla dictionary plus translator that means you can translate now a whole line, also with some improved logic it can now able to tell the Parts of Speech and Synonyms (not applicable when translating a line).

With this new update english to english meaning will show up by default with bangla meaning and adding a + sign at the begaining of a word will show  Bangla to English with the parts of speech of the word in english. Bangla to English will work (only as a dictionary) as it was working, also wikipedia definition (? sign) will work unless they stop their api.

If you are having any issues please do let me know. Thank You.

Update:

I have updated the back-end parser, in place of my custom made json parser now i am using rhino (server-side javascript). so now this bot is much faster and smarter. It can answer english to bangla (by default), if no bangla meaning found on google word bank then it will answer a english meaning instead (means english to english). another thing for example if you type help it will return bangla meaning by default, but if you  want to skip bangla and want it to return english then just start the word with a ‘+’ sign like +help then it will return english meaning. One more interesting thing is now it can return bangla to english also :) , like if you type আমার=> it will return you a english meaning “mine”, “My”. Do comment on this post about your thoughts.

Wikipedia Definition: To search for a wikipedia definition just start the word with ‘?’ character. for example: ?java will return definition of java from wikipedia.

For mobile devices (with a internet connection) you can bookmark this (http://eng2ban.appspot.com) on your mobile browser (like opera mini), with this url you can use this dictionary without logging into any google talk client. This page does not contain any rich styling so it is very light and only consumes just a few bytes of bandwidth for your mobile internet.

Tips:

If the the dictionary returns English meaning by default that means it didn’t find the Bangla meaning for the given word, so try to give your english word in present tense + singular number form. For example: if you give ‘helped‘ it will return all meanings in english by default. but if you give ‘help‘ it will return meanings in Bangla

1 known issue: if you find bot is not showing online on your Gtalk client then just remove and add again it will work.

Posted in Google, Java | Tagged , | 47 Comments

Changes in HTML5

There are lots of excitement about new HTML5 among developers. HTML5 is still under specification, and is currently in the Working Draft stage in the W3C, but many aspects of HTML5 are now stable and can be implemented in browsers

Document Type
The <doctype> for an HTML document has changed from its verbose DTD reference to a much simpler format, simply stating the document is an HTML document type:
<!doctype html>

Character Encoding
The <meta> tag for a document allows you to set the character encoding using the simple charset attribute, replacing declarations such as:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
with
<meta charset="UTF-8">

Script and Link Elements
The <script> element has been stripped down, removing the need for the type attribute. The reason for this is that scripts are typically written in JavaScript. The <link> element has lost its type attribute due to the prevalence of CSS.

Some of the new elements in html5 here:

<article> An independent piece of content for a document e.g. blog entry,forum entry
<aside> A piece of content that is somehow related to the rest of the page
<audio> Audio media content
<canvas> A component for rendering dynamic bitmap graphics on the fly. e.g games
<command> A command that the user can invoke: a button, radio button or checkbox
<datalist> Together with the new list attribute for the <input> element can be used to make combo boxes
<details> Additional information or controls that the user can obtain on demand, to provide details on the document, or parts of it
Used for plug-in content
<figure> A piece of self-contained flow content referenced as a single unit from the main flow of the document
<figcaption> Caption for a <figure>
<footer> Footer for a section; may contain information about author, copyright information, etc.
<header> A group of introductory or navigation aids
<hgroup> Header of a section
<keygen> A key pair generation control for user authentication in forms
<mark> A run of text in one document marker or highlighted for reference purposes
<meter> A measurement, such as disk usage, when the minimum and maximum values are known.
<nav> A section of the document intended for navigation
<output> Output such as a calculation done through scripting
<progress> Represents progress of a task such as downloading or performing other expensive operations
<section> A generic document or application section
<source> Used to specify multiple media resources on elements such as <audio> and <video>
<time> Date and time definition
<video> Video media content

NOTE: The input element’s type attribute now has these new attributes: color, date, datetime, datetime-local, email, month, number, range, search and tel.

REMOVED ELEMENTS
The following elements have been removed from HTML5 because they are more effectively represented using CSS: basefont, big, center, font, s, strike, tt and u.

Other elements have been removed because they have a negative effect on usability and accessibility. These include: frame, frameset and noframes.

This last set of elements has been removed due to their lack of frequent use. They also caused confusion at times:
acronym (use abbr for abbreviations), applet (object replaces its use), isIndex and dir (use ul instead).

Posted in web design | Tagged | Leave a comment

JavaScript best practices

  • It is recommended to place all <script> tags as close to the bottom of the <body> tag as possible so as not to affect the download of the entire page.
  • An inline script placed after a <link> tag referencing an external stylesheet caused the browser to block while waiting for the stylesheet to download. This is done to ensure that the inline script will have the most correct style information with which to work. So the best practice is never putting an inline script after a <link> tag.
  • Each <script> tag blocks the page from rendering during initial download, it’s helpful to limit the total number of <script> tags contained in the page. This applies to both inline scripts as well as those in external files.
  • For external Javascript, each HTTP request brings with it additional performance overhead, so downloading one single 100 KB file will be faster than downloading four 25 KB files. To that end, it’s helpful to limit the number of external script files that your page references.
Posted in JavaScript | Tagged | Leave a comment

Creating a FaceBook like profile badge

You know what a facebook profile badge is, right? (if no, just look here on sidebar my facebook profile badge). Well creating a profile badge like that is really easy. Here i created a small script to show the basic of how this thing works. So, here is the profile badge class

<?php
class profile_badge{
	public static function calc_image_height($strs,$limit){
		$total_line=0;

		foreach($strs as $str){
			$len=strlen($str);
			$div=(int)($len/$limit);
			$mod=$len%$limit;
			if($mod>0){
				$total_line=$total_line+$div+1;
			}else{
				$total_line=$total_line+$div;
			}
		}

	return ($total_line*15)+40;
	}

	public static function get_badge($text_name,$text_email){
	$CHARLIMIT=19;
	$label_name='Name:';
	$label_email='Email:';

	$logo="http://127.0.0.1/logo_fade.jpg";
	$extra=profile_badge::calc_image_height(array($text_name,$text_email),$CHARLIMIT);

	list($width,$height)=getimagesize($logo);
	$im=imagecreatefromjpeg($logo);

	$bg=imagecreatetruecolor($width,$height+$extra);

	$black=imagecolorallocate($bg,0,0,0);
	$white=imagecolorallocate($bg,255,255,255);
	$gray=imagecolorallocate($bg,124,124,124);
	$bdr=imagecolorallocate($bg,218,218,218);

	imagecopymerge ($bg,$im,0,0,0,0,$width,$height,100);

	imagefilledrectangle ($bg,0,$height,$width,$height+$extra,$white);
	imagerectangle ($bg,0,0,$width-1,$height+$extra-1,$bdr);

	$font='tahoma.ttf';
	$pad=15;
	$text_pos=$height+$pad;
	imagettftext($bg, 10,0,5, $text_pos, $black, $font, $label_name);
	$text_pos=$text_pos+$pad;

	if(strlen($text_name)<=$CHARLIMIT){
		imagettftext($bg, 10,0,5, $text_pos, $gray, $font, $text_name);
		$text_pos=$text_pos+$pad;
	}else{
		$name_array=str_split($text_name,$CHARLIMIT);
		foreach($name_array as $text_name){
			imagettftext($bg, 10,0,5, $text_pos, $gray, $font, $text_name);
			$text_pos=$text_pos+$pad;
		}
	}

	imagettftext($bg, 10,0,5, $text_pos, $black, $font, $label_email);
	$text_pos=$text_pos+$pad;

	if(strlen($text_email)<=$CHARLIMIT){
		imagettftext($bg, 10,0,5, $text_pos, $gray, $font, $text_email);
		$text_pos=$text_pos+$pad;
	}else{
		$email_array=str_split($text_email,$CHARLIMIT);
		foreach($email_array as $text_email){
			imagettftext($bg, 10,0,5, $text_pos, $gray, $font, $text_email);
			$text_pos=$text_pos+$pad;
		}
	}

	return $bg;
	}
}

logo_fade.jpg

Notice, at line 25, yes that’s my site’s logo image url. Also notice at line 43, yes this my font file. you can use your own font of choice in there. Ok now include that class and call its get_badge function, this way,

$name='Mahabubul Hasan';
$email='uzzal.me@gmail.com';

$bg=profile_badge::get_badge($name,$email);

header("Content-type: image/png");
imagepng($bg);
imagedestroy($bg);

and it generates a output like this:

isn’t it cool? ;)

Posted in php, web design | Tagged , | 2 Comments