Monday, December 25, 2006

Fishing

Last night I went fishing in Shorncliff with my friends. None of us knew how to cast the net, so we improvised. We caught a fish by surprise. Surprise because we thought the net didn't spread when we cast it. So pulled on the net and up came a little fish (3 inch). No idea what fish it was.

The day ended when we accidentally let go of the net completely when we cast it.

Oh well. Headed home after throwing the fish back in the water.

Sunday, December 24, 2006

Tech Bust Due Soon

The news article Rampant M&A activity may signal peak of global business cycle puts forward a nice justification that the next bust is near. Current M&A activity ($3.6 trillion) has already exceeded the activity ($3.4 trillion) of the previous tech bust.

I, for one cannot understand YouTube's valuation of $1.65 billion or Skype's valuation of over $3 billion. Just numbers of customers cannot justify those valuation. Right now all of them are supported by ads. What will happen to them at the next bust when advertising money dries up. However, its all part of evolution. We need the next bubble bust to kill off the weak, so that the strong can rise from the ashes.

It takes a long time for a big company to die: so long that it's non-obvious that most of them are in fact dying, or at best treading water. We're a hit-driven industry. A few big successes can make it seem like everyone's doing well. But most of them have only had one hit. Go visit most tech companies, and all you'll find is a fussy henhouse parading around an aging goose that laid one or two golden eggs. All their innovation happened in the first act, and now they're focused on "managing for success." But that kind of managing is just staving off insolvency until a real innovator takes their business away. Any tech company overly focused on (or dependent on) its management is probably a good candidate for short-selling.

Friday, December 15, 2006

Graduation

Finaly had my graduation ceremony today. What can I say…

What I remember most are the:
1. professors (especially the most bizarre ones)
2. staying up late working on assignments
3. craming for exams the night before
4. writing a year long research paper in three weeks

Now I am officially an engineer. =)

Tuesday, November 28, 2006

Snippet://java/internet connectivity

The following code checks if internet can be accessed. Note, this is not a ping. The Java Socket class isn't capable of such low level function. However, since JDK5, Java java.net.InetAddress.isReachable(int) can be used to check if a server is reachable or not.

isReachable() will use ICMP ECHO REQUESTs if the privilege can be obtained, otherwise it will try to establish a TCP connection on port 7 (Echo) of the destination host. But most Internet sites have disabled the service or blocked the requests (except some university such as web.mit.edu).



public static boolean checkinternet(String url) {
try {
InetAddress address = InetAddress.getByName(url);
System.out.println("Name: " + address.getHostName());
System.out.println("Addr: " + address.getHostAddress());
System.out.println("Reach: " + address.isReachable(1000));
} catch (UnknownHostException e) {
System.err.println("Unable to lookup " + url);
} catch (IOException e) {
System.err.println("Unable to reach " + url);
}
}

Monday, November 27, 2006

Snippet://Java/InputStream

Java code snippet to read InputStream using buffered reader.

NOTE: StringBuffer won't insert extra \n, so the returned string will be exactly as the InputStream. Also, the unusual for statement in the snippet below is 10 times faster than the traditional while statement.

private static String slurp(InputStream in) throws IOException {
StringBuffer out = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
out.append(new String(b, 0, n));
}
return out.toString();
}

java.lang.NoClassDefFoundError: org/apache/commons/

I'm working on a project where I needed to make HTTP requests. Instead of reinventing the wheel, I decided to use Apache-Commons-Httpclient library. Upon compiling, the code blew up in my face. The debugger says:

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Hmm... so Apache-Commons-Httpclient is dependent upon Apache-Commons-Logging library. After I download and add the required library, I compile the code to have it blow up in my face again. This time the debugger says:

java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

Good god, another dependency. This time Apache-Commons-Codec. That's what I hate about external libraries. None of them is self contained. I need the code small enough to fit in embedded devices like a cell phone. Good thing Apache-Commons library is opensource, so the source code is available. I need to strip it down. So much for reinventing the wheel.

Friday, November 17, 2006

High Avalibility - 5 Nines - 99.999%

Recently machinehead asked me how to build high availibility. For the less technically inclined, high availibility is a measure of the reliability of a system and sometimes indicated by "Five nines" or 99.999% reliability. Basically what it means is the system has a total downtime of no longer than five minutes per year.

Having done a course on distributed systems, I decided to take a crack at it. There are three main issues that needs to be addressed:

  • Hardware

  • Software

  • Data

Hardware
Everyone thinks high availibility means only hardware. Its not. Its only the beginning. Firstly, you need at least two of everything located geographically apart. For example, most people believe RAID is insurance against data loss. But RAID only protects against one or two drive failure. What happens if the PSU shorts and pump 240V instead of 5V. That will fry every disk in the array. Plus, rebuilding disk takes time which isn't high availibility. It should also be geographically located apart to protect against fire, earthquake, tsunami, plane etc.

Secondly, you need smooth, automatic switchover incase of crash. For example, using heartbeat to monitor servers and changing the IP at DNS server to the failover server. This makes it smooth and you don't need to make any other server aware of the server failure.

Software
Software should be built from ground up with high availibility in mind. Meaning they should be scalable and clusterable. The best way to do this is to make them stateless. For example, when you click on "2" to goto the second result page on Google, the second page doesn't necessarily have to be processed by the same server that did the initial first page. It can be done by any server. This is the power of stateless.

Data
Data is the hardest problem to solve. If you fragment and replicate the data for performace and scalability, you need to address sync issues. How would you lock and commit multiple partitions? How would you detect deadlocks? 2 phrase lock and 2 phrase commit is not an easy answer. eBay takes down the site on Monday 12-4AM every week to archive sold items so as to keep the fragments small (smaller fragments means faster searching by the database). Yes, this 4 hours is "planned" downtime and no, planned downtime does count towards high availibility.

Tuesday, November 14, 2006

Sun Just Killed Java

Yup, its official, Sun open-sourced Java by changing its license to GPLv2. The announcement is at http://www.sun.com/software/opensource/java/.

This is a good news for the open-source community. Especially GNU Linux which can now include all Java software with the platform like JBoss, IBM WebSphere, BEA Weblogic because all of them are nor GPL. Hehe.

Bad news is for all commercial firms who's propreity Java applications are now GPL. The GPL requires that any code combined with GPL code must be distributed under the same license. Developers must provide their contributions back to the community. This provision provides a mechanism to ensure that Java continues as a unifying platform for innovation. Most probably this will give rise to .NET technology as all commercial firms move to .NET.

P.S. This does not affect Java applications developed in-house for use in-house ONLY. It mostly effects commercial development of Java.

Tuesday, November 07, 2006

Format External SATA Drive

I just bought a Seagate SATA 250GB HD and an external SATA enclosure on eBay. Windows 2003 recognized the enclosure in Device Manager but the HD did not show up in My Computer. Reason being the drive was uninitialized and unformatted (since its new).

So how do you format a drive that does not show up on My Computer. Normally, a new HD connected directly to IDE shows up as unallocated drive in My Computer which you can then partition and format. However, what do you do when its connected to USB?

After half hour of playing around, the answer was simple enough:

1. Start -> Administrative Tools -> Computer Management -> Disk Management.
2. The HD will show up as Disk1 (unallocated)
3. Right click on Disk1 and select Initialize.
4. A Wizard will walk you through initializing, partitioning and formatting.

I partitioned it into 4 primary partition (maximum allowed by NTFS).

Monday, November 06, 2006

Debian Hard Disk Spindown

This article Debian hdd spindown - Kurobox Central has an interesting note on how to spin down the hard drive in Debian. When will Linux be as easy to use as Windows?

Install hdparam: apt-get install hdparm

Hard drive info: hdparm -i /dev/hda

Hard drive performance: hdparm -tT /dev/hda

Here's my 7 years old Toshiba Satellite2755 laptop Debian Server 6GB hard drive performance:

Timing cached reads: 62 MB in 2.01 seconds = 30.86 MB/sec
Timing buffered disk reads: 40 MB in 3.07 seconds = 13.01 MB/sec

Set spin down to 35 seconds: hdparm -S7 /dev/hda

To turn on spin down at 35 seconds by default, edit /etc/hdparm.conf:

/dev/hda {
mult_sect_io = 16
write_cache = off
dma = on
spindown_time = 120
}

Run to add hdparm setting to run control 2 (with shutdown running at reboot, shutdown, and single-user mode):

update-rc.d -f hdparm remove
update-rc.d hdparm start 19 2 . stop 19 0 1 6 .

Add to /etc/init.d/sysklogd so SYSKLOGD doesn't log MARK to /var/log/messages every 20 minutes and force the hard drive to turn on

SYSLOGD="-m 0"

Sunday, November 05, 2006

Installing .rpm in Debian

Installing a RedHat .rpm in Debian means converting to .deb and then installing it. And here's how to do it:

Convert .rpm to .deb: alien -k package.rpm

NOTE: The -k option preserves the minor version

Install .deb: dpkg -i packagename.deb

Uninstall .deb: dpkg -r packagename

Wednesday, November 01, 2006

How to Install WordPress On Debian Etch

Complete the following the steps:
  1. # apt-get install mysql
  2. # apt-get install apache2
  3. # apt-get install php5
  4. # apt-get install wordpress
  5. # mysql -u root
  6. mysql> CREATE DATABASE wordpress
  7. mysql> GRANT ALL PRIVILEGES ON *.* TO wordpress@localhost
    IDENTIFIED BY ‘wordpresspassword’ WITH GRANT OPTION;
  8. mysql> FLUSH PRIVILEGES;
  9. #mv wp-config-sample.php wp-config.php
  10. Edit wp-config.php to enter the correct setting:
    // ** MySQL settings ** //
    define('DB_NAME', 'wordpress');
    define('DB_USER', 'wordpress');
    define('DB_PASSWORD', 'wordpresspassword');
    define('DB_HOST', 'localhost');
  11. Add to /etc/apache2/sites-available/default:
    Alias /blog "/usr/share/wordpress/"
    <Directory "/usr/share/wordpress/">
    Options FollowSymLinks
    AllowOverride Limit Options FileInfo
    DirectoryIndex index.php
    </Directory>
  12. #/etc/init.d/apache2 restart
  13. Goto: http://localhost/blog/wp-admin/install.php
  14. Follow the instruction to create a login
  15. Use generated login to log in and start blogging.

Sun Blackbox

Sun just released Sun Blackbox, a new readymade data-center in a shipping container complete with 25 racks, 1.5PB storage, networking, cooling and shock absorbers. The idea is they ship you the whole container and you just power it up. A la data-center in a box.

How cool is that? Do you see whats happening here. Sun Microsystem is changing their whole business model. I remember a few years ago, Cemex, a cement manufacturer based in Mexico changed their business model from '$ per weight' to 'just-in-time' model. Cement manufacturing is a highly standardized business and the margins are too thin. So Cemex came up with a new idea. See, the problem is cement starts setting from the moment it leaves the factory, so you can't have it lying around. Also, sometimes the site is not ready or labours lying around too long waiting for the cement to arrive. Cemex identified these issues and told their customers that from now on, they will only pay for the right amount of cement at right time i.e., time is the business model. Customers phones the call-center to say when and how much cement they want and their ERP system optimizes and routes trucks in the field (fitted with GPS monitoring and comminicator) to the customer. Benefit for customer is they get right amount of cement at right time (usually within plus minus an hour). Benefit for Cemex is they bacame a multibillion dollar company and the 3rd largest cement manufacturer in the world. All by changing their business model to 'just-in-time'.

And this is what Sun Microsystem is doing. Shortening the time and effort for customers to set up a data-center. Sure you won't get the Blackbox within an hour of ordering. But even then, it will be there in a few days all set up and ready to go. Compare this with time taken to plan and build a data-center, from evaluating vendors to purchasing, building and testing infrastructure, etc.

Monday, October 30, 2006

Scaling MySQL

Have been experimenting with MySQL 5. It's not optimized right out of the box which is expected. But I can't find a lot of literature on the web to solve them. Seems MySQL is mostly used by kiddies to run their website who does no performance tunning. Of course, it could also mean I haven't looked well enough.

Anyway, my concern is with scaling. Cluster or replication... that is the question. Replication works because its mostly read based. You can have a central master with slaves replicating from it. Thankfully, I don't need real-time replication. The data size is now in giga bytes which will eventually approach tera bytes. More data means more time for replicating. The slaves will be down during replication but need them to be up 24/7. One way to solve this is to have two sets of slaves. Replicate one set while the other one is up and then switch over. However, this is a waste of resource as one set will always be unsed.

Basically, the problem with replication is it doesn't scale the writes. Expensive raid can speed it up but I can't afford that. As soon as I hit 100% of write transaction operation, I've hit the scaling wall with replication.

I need to investigate vertical and horizontal partitioning and clustering. I'm using my text book, Distributed Systems by Coulouris, Dollimore and Kindberg to base my theory. The book is supposed to be a bible on Distributed Systems. But its only general theory. I need something more geared towards MySQL. Anyone has any lead?

Google uses BigTable which is IO based instead of SQL based. Too bad I can't use that. Think at some point I'll have to develop my own custom thingy. Of course, the other bootleneck with replication is the network. Gigabit ethernet isn't going to cut it anymore. I have seen some cheap optical network card on eBay for $30, but optical cables cost about $100 per 10 meters. I can't afford that either. Oh well.

Thursday, October 26, 2006

Thesis Demo

The demo went quite well. The examiner grilled me for 45 minutes, but I had an answer for everything. You will too if you wrote an 85 page thesis (excluding appendix). I think I demoed to about 20 public visitor. All of them said it was quite good (but I'm sure they said that to everyone). But a couple of the visitors really appreciated my product.

Basically what my thesis did was implement a metric monitoring and reporting platform. You can use it to records metrics from different points and then the application will allow you to do whatever you want with the data. The project is actually implemented in the largest bank in the state where the data is hooked into Cognos for balanced scorecarding and other business intelligence thingies. At the bank, what used to take 2 days to perform now takes less than 5 minutes with my product.

The people who appreciated my product were mostly managers who frquently has to collect and analyze data for monitroing and reporting. When they saw what my product, they started grilling me on how it was implemented and the nuts and gritty. One guy even asked if I wanted to commercialize the product. I wasn't since the bank had sponsered me on the project and they were clear from the beginning that they would own the code. Well, the actual reason I don't want to commercialize my product is because there is nothing innovative about it. It basically leveraged existing product to create a new product. Anyone can do it in 6 months (which is how long it took me). Now, after learning from my mistakes, I can make a better one. But I'm still not keen on commercializing it. If I do and it is successful, they I know compititors will spring up on less than 6 months, since they can work on it full time (I worked on it part-time while I had a full load at uni and also working). Hell, with Cognos's resources, they can probably do it in 2 weeks.

So, yup, no commercial product from me. I wish I had asked the bank to pay me for it. I can't believe I did it for free just so I can write a good thesis. Another of life's lesson.
No more free lunch.

Wednesday, October 25, 2006

Finished My Thesis

I've finally finished my thesis this week. Submitted the electronic version today followed by printed/binded version in a week. That was quite a journey. I realized a lot of things about myself that I never knew. Tomorrow I demo the project at the university fair from 1-6PM which is open to the public. Anyone in the area is welcome to drop by.

I recommend using LaTeX to anyone planning to write a thesis. Basically, LaTeX is a typesetting application that takes care of formatting for you so you can concentrate on the content. It takes care of all formatting and creates table of content, figures, chapter, bibligraphies etc. LaTeX might seem an overkill, but when you approach more than 50 pages, you'll be thankful you chose LaTeX. Don't go with Word and EndNote like I did in the beginning.

Friday, October 20, 2006

Debian Etch

Just installed the latest Debian Etch (Debian 4.0) on my server using netinst cd. The netinst cd contains the base install and is about 150MB in size (better than downloading the full CD). Wow, is it me or is Etch much faster than Sarge.

Since netinst only has the base packages, I need to manually install everything I need, which is better because I get to keep the server lean. I need ssh, svn, apache, mysql, and perl (basically the whole LAMP thingy). Java, Tomcat, JUnit, ANT and Continuous Integration server will come later on. But I ran into a bit of a trouble. Since I installed from CD, I don't have the web mirrors set up. The fix is simple:

1.Add to /etc/apt/sources.list:
deb http://mirror.optus.net/debian/ etch main
2. apt-get update

Which threw up the following error:

# apt-get update
......
Fetched 5562B in 13s (421B/s)
Reading package lists... Done
W: There are no public key available for the following key IDs: A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems

Bit of googling showed the fix is simple

3. apt-get install debian-archive-keyring
4. apt-get update

NOTE: You need to be root when you do all these.

Saturday, October 07, 2006

New House

My parents moved in today into the new house they just bought. The house is two stories and has a pool.

I will move in a week later as the new house has no internet and I need it to complete my thesis and an assignment.

Need to check up on the status of DSL and Foxtel connection.

Sunday, September 24, 2006

Calvin&Hobbs I

One of my favorite quotes from Calvin&Hobbs. Now all I have to do is find the strip:


Mrs. Wormwood: "Calvin, can you tell us what Lewis and Clark did?"
Calvin: "No, but I can recite the secret superhero origin of each member of Captain Napalm's Thermonuclear League of Liberty."
Mrs. Wormwood: "See me after class, Calvin."
Calvin: (speaking in retrospect) "I'm not dumb. I just have a command of thoroughly useless information."


Update: Found the strip

Calvin and Hobbes - I am not dumb

Friday, September 15, 2006

CEO Phooey

I've been reading Sun CEO Jonathan's blog. It was interesting at first but the more I read, the more I got the feeling its all fluff and no substance. He gushing about how Sun will change the future with things like UltraSPARC machines which has a lower TCO than any other machines, and about Solaris. He even had his friend Marc Anderson (creator of Netscape) to talk about how Marc runs his latest startup on Solaris on Sun machines. Then he talks a new service called Sun Grid at network.com that is offering Grid computing at $1/CPU Hr.

Here's why I think its all fluff. I tried to download Solaris. It's free but the site asked me to fill in a form so they can harvest my personal information in the name providing me with a license code. I decided against it. In fact, the download is more than a couple GB in size. No way I'm gonna waste my 10GB limited bandwidth on that. If they had made it available openly like Linux, then mirrors around the world could've host it making it more attractive. Plus as more people uses it, the more software will be available for it. Right now, it takes a year for a new software to make its way to Solaris platform. For example RubyOnRails.

Don't get me started on TCO. That topic is too biased no matter how impartial everyone tries to be.

Next, Grid Computing. Sun runs a Grid compting network on UltraSPARC machines. People pays $1/CPU hr. Who in the world will use that? Amazon started a similar service six months ago and it went nowhere. The reason. Well, the only people who legitimately needs Grid Computing (and heavily will use to make the service profitable) are research lab, utility, financial and government agency. But none of them worth their salt will use the service due to confidentiality/security/privacy issues. I think that leaves lame ass smaller companies at the long tail end that needs Grid computing.

And after reading through the site, I was right. The first customer listed on their press release to use it is a biotech company who says
Sun Grid Compute Utility Helps Genetic R&D Company Get Life-Saving Products to Market in Record Time.
How many times have you heard that from a pharmacetical company in the last 10 years. How many genetic based cure do you know that saved some ones life?

Anyway, I think Jonathan as a CEO is no good. He is at heart a techie. He believes in using technology to solve all of world problem Unfortunately, thats only a wish and not a vision. Without vision, you don't stand a chance. He would be better suited as a CTO.

Why do you need vision to win. Well, that post will be coming soon.

Friday, September 08, 2006

My 43Things

I just signed up for 43things. I've been resisting the whole social networking movement for long. It simply takes too much time signing up and filling those forms. But it was only a matter of time. With 43Things, you select things/places/books/movie you did, doing or want to do. The site then tracks you against time and other people. The fun part's you get to read other people's experience who's in the same boat as you. You can read their blogs and 'cheer' them on while they too cheer you. You can see my 43Things on the right sidebar here.

The site is created using Ruby on Rails by a bunch of folks who worked at Amazon.com before. Recently they turned two and got funding from Amazon.com, so looks like they made it. Here are a few things a learnt along the way:


  • Bring your own computer.

  • Sit around one big table. Make communication easy.

  • No discussions over mailing lists.

  • Meetings take place at the pub, or as a standing meeting.

  • Use paper and notecards instead of documents.

  • Share the stereo.

  • Walk or bike to work if you can.

  • Eat lunch together. Play credit card roulette.

  • Make it more fun than useful.

  • Embrace constraints.

  • Build something you’d use. Use what you build.

  • Don’t overmonetize.

  • Rely on the software in your head rather than try to replicate culture in features.

  • Design as you build. Keep the cost of change low.

  • Be in it to win it.

Thursday, September 07, 2006

Overhead in Data Mining Class

Professor: A lot of professors will tell you that there is no such thing as a bad question.

Professor: (pause)

Professor: Yeah, they're all full of shit.

HP Goes On Dunn Hunt

Long story short:
1) One of HP's board of directors was leaking info to CNET.
2) HP's chairwoman, Dunn, authorized independent electronic-security experts to spy on the January 2006 communications of the other 10 directors.
3) These security experts used "pretexting" in order to coerce phone companies to send phone records to their own email addresses so they could determine who dunn it.
4) The slime was found, confronted, and admitted his leaking. He's decided to remain on the board until shareholders vote him off.
5) In protest of her tactics, another director, Perkins, resigned calling Dunn's tactics illegal, unethical and a misplaced corporate priority.
6) Dunn, and HP, filed paperwork with the SEC citing Perkins' resignation, but failed to identify the reason why he resigned in order to hide Dunn's investigation... a point which seems to be legally required by SEC regulations.
7) Shit ---> Fan

Wednesday, September 06, 2006

Crikey

I never met Steve in person, yet I feel like I did know him since I watched him so much on TV. I have to say, I was never a huge fan - although I was a fan and I certainly admired his passion. Its rare to see someone who is so dedicated to what they do and loves it so much. I just feel at such a loss that the world has lost a wonderful bloke.

Wednesday, August 23, 2006

Judgment That Defeats Us

I was just watching Apocalypse Now Redux for like the 100th time and there was this line by Kurtz
Because it's judgment that defeats us.
and it made me think.

How many times in our life have we failed to execute or take a risk because of our judgement. I mean look at Wikipedia. The first time I saw it, I remember thinking how was it ever gonna work. I mean who would ever take the time to write/edit articles for free, especially when the standards set for formatting was simply too high.

If I had dreamt of wikipedia, I'd have dropped it because of my judgement. But the truth of the matter is it worked. So how many ideas and dreams are lost everyday because of judgement?

Saturday, August 19, 2006

Boo GPL/GNU

Continuing from my previous post about open-source licenses, it seems the bad guys of the bunch is GPL/GNU. Why? Because if your software uses even one line of GPL/GNU licensed code, you've to re-release your source code under a GPL/GNU license or your can't use your own software at all. How's them apples?

And here I was a great fan of GNU\Debian Linux. In fact, I was right in the middle of tweaking the file system to make read operations faster than write operations (at the expense of the write operation). Now I need to look into another platform. Good thing I found out about it before I made too much headway.

BSD or MIT licenses seem to be the ideal choice. But there's not a whole lot of software released under those. The next best choice, Apache, has quite a few, but they are mostly written in Java. I'm actually quite good at Java, but it doesn't serve my purpose in the long run due to resource and performance requirements. I need good C/C++ software upon which I can build my own software.

Wednesday, August 09, 2006

Open Source License Comparison

The table below shows a major comparison of the open source license. There are a few more minor difference but I had enough legal reading for one day.

ApacheGPLLGPLBSDMIT
Disclaimer of liabilityxxxxx
Preserve Copyright Noticexxxxx
Can be used in commercialclosed source softwarex-*xx
Can be sublicensed*--*x
Prevents the authors name from being used to promote derived worksxxxx-


x = yes
- = no
* = under certain circumstances, yes

Monday, July 31, 2006

Snippet://Regex/URL

https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

Tuesday, July 18, 2006

MMC cannot open the file "blah blah"

My laptop running Windows 2003 R2 server developed a problem where I can't use any of the admin tools snap-ins lije Services or Event Viewer or IIS or SQL Server Console. The error I get is:

MMC cannot open the file C:\WINNT\system32\eventvwr.msc. This may be because the files do not exist, is not an MMC console, or was created by a later version of MMC. This may also be because you do not have sufficient access rights to the file.


After a bit of Googling, the solution was simple:
RUN: regsvr32 C:\Windows\system32\msxml3.dll (as admin)

Saturday, July 15, 2006

Snippet://SQL Server/Change Password

To change a password in SQL Server, use the following stored procedure

sp_password [ [ @old = ] 'old_password' , ]
{ [ @new =] 'new_password' }
[ , [ @loginame = ] 'login' ]

Friday, July 14, 2006

ColdFusion SQL Anamolies

Below are a list of anamolies (whatever that mean) regarding use of SQL in ColdFusion. Knowing these anamolies will make your life easier while developing ColdFusion. I didn't know them and wasted a whole day trying to figure out why my code didn't work.


  • ColdFusion doesn't have null. It only has empty string. SQL has both. When CF reads a null SQL field the result is an empty string. When CF reads a empty string SQL field the result is an empty string too.

  • Putting SQL in variable and running can be useful for debugging. But single quotes cause problems. Use preservesinglequotes(#QueryString#) function to fix this.

  • Convert SQL Date to string before retrieving by ColdFusion SELECT CONVERT(VarChar(10), MyDate, 10) From Mytable

  • For Null aggregate, use SELECT TotalCost = Total + ISNULL(ExtraCost, 0.00)

  • You do a query SELECT * FROM tablename and you want your code to automatically know the column names. Use the ColumnList variable of the query. PS there are also hidden query variables for RecordCount, CurrentRow and ExecutionTime

  • Say I've got a record set of 20 items and I want to access column foo in row 10. Here is the code to do that as an array. RecordSet.foo[10]

  • Check if table exists
    select name from sysobjects

Monday, July 10, 2006

ColdFusion MX

Buh Humbug!

I've been working on a project for past 3 months where in phrase 2 of the project I had to design and develop an ASP.NET 2.0 solution. After 2 months of development work, I requested the client IT department to migrate the solution to the staging environment for system testing.

This is when they got back to me saying they changed the corporate standard from ASP.NET to ColdFusion about a month ago, so all new projects need to be in ColdFusion. And umm.. didn't I get the memo.

Now I need to redo 2 months worth of work from ASP.NET to ColdFusion while learning ColdFusion at the same time.

Buh Humbug!

Tuesday, July 04, 2006

The Network Is The Computer

Today I had a discussion about Scott McNealy and his 'way ahead of time' vision about 'the Network is the Computer'. Later, I googled what his latest vision is. Looks like its still the same. But now he can prove it.

Recently, he critisized Apple's iPod in The Register. McNealy said,
There's a pendulum thing where stuff is on the client side and then goes back into the network where it belongs. The answering machine put voicemail by the desk, and then it went back into the network. Your iPod is like your home answering machine. I guarantee you it will be hard to sell an iPod five or seven years from now when every cell phone can access your entire music library wherever you are.


Scott is way off base here. Five or seven years! Motorola's already selling cell phone with iPod technology in it. Nokia N91 has 4GB drive to store mp3. Sony has W900 with memorystick to store mp3. 3G can stream song and movies and TV. Five or seven years! It's already happening. OMG Scott lost his soothsayer tongue!

Saturday, July 01, 2006

Crappy Free Apple Quicktime Movie Player

I just reformatted my laptop and reinstalled all my software. This is a ritual I perform after every semester (meaning twice a year). It lets me purge all the crap I installed during the semester in order to work on assignments. And also have the latest updates to all software. However, todays ones didn't go smoothly. Apple's to blame.

Apple just released a new version of Quicktime 7.1 for iTunes. The new update doesn't work with Windows 2003 R2. The error message during installation is
Error in Installation (QT error -3). It breaks iTunes and all other software dependant upon it such as Adobe AfterEffect.

Yeah, nothing like having something $2000 worth of software/hardware crippled by a free movie player...


After surfing the internet, I found the following solution which fixed the problem:

* Install iTunes 6 bundled w/ QT 7.1
* Watch it fail w/ the -3 install code
* Try the unistall, it'll fail
* Remove the QuickTime folder
* Delete the "QuickTime.qts and QuicktimeVR.qtx" from \system32
* For good measure, delete all QuickTime registry entries
* Use the QT 7.04 standalone installer, it'll work now
* Use iTunes and sigh deeply that this didn't work two hours ago.

QT 7.04 can ve found at Apple Quicktime 7.04

Tuesday, June 27, 2006

Bundle VS.NET With Vista

Visual Studio .NET Express should be a part of Windows Vista. Its offered for free as download from MSDN anyway, why not include it with OS?

All major OS except for Windows come with a programming tool. Mac OSX with AppleScript, Unix/Linux with gcc/perl/shell scripting.

The other reason for including it is to fuel the next generation of programmers. When I bought my first PC back in the Windows 3.1 days, it came with QBasic in DOS. I had a lot of fun times programming with it. It was amazing what a few lines of code could accomplish. Today, a novice user almost never sees a line of code and are becoming more and more of a passive user than active one.

To stop losing the next potential developer, bundle Visual Studio .NET with Vista.

Saturday, May 20, 2006

New Apple Store In New York City

Apple just opened a new store in New York City on 5th Avenue. It just joined the line of store along with Tiffany and Saks Fifth Avenue. One of my favorite hanging grounds when I was in New York. The entrance to the store is made of glass. The actual store is underground.

I so miss living in New York. :(

Apple Store In New York City

Saturday, May 06, 2006

Lead User Developement Process

I've been reading up on new developement process and one that caught my eye is "Lead User Development Process" developed at MIT.

Lead users have two characteristics:
1. they expect relatively high benefits
2. their needs are at “the leading edge of the market”

Lead users present strong needs that will become general in the marketplace in the future and hence serve as a need forecasting laboratory for marketing research.

But what's really innovative about this new concept is that lead users can provide new product concept and design data as well. Designing for extreme characters is a technique that takes the opposite approach. Instead of designing for characters that are emotionally shallow, the developement process designs for characters that have exaggerated emotional attitudes.

For example, if you perform a normal requirement analysis to develop a new query tool for Oracle, then you will end up with a query tool that works like any other query tool out there. But if you use a Lead User for requirement analysis, like some admin who experienced fixing the database at 3AM in the morning, then you will end up with an innovative query tool.

Wednesday, May 03, 2006

Snippet://Oracle/DUAL

Oracle Table DUAL
All Oracle accounts have access to a table called dual. You can query against this table to get the current account, system date/time, and excecute mathematical functions. For example
select user from dual;
select sysdate from dual;
select power(4,3) from dual;

Other Useful Commands
Use "Describe" To Get Table Definition
Use "Column" To Set Column Output Length
Use "Show All" and "Set" To View/Set SQL Editor Internal Variables and Their Values
Use "Truncate" To Delete All Rows of a Table
Use "Alter Table" To Change Table Definition
Adding Constraints to Table Definition
Specifying Primary Key in Table Definition

You can use the describe command on the following views to obtain information on your account.
View Name Description
DICT table names and table description
DICT_COLUMN column names of table names and column description
CAT names of all user's tables, views, synonyms, and sequences
OBJ information on all objects in your account
TABS table information on all user's tables
COLS column information on all user's columns
USER_VIEWS view information on all user's views
SYN synonyms information on all user's synonyms
SEQ sequence information on all user's sequences
USER_CONSTRAINTS constraint information on user's constraints
USER_CONS_COLUMNS column information on user's constraints
IND index information on all user's indices
USER_IND_COLUMNS column information on user's indices

Snippet://Oracle/RecycleBin

Delete With Purge
DROP TABLE table_name PURGE;
DROP INDEX index_name PURGE;
DROP TABLESPACE tablespace_name PURGE;

NOTE: You can’t roll back a PURGE statement

Lookup Recycle Bin
SELECT * FROM USER_RECYCLEBIN;

Recycle Bin Naming Convention
BIN$unique_id$version
unique_id is an unique 26 character across all Oracle
version is a random number set by set by the database

Recover Recycle Bin
FLASHBACK TABLE "BIN$04LhcpnoanfgMAAAAAANPw==$0" TO BEFORE DROP RENAME TO new_table_name;
FLASHBACK TABLE table_name TO BEFORE DROP RENAME TO new_table_name1;
FLASHBACK TABLE table_name TO BEFORE DROP RENAME TO new_table_name2;

which will reinstate the first version of the table to new_table_name1 and the second versions to new_table_name2. The values of the column COL1 in new_table_name1 and new_table_name2 will be 1 and 2 respectively.

Purge Recycle Bin
PURGE RECYCLEBIN; -- Purge Current User Recycle Bin
PURGE USER_RECYCLEBIN; -- Purge Current User Recycle Bin
PURGE DBA_RECYCLEBIN; -- As DBA, purge all

Be Warned...

The un-drop feature brings the table back to its original name, but not the associated objects like indexes and triggers, which are left with the recycled names. Sources such as views and procedures defined on the table are not recompiled and remain in the invalid state. These old names must be retrieved manually and then applied to the flashed-back table.

The information is kept in the view named USER_RECYCLEBIN. Before flashing-back the table, use the following query to retrieve the old names.

SELECT OBJECT_NAME, ORIGINAL_NAME, TYPE
FROM USER_RECYCLEBIN
WHERE BASE_OBJECT = (SELECT BASE_OBJECT FROM USER_RECYCLEBIN
WHERE ORIGINAL_NAME = 'RECYCLETEST')
AND ORIGINAL_NAME != 'RECYCLETEST';

OBJECT_NAME ORIGINAL_N TYPE
------------------------------ ---------- --------
BIN$04LhcpnianfgMAAAAAANPw==$0 IN_RT_01 INDEX
BIN$04LhcpnganfgMAAAAAANPw==$0 TR_RT TRIGGER

After the table is flashed-back, the indexes and triggers on the table RECYCLETEST will be named as shown in the OBJECT_NAME column. From the above query, you can use the original name to rename the objects as follows:

ALTER INDEX "BIN$04LhcpnianfgMAAAAAANPw==$0" RENAME TO IN_RT_01;
ALTER TRIGGER "BIN$04LhcpnganfgMAAAAAANPw==$0" RENAME TO TR_RT;

One notable exception is the bitmap indexes. When they are dropped, they are not placed in the recycle bin--hence they are not retrievable. The constraint names are also not retrievable from the view. They have to be renamed from other sources.

Snippet://Oracle/Table

Lookup All Table
SELECT * FROM TAB;

Create Table
CREATE TABLE table_name
(
id NUMBER(6,0),
colname1 VARCHAR2(20 BYTE) CONSTRAINT constname_nn NOT NULL ENABLE,
colname2 NUMBER(8,2),
CONSTRAINT t_id_PK PRIMARY KEY ("id") ENABLE,
CONSTRAINT t_col1_UK UNIQUE ("colname1") ENABLE,
CONSTRAINT t_col2_MIN CHECK (colname2>0) ENABLE,
CONSTRAINT t_col_FK FOREIGN KEY ("colname")
REFERENCES other_table_name ("primarycol") ENABLE
);
COMMENT ON COLUMN table_name.colname IS 'something';
CREATE INDEX index_name ON table_name ("colname")

Use "Truncate" To Delete All Rows of a Table
The truncate command will permanently delete all rows from a table. No need for commit.
truncate table table_name;

Use "Alter Table" To Change Table Definition
Use the Alter Table command to change the definition of a table. You can either add another column or change the definition of an existing column.
alter table table_name add (colname varchar2(24));
alter table table_name modify (colname varchar2(32));

Constraints to Table Definition
There are four kinds of constraints
1. not null
2. check value
3. unique
4. foreign key.

To disable a constraint, use the alter table command. To enable a disabled constraint, again use the alter table command. The following examples disables and then re-enables the salary check condition

ALTER TABLE table_name DISABLE CONSTRAINT constraint_name;
ALTER TABLE table_name ENABLE CONSTRAINT constraint_name;

Delete Table
DROP TABLE table_name;
DROP TABLE table_name PURGE; -- To delete and purge from the recycle bin

Create Sequence
CREATE SEQUENCE name_seq INCREMENT BY 1 START WITH 1;

How To Use Sequence
INSERT INTO table_name (id,...) VALUES (name_seq.NextVal,...);
INSERT INTO table_name VALUES (name_seq.NextVal,...);

NOTE: This is actually the best way to to use auto increment for a primary key. The other way:

INSERT INTO table_name (id, ...)
(SELECT CASE WHEN MAX(id) IS NULL THEN 1 ELSE MAX(id)+1 END, ... FROM table_name);

won't work because if first session INSERTS something, then another session won't be able to insert anything until session 1 commits transaction. After that when session 2 tries to INSERT, a unique contraints voilation will occur.

Snippet://Oracle/User

Create Tablespace
CREATE TABLESPACE ts_username
DATAFILE '/path/to/oracle/oradata/SID/ts_username.dbf'
SIZE 10M -- Initial Size
AUTOEXTEND ON NEXT 10M -- Increment Size
MAXSIZE 100M; -- Maximum Quota

Create New User
CREATE USER username
IDENTIFIED BY password
DEFAULT TABLESPACE ts_username -- Defaults to SYS if not specified
TEMPORARY TABLESPACE ts_temp
ACCOUNT LOCK -- Account Locked
PASSWORD EXPIRE; -- Force user to change password at next login

Lock/Unlock User Account:
ALTER USER username ACCOUNT LOCK;
ALTER USER username ACCOUNT UNLOCK;

Change User Password
ALTER USER username IDENTIFIED BY newpassword;

Grant User DDL/DML Rights
GRANT CONNECT TO username;
GRANT RESOURCE TO username;
GRANT DBA TO username; -- Make user a DB Administrator
GRANT SELECT ON tablename TO username;
GRANT CREATE TABLE TO username;
GRANT CREATE VIEW TO username;
GRANT CREATE SEQUENCE TO username;

Delete User Including Related Items Excluding Tables/Views/Sequence
DROP USER username CASCADE;

COMMIT/ROLLBACK
COMMIT; -- Commit Changes
ROLLBACK; -- Roll back changes since last commit

Who Am I
SELECT user, uid FROM dual

Find Active Sessions
SELECT sid, serial#, username, TO_CHAR(logon_time,'Month dd hh24:mi:ss')
FROM sys.v_$session;

Kill Session
ALTER SYSTEM KILL SESSION '12,33' -- 12,33 is the sid and serial#

TNSNAMES
local_SID =
(DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= hostname.network)(Port= 1521))
(CONNECT_DATA = (SID = remote_SID))
)

Saturday, April 08, 2006

Virtual Server 2005 for Free

Microsoft made Virtual Server 2005 R2 available for freenow. Why, not because its trying to compete with VMware, but because Vista server has builtin support for Virtualization Technology, so no point charging for it now.

I for one have grown used to Virtual PC 2004. I run Windows 2003 Server on Virtual PC on my laptop running also Windows 2003 Server. Why Windows 2003 inside Windows 2003? Well, I experiment with all sorts of applications... from DB or Applications Servers. Using virtual PC keeps my host laptop free of clutters.

Tuesday, April 04, 2006

Dell Store in Brisbane

Dell opened two new stores in Brisbane. That's right. No more ordering on their website and waiting ages for the courier to deliver.

That's right. Courier to deliver. I had experience of ordering to PC from Dell in Brisbane and tracked the package on their website. They always ship within one day of ordering. (which is the normal speed of Dell). The package both times arrived in Brisbane and was sitting in the courier depo for 1 week before being deliverede on the exact date of the delivery date that was given when the order was placed.

I can't believe the courier would just wait till the last moment just because they can. This is exactly the opposite of US. I ordered a laptop in US at 7PM Thursday night. It was built, shipped and delivered to me within one business day at 12:30PM Monday afternoon.

Anyway, Dell store's located at:

1. Westfield Chermside:
Cnr. Gympie & Hamilton Rd Chermside, QLD 4032
Site location: The Dell Direct Store is located
on Level 1, opposite Games Workshop

2. Westfield Carindale:
Cnr. Creek & Old Cleveland Rd Carindale, QLD 4152
Site location: The Dell Direct Store is located
on Ground Floor, opposite Noni B

They should open one in Gargen City Westfield too!

UPDATE: This is a scam. Its not a real Dell store. Just a booth with a computer and a salesman who will walk you through ordering online.

Wednesday, March 15, 2006

Google Is Evil Or Will Be

Google always said don't be evil. But I always knew it'll be a matter of time before they do.

First, they sold out those lil' chinese people by filtering chinese searhc results.

Second, they're handing over all private data of every user to the govenrment with a simple subpeona (not even a warrant).

What information does Google hold... every search term entered by date, IP and associated Google login. 2GB of email, text extract of all files on user's PC running Google Desktop.

What does Google Privacy Policy say? Its changing all the time, but what remains unchanged is they'll be pooling all the information they collect on you from all of their various services. Moreover, they may keep this information indefinitely, and give this information to whomever they wish. All that's required is for Google to
have a good faith belief that access, preservation or disclosure of such information is reasonably necessary to protect the rights, property or safety of Google, its users or the public.


It's amazing how a vague privacy policy, a minimalist browser interface, and an unconventional corporate culture have convinced so many that Google is different on issues that matter.

After 180 days in the US, all data lose their status as a protected communication under the Electronic Communications Privacy Act, and become just another database record. This means that a subpoena instead of a warrant is all that's needed to force Google to produce a copy. Other countries may even lack this basic protection, and Google's databases are distributed all over the world. Since the Patriot Act was passed, it's unclear whether this ECPA protection is worth much anymore in the U.S., or whether it even applies to email that originates from non-citizens in other countries.

Google is evil. :(

Open Word Document Without Word

A friend of mine wanted to open a word document but couldn't. Apparently he doesn't have Microsoft Word. The horror. The horror...

I figured out a work around. You can email the word document to your gmail account. Then when you open the email, gmail will give you the option to either download it or view as HTML. Good ol' gmail. :)

Sunday, March 05, 2006

Microsoft Oragami Project

Microsoft put up their Microsoft Oragami Project about 2 weeks ago with words it will release on March 9, 2006. The website plays a flash movie, saying "I am everywhere you are and never in the way... what am I? Find out March 9, 2006". The suspense for the last 2 weeks set the blogging world on fire. Its a perfect viral marketting.

Some says it will be a mp3 player to compete with iPod. Other says it will be a portable x-box 360. Yet other says it will be small tablet pc with wifi and mobile phone and everything changing the world of portable PC. No one knows what and Microsoft's not telling.

My guess, it will be all of the above. A device with phone, wifi, camera, mp3 player plus gaming device and most importantly GPS. After all, thats what oragami implies, transforming an object into something else.

Tuesday, February 28, 2006

Future Alarm Clock

Lately my brains been full of ideas. Must be from reading too much thesis. One idea I got is an alarm clock that tells you the weather when you wake up.

And not just weather, any information. Stock quotes, news headlines, rss from blogs.

I know I know, there's alarm clocks with radio/cd player, but the big difference is, with the radio/cd player you are stuck with whats playing on the radio or whats in the CD. But with the new alarm clock, you can customize to your heart's content. Everything's pluggable.

Saturday, February 25, 2006

Thesis Grinding

Spent the last two weeks reading and ranking all the thesis topics put out by the ITEE department. Must've been over 200 of them.

Finally got 7 topics that interest me. Now it's time to make the rounds with the thesis supervisors and hopefully one of them will take the bait. The deadline's this weekend.

1) PST #8 - Industry Project: Corporate-Wide Software Quality Measurement Programme
2) PSA #5 - Head-Mounted Display: Information Design
3) WLG #5 - Datalogging And Web Display Of PV Array Data
4) MKS #8 - Implement A Personal PBX Using Asterisk@Home
5) PST #5 - Industry Project: Model-Driven Approaches (MDA) To SE
6) PST #7 - Data I/O In High-Performance Computing using netCDF
7) WLG #2 - Wind Turbine Software Update

Thursday, February 02, 2006

Configure Network On Virtual PC 2004

Virtual PC 2004 with SP1 has replaced virtual switch. What it means is your VPC Guest will no longer have network connectivity in the virtual sense. What Microsoft wants you to do is have a physical NIC for each VPC Guest and VPC 2004 binds the VPC Guest to the physical NIC. The physical network card can then get an IP address from the DHCP server or Domain Controller or whatever.

This way, as far as the rest of your network is concerned, your VPC Guest is just another server on the network.

But the question is, what if you don't have multiple network card and all you have is one NIC used by your VPC host machine? The answer it seems is quite simple but took me a while to figure it out.

You install a virtual NIC on your host called Microsoft Loopback Adapter and assign your VPC Guest to use that as its NIC. Then you enable ICS (Internet Connection Sharing) on you host physical NIC. This way, the Microsoft Loopback Adapter will use the physical NIC as a gateway.

Below are the steps I took:

The directions on how to install the Microsoft Loopback Adapter under Windows XP are as follows:

1) On the host operating system go to 'Control Panel'
2) Go to 'Add Hardware'
3) In the 'Add Hardware' wizard, click 'Next'
4) When the 'Is the hardware connected?' page appears, select 'Yes, I have already connected the hardware', and then click 'Next'
5) In the 'Installed hardware' list, select 'Add a new hardware device' and then click 'Next'
6) In the 'What do you want the wizard to do?' list, select 'Install the hardware that I manually select from a list (Advanced)', and then click 'Next'
7) In the 'Common hardware types' list, click 'Network adapters', and then click 'Next'
8) In 'Manufacturer' list, select 'Microsoft'
9) In the 'Network Adapter' list, select 'Microsoft Loopback Adapter', and then click 'Next' twice
10) In the 'Completing the Add Hardware Wizard' page, click 'Finish'

11) Once you have done this you will then need to enable Internet Connection Sharing (ICS). The catch here is that you need to enable ICS on the network interface that you want to use to access the Internet - not the Microsoft Loopback Adapter:

12) On the host operating system go to 'Control Panel'
13) Go to 'Network Connections'
14) Right click on the network connection that you use for Internet connectivity and select 'Properties'
15) Click on the 'Advanced' tab
16) Check the option to 'Allow other network users to connect through this computer's Internet connection'
17) If you have multiple network adapters you will need to also specify that you are sharing the Internet connection with the Microsoft Loopback Adapter.
18) Click 'OK'

A couple of things to know at this stage:

Under Windows XP this will cause your Microsoft Loopback Adapter to be hard configured to use '192.168.0.1'. This is problematic if your external network is configured to use the 192.168.0.xxx subnet - but unfortunately there is nothing that you can do about this except to change your physical network settings (I have moved my physical home network to 192.168.1.xxx for exactly this reason).

