tag:blogger.com,1999:blog-73963743130026342732008-06-13T21:52:52.171+08:00Code FTWHendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-7396374313002634273.post-55024932278973865452008-06-13T21:52:00.001+08:002008-06-13T21:52:52.190+08:00Delicious 2.0 extension messing up my Firefox<div xmlns='http://www.w3.org/1999/xhtml'>Delicious extension seems to cause problems with Firefox.<br/><br/>First at my work Ubuntu laptop, the location bar became a blank bar. Fixed by disabling the extension or reverting to previous version.<br/><br/>Now on my home Windows XP PC, the title bar is doesn't change when I switch tab. I'm going to revert it too.<br/><br/>Anyway, I thought version 2 will make bookmark searching faster. Turned out I was wrong. So there is no point in using version 2 for me.<br/></div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-23846845529363366202008-04-20T11:04:00.002+08:002008-04-20T11:07:27.639+08:00Starting Rails Project from Scratch - Part 1<div xmlns="http://www.w3.org/1999/xhtml">While I've been working with Rails for about 4 months now, I've never started any project from scratch. As I'm doing my personal project while also learning more about Rails, let me just document my journey here.<br /><br />I'm creating my project with Rails 2.0.2 on Windows platform using Netbeans as the IDE. Somehow Ruby programs take some time to load on my PC, which is why I have some extra time to write this, lol.<br /><br />OK, let's go to the meat. These are the first few steps I did.<br /><br /><span style="font-weight: bold;">Configure Subversion for Rails</span><br /><a href="http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion">http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion</a><br />Just follow it blindly. I tried to be smart and end up missing out some things. Don't forget to create the branches, tags, and trunk structure in the first place.<br /><br /><span style="font-weight: bold;">Import to NetBeans</span><br />And ignore the NetBeans project files: svn propedit svn:ignore nbproject<br /><br /><span style="font-weight: bold;">Use Piston for Plugins</span><br /><a href="http://www.rubyinside.com/advent2006/12-piston.html">http://www.rubyinside.com/advent2006/12-piston.html</a><br />Those unfamiliar with Piston need to know that Piston doesn't work like script/plugin. You must specify where the plugin files are created.<br /><pre>piston import http://dev.rubyonrails.org/svn/rails/plugins/simply_helpful/ <span style="font-weight: bold;">vendor/plugins/simply_helpful</span></pre><span style="font-weight: bold;">Add authentication using Restful Authentication</span><br /><a href="http://railscasts.com/episodes/67">http://railscasts.com/episodes/67</a><br /><a href="http://www.railsforum.com/viewtopic.php?id=14216">http://www.railsforum.com/viewtopic.php?id=14216</a><br /><br />Note:<br />If you're following the Railscast and creating "session" controller instead of "sessions", this error might happen when you try to log in:<br /><pre>Error: uninitialized constant SessionsController</pre>at routes.rb add this <pre>map.resource :session, :controller => 'session'</pre> instead of <pre>map.resource :session</pre></div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-74729337200538921332008-04-17T22:12:00.003+08:002008-04-20T11:09:42.636+08:00People You May Know in Facebook<div xmlns="http://www.w3.org/1999/xhtml">This is the kind of feature that I have been hoping to have in social network sites, yet none of them that I know did although it's very simple to implement. And here is Facebook doing it, although it's way too late. Unfortunately, the first 3 people they show on my home page are people that I don't know. Going to the details, I only found one guy that I really know. I guess my network in Facebook is pretty saturated.</div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-7329629222989497852008-04-13T19:10:00.001+08:002008-04-13T19:11:26.503+08:00Countering The Dead Sea Effect<div xmlns='http://www.w3.org/1999/xhtml'>There is a new idea called <a href='http://brucefwebster.com/2008/04/11/the-wetware-crisis-the-dead-sea-effect/'>the Dead Sea effect</a> which is basically saying that in large corporate, the more talented IT engineers are the ones most likely to leave because they're they most likely can't put up with the stupidities and inefficiencies in the workplace, not to mention all the problems.<br/><br/>And the worse thing about it is the vicious cycle effect that happens. Talented IT engineers are not likely to join a defunct team and the only way they can get a talented people is from entry positions. But they'll leave too once they know enough.<br/><br/>How to escape this situation? I don't think it's impossible, but it's certainly difficult. This is what I thought. First, get a talented people (of course, if they can find it), pay them high, and give them super power (authority). Talented person knows talented people. He'll get either his talented friends, or he'll hire other talented people. Then they'll start fixing things up. Looks simple? No. It's very difficult because they'll face resistance from old people who're afraid they'll lose their jobs. These people may even hide important informations (you know, the tricky parts which only one guy knows) or restrict access to them (you can't touch my server!) making their progress slower. Not to mention that whatever they want to change will have rotten codes which are very difficult to understand. But I believe it's doable, given that the people doing it strife till the end. Or they might just decide that enough is enough, no amount of money can make them do this, etc. Then the company is screwed.<br/><br/>Eventually, the best way for them is probably to keep the way things are. They're big, they can afford it. But if they want to beat the competition, they should look into how they can make their IT more agile. A good in-house IT team can make a lot of things happen. The least, they can cut down the manual works. Then, with software applications, they can make people work more efficiently and faster.</div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-29252214940408286752008-04-12T10:14:00.001+08:002008-04-12T10:14:01.214+08:00Moving Vista Taskbar Buttons<div xmlns='http://www.w3.org/1999/xhtml'>Five years of development and the Windows team can't get a simple thing right.<br /><br />The first few days I used Vista, there was one thing I expected to work, considering that Vista is a major improvement for Windows. That thing is moving the taskbar buttons around to arrange them in the order that I like. Linux desktop managers can do that since a long time and I was expecting that Vista was able to do it since it's just a simple thing. Guess what, it didn't work.<br /><br />Arranging the taksbar buttons is so important for me that if one of the application crashes, I'd rather restart the others just to arrange it again. That's during the Windows time anyways. Because I've been using Linux on work for quite some time, it's not an issue anymore. Of course there are some free third party applications to do it, but why do we have to deal with it when it should be part of the OS?<br /><br />It's always good to know that things are where you expect them to be.</div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-8744907341498006102008-04-10T21:06:00.001+08:002008-04-10T21:06:02.577+08:00Remember the Milk widget crashes Firefox 2.0.0.13<div xmlns='http://www.w3.org/1999/xhtml'>Just to make the noise louder, my Netvibes started crashing my Firefox since a few days ago. I thought Netvibes will fix it soon but it doesn't happen and it's getting itchy here. A <a href='http://groups.google.com/group/mozilla.support.firefox/browse_thread/thread/0ed963c347b65639/e107233c18b125a4'>Google search</a> later, I found that the problem is with Remember the Milk widget. I archived the widget and Netvibes works again.</div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-62037149294722509852008-02-24T18:35:00.003+08:002008-02-24T18:45:32.493+08:00Way to lose your site user: ban themI haven't used StumbleUpon for a long time and when I wanted to use it, this is what I get.<br /><br /><img src="http://htimage.googlepages.com/su_too_many_acc.png"></img><br /><br />OK, so some spammers used my <span style="font-weight:bold;">dynamically allocated</span> IP address and created a lot of accounts and StumbleUpon banned the IP to protect themselves.<br /><br />But I'm a <span style="font-weight:bold;">logged in</span> legitimate user and I'm also banned? Well, I won't bother contacting them for this. I'll simply don't use it until I feel like it, which might be a few months, a year, or never.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-52901701403898383752007-12-05T22:44:00.000+08:002007-12-05T22:45:35.510+08:00Python makes you fly<a href="http://xkcd.com/353/"><img src="http://widgetftw.googlepages.com/python.png" /></a><br /><br />That's about what I felt when I learned Python. It really opened my eyes to a whole new world. What I thought was scary like dynamic typing turns out to hardly matter at all (provided the the code is well written of course, otherwise it's hell).<br /><br />Then the new concepts that I found from scripting languages like strong vs weak typing, dynamic vs static typing, list comprehension, functional programming, closures, map, etc. It's just so cool.<br /><br />I thought I need to tune my brain to different way of thinking when programming in scripting language. Turns out I'm doing alright. What needs tweaking is the way I tried to solve a problem, apparently. I think I need to zoom out and see things as a whole.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-82462455530289637622007-10-22T22:47:00.000+08:002007-10-22T23:05:48.859+08:00Netvibes widget is going multi platform, reallyI'm happy <a href="http://dev.netvibes.com/blog/2007/10/20/uwa-widgets-now-available-on-windows-vista-and-livecom/">they did so</a>. I thought the Universal in UWA (Universal Widget API) only means Netvibes, iGoogle, and Apple Dashboard.<br /><br />I was considering to come up with iGoogle version of my <a href="http://codeftw.blogspot.com/2007/07/f1-standings-widget.html">F1 Standings Widget</a> since iGoogle seems to have more users. In fact, I have a working version already, just need to touch up a bit.<br /><br />It makes my Netvibes effort all worth it now that the widgets are available for these platforms:<br /><img src="http://htimage.googlepages.com/netvibes-platforms.jpg" alt="Netvibes Platforms" border="0" /><br /><br />Upcoming is Yahoo! Widgets (formerly Konfabulator). Go for it!<br /><br />Now, how can I publish my widgets to all these platforms?Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-43297010786050190342007-10-18T23:58:00.000+08:002007-10-19T00:20:45.210+08:00When conditionally deleting from a list, iterate backwardMy ex colleague once told me, if you need to delete some element of a list or array based on some condition, iterate though the list backward. That way, the index will remain the same while traversing the list. Never been in that situation, I thought.<br /><br />I was faced with this problem recently and thinking about how to solve it, it seems not so straight forward. Then I remembered that advice. Problem solved, yay.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-26596998293998019412007-10-04T14:41:00.000+08:002007-10-05T22:53:56.616+08:00TheDailyWTF hackedSo The Daily WTF site is <a href="http://forums.worsethanfailure.com/forums/thread/132187.aspx">hacked</a> using XSS, by script kiddies. How ironic.<br /><br />But not a big surprise. Many people have been saying that the real WTF is the forum software itself.<br /><br /><a href="http://htimage.googlepages.com/dailywtfhacked.jpg"><img src="http://htimage.googlepages.com/dailywtfhacked_thumb.jpg" /></a><br /><br />See it live <a href="http://worsethanfailure.com/Comments/A-Very-Valid-validInt.aspx?pg=2">here</a>. [<span style="font-style:italic;">Update: Already fixed now.</span>]Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-62695901601202370222007-09-22T20:56:00.000+08:002007-09-22T21:18:15.973+08:00Is there a better way, againPreviously I wrote about the <a href="http://codeftw.blogspot.com/2007/03/what-makes-better-programmer.html">difference between good and bad programmer</a>.<br /><br />This <a href="http://worsethanfailure.com/Articles/All-For-19-Seconds.aspx">WTF</a> is another golden example of the case.<br /><br />The programmer is writing in Perl (when I read it's Perl, I almost laugh already), a code to add 19 seconds to a time. Moving on to the second, minute, hour in the code and I know it's going to go up to year and leap year. In the end, the programmer is just one step to implementing a calendar. The successor replaced the whole fifty lines with just <span style="font-weight:bold;">one</span> line.<br /><br />The programmer is neither stupid nor lazy (though this line is suspicious: <span style="font-style:italic;">if (($year == 2008)||($year == 2012))</span>), but again: <blockquote>"It never occurs to them to think 'there *has* to be a better way than this.'?"</blockquote><br /><br />It's all about common sense. If it's so common, someone else must have done it and we can use it too.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-29312462928645866662007-09-20T21:19:00.000+08:002007-09-20T21:22:42.813+08:00Ooma => Osama?Try reading this with tired eyes: <a href="http://www.techcrunch.com/2007/09/19/oomas-drug-induced-viral-video/">Ooma’s First (Drug Induced?) Viral Video</a>.<br />I read it as <span style="font-style:italic;"><span style="font-weight:bold;">Osama</span>'s First (Drug Induced?) Viral Video</span>. Wow, hot terrorist campaign stuff.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-42426015614400411032007-09-13T22:06:00.001+08:002007-09-13T22:48:23.835+08:00Terminology ConfusionologyI heard someone mixed up the usage of thread and process. I don't know if it's done on purpose to make it easier to understand. But anyway, <a href="http://en.wikipedia.org/wiki/Thread_(computer_science)">thread</a> and <a href="http://en.wikipedia.org/wiki/Process_(computing)">process</a> are different things and should not be mixed up.<br /><br /><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Multithreaded_process.svg/180px-Multithreaded_process.svg.png" /><br /><br />Which brings me to another question. What about hang and crash? I thought the terms explain themselves. Hang is when the process does not respond, also known as freeze. Crash has more definitions, but when talking about application or process, it usually means the process terminates unexpectedly.<br /><br />Webopedia gets it wrong. Is hang a subset of crash? I don't think so.<br /><blockquote><a href="http://www.webopedia.com/TERM/h/hang.html">hang</a>: To crash in such a way that the computer does not respond to input from the keyboard or mouse. If your computer is hung, you usually need to reboot it, although sometimes hitting the correct sequence of control characters will free it up.<br /><br /><a href="http://www.webopedia.com/TERM/C/crash.html">crash</a>: (n) A serious computer failure. A computer crash means that the computer itself stops working or that a program aborts unexpectedly. A crash signifies either a hardware malfunction or a very serious software bug.<br />(v) To fail or break. Other terms for crash include hang and bomb.</blockquote><br /><br />So is TechEncyclopedia. They even mix it up.<br /><blockquote><a href="http://www.techweb.com/encyclopedia/defineterm.jhtml?term=hang">hang</a>: To freeze or lock up. If an application hangs without any dialog box indicating the reason, such as an out-of-paper condition, then the application has "crashed."<br /><br /><a href="http://www.techweb.com/encyclopedia/defineterm.jhtml?term=crash">crash</a>: An abnormal termination of a program, which is usually caused by software, although a hardware failure can also be the reason. When a computer "crashes," it locks up (freezes), and the user cannot obtain any response from the keyboard or mouse.<br />If the crash occurs in an application, then only that application "hangs up," but other applications continue running. If the crash occurs in the operating system, then the user is locked out of the computer entirely, and it has to be rebooted. See abend and crash in Windows.</blockquote><br /><br />Good thing Wikipedia <a href="http://en.wikipedia.org/wiki/Hang_(computing)">gets</a> <a href="http://en.wikipedia.org/wiki/Crash_(computing)">them</a> right and even more detailed. Power to the community.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-17940351010171673382007-08-08T21:50:00.000+08:002007-08-26T22:35:32.288+08:00Going back and FROI'm going back to Indonesia tomorrow and one thing bothering me is how my Google Reader feeds are going to kill me when I'm back. The condition medically known as FRO (Feed Reader Overload), haha..<br /><br />Anyway, some interesting tips to handle FRO is by <a href="http://lifehacker.com/software/feed-readers/beat-unread-feeds-item-overload-with-tags-287101.php">tagging the feeds to things like essential, expendable</a>, or whatever you can think of.<br /><a href="http://www.aiderss.com/">AideRSS</a> can also be helpful by helping to pick the popular stuffs, but I don't think popular is good enough for me. Sometimes the interesting things for me are not the popular ones.<br /><br />For me, my feeds are still manageable, so by the feed name I know I can skip everything. What I'm going to do when I'm back is to just read the titles and look for something interesting instead of reading the summary as I usually do. Well, it depends on how many feeds I'll be getting by the end of the vacation. Probably 1100+. If I can't take it, I still have my <span style="">必殺 (hissatsu)</span>, <span style="font-weight: bold;">Mark all as read</span>.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-91408914001998534502007-07-22T11:27:00.000+08:002007-07-23T22:13:33.380+08:00Quick Regular Expression in PythonSometimes I want to do a quick one time search and process the result. For simple file search, I can use grep. But when the pattern gets complicated or I need to do things with the result, I use Python in interactive mode.<br /><br />Of course I can use some off the shell GUI based tools to do regex. But with Python, I can manipulate my results on the fly.<br /><br />This is how I do it.<br /><br />First, import the regular expression module.<br /><pre>>>> import re</pre><br /><br />Put the text into a variable. Use the triple quotes, paste, and another triple quotes.<br /><pre>>>> text = """<option value='../info/view?number=ACM063'>ABCD 12345</op<br />tion><br />...<br />... <option value='../info/view?number=AC<br />M013'>XYZ 13355</option><br />...<br />... <option value='../info/view?number=AC<br />M019'>BLK 1234</option><br />...<br />... <option value='../info/view?number=AC<br />M021'>AB XD 34</option>"""</pre><br /><br />Or just read the text from file.<br /><pre>>>> f = open('c:/text.txt')<br />>>> text = f.read()<br />>>> f.close()</pre><br /><br />Then regex it. Don't forget to use raw string on the pattern so that backslashes don't need to be escaped. Prefix your pattern string with "r" to use raw string.<br /><pre>>>> matches = re.findall(r"number=(\w+)'>(.+)<", text)</pre><br /><br />You'll get a list of tuples.<br /><pre>>>> matches<br />[('ACM063', 'ABCD 12345'), ('ACM013', 'XYZ 13355'), ('ACM019', 'BLK 1234'), ('AC<br />M021', 'AB XD 34')]</pre><br /><br />Do whatever you want with the list. For example, make it a wiki table.<br /><pre>>>> for m in matches:<br />... result += '|| ' + m[0] + ' || ' + m[1] + ' ||\n'<br />...<br />>>> print result<br />|| ACM063 || ABCD 12345 ||<br />|| ACM013 || XYZ 13355 ||<br />|| ACM019 || BLK 1234 ||<br />|| ACM021 || AB XD 34 ||</pre><br /><br />Or sort it by second column.<br /><pre>>>> matches.sort(lambda x, y: cmp(x[1], y[1]))<br />>>> matches<br />[('ACM021', 'AB XD 34'), ('ACM063', 'ABCD 12345'), ('ACM019', 'BLK 1234'), ('ACM<br />013', 'XYZ 13355')]</pre><br /><br />If the result is large, write it to a file.<br /><pre>>>> f = open('c:/result.txt', 'w')<br />>>> f.write(result)<br />>>> f.close()</pre><br /><br />More on Python regular expression at this <a href="http://www.amk.ca/python/howto/regex/regex.html">Python regular expression tutorial</a>.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-68213055288921407452007-07-21T13:28:00.000+08:002007-08-26T22:42:44.852+08:00.NET, better than Java?This is an almost religious topic. I'm going to point to what people have said and what I think. Note that I have experience in .NET but not much in Java other than self learning and part of my degree course.<br /><br />My colleague said that Java is faster than .NET, or more specifically ASP.NET. It "feels lighter", according to the person.<br /><br />Well, as an ex semi active .NET developer and having tried developing in Java and learning J2EE, I was surprised. I couldn't believe that someone has that belief. From hearsay and my experience, Java is slow and resource hungry. Loading Eclipse and Tomcat on my low end 512 MB RAM PC brings my PC to almost halt. Not to mention Eclipse's feature is not as good as Visual Studio. Then I did some search and this is what I think.<br /><br />Let's compare from a few point of view (no pun intended here).<br /><br /><ul><br /><li>Tooling. Many tools and controls are included in .NET. For example, DataTable, which is part of ADO.NET. I don't really know the whole thing about ADO.NET and I don't really care unless I have to revisit it again. But I use DataTable, DataGrid, DataView, GridView and other table related objects. Not to mention other UI controls which are easy to use. It's really useful and saves a lot of time. In Java, good luck with comparing so many framework first (Struts vs JSF vs whatever else). Then after confusing yourself, just pick up whichever feels more comfortable. Maybe you're more comfortable with standard, pick JSF. More comfortable with tried and proven? Pick Struts. Then code 'em notepad style. Or if you use JDeveloper, you can do it visually though.</li><br /><br /><li>IDE. So you want to be productive and able to do things more efficiently. That's why IDE was created. To do the mundane tasks for you. And we are now at a time where IDE actually helps people pick up codes on the fly because IDE helps you visualize the program.<br /><br />Now, Visual Studio is arguably one of the best IDE out there, if not the best. It's easy to learn and when talking about ASP.NET, hey, you can interactively debug it. Can you do the same on J2EE solution? Most likely yes. But I know some who don't know how to do it. And I'm probably one of them.<br /><br />I have tried to set up Eclipse to do it. Some were successful and some were not successful. On one failed occasion, although I read about a possible solution, I didn't want to continue, because it requires another slow download and I was just helping someone. Let them continue doing <span style="font-style: italic;">System.out.println</span> to debug then. How primitive is that. Not to mention painful. Build your WAR, put it into Tomcat or JBOSS, then restart Tomcat or JBOSS. Wait for eternity, start testing, and pay attention to the console or log file. What a life. In Visual Studio, set your break points, press F5, your browser will pop up, and you can debug it step by step.</li><br /><br /><li>Performance. I don't really know about this. But there are performance comparison with varied results. Objectivity is easily arguable. If someone doesn't like the result, he can say that the test is not objective, thanks to zealotry.<br />Here are some <a href="http://www.shudo.net/jit/perf/">performance</a> <a href="http://www.promoteware.com/Module/Article/ArticleView.aspx?id=10">comparison</a>. I believe the performance difference in a well tuned system may not be significant enough.<br /></li><br /><br /><li>Frameworks hell. We have heard about the multitude frameworks and tools that Java has. From the different VMs and application servers to different web frameworks.<br /><br />Your organization wants you to develop a web application in Java. What do you do first? Evaluate the frameworks available and see which one is suited for the application. By the time you're done evaluating, you probably have known three or four frameworks quite well. But you haven't started anything. From the organization, it's a waste of time and money.<br /><br />In .NET, you don't have a choice. Start immediately and when met with dead end, search the web and most likely somebody has solved the same problem. Monoculture does have its <a href="http://www.oreillynet.com/onlamp/blog/2007/04/the_virtues_of_monoculture.html">good points</a>.<br /></li><br /><br /><li>Difficulty. J2EE is <a href="http://www.codinghorror.com/blog/archives/000090.html">hard</a>. It's too complex. You don't learn J2EE in a month. Hell, try setting up a J2EE stack first, if you can.<br /><blockquote>"My students who elected to use Microsoft .NET tools spent an average of two hours setting up their systems. Those students who elected to go the J2EE route wasted two weeks and ended up having to drop the course because they couldn't get their application servers up and running (despite the fact that all of these students had at least one semester of Java programming experience)." <a href="http://philip.greenspun.com/bboard/q-and-a-fetch-msg?msg_id=000tcP">Philip Greenspun</a>.</blockquote></li><br /><br /><li>Configuration hell. Yes, Java is very configurable but isn't there too much configuration? For example, JBOSS. There are so many configuration in different files. I can't figure out what the hell are those XML configs for. A <a href="http://www.codinghorror.com/blog/archives/000508.html">Pet Store comparison</a> reveals that in terms of configuration, it requires 2566 LOC for config while .NET version only uses 56. But this doesn't always happen though. It depends on how flexible you want it to be. Most of the time, those flexibility are not useful because the basic settings are probably good enough.</li><br /></ul><br />Another interesting point is can be seen in this <a href="http://www.promoteware.com/Module/Article/ArticleView.aspx?id=10">article</a>, which compares the Pet Store application. According to the article, the .NET advantages are: much much less line of code (2096 vs 14004), faster to develop (2 man-weeks vs 10 man-weeks), and better performance.<br /><br />And an interesting discussion about <a href="http://philip.greenspun.com/bboard/q-and-a-fetch-msg?msg_id=000tcP">why MIT choose ASP.NET</a>. It's probably because most students know .NET and with Java they would have to evaluate the right Java application server. It's also mentioned that J2EE looks like a classical IT dead end because of the multitude of application servers and execution environments.<br /><br />So my conclusion is if you want to get things done fast and easy, use .NET. The downside is .NET costs money. Though the benefits should exceed the cost.<br />If you want do it standard compliant, proven, and <a href="http://www.google.com/custom?aq=t&oq=&hl=en&ie=ISO-8859-1&oe=ISO-8859-1&client=pub-6897220306923822&channel=7501220674&cof=FORID%3A1%3BGL%3A1%3BS%3Ahttp%3A%2F%2Fworsethanfailure.com%3BL%3Ahttp%3A%2F%2Fworsethanfailure.com%2FResources%2FImages%2FPrimary%2Flogo.gif%3BLH%3A50%3BLW%3A236%3BLBGC%3AFFFFFF%3BLC%3A%230000ff%3BVLC%3A%23663399%3BGFNT%3A%230000ff%3BGIMP%3A%230000ff%3BDIV%3A%23336699%3B&domains=worsethanfailure.com&q=enterprisey&btnG=Search&sitesearch=worsethanfailure.com">enterprisey</a>, use Java, whatever <span style="font-weight: bold;">standard</span> means because apparently porting to different application server may require code change.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-6564426982542161752007-07-13T23:39:00.000+08:002007-08-22T20:47:09.958+08:00Why Ubuntu is still not there yetI used Ubuntu again just now. It's because when walking home, my wandering thought said "Today is Ubuntu day". And so I booted my PC into Ubuntu, started my lovely Amarok, Firefox, and of course after few months of abandonment, Update Manager had something to say for the next 2 hours.<br /><br />Firefox worked perfectly. I think the fonts are refreshing. I did some add on updates and added a few more like <a href="http://lifehacker.com/software/gmail/lifehacker-code-better-gmail-firefox-extension-251923.php">Better Gmail</a> and FoxyTunes. I've always thought Better Gmail is created by Adam Pash, but it's actually by Gina Trapani. My bad...<br /><br /><a href="http://amarok.kde.org/">Amarok</a>. I love the cover fetching and interface. It will be better if the smaller control window is independent of the playlist window so that you can open just the control without bringing up the whole playlist window.<br /><br />Then I also watched Keroro Gunsou. Not a pleasant experience though, due to some annoyances.<br /><br />Now, let me explain why it's still not good enough. First, it crashed, several times. When I dragged an album at Amarok's left sidebar to playlist column, it froze. My mouse wasn't able click on anything although the cursor was still able to move. After a hard reboot, another problem happened. This time when the update finished. Froze again. Hard reboot again. Next problem had to do with sleep function. I pressed the sleep button on my keyboard, my PC went to sleep, only to never wake up. Another hard boot. Argh, what the hell is going on? I suspect it was because Amarok was run under GNOME, causing it to go berserk.<br /><br />Second, it lacks in multimedia department. Nothing beats my DFX enhanced sound on Windows. Though I think Amarok is the best music player, but the sound is raw, with no sound enhancement other than equalizer. Maybe I can live with it eventually. But there is another problem, which is the media player. It's just not good enough. The interface and usability was bordering on annoying. For example, on the default player, when you go full screen, the video control pops out when you move the mouse. But it took quite long to disappear again, unlike Media Player Classic, which will only pop up when you mouse over, and immediately hide itself when you move away. Other than that, the seeking sucks. It's like moving a boulder on an uneven ground. It's rough, you can't chose where exactly you want to go. Again, Media Player Classic is a smooth fella. The last multimedia related problem is the video. It appears a bit blocky for me.<br /><br />Despite Ubuntu gaining popularity and someone predicting that <a href="http://www.maximumpc.com/article/2008_year_of_the_linux_desktop">2008 is year of the Linux desktop</a>, those experiences pushed me back a few steps again. I thought my last obstacle was migrating my uTorrent and making it share data between Windows and Ubuntu. Forget it, no more Linux for the next few months.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-27207986005761770552007-07-11T21:51:00.000+08:002007-07-11T22:19:40.101+08:00F1 Standings WidgetI started to follow F1 on 1999, that's when Mika Hakkinen won and I was still at my 2nd year of high school.<br /><br />I bought a guide book for that year and filled the race results table the next day after Grand Prix. Since I couldn't write it immediately (due to some circumstances), I memorized it until I got to my guide book. At that time, I lived in a dorm and TV was restricted, so I didn't watch F1 back then, just read the news.<br /><br />Fast forward 8 years later, I still can't watch F1 because I live in this small little country that doesn't broadcast F1 for free. If I were to subscribe, I'll be getting other channels that I won't bother to watch and still have to pay for it. No thanks. That's one of the disadvantages of living in small country.<br /><br />The difference now is it's easier to keep track of the championship standings thanks to Internet. And I'm here to make it even easier for Netvibes, iGoogle, and Apple Dashboard users with my new widget.<br /><br />The project page is <a href="http://code.google.com/p/f1standings-uwa/">here</a>. Enjoy.<br /><br /><a href="http://eco.netvibes.com/uwa/200927/f1-drivers-and-constructors-standings"><img src="http://widgetftw.googlepages.com/f1standings-uwa_screen.png" /></a><br /><br /><a href="http://eco.netvibes.com/subscribe.php?id=200927&url=http%3A%2F%2Fwidgetftw.googlepages.com%2Ff1standings.html&type=UWA"><img src="http://eco.netvibes.com/img/add2netvibes.png" width="91" height="17" alt="Add to Netvibes"/></a><br /><br /><a style="border: 0pt none ;" title="Add this module to Google Homepage" href="http://www.google.com/ig/add?moduleurl=http%3A%2F%2Fwww.netvibes.com%2Fapi%2Fuwa%2Fcompile%2Fgoogle.php%3FmoduleUrl%3Dhttp%253A%252F%252Fwidgetftw.googlepages.com%252Ff1standings.html"><img alt="Add to Google Homepage" src="http://www.netvibes.com/img/uwa-google.png"></a>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-16242115736383056162007-07-02T20:33:00.000+08:002008-05-28T20:04:49.285+08:00Singapore Mutual Funds Widget<div xmlns='http://www.w3.org/1999/xhtml'>I started investing in mutual funds last month and immediately realized that there is no convenient tool for me to check my funds' daily performance. Though I have my profit and loss calculated in my portfolio, I wanted to have something like Yahoo Finance to check day to day price changes. The best I get was a table with 3 months of price, which was selected through drop down list twice and two mouse clicks for EACH fund. What a pain. Not to mention the price difference was not calculated. So every time I had to pull out my calc.exe and calculate the change in percentage.<br/><br/>Then an idea came and this is the result.<br/><br/><a href='http://eco.netvibes.com/uwa/198855/singapore-mutual-funds' target='_blank'><img src='http://widgetftw.googlepages.com/sgmf-uwa_screen.png'/></a><br/><br/>It's a <a href='http://dev.netvibes.com/'>UWA</a> widget to track the latest change in Singapore based mutual funds price. It can be used in Netvibes, iGoogle, and Apple Dashboard.<br/><br/>I went into quite some trouble while creating this widget. Mostly from my lack of experience with notepad based web programming. Other problems come from the UWA itself. Standalone/local mode does differ from online mode. Sometimes it works in standalone but not in online mode. Oh the frustration...<br/><br/>Fortunately most questions are already answered in the <a href='http://dev.netvibes.com/forum/'>forum</a>. And also thanks to <a href='http://www.getfirebug.com/'>Firebug</a>. I couldn't have made it without Firebug. What a super helpful tool, though I still have to learn how to use it for JavaScript debugging.<br/><br/>I used Aptana for code editor but sometimes it's to slow on my PC and I have to switch to my trusty <a href='http://www.flos-freeware.ch/notepad2.html'>notepad2</a>. The code editor is convenient, but the slow motion is not.<br/><br/>Anyway, I managed to complete it in few days and thanks to <a href='http://code.google.com/hosting/'>Google Code Hosting</a>, it's available as an open source under BSD license. Find the project page <a href='http://code.google.com/p/sgmf-uwa/'>here</a>. Feel free to contribute, ask for enhancement, whatever.<br/><br/>Enough of the long talk. Try it <a href='http://eco.netvibes.com/uwa/198855/singapore-mutual-funds'>here</a>.<br/>You can also add the widget to Netvibes or iGoogle using one of these buttons.<br/><br/><a rel='nofollow' href='http://eco.netvibes.com/subscribe.php?id=198855&url=http%3A%2F%2Fwidgetftw.googlepages.com%2Fsgmf.html&amp;type=UWA%22'><img src='http://eco.netvibes.com/img/add2netvibes.png'/></a><br/><a rel='nofollow' href='http://www.google.com/ig/add?moduleurl=http%3A%2F%2Fwww.netvibes.com%2Fapi%2Fuwa%2Fcompile%2Fgoogle.php%3FmoduleUrl%3Dhttp%253A%252F%252Fwidgetftw.googlepages.com%252Fsgmf.html'><img src='http://www.netvibes.com/img/uwa-google.png'/></a><br/><br/>Last one. I have created another widget to show Formula 1 drivers and constructors standings. Currently doing some minor improvements but basic functionality is already there and I'm already using it.</div>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-64378485797636451002007-06-06T20:07:00.000+08:002007-08-26T22:04:53.563+08:00Remember The MilkA great application with a strange name.<br /><br /><a href="http://www.rememberthemilk.com/">Remember The Milk</a> is a web 2.0 to do list with loads of feature and today is my first day using it and I'm already blogging about it.<br /><br />Essentially, it's just a to do list, with <a href="http://www.rememberthemilk.com/services/">super power</a>.<br /><br />Connectivity wise, it's a data source you can retrieve from e-mail, <a href="http://www.netvibes.com/">Netvibes</a>, GCal, iGoogle, feed reader, mobile phone, widget, and IM. What an extensive list and I'm looking into how I can maximize these connections.<br /><br />Productivity wise, it's a reminder that you can receive from e-mail, IM, and mobile phone.<br /><br />Collaboration wise, you can share your lists with your contacts. Making it one helpful tool for working. That is provided that your colleagues are technologically aware. That's one thing I find it a pain. People working in IT sector doesn't mean they're very open to new technology. In fact, most friends I know still live in web 1.0 glory and probably never heard of web 2.0 and the AJAX sugar. Even when introduced, they don't bother to explore. Well well...<br /><br />Fancy, sugary wise, there's Google Map integrated. So you want to meet your friend? Put your meeting place on the to do list, click on it, and you can see the map. I don't find much use for this other than for fun. Probably because I don't have a mobile gadget to access the map and even if I have, Singapore is not too well represented on Google Map. Postal code search will be nice though. But at least street name search works.<br /><br />Programming wise, there's an API! Should I say more?<br /><br />What else is missing? Can't say anything at the moment. I'm overwhelmed with this killer to do list. Those people are totally nuts and I love them for creating Remember The Milk.<br /><br /><span style="font-size:85%;">It will be great for Google Maps to add postal code search to Singapore map since Singapore's postal code as far as I know refers to a building. So by postal code, we can instantly get to the building we want.</span>Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-62668568081713465442007-05-21T21:26:00.000+08:002007-08-26T22:10:54.985+08:00Learning RailsI've been learning Ruby on Rails these past 2 months. I'm using <a href="http://www.aptana.com/">Aptana</a> as the IDE and this <a href="http://rubyonrails.freetutorial.info/index.htm">tutorial</a> as the guide. That tutorial is a good one. Normally, RoR tutorials only tell you how to create a web application in 15 minutes, or something like that. That's only good for whetting your appetite but after that you can't do anything on Rails. In that tutorial, I learned about the model (Active Record), scaffolding, controller, view, and even AJAX! So it kind of forms the basic for me. Deeper than that, I can just refer to the manual, or even better, the <a href="http://www.pragmaticprogrammer.com/titles/rails/index.html">book</a>.<br /><br />Now, about Rails itself, it definitely enables fast web development as advertised. The biggest advantage for me is no SQL required and the scaffolding feature.<br /><br />Writing SQL code is kind of repetitive, boring, takes a substantial time, and error prone. With Rails, this is not necessary. Not only it saves your time, you don't need to test every single SQL because it's not there! How about that?<br /><br />Scaffolding is kind of creating a template to work on. It creates a working CRUD pages for a database table an all is good except it looks ugly. So the key here is to modify the template to your liking. Creating this template enables you to visualize how the application will look like and it makes you feel the application is 50% done. Yeah, 50% done all the time. :P<br /><br />Other great feature is the integrated AJAX. That was my first time doing something related to AJAX and I can't believe it's so simple. I'm always intimidated by JavaScript in general and XMLHttpRequest is naturally part of the intimidation. But when I did the tutorial, I didn't use XMLHttpRequest. Heck, I didn't even write a single JavaScript!<br /><br />I'm using Aptana as the IDE. It's intuitive enough for me, but the code complete certainly deserves improvements. Anyway, it's good enough to code like mad :)<br /><br />Now, what I'm lacking are how to properly read the manuals, mastering the Ruby language, and real world experience (need to get Rails job!).Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-87137084231660717282007-04-21T20:43:00.000+08:002007-08-26T21:55:54.896+08:00Edgy Eft + Beryl -> Feisty Fawn = FailureFailure. That's what happened when I upgraded Ubuntu Edgy Eft with Beryl to Feisty Fawn.<br /><br />First, the X server failed to start and sent me to command line. OK, time to restore my xorg.conf. Here came a trouble: I wasn't able to login. It's as if my password was wrong.<br /><br />Then I used my Edgy Eft CD to try to restore my original xorg.conf . I mounted my linux drive using a <a href="http://www.psychocats.net/ubuntu/mountlinux">guide</a>, and then I tried to restore the file using Nautilus, but I was not able to copy. I realized that it was a permission problem. So I read the guide again, because I remembered there was a part about setting privilege after mounting. This is the command that screw up my linux: <span style="font-family:courier new;">sudo chown -R root:root /storage</span><br /><br />Now the whole file in my Ubuntu is owned by da root. Then I managed to restore the xorg.conf and tada.. X server started. Then I logged in and I almost went in, only to find that my home folder's owner iwas not me, then I get kicked out. Yeah, you can't enter someone's home without permission, can you?<br /><br />So I went back to the Live CD, created an account with the same username as my Ubuntu username, set my home to be owned by the new account. Then I rebooted again and this time managed to login.<br /><br />Not bad, but now I can't do <span style="font-family:courier new;">sudo</span>. It says I am not in the list or something. Damn, I don't even know the root password. Of course I probably can do something to add my account into the list. But the file permission is already f*cked up anyway. It's too broken, no point fixing it.<br /><br />So I think I'm going to install a fresh Feisty Fawn. This time with my /home under seperate partition. I hope the Beryl is not broken this time. My previous Beryl always hang after a few minutes.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-53057658940955901742007-04-12T20:43:00.000+08:002007-08-22T21:08:19.197+08:00Reverse string in PythonWhile reading "<a href="http://worsethanfailure.com/Articles/Some_Call_it_Concatenation.aspx">Some Call it Concatenation</a>" (which is funny, btw), some commenters are getting crazy and started to write in reverse. You know, in <span style="font-style: italic;">esrever</span>. It's easy to write it, just use your left arrow key, but reading it is a pain.<br /><br />So after reading one of them and met another few, I thought, "Let's reverse it using a program. Python will be great!". Besides, any decent programmer is expected to know this according to the <a href="http://www.joelonsoftware.com/articles/fog0000000073.html">expert</a> guys.<br /><br />I'm new to Python, so forgive my lameness.<br />This is my first try:<br /><br /><pre>C:\>python<br />Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win<br />32<br />Type "help", "copyright", "credits" or "license" for more information.<br />>>> import string<br />>>> string.reverse("?etisoppo eht siht sI. 'tac' fo draeh ev'I ?'cat' s'tahW")<br />Traceback (most recent call last):<br />File "<stdin>", line 1, in <module><br />AttributeError: 'module' object has no attribute 'reverse'<br />>>> string.rev("?etisoppo eht siht sI. 'tac' fo draeh ev'I ?'cat' s'tahW")<br />Traceback (most recent call last):<br />File "<stdin>", line 1, in <module><br />AttributeError: 'module' object has no attribute 'rev'</pre><br />Oops, no reverse function there.<br /><br /><pre>>>> import string<br />>>> def reverse(s):<br />... res = ""<br />... for x in s:<br />... res = x + res<br />...<br />>>> def reverse(s)<br />File "<stdin>", line 1<br />def reverse(s)<br /> ^<br />SyntaxError: invalid syntax<br />>>> def reverse(s):<br />... res = ""<br />... for x in s:<br />... res = x + res<br />... return res<br />...<br />>>> print reverse("?etisoppo eht siht sI. 'tac' fo draeh ev'I ?'cat' s'tahW")<br />What's 'tac'? I've heard of 'cat' .Is this the opposite?<br />>>> print reverse("(: .em rof gnipyt-esrever eht od ot 'cat' gnisu ot gnitroser<br />m'I .ylkciuq sa stsop hcus epyt t'nac I taht si FTW rehto ehT")<br />The other WTF is that I can't type such posts as quickly. I'm resorting to using<br />'tac' to do the reverse-typing for me. :(</pre><br /><br />Wow, I made it. String reverse in few minutes.<br />But that hack job is surely not scalable. So just as an exercise, I decided to improve the it.<br />At first, I want to do a half loop of the characters and swap the character in mirror image.<br />But Python string is immutable, I didn't know how to create an empty list with predetermined length (it's supposed to be done like this: s = [0] * 10).<br /><br />Then I stumbled upon an article about <a href="http://www.skymind.com/%7Eocrow/python_string/">string concatenation in Python</a>. It says that using list comprehension is the fastest. Interesting. Let's apply the method there. I came up with these:<br /><ul><li style="font-family:courier new;"><span style="font-size:85%;">''.join([s[len(s) - 1 - i] for i in range(len(s))])</span></li><li style="font-family:courier new;"><span style="font-size:85%;">''.join([s[i] for i in range(len(s) - 1, -1, -1)])</span></li></ul>And finally, after reading about <a href="http://docs.python.org/lib/built-in-funcs.html">Python's built in function</a>, I came up with this.<br /><ul style="font-family:courier new;"><li><span style="font-size:85%;">''.join([x for x in reversed(s)])</span></li></ul>While writing about this, I found <a href="http://mail.python.org/pipermail/patches/2003-January/010886.html">someone suggested string reverse method in Python</a>. I found this gem there:<br /><ul><li><span style="font-size:85%;"><span style="font-family:courier new;">s[::-1]</span></span></li></ul>Wow, that's cool and I feel very newbie. But at least my method is supposed to be faster (maybe) and still in one line. :)<br /><br />To conclude, Python seems to have good language features. Imagine how string reverse is implemented in Java. One line? I don't think so.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.comtag:blogger.com,1999:blog-7396374313002634273.post-25683451804992589912007-03-27T10:54:00.000+08:002007-08-26T21:51:28.806+08:00What makes a better programmerWhen reading <a href="http://worsethanfailure.com/Comments/The_Insanity_Defense.aspx">The Insanity Defense</a> at Worse Than Failure (formerly known as TheDailyWTF, gosh I hate the new name..), I found one interesting comment.<br /><br /><div style="border: 4px solid rgb(229, 229, 229); margin: 12px 0px; background: rgb(255, 255, 255) none repeat scroll 0% 50%; font-family: arial; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px; background-color: rgb(255, 255, 255);"><div style="border-bottom: 1px solid rgb(220, 220, 220); white-space: nowrap; margin-bottom: 8px; background-color: rgb(238, 238, 238); background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: rgb(102, 102, 102); font-size: 10px;"><a href="http://clipmarks.com/popular/" title="see clips that are hot right now"><img src="http://clipmarks.com/images/clip-icon.gif" alt="" style="border: medium none ; margin: 0px 4px; vertical-align: middle; display: inline; float: none;" border="0" height="19" width="19" /></a>clipped from <a title="http://worsethanfailure.com/Comments/The_Insanity_Defense.aspx" href="http://worsethanfailure.com/Comments/The_Insanity_Defense.aspx" style="font-size: 11px;">worsethanfailure.com</a></div><blockquote style="border: medium none ; margin: 4px 0px 8px; padding: 0px 8px; background: transparent none repeat scroll 0% 50%; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" cite="http://worsethanfailure.com/Comments/The_Insanity_Defense.aspx"><div class="CommentSubHeading"><br /> 2007-03-23 09:07<br /> •<br /> by kanna<br /><span id="ctl00_MainContent_CommentsRepeater_ctl02_UnregisteredIndicator">(unregistered)</span><br /> </div></blockquote><div style="border-bottom: 1px solid rgb(245, 245, 245); margin: 2px 4px; background: rgb(220, 220, 220) none repeat scroll 0% 50%; height: 2px; font-size: 2px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"></div><blockquote style="border: medium none ; margin: 4px 0px 8px; padding: 0px 8px; background: transparent none repeat scroll 0% 50%; text-align: left; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" cite="http://worsethanfailure.com/Comments/The_Insanity_Defense.aspx"><div class="CommentBodyText"><br /> I guess they should be greatful it's not *all* on one line. Seriously though, that's impressive. Sometimes you have to wonder how these people survive a day. It never occurs to them to think "there *has* to be a better way than this."?<br /><br /></div></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="padding: 0px; font-size: 11px; border-spacing: 0px;" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="border-width: 0px; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><br /></td><td style="border-width: 0px; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 58px;" width="58"><a href="http://clipmarks.com/" title="go to clipmarks.com"><img src="http://clipmarks.com/images/c2b-foot-logo.png" alt="powered by clipmarks" style="border-width: 0px; margin: 0px; padding: 0px;" border="0" height="17" width="58" /></a></td><td style="border-width: 0px; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 48px;" width="48"><a href="http://clipmarks.com/share/B366BBBA-6A1E-4589-869F-0B327F0AB38E/blog/" title="blog or email this clip"><img src="http://clipmarks.com/images/c2b-foot-blogit.png" alt="blog it" style="border-width: 0px; margin: 0px; padding: 0px;" border="0" height="17" width="48" /></a></td></tr></tbody></table></div></div><br /><br />That's exactly what I've been pondering. For me, that's the difference between the good and bad programmer:<br /><blockquote>"It never occurs to them to think 'there *has* to be a better way than this.'?"</blockquote><br />A good programmer will think that he/she is doing either stupid or too difficult things. One long line of condition is difficult to understand. There <span style="font-weight: bold;">HAS</span> to be a better way to do it. Deeply nested if statements are just wrong, it's hard to comprehend. There <span style="font-weight: bold;">HAS</span> to be a better way to do it. And then the search for greatness begins.<br /><br />And talking about the bad programmer, I sometimes think: this people, either they are genius for being able to understand the mess or just plain average Joe, at which the latter is more possible. Understanding crazy codes is really beyond my ability. I simply hate it. That's why I always keep it simple for the sake of my future self and other programmers.<br /><br />But the bad programmers, if they are such a genius that they're able to understand it with ease, they're not smart for not being able to see the simpler form. If they're just average, well, too bad, being average in programming world equals to being bad programmer.<br /><br />There is just a <a href="http://www.codinghorror.com/blog/archives/000635.html">vast divide between those who can, those who can't</a>. And for me, another vast divide between those who are good and those who are bad. For the good programmer, he/she will always think when stumbling upon stupid or repetitive things: <span style="font-weight: bold;">there has to be a better way than this</span>.<br /><br />And by the way, I'm not implying that I'm good myself. I'm just someone learning to be better.Hendy Tanatahttp://www.blogger.com/profile/12970275896974540871noreply@blogger.com