<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5112579269437914545</id><updated>2012-02-16T20:21:29.935-08:00</updated><category term='linux'/><category term='Development'/><category term='editor'/><category term='download'/><category term='java'/><category term='object oriented'/><category term='logger'/><category term='browser'/><category term='web. javascript'/><category term='mac'/><category term='programming'/><category term='internet'/><category term='oop'/><category term='eclipse'/><category term='concurrency'/><category term='jedit'/><category term='nix'/><category term='guice jsf java'/><category term='chrome'/><title type='text'>uudashr's blog</title><subtitle type='html'>It just piece of my toughts..!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-662195089316603783</id><published>2008-12-25T06:46:00.000-08:00</published><updated>2008-12-25T18:00:12.311-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='guice jsf java'/><title type='text'>Guicing JSF with Guice</title><content type='html'>&lt;div&gt;Recently I read some of presentation of the WebBeans. This encourage me to learn JSF. When learning the JSF there are Managed Bean and I think I need some injection, Guice cross on my mind, so I search on the internet about integrating Guice and  JSF. Some of article and one project found, but none of fits on what I need and I want.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I'm trying to learn how this JSF works so I can use Guice on it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The case of login on a web page. User need to login to a web page using username and password. Below is the login bean&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;public class LoginBean {&lt;/div&gt;&lt;div&gt;    private String username;&lt;/div&gt;&lt;div&gt;    private String password;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public String login() {&lt;/div&gt;&lt;div&gt;        return "success";&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public void reset(ActionEvent event) {&lt;/div&gt;&lt;div&gt;        username = null;&lt;/div&gt;&lt;div&gt;        password = null;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;we need some logic when login button execute. So I add some logic.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;public class LoginBean {&lt;/div&gt;&lt;div&gt;    private String username;&lt;/div&gt;&lt;div&gt;    private String password;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    @Inject&lt;/div&gt;&lt;div&gt;    private UserDao userDao;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public String login() {&lt;/div&gt;&lt;div&gt;        User user = userDao.findByUsername(username);&lt;/div&gt;&lt;div&gt;        if (user != null &amp;amp;&amp;amp; user.getPassword().equals(password)) {&lt;/div&gt;&lt;div&gt;            // we found the user on our d   atabase&lt;/div&gt;&lt;div&gt;            return "success";&lt;/div&gt;&lt;div&gt;        } else {&lt;/div&gt;&lt;div&gt;            // there is no user with specified username and password&lt;/div&gt;&lt;div&gt;            return "failed";&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public void reset(ActionEvent event) {&lt;/div&gt;&lt;div&gt;        username = null;&lt;/div&gt;&lt;div&gt;        password = null;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The @Inject marked will be injected by the Guice injector. So we are going to create the Guice injection works. Mojarra, the JSF Resource Implementation, we can find com.sun.faces.spi.InjectionProvider, here are the injection will be held.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;public class InjectionProvider {&lt;/div&gt;&lt;div&gt;    void inject(Object managedBean) throws InjectionProviderException;&lt;/div&gt;&lt;div&gt;    void invokePostConstruct(Object managedBean) throws InjectionProviderException;&lt;/div&gt;&lt;div&gt;    void invokePreDestroy(Object managedBean) throws InjectionProviderException;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We are iterested only on "inject" method, this are executed everytime the Managed Beans are about to use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;public class GuiceInjectionProvider implements InjectionProvider {&lt;/div&gt;&lt;div&gt;    private final Injector injector;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public GuiceInjectionProvider() {&lt;/div&gt;&lt;div&gt;        // create injector&lt;/div&gt;&lt;div&gt;        injector = Guice.createInjector(new InMemoryModule());&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public void inject(Object managedBean) throws InjectionProviderException {&lt;/div&gt;&lt;div&gt;        // inject managed beans&lt;/div&gt;&lt;div&gt;        injector.injectMembers(managedBean);&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public void invokePostConstruct(Object managedBean)&lt;/div&gt;&lt;div&gt;            throws InjectionProviderException {&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    public void invokePreDestroy(Object managedBean) throws InjectionProviderException {&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Above are simple implementation for the injection, actually for now on we need the simple one. The creation of injection is on the constructor.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We already have the java class, now is the configuration part. Add context-param on web.xml&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt; lt;param-name&amp;gt;com.sun.faces.injectionProvider&amp;lt;/param-name&amp;gt;&lt;br /&gt; &amp;lt;param-value&amp;gt;uudashr.guicejsf.guice.GuiceInjectionProvider&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It tells the mojarra to use custom injection provider.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-662195089316603783?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/662195089316603783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=662195089316603783' title='44 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/662195089316603783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/662195089316603783'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2008/12/guicing-jsf-with-guice.html' title='Guicing JSF with Guice'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>44</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-751081757344201285</id><published>2008-09-04T21:22:00.000-07:00</published><updated>2008-09-04T22:39:43.222-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web. javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>V8 Benchmark</title><content type='html'>&lt;div&gt;Google Chrome is rock.&lt;/div&gt;&lt;div&gt;One things that make it a rock star is the JavaScript engine, "V8". Then I try to do a benchmark by opening http://code.google.com/apis/v8/run.html on different browser.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the result:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Google Chrome 0.2.149.27&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Score: 1362&lt;/div&gt;&lt;div&gt;DeltaBlue: 1543&lt;/div&gt;&lt;div&gt;Crypto: 1201&lt;/div&gt;&lt;div&gt;RayTrace: 1022&lt;/div&gt;&lt;div&gt;EarleyBoyer: 1820&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Safari 3.1.2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Score: 165&lt;/div&gt;&lt;div&gt;DeltaBlue: 115&lt;/div&gt;&lt;div&gt;Crypto: 113&lt;/div&gt;&lt;div&gt;RayTrace: 194&lt;/div&gt;&lt;div&gt;EarleyBoyer: 296&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Firefox 3.0.1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Score: 174&lt;/div&gt;&lt;div&gt;DeltaBlue: 204&lt;/div&gt;&lt;div&gt;Crypto: 110&lt;/div&gt;&lt;div&gt;RayTrace: 173&lt;/div&gt;&lt;div&gt;EarleyBoyer: 237&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Opera 9.52&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Score: 247&lt;/div&gt;&lt;div&gt;DeltaBlue: 160&lt;/div&gt;&lt;div&gt;Crypto: 110&lt;/div&gt;&lt;div&gt;RayTrace: 315&lt;/div&gt;&lt;div&gt;EarleyBoyer: 666&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Well, where is the IE7?&lt;/div&gt;&lt;div&gt;When I open the URL on IE7, it shows alert window when the progress reach 33%, but I finally got the result.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J_SN67qNirg/SMDF2Rfb1VI/AAAAAAAAAKM/mxnUFd79YOo/s1600-h/stop+running+this+script.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_J_SN67qNirg/SMDF2Rfb1VI/AAAAAAAAAKM/mxnUFd79YOo/s400/stop+running+this+script.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5242407502458115410" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Internet Exprorer 7&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Score: 41&lt;/div&gt;&lt;div&gt;DeltaBlue: 18&lt;/div&gt;&lt;div&gt;Crypto: 36&lt;/div&gt;&lt;div&gt;RayTrace: 57&lt;/div&gt;&lt;div&gt;EarleyBoyer: 78&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At first, the score is only 18, and I try it again, hoping a better result. It only can reach 40 to 41.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Well, IE7 has the slowest JavaScript engine. The browser war is started.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-751081757344201285?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/751081757344201285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=751081757344201285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/751081757344201285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/751081757344201285'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2008/09/v8-benchmark.html' title='V8 Benchmark'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_J_SN67qNirg/SMDF2Rfb1VI/AAAAAAAAAKM/mxnUFd79YOo/s72-c/stop+running+this+script.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-5458058616087769655</id><published>2008-08-06T19:41:00.000-07:00</published><updated>2008-08-06T23:52:24.564-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jedit'/><title type='text'>jEdit: Basic Setting of My Favourite Text Editor</title><content type='html'>Not much people knows jEdit is a great tools, most of I know it can compete with existing commercial and free Text Editor (or even Programmer's Editor), and the great thing it is multiplatform and open source,  many people give contribution on jEdit.&lt;br /&gt;&lt;br /&gt;I'll introduce best practice of using jEdit, it based on my needs as software developer.&lt;br /&gt;&lt;br /&gt;You can download jEdit on www.jedit.org. Get the jEdit distribution and install it.&lt;br /&gt;Start the jEdit, and you will see splash screen like this&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J_SN67qNirg/SJpr7SjjV-I/AAAAAAAAAJM/Mx1YnhNvLkw/s1600-h/splash.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_J_SN67qNirg/SJpr7SjjV-I/AAAAAAAAAJM/Mx1YnhNvLkw/s200/splash.jpg" alt="" id="BLOGGER_PHOTO_ID_5231612583481661410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Some platform such windows has jEdit server, it runs on the background, so there is no need to do initialize things again and when you need to open jEdit, it will start quicker.&lt;br /&gt;&lt;br /&gt;This are the main screen&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_J_SN67qNirg/SJpuNcnLQJI/AAAAAAAAAJk/AJR70Oi8iZM/s1600-h/main.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_J_SN67qNirg/SJpuNcnLQJI/AAAAAAAAAJk/AJR70Oi8iZM/s200/main.jpg" alt="" id="BLOGGER_PHOTO_ID_5231615094442115218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Since version version 4.3 pre 14 it has new splash screen and little fancy icons.&lt;br /&gt;Straight to the point, what do programmers usually need is?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Line numbers&lt;/li&gt;&lt;li&gt;Indentations&lt;/li&gt;&lt;li&gt;Shortcut to do things&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Line numbers&lt;/span&gt;&lt;br /&gt;To show line numbers, simply by click on menu bar: "Utilities -&gt; Global Options..."&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_J_SN67qNirg/SJptGm8MUjI/AAAAAAAAAJc/cuJFY-A52no/s1600-h/globaloptions.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_J_SN67qNirg/SJptGm8MUjI/AAAAAAAAAJc/cuJFY-A52no/s200/globaloptions.jpg" alt="" id="BLOGGER_PHOTO_ID_5231613877443908146" border="0" /&gt;&lt;/a&gt;Alternative of this you can click "Global Options..." on the toolbar.&lt;br /&gt;Select "gutter" on the left tree and check the "Line numbering" on the right view.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Indentations&lt;/span&gt;&lt;br /&gt;Indentation has been set by default, but it use 8 as tab and indent width. I'm not conform with this options and usually use 4 as tab and indent width . On the same "Global Options..." dialog, select "Editing" on the left tree. Fill all the desirable value.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Shortcut&lt;/span&gt;&lt;br /&gt;Programmers need to do things fast. So this are list of some usefull shortcut&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Open... (ctrl + o)&lt;/li&gt;&lt;li&gt;New (ctrl + n), it will create new editor of new buffer. Buffer is just like tab.&lt;/li&gt;&lt;li&gt;Show Buffer Switcher (alt + back_quote), it just open the combo box, you can do this by clicking on the Buffer Switcher.&lt;/li&gt;&lt;li&gt;Go to Next Buffer (ctrl + page_down)&lt;/li&gt;&lt;li&gt;Go to Previous Buffer (ctrl + page_up)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Find... (ctrl + f)&lt;/li&gt;&lt;li&gt;Find next (ctrl + g)&lt;/li&gt;&lt;li&gt;Incremental search (ctrl + comma)&lt;/li&gt;&lt;li&gt;Hypersearch (ctrl + period), this will show list of all occurrence word on different view&lt;/li&gt;&lt;li&gt;Incremental search for selected word (alt + comma)&lt;/li&gt;&lt;li&gt;Hypersearch for selected word (alt + period), this will show list of all occurrence word on different view&lt;/li&gt;&lt;/ul&gt;Well, start using the free and powerful jEdit. It has many other functionality and you can make it more powerful by using plugins.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-5458058616087769655?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/5458058616087769655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=5458058616087769655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/5458058616087769655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/5458058616087769655'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2008/08/jedit-basic-setting-of-my-favourite.html' title='jEdit: Basic Setting of My Favourite Text Editor'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_J_SN67qNirg/SJpr7SjjV-I/AAAAAAAAAJM/Mx1YnhNvLkw/s72-c/splash.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-6846291749382438676</id><published>2008-05-29T00:52:00.000-07:00</published><updated>2008-05-29T09:08:27.941-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>ConcurrentHashMap</title><content type='html'>Why use the ConcurrentHashMap? The traditional synchronized HashMap or Hashtable, use a single lock to read and write. When you try to write new entry while other try to read the different entry, the locking happened. Shouldn't be like this. The simple implementation is using a N lock for N entries. The modification for entry X will be use the Y lock, where Y is lock for X. On ConcurrentHashMap, they use segmentation for the lock, they have 32 lock (or depends on the configuration). So a different write or read can be done concurrently without locking if they have a different lock/segment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-6846291749382438676?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/6846291749382438676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=6846291749382438676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/6846291749382438676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/6846291749382438676'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2008/05/cocurrenthashmap.html' title='ConcurrentHashMap'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-3167709680325468352</id><published>2007-10-17T08:13:00.000-07:00</published><updated>2007-10-17T08:40:31.150-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='logger'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Why use log adapter (generic logging)</title><content type='html'>Long time ago I have a question "Why use common logging, why not use log4j?"&lt;br /&gt;The answer is "Because you can use different log implementation".&lt;br /&gt;Unsatisfying answer.&lt;br /&gt;But past week ago I found  &lt;a href="http://www.slf4j.org"&gt;SLF4J&lt;/a&gt; and I use it for &lt;a href="http://code.google.com/p/jsmpp"&gt;jSMPP&lt;/a&gt; projects.&lt;br /&gt;&lt;br /&gt;It comes answer that we are creating API/Component that might be use with application using unpredictable log implementation.&lt;br /&gt;&lt;a href="http://www.slf4j.org"&gt; &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-3167709680325468352?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/3167709680325468352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=3167709680325468352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3167709680325468352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3167709680325468352'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/10/why-use-log-adapter-generic-logging.html' title='Why use log adapter (generic logging)'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-7910936681601130542</id><published>2007-09-08T01:41:00.000-07:00</published><updated>2007-09-08T01:52:25.870-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='editor'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Why I love jEdit</title><content type='html'>jEdit, this is an awsome programmer's text editor. Might some of people said that the user interface is ugly, but it's powerful, believe me.&lt;br /&gt;Give it a try for some time range, try to find out "how do I do things in jEdit", try to see the available plugins.&lt;br /&gt;Here is my favourit plugins:&lt;br /&gt;&lt;ol id=""&gt;&lt;li&gt;Buffer Tabs&lt;/li&gt;&lt;li&gt;Project Viewer&lt;/li&gt;&lt;li&gt;Open It (just assign shortcut here ctrl+shift+o, and set the refresh interval to 10 seconds, and automatic import path to project path)&lt;/li&gt;&lt;li&gt;Sidekick&lt;/li&gt;&lt;li&gt;Error List&lt;/li&gt;&lt;li&gt;Plugins related to xml things&lt;/li&gt;&lt;li&gt;Ruby plugins if you want to use Ruby application&lt;/li&gt;&lt;li&gt;PHP Plugins if you want to develop PHP application&lt;/li&gt;&lt;li&gt;SuperAbbreviations (this is cool)&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;The most great thing is free of charge.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-7910936681601130542?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/7910936681601130542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=7910936681601130542' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/7910936681601130542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/7910936681601130542'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/09/why-i-love-jedit.html' title='Why I love jEdit'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-6461550941995968338</id><published>2007-09-02T03:57:00.000-07:00</published><updated>2007-09-05T23:06:12.854-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='oop'/><title type='text'>Value Object, Entity and Data Transfer Object</title><content type='html'>There are several type of object on Object Oriented Programming. There are a lot of misconception of those. Below is some explaination of  some type such as Value Object, Entity and Value Object.&lt;div&gt;&lt;br /&gt;&lt;h4&gt;What is Value Object?&lt;/h4&gt;Value Object is not Entity. According to Martin Fowler &lt;a href="http://www.martinfowler.com/ap2/valueObject.html"&gt;http://www.martinfowler.com/ap2/valueObject.html&lt;/a&gt; "An object whose conceptual identity is based on a combination of values of its properties." So what was that? It's like Integer, Date, etc. When you want to do an equality those object to another it should compare all it's meaning properties.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Grade {&lt;br /&gt;    private Subject subject;&lt;br /&gt;    private float gradeValue;&lt;br /&gt;    ....&lt;br /&gt;    public boolean equals(Object o) {&lt;br /&gt;        ...&lt;br /&gt;        Grade other = (Grade)o;&lt;br /&gt;        // compare all the meaning objects&lt;br /&gt;        return subject.equals(subject) &amp;&amp; gradeValue == other.gradeValue;&lt;br /&gt;        ...&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It might have more than one instance of Grade in memory. John has Grade and Brad has it too, we can check the equality by it's properties (subject and the gradeValue). They both might have the same grade.&lt;br /&gt;Address class can be another good example. Lets say that a store have a lot of customers. Addess is composite of city, street, and floor. When we find some customers life on same place we might say they are on the same city, street and floor.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;So what is Entity?&lt;/h4&gt;Entity might be POJO and Value Object "might" too. It recognized by their identity.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class User {&lt;br /&gt;    private String username;&lt;br /&gt;    private String password;&lt;br /&gt;    private Group group;&lt;br /&gt;    ....&lt;br /&gt;    public boolean equals(Object o) {&lt;br /&gt;        ...&lt;br /&gt;        User other = (User)o;&lt;br /&gt;        return username.equals(other.username);&lt;br /&gt;        ...&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We only concern to username property as identity and ignore the other properties of User class (password, group). We can imagine entity is like a record on database table which has primary key.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;So what is Data Transfer Object?&lt;/h4&gt;According to Martin Fowler &lt;a href="http://www.martinfowler.com/eaaCatalog/dataTransferObject.html"&gt;http://www.martinfowler.com/eaaCatalog/dataTransferObject.html&lt;/a&gt;, DTO is "An object that carries data between processes in order to reduce the number of method calls.". The main idea is object that transfered in order to reduce method calls over the network. We can call it as Value Object or we can call it as Entity. When it does? It depends on how we compare the object - Value Object if based on it's properties or Entity if based on it's identity.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;references:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.martinfowler.com/ap2/valueObject.html"&gt;http://www.martinfowler.com/ap2/valueObject.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://c2.com/cgi/wiki?ValueObject"&gt;http://c2.com/cgi/wiki?ValueObject&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.martinfowler.com/eaaCatalog/dataTransferObject.html"&gt;http://www.martinfowler.com/eaaCatalog/dataTransferObject.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html"&gt;http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://martinfowler.com/bliki/LocalDTO.html"&gt;http://martinfowler.com/bliki/LocalDTO.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-6461550941995968338?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/6461550941995968338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=6461550941995968338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/6461550941995968338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/6461550941995968338'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/09/value-object-entity-and-data-transfer.html' title='Value Object, Entity and Data Transfer Object'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-5315977715350603064</id><published>2007-07-27T00:09:00.000-07:00</published><updated>2007-07-27T00:23:16.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><title type='text'>TODO and FIXME notes</title><content type='html'>This may help if you developing software in team.&lt;br /&gt;We may add comment on our code as notes for later changes/implementation.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Monitor {&lt;br /&gt; public void doMonitor() {&lt;br /&gt;     // TODO implement this method&lt;br /&gt;     // FIXME create specific exception&lt;br /&gt;     throw new IllegalArgumentException("Not implemented yet");&lt;br /&gt; }&lt;br /&gt; public void process() {&lt;br /&gt;     // FIXME bugs ....&lt;br /&gt;     ....&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But when the source is already unified with other source code on the same team, ("&lt;span style="font-style: italic; font-weight: bold;"&gt;TODO implement this method&lt;/span&gt;") we might ask "w&lt;span style="font-style: italic;"&gt;ho write this notes? the system is on production state and there are still unimplemented code!&lt;/span&gt;" or another case is "&lt;span style="font-style: italic; font-weight: bold;"&gt;FIXME find bugs ....&lt;/span&gt;", someone find bugs, but the original writer can read and say "&lt;span style="font-style: italic;"&gt;thanks, you save my life by finding my bugs&lt;/span&gt;" but he/she didn't know who the one find the bugs.&lt;br /&gt;&lt;br /&gt;So it might a good idea if we write a name on our comments&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Monitor {&lt;br /&gt; public void doMonitor() {&lt;br /&gt;     // TODO uudashr: implement this method&lt;br /&gt;     // FIXME uudashr: create specific exception&lt;br /&gt;     throw new IllegalArgumentException("Not implemented yet");&lt;br /&gt; }&lt;br /&gt; public void process() {&lt;br /&gt;     // FIXME uudashr: bugs ....&lt;br /&gt;     ....&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-5315977715350603064?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/5315977715350603064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=5315977715350603064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/5315977715350603064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/5315977715350603064'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/07/todo-and-fixme-notes.html' title='TODO and FIXME notes'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-1511237399959748831</id><published>2007-07-16T23:10:00.000-07:00</published><updated>2007-07-28T21:11:11.792-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Reflection API</title><content type='html'>It started 2 years ago, when I have to develop a web based system using PHP.&lt;br /&gt;I'm not a PHP expert, so I asked my friends who works as PHP Developer a question&lt;br /&gt;"What are they usually need for developing system? What is the best framework did they&lt;br /&gt;use?" So 2 frameworks comes, Eocene and Mojavi.&lt;br /&gt;&lt;br /&gt;I'm trying to learn about Mojavi, and I have to learn so many things to start my&lt;br /&gt;project. Oh my god. So I stopped and think "Why don't I learn the concepts, and create&lt;br /&gt;the framework by myself, so I don't have to waste time to learn features and&lt;br /&gt;regret if the framework didn't fit to me".&lt;br /&gt;So I started my simple framework using OO on PHP.&lt;br /&gt;The problem is "how can I handle with unexists class on code time, but exist on&lt;br /&gt;run time?" Google comes to help and I found "reflection".&lt;br /&gt;So there is reflection API on PHP as well.&lt;br /&gt;After that I learn reflection on Java.&lt;br /&gt;&lt;br /&gt;Here is an example of how to use reflection API.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package uudashr.reflection;&lt;br /&gt;&lt;br /&gt;public class Example {&lt;br /&gt;  public void hello() {&lt;br /&gt;      System.out.println("This is hello method");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public String toString() {&lt;br /&gt;      return "This is example instance [from toString method]";&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;How to handle this simple class using reflection API? watch this.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package uudashr.reflection;&lt;br /&gt;&lt;br /&gt;import java.lang.reflect.Method;&lt;br /&gt;&lt;br /&gt;public class GettingClass {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;      testCreateInstance();&lt;br /&gt;    &lt;br /&gt;      testExecutingMethod();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static void testCreateInstance() {&lt;br /&gt;      try {&lt;br /&gt;          Class exampleClass = Class.forName("uudashr.reflection.Example");&lt;br /&gt;          Object obj = exampleClass.newInstance();&lt;br /&gt;          System.out.println(obj.toString());&lt;br /&gt;      } catch (Exception e) {&lt;br /&gt;          e.printStackTrace();&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static void testExecutingMethod() {&lt;br /&gt;      try {&lt;br /&gt;          Class exampleClass = Class.forName("uudashr.reflection.Example");&lt;br /&gt;        &lt;br /&gt;          Object obj = exampleClass.newInstance();&lt;br /&gt;        &lt;br /&gt;          Method helloMethod = exampleClass.getMethod("hello", null);&lt;br /&gt;          helloMethod.invoke(obj, null);&lt;br /&gt;      } catch (Exception e) {&lt;br /&gt;          e.printStackTrace();&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-1511237399959748831?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/1511237399959748831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=1511237399959748831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/1511237399959748831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/1511237399959748831'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/07/reflection-api.html' title='Reflection API'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-3068297939350620084</id><published>2007-06-25T08:27:00.000-07:00</published><updated>2007-06-25T09:31:01.158-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>Eclipse - Generating code, constructors, getters, and setters</title><content type='html'>Sometimes we have to work with POJO, like when we work with Hibernate. The main problem is after we create all the member variables, we should create the getters and setters. To create N properties, it need N * 2 method (of getters and setters), that would be an extra job for your fingers. The same problem comes when we want to create a constructor that has parameter from the member variables . Thanks god, Eclipse come to save us.&lt;br /&gt;&lt;br /&gt;Assume we have create UserProfile class.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_J_SN67qNirg/Rn_maIVn2iI/AAAAAAAAABM/9Gh-C1mzKXM/s1600-h/code1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; cursor: pointer;" src="http://bp0.blogger.com/_J_SN67qNirg/Rn_maIVn2iI/AAAAAAAAABM/9Gh-C1mzKXM/s320/code1.png" alt="" id="BLOGGER_PHOTO_ID_5080032241286371874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now we will create the constructor&lt;br /&gt;"right click + source"&lt;br /&gt;or&lt;br /&gt;"alt + shift + s" on windows&lt;br /&gt;or&lt;br /&gt;"alt + cmd + s" on mac&lt;br /&gt;then select&lt;br /&gt;"Generate Constructor using Fields..."&lt;br /&gt;&lt;br /&gt;Select all fields you need&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_J_SN67qNirg/Rn_nf4Vn2jI/AAAAAAAAABU/notsG2xBaBM/s1600-h/Generate+Constructor+using+Fields.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer;" src="http://bp3.blogger.com/_J_SN67qNirg/Rn_nf4Vn2jI/AAAAAAAAABU/notsG2xBaBM/s320/Generate+Constructor+using+Fields.png" alt="" id="BLOGGER_PHOTO_ID_5080033439582247474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and click OK, it should be like this&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_J_SN67qNirg/Rn_oq4Vn2kI/AAAAAAAAABc/cm0bZRkVb9A/s1600-h/code2.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer;" src="http://bp3.blogger.com/_J_SN67qNirg/Rn_oq4Vn2kI/AAAAAAAAABc/cm0bZRkVb9A/s320/code2.png" alt="" id="BLOGGER_PHOTO_ID_5080034728072436290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and let's generate the getter and setter, open the source menu like above, then select&lt;br /&gt;"Generate Getters and Setters..."&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_J_SN67qNirg/Rn_qAYVn2lI/AAAAAAAAABk/IAAfcJ6wIzw/s1600-h/Generate+Getters+and+Setters.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; cursor: pointer;" src="http://bp1.blogger.com/_J_SN67qNirg/Rn_qAYVn2lI/AAAAAAAAABk/IAAfcJ6wIzw/s320/Generate+Getters+and+Setters.png" alt="" id="BLOGGER_PHOTO_ID_5080036196951251538" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;"Select all" or what ever you need, then boom, Eclipse save your fingers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-3068297939350620084?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/3068297939350620084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=3068297939350620084' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3068297939350620084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3068297939350620084'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/06/eclipse-generating-code-constructors.html' title='Eclipse - Generating code, constructors, getters, and setters'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_J_SN67qNirg/Rn_maIVn2iI/AAAAAAAAABM/9Gh-C1mzKXM/s72-c/code1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-3030876260302057450</id><published>2007-06-19T09:02:00.001-07:00</published><updated>2007-06-19T09:06:59.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='internet'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><category scheme='http://www.blogger.com/atom/ns#' term='nix'/><title type='text'>How to download using curl</title><content type='html'>Hello, I'm new on Mac, previously I'm using MS Windows and I still use it on my office. The first thing when I'm using my mac is "Where is my free download manager, where I can perform resume on my download?". Nix platform already has great tools to download "curl". How do I download using curl.&lt;br /&gt;&lt;br /&gt;When you want to download, you have to find the URL for an example "http://www.downloads.com/filetodownload.zip".&lt;br /&gt;To start download you can type&lt;br /&gt;&lt;br /&gt;curl -C - -O http://www.downloads.com/filetodownload.zip&lt;br /&gt;&lt;br /&gt;You can cancel your download or there might be an network error found, we can resume the download as long the server support for the resuming.&lt;br /&gt;&lt;br /&gt;just type the same command on the same directory&lt;br /&gt;&lt;br /&gt;curl -C - -O http://www.downloads.com/filetodownload.zip&lt;br /&gt;&lt;br /&gt;Thats it, the download will resume.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-3030876260302057450?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/3030876260302057450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=3030876260302057450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3030876260302057450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/3030876260302057450'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/06/hello-im-new-on-mac-previously-im-using.html' title='How to download using curl'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112579269437914545.post-7040043777681550628</id><published>2007-06-19T08:50:00.000-07:00</published><updated>2007-06-19T09:13:03.405-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='object oriented'/><title type='text'>Pure Object Oriented Language</title><content type='html'>What is Object Oriented? Based on this article written by Bjarne Stroustrup on http://www.research.att.com/~bs/oopsla.pdf , "A language or technique is object-oriented if and only if it directly supports: [1] Abstraction - providing some form of classes and objects. [2] Inheritance - providing the ability to build new abstractions out of existing ones. [3] Run-time polymorphism - providing some form of run-time binding". So, when a language have this three of features, we can call it as an Object Oriented Language.&lt;br /&gt;&lt;br /&gt;So what is pure Object Oriented Programming Language? Which one is it?&lt;br /&gt;What do I ask above question?&lt;br /&gt;Well, there is some discussion, and someone says that Java is not pure Object Oriented Language instead of C++. Wow, it's shocking statement. So lets the amazing Google help us, and I find this http://www.jvoegele.com/software/langcomp.html , where stated where object orientation of language can be separated by:&lt;br /&gt;1. Pure&lt;br /&gt;2. Hybrid&lt;br /&gt;3. Multi-Paradigm&lt;br /&gt;4. Add-On&lt;br /&gt;5. Partial Support&lt;br /&gt;&lt;br /&gt;In this articles, consideration of pure Object Oriented Language should support such of qualities of :&lt;br /&gt;1. Encapsulation / Information Hiding&lt;br /&gt;2. Inheritance&lt;br /&gt;3. Polymorphism/Dynamic Binding&lt;br /&gt;4. All pre-defined types are Objects&lt;br /&gt;5. All operation performed by sending messages to Objects&lt;br /&gt;6. All user-defined types are Objects&lt;br /&gt;&lt;br /&gt;Well, Java and even C++ doesn't fit with above definition. The Eiffel, Smalltalk, and Ruby is the winner as pure Object Oriented languages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112579269437914545-7040043777681550628?l=uudashr.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://uudashr.blogspot.com/feeds/7040043777681550628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112579269437914545&amp;postID=7040043777681550628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/7040043777681550628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112579269437914545/posts/default/7040043777681550628'/><link rel='alternate' type='text/html' href='http://uudashr.blogspot.com/2007/06/pure-object-oriented-language.html' title='Pure Object Oriented Language'/><author><name>Uudashr</name><uri>http://www.blogger.com/profile/01345159643256995628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_J_SN67qNirg/SQGUwVA4LKI/AAAAAAAAAMo/gSMhI4uMGDM/S220/Photo20087221058211.jpg'/></author><thr:total>0</thr:total></entry></feed>