Under Windows Server 2003 it is possible to change the IP address and subnet used on the Microsoft Loopback Adapter when ICS is enabled.

ICS provides DHCP services as well - so virtual machines connected to the Microsoft Loopback Adapter do not need to have static IP addresses configured.

Wednesday, February 01, 2006

Asterisk@Home - Oh The Genius Of It!

I've been reading up on Asterisk@Home lately. This year, I've to do my honors engineering thesis in order to graduate, but first I've got to get one of my professors agree to supervise my thesis. Its much easier to get their agreement if the topic is in one of their area of expertise or interest.

I've always dreamed of doing something different, something exceptional with my thesis, like build a better satellite navigational system or something. But then I found out my thesis becomes the property of the university once I complete it. No point trying to find the cure for cancer for someone else, so to speak.

One more thing I've realized is I really don't need a university to back my research. I can build something in my own home on my own time. Thats one good thing about Technology. Its such a commodity that you don't need a univeristy or major corporation to back your research as opposed to other areas like Physics, Chemistry or Medicine. Any guy in his garage can build the next Google, Dell or Microsoft.

Anyway, getting back to my story, one of the professors put up an idea on the course website to build an advanced application that uses Asterisk@Home. By this, he means he wants more than just configure Asterisk@Home. He wants us to come up with an idea to build a hardware or software that will use Asterisk@Home. I think I may choose this as my thesis. VOIP is a hot topic, plus the topic is already pre-approved by the professor AND it gives me enough freedom to do what I want as long as it uses Asterisk@Home somewhere.

One of my idea is to build a Security Alert System. Basically its an application that will monitor webcams around the house by means of video conferencing. When it notices anything (using MIT MARS PathFinder technology), it will send out an alarm by placing a VOIP call to you or the police. The video of couse will be recorded.

What I find most interesting about Asterisk@Home is the genius of it. I'm not talking about the PBX or VOIP. That technology's been available since before 2000. But what the software achieves. Digium initially build PCI cards to connect PSTN trunk lines to PC. There was no market for these cards since other VOIP PBX products were available from companies such as CISCO and Seimens.

So they wrote Asterisk@Home which natively supports their card and released it to the open source community who then ran with it. Asterisk@Home doesn't need Digium card to run, but buying one will let the owner take full advantage of the capabilities of Asterisk@Home by connecting it to phone lines. Digium simply created an artificial demand for their product by Asterisk@Home. Oh, the genius of it.

Tuesday, January 31, 2006

1GB RAM Finally Arrived in the Mail

The 1GB RAM finally arrived in the mail today. Installed it in less than a minute. There wasn't any noticible difference in speed up (had 368MB before), but pagings down to nil. Next, gonna install Virtual PC 2004, Oracle 10g on Linux and Asterisk@Home.

Tuesday, January 17, 2006

Kensington Repackaged Hynix RAM

Just bought two Hynix 512 DDR2700 SODIMM 333MHz RAM on ebay for AU$38 each, totaling AU$120 (incl. shipping/insurance). Talk about cheap.

Interesting thing about the RAM. The seller was selling the same spec RAM, one from Hynix for AU$38, and other from Kensington for AU$53. I heard of Kensington before, so I presume Kensington cost more because its better. But on zooming into the auction photo, the Kensington RAM is marked Hynix on the chip. What The?!?!?.

After some Googling, here's what I found. There are 4 major RAM manufacturers - Hynix (formarly Hyundai Electronics), Samsung, Infineon, and Micron. All other RAM manufacturer are not manufacturers. They buy their RAM from one of above 4, slap their sticker on it before putting it in a nice box, and sell it for twice the price. Why those bloody pirates!@#$%

Still I was doubtful. Maybe the Kensington's better because they test before packaging when a thought hit me. My laptop's Dell, which means Dell will go to the source to buy their parts. I opened the bottom panel covering the laptop's RAM and lo behold... it's Hynix!

So I got Hynix instead of the repackaged Hynix.

Sunday, January 15, 2006

Tomcat5 VS Jetty6

Since I've installed CruiseControl, I've been viewing my Continuous Integration report from CruiseControl using the bundled Jetty6 server.

Today, I replaced Jetty6 with Tomcat 5.5.12 and its fast as hell. What The!?!?! I expected it to be slower. Jetty6 is supposed to be a fast, light-weight servelet container, or so the author claims. If Tomcat runs the same thing Jetty6 ran faster, how can it be fast and light-weight???

Good thing of testing open-source on a PIII-600MHz with 64MB RAM is everything is so not blindingly fast that I get the feel of the application's performance just by listening to the server churn underneath my bed.

Lesson Learned: Never take the word of some low-life open source developer at face value again without independently verifying it.

Wednesday, January 11, 2006

CruiseControl 2.3.1

I've been trying to install CruiseControl 2.3.1 (Continuous Integration Server) on my Debian server. Everytime I try to compile CruiseControl, I keep getting the same error message "java exception NoClassDefFound: com.twmacinta.util.MD5OutputStream".

Google was no help. I went through the source code, but everything looked fine. Fast-md5.jar which contains the com.twmacinta.util.MD5OutputStream class was where it should be. Even checked if the classpath was called correctly. Nothing was wrong.

After several retries, I finally found the source of the problem - manifest.mf. The manifest.mf is used by ANT Build script to build the final cruisecontrol.jar file. The manifest.mf lists all the external libraries to be included in cruisecontrol.jar and it was missing Fast-md5.jar, hence it doesn't make a difference even if you include it in the classpath.

So edited the file to include Fast-md5.jar and everything works fine.

UPDATE: This has been corrected in the CVS repository of cruisecontrol and awaiting release with next version. You can download just that file from the CVS if you aren't keen on editing source code.

Friday, January 06, 2006

Snippet://Linux/Command/Summary

System
uname -a
cat /proc/cpuinfo
cat /var/log/messages

Network
ifconfig
arp
arp -d entry : Clear cache
ping -a ip
echo atdt3333333 > /dev/ttyS1 : Send modem command to COM1. Dials '3333333'

Sunday, January 01, 2006

New Year - 2006

Every year on new years' eve, I tend to look back in my life and compare what I've accomplished. The list is always long but undistinguished (according to me atleast).

Looking back, my mind began to wander all the way back to when I was 5 years. One fine summer day, my cousin took me for a walk in the park. After hours or so, we sat down by the river bank to take a rest when we noticed an artist painting on the other side of the river. We went across the bridge to see him paint and guess what we found... He was painting the part of the river bank where we were sitting and since we were also sitting there, he had painted us in too.

WOW... there's a painting out there in the world with me in it. I wonder if I'll ever come across that painting again. I wish I knew the name of the painter, so I could look it up. Oh well.