Posts Tagged java
How to install the 64-bit Sun Java plugin on 64-bit firefox on 64-bit Fedora Core 11 Linux (which happens to use 64 bits)
Posted by evan in Uncategorized on October 21, 2009
I’m giddy! I found this post on mozdev.org which was magical.
[evan@ehoffman ~]$ java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
[root@ehoffman plugins]# uname -a Linux ehoffman 2.6.30.8-64.fc11.x86_64 #1 SMP Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux [root@ehoffman plugins]# pwd /usr/lib64/mozilla/plugins [root@ehoffman plugins]# ln -s /usr/java/jdk1.6.0_16/jre/lib/amd64/libnpjp2.so
The main thing I was missing was that the plugin isn’t libpluginjava_oji.so, or whatever I thought it was, but libnpjp2.so. Once I created the symlink into /usr/lib64/mozilla/plugins it worked (as verified on http://www.java.com/en/download/help/testvm.xml and http://www.java.com/en/download/installed.jsp).
That’s all it takes to get the Sun Java plugin working in Firefox on Linux.
Java compound interest calculator
Posted by admin in Uncategorized on January 10, 2008
I wrote a thing to calculate compound interest and print out how much you’ve accrued after each period. It’s pretty basic but I was bored and didn’t want to do it via calculator. The code is in InterestCalculator.java, sample output is below:
Initial principal: 5000.00 Interest rate: 0.05 (4.93%) # of ann. periods: 4 Total years: 5 Annual Addition: 500.0 Starting year 1 with $5000.00 Year 1, period 1, accrued $61.62, value is now: $5061.62 Year 1, period 2, accrued $62.38, value is now: $5124.01 Year 1, period 3, accrued $63.15, value is now: $5187.16 Year 1, period 4, accrued $63.93, value is now: $5251.09 Added $500.00 for the end of year 1, total is now: 5751.09 Starting year 2 with $5751.09 Year 2, period 1, accrued $70.88, value is now: $5821.98 Year 2, period 2, accrued $71.76, value is now: $5893.73 Year 2, period 3, accrued $72.64, value is now: $5966.37 Year 2, period 4, accrued $73.54, value is now: $6039.91 Added $500.00 for the end of year 2, total is now: 6539.91 Starting year 3 with $6539.91 Year 3, period 1, accrued $80.60, value is now: $6620.51 Year 3, period 2, accrued $81.60, value is now: $6702.11 Year 3, period 3, accrued $82.60, value is now: $6784.71 Year 3, period 4, accrued $83.62, value is now: $6868.34 Added $500.00 for the end of year 3, total is now: 7368.34 Starting year 4 with $7368.34 Year 4, period 1, accrued $90.81, value is now: $7459.15 Year 4, period 2, accrued $91.93, value is now: $7551.08 Year 4, period 3, accrued $93.07, value is now: $7644.15 Year 4, period 4, accrued $94.21, value is now: $7738.37 Added $500.00 for the end of year 4, total is now: 8238.37 Starting year 5 with $8238.37 Year 5, period 1, accrued $101.54, value is now: $8339.90 Year 5, period 2, accrued $102.79, value is now: $8442.69 Year 5, period 3, accrued $104.06, value is now: $8546.75 Year 5, period 4, accrued $105.34, value is now: $8652.09 Added $500.00 for the end of year 5, total is now: 9152.09 Final value: $9152.09
Java utility to reorganize photos by date taken (via EXIF metadata)
Posted by admin in Uncategorized on March 28, 2007
I wrote a little utility to reorganize my digital camera pics based on the EXIF date-taken data stored in the pic. It’s pretty simple, I hacked it together in about an hour,
but I thought it might be worth sharing for anyone else looking to do something similar. My camera organizes stuff as it sees fit sometimes, I am particular about my directory structure. This is probably a job best left to perl, but I don’t feel like getting Perl running on my Windows box where all the pics are. Now I can finally burn all my images to DVD.
- Drew Noakes’s Metadata Extractor – this is
a required library used to do the actual reading of the exif data. - FileOrganizer.java – Abstract base class that moves
files from a source to a target directory based on criteria specified in the subclass. - JpegFileOrganizer.java – Subclass that
accepts jpeg files and generates the correct path based on the EXIF data stored
in the image’s header. So if picture pic00001.jpg was taken on August 20, 2004, and the supplied
target directory is “/pics”, the directory to which the image would be moved would be
/pics/2004/08/20/pic00001.jpg.
The main() method is in JpegFileOrganizer, its arguments are [sourceDir] [targetDir].