Vincent Cheung

Vincent Cheung's Blog


« Newer Posts Home Older Posts »

Saturday, May 29, 2004

Excelsior Jet: Java -> Native Code Compiiler

Oh, I forgot to mention about the compiler that I use with my Java programs. Yes, Java is slower than C/C++/C#/Assembly/etc, but you can compile the bytecode to native code and the program magically runs faster!

I've been using Excelsior Jet since my undergrad thesis. It's free for personal and educational use. It works great. It works directly from the bytecode, so if you can compile your Java code, you can compile your Java code to native code.

I found that it tends to speed things up I think 2 - 4 times, which is nice when your program takes up to a couple hours to run.

Edit (June 7, 2004): Java JRE 1.4.2 has a HotSpot Compiler that does some native code compilation before running (esp. using "java -server"). I haven't done a speed test between the two, but it seems to narrow the gap between "regular" Java execution and with Excelsior Jet.

AND dammit, not OR!

Stupid && vs ||.....

It messed up my "inpainting" program, so I was ignoring vast amounts of the image / video in learning the epitome, rather than just ignoring a small patch.

I'm currently running code on 3 computers.....this is a PIV 3 GHz (my home computer), my computer at school's a PIV 3.2 GHz, and I'm also using a computer in the PSI lab room that's free and that's a PIV 2.4 GHz :p. My computer "only" has 512 MB of RAM, while my computer at school has 2 GB! and the extra computer in the lab room has 1 GB :).

I'm currently at home and I remotely access the other computers to run my program on them (I'm using Java, cuz it's faster than Matlab). I'm using Remote Administrator to do the remote accessing. I like the program. Plus, it's the only one that you can (easily) use at school to access computers remotely cuz they only open up that port. Actually, there's something weird with the extra computer in the lab cuz I can't get to it with radmin, so what I actually do is remotely access my computer at school, then use Window XP's built-in remote desktop software, which is pretty slick. It even converts resolution, so you don't get funky scrolling / shrunken windows. Too bad the clusters at school don't have Java on them, otherwise I'd make use of them.

I'm frantically trying to get some better results right now, cuz the NIPS deadline is in a week!

Friday, May 21, 2004

Batch Image Processing

I realized that I never finished the story behind batch image processing...

I found out that you can do this in Photoshop! You have to first record the action that you want, then you can run that action in a batch process. I haven't played with all the settings yet, but since you can record an action with the full power of Photoshop, it's much more powerful than the stand-alone applications, but has more of a learning curve for such a simple thing as resizing a bunch of images.

On a second note, I now have titles for my blog entries!

Wednesday, May 19, 2004

I'm all moved into my new apartment now (moved everything on the 7th), but just got DSL from Bell Sympatico on Monday (17th).

I was gettin' some crazy speeds! Downloading off BitTorrent at 275 kB/s! I downloaded Avril Lavigne's new album in just a few minutes, same with a few episodes that I missed, i.e. Angel, 24, last 5 min. of the series finale of Friends.

I'm quite impressed. Bell recently upgraded the DSL from 1Mbps to 3 :D. Back in Winnipeg, I never got over 150 kB/s. That was after it was upgraded. Prior to that I was getting no more than 80. Before that, I was on dial-up and got like 4-5 kB/s :p.

I was on dial-up between the 7th and 17th....used quite a number of hours, like close to 20 hours :p.

My phone was up on the 8th and same with cable, but Internet took a while. Plus, they delivered the package on a Friday evening and didn't even leave a message telling me they came. I got the tracking number from Bell and found that it was at Shopper's and picked it up on Monday...

Anyways, gotta go.
Ack....I got caught by the floating point vs integer division....

I was doing division, but forgot to typecast to double so that I didn't get truncation:
numTime = (int)Math.ceil((double)(x.length - patchSize[p][0]) / displacement[0]) + 1;

Sunday, May 02, 2004

Btw, I'm using eDonkey to get the key / keygen cuz I couldn't find a torrent file for it :p
Batch Image Resizing

Ever want to take your digital pictures and put them on the web or send them through e-mail? Well, you've probably wanted to resize them cuz they're just too big right from the camera. You want really good quality for permanent keeping of the pictures so you can print them out if you want, but you usually just want viewable quality when e-mailing or posting onto web pages. It's a pretty big pain in the ass to have to manually resize each picture. I've been looking for programs to do this for a while and previously have been using this PictureTray program which was pretty limited in its capabilities.

I just found this new program that's much more powerful. It's called ReaConverter. I tried it out a bit and it's pretty easy to use. In terms of resizing, you can resize by percentage or set maximum height / width in pixels. It has lots of options, even one that lets you keep the original file date of the changed image (I'm a big fan of date stamps). You can even save the scripts you make. It also supports a number of image formats. The only thing is that it's shareware.....I'm waiting for eMule to download a key / keygen :p.

Saturday, May 01, 2004

Firefox Tabs. (going to emphasize the titles from now on)

Finally figured it out! Holding ctrl while left-clicking a link in Firefox opens up the page in a new tab in the background, while holding ctrl-shift while left clicking opens up the page in a new active tab (i.e. shows you the page). Finally, holding shift while left clicking opens up in a new window.

I couldn't figure out how to open a new tab in the background for the last few days :p. The problem was that I was used to Opera's shortcut keys and was pressing too many buttons :p.
Cool! Firefox lets you have multiple home pages! So now when I open Firefox, it opens up Google news and Slashdot at the same time (multiple tabs)! The only weird thing is that sometimes you just want it blank and instead of getting the home page open, you get two :s. Also, when you press the "home" key, it pops open a second tab, even if you're at the homepages, eh....

Happy Six Month! (to me and Helen.....dating, not marriage)
« Newer Posts Home Older Posts »