Rest in Peace

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

Steven Paul Jobs (February 24, 1955 – October 5, 2011)
“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
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.
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.
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).
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;
}
}
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);
SVN is the most crucial tool for collaborative development. Many of us like to use for opensource project http://kenai.com or http://code.google.com for SVN but there is a problem if your project is not open source and you might want to setup your own svn server. I am here just showing how simply you can setup a SVN server with XAMPP. Well i am saying about XAMPP just because this is the most popular package(Filezilla, MySql, Apache, Mercury) for php development. If you have a xampp installed (if not go here, download and install) in you machine then follow the steps below:
step1: get a SVN server from here. This SVN server bundled with an Apache server. Skip that as you already have a Apache server installed in your pc with xampp. Before starting installation it will ask for a repository path, give it a path. (like c:\svn_repository). Continue reading
There are some older html tags and attributes which has declared deprecated or forbidden by W3C consortium, though all modern browsers still support them but in future they may not. So it is best to know about those deprecated tags and attributes, and best practice is avoid them in your code.
Here is the list of deprecated tags:
<applet>, <basefont>, <center>, <dir>, <embed>, <font>, <isindex>, <menu>, <noembed>, <s>, <strike>, <u>
Here is the list of deprecated attributes: Continue reading
Okay let me first tell what is the term Y2K38 or Unix Millennium bug or year 2038 problem: Well it is a some kind of computer programming problem with date (something similar like Y2K), says that all programs and software are going to crash on near or after 2038. You will find a Wikipedia definition here. Okay look at some php code and its output:
$timestamp=mktime(0, 0, 0, 01 , 01, 2009);
echo date("F j, Y, g:i a",$timestamp); // January 1, 2009, 12:00 am
Well output shows expected result. But notice this code now:
$timestamp=mktime(0, 0, 0, 01 , 01, 2039);
echo date("F j, Y, g:i a",$timestamp); //January 1, 1970, 7:00 am
Yes output is little shocking. This is what they are calling Y2K38. I think we don’t need to worry about it too much. We still have enough time to solve this. The code above is tested in php(5.2.9) language. I also tested the same thing in java and there is no such problem i found yet (yes java is great!!!
).
Calendar cal=Calendar.getInstance(); cal.set(2059,11,1,0,0,0); Date date=cal.getTime(); String output; DateFormat df=DateFormat.getDateInstance(DateFormat.FULL,Locale.ROOT); output=df.format(date); System.out.println(output); //Monday, December 1, 2059
notice input and output(shows as expected). Yes we don’t need to worry about it. If we manage to survive until 2038 we will definitely have a solution by then.
Continue reading
1955 — Eric Emerson Schmidt was born on April 27 in Washington, D.C.
1973 — Lawrence Edward Page was born on March 26 in Ann Arbor, Michigan. Sergey Mikhailovich Brin was born on August 21 in Moscow, Russia.
1979 — The Brin family, which included young Sergey, his parents and grandmother, arrived in the United States on October 25.
1995 — Larry Page and Sergey Brin met when Brin guided a tour of San Francisco for prospective new Stanford graduate students.
1996 — Page and Brin collaborated on Page’s Back Rub search engine. The first version of Google is released in August on the Stanford Web. The address: google.stanford.edu. A little over a year later, the search engine left Stanford servers because it took up too much bandwidth.
1997 — Google.com was registered as a domain name. The young inventors tried to sell Google through the venture capital firm of Kleiner Perkins Caufield & Byers (KPCB). After unsuccessfully pitching the search engine to all likely buyers, they gave up the idea of selling.
1998 — Google was getting more than 10,000 queries a day. Andy Bechtolsheim, a founder of Sun Microsystems, watched the demo for Google and immediately wrote a $ 100,000 check to get the company started. Google became an official corporation on September 7. A few weeks after incorporation, Craig Silverstein became Google’s first employee. PC magazine recognized Google as the search engine of choice and one of the Top 100 Web Sites for 1998.
1999 — After several months of operating out of a rented bedroom and garage, Google opened its first Palo Alto office. Later in the year, the company moved to Bayshore Drive in nearby Mountain View.Kleiner Perkins Caufield & Byers, in partnership with Sequoia Capital, provided Google with additional venture capital of $ 25 million. Brin and Page finally dropped out of the Stanford graduate studies program. Omid Kordestani, the company ’ s twelfth employee and its first nonengineer, joined Google as head of global sales. Kordestani is credited with creating the advertising model that led to Google’s early and continuing financial glory. Charlie Ayers, who once cooked for the Grateful Dead, joined Google as its chef. Continue reading
I started learning JavaFx just after it released, as JavaFx is based on java it has the power and maturity of java by born. I wanted to use JavaFx as an alternative to Flash. Though i was learning Flex framework and actionscript3 before starting JavaFx, and i was not so serious about that RIA thing then, and i can’t afford much time for Flex then. But after JavaFx released i was so excited and i started learning and doing javafx seriously. I was very excited about its power and possibilities. From a developer view Javafx runs on a JVM which is more then 25 times faster then Tamarin VM (used in flashplayer), you can deploy javafx project virtually on any platform, and any device (though flash now have support for desktop and mobile devices). Continue reading