My first Android app is a simple calculator with memory that operates similar to a paper tape. I think the coolest thing is that you can use the results in the tape in subsequent calculations, just as you could use values stored in memory; but you have access to all calculations for that session. You can see a video of the app at www.atlscrog.com.
While learning the Android SDK was a challenge the experience was made a bit easier since Google chose to use Java as it's language and provides seamless Eclipse integration. BTW, this is the first time I really used Eclipse and it makes me wonder if there are any other editors left for Java.
So have a look at the app... I also expect to port the app to the browser and desktop. Looking at JavaFX for the desktop and still not sure about the browser.
Thursday, September 2, 2010
Sunday, June 6, 2010
Displaying Doubles in Java
I wrote a simple calculator app to learn the Android tool-chain.
It's been a long time since I seriously had my head in code and I was struggling with how to properly display the result of 0.02 X 0.02 (which should be 0.004).
After much dorking around I found the simplest solution is to use java.text.NumberFormat.
NumberFormat nf = new DecimalFormat("#0.#####");
String s = new String(nf.Format([my double]);
That was it. Solved all my problems.
It's been a long time since I seriously had my head in code and I was struggling with how to properly display the result of 0.02 X 0.02 (which should be 0.004).
After much dorking around I found the simplest solution is to use java.text.NumberFormat.
NumberFormat nf = new DecimalFormat("#0.#####");
String s = new String(nf.Format([my double]);
That was it. Solved all my problems.
Saturday, May 29, 2010
Access 2007 and Fuzzy String Matching with Levenshtein Distance
So I got a special project to make sense of an imperfect/dirty data set in Microsoft Access 2007.
The challenge was to match names from two different tables. One table was entered as the 'master' name table and the other was the result of importing about 100 Excel spreadsheets. The Excel spreadsheets were created by about 30 different people so names are spelled differently.
After much Google-ing of the issue I finally hit upon the Levenshtein Distance algorithm. That proved to be almost exactly what I wanted!
I simply iterated through list B for every entry in list A and saved the closest match. This worked great.
Implemented in VBA in Access 2007 it's not fast, but it processes 500x6000 rows in about four minutes on a WinXP Lenovo laptop with decent specs.
The challenge was to match names from two different tables. One table was entered as the 'master' name table and the other was the result of importing about 100 Excel spreadsheets. The Excel spreadsheets were created by about 30 different people so names are spelled differently.
After much Google-ing of the issue I finally hit upon the Levenshtein Distance algorithm. That proved to be almost exactly what I wanted!
I simply iterated through list B for every entry in list A and saved the closest match. This worked great.
Implemented in VBA in Access 2007 it's not fast, but it processes 500x6000 rows in about four minutes on a WinXP Lenovo laptop with decent specs.
Monday, May 24, 2010
Upgrade to Ubunut 10.04 Lucid Lynx
So I upgraded my desktop detailed in a earlier post. As it turns out I didn't have space allocated to "/" filesystem to do the network upgrade.(download the upgrade and run it in one step). I had to burn an ISO and then install it. Instructions can be found here.
After the upgrade everything worked fine. For some reason the Ubuntu designers put the window controls on the left side of the title bar but other than that it was smooth sailing.
The biggest challenge for me was having to enable the partner respositories to get the Sun JDK instead of openJDK and IcedTea.
All in all a great upgrade.
After the upgrade everything worked fine. For some reason the Ubuntu designers put the window controls on the left side of the title bar but other than that it was smooth sailing.
The biggest challenge for me was having to enable the partner respositories to get the Sun JDK instead of openJDK and IcedTea.
All in all a great upgrade.
Wednesday, May 12, 2010
The Minute Grill in Dublin, GA

If you're ever on GA 16 between Atlanta and Savannah, be sure to stop off at the Minute Grill in Dublin, GA for some fine burgers. They are small and square (just like Krystals) but much better :) Fresh ground beef, ketchup, mustard and a bit of hot-sauce. Lunch for two is about $12.
Sunday, May 9, 2010
Getting USB to Work with VirtualBox on Ubuntu
Like many others I had problems with VirtualBox and USB on Ubuntu. I found a great article that pointed out the steps to ensure your user account is in the VirtualBox group; but it still woudn't work.
After much reading of the documentation (RTFM) it occurred to me that Ubuntu was auto-mounting the USB device. Using the following command "scottr@deskbuntu64:~$ VBoxManage list usbhost" verfied that VirtualBox could not attach to the device because it was in use.
It took me a bit to find the following article on the Ubuntu forums that shows how to configure USB automount options.
After that USB worked with Virtual Box...
Winner, winner, chicken dinner
After much reading of the documentation (RTFM) it occurred to me that Ubuntu was auto-mounting the USB device. Using the following command "scottr@deskbuntu64:~$ VBoxManage list usbhost" verfied that VirtualBox could not attach to the device because it was in use.
It took me a bit to find the following article on the Ubuntu forums that shows how to configure USB automount options.
After that USB worked with Virtual Box...
Winner, winner, chicken dinner
Labels:
ubuntu,
usb,
virtualbox
Remote Desktop
By far the best remote desktop solution I have found to date is Nomachine NX. I have used the client from Windows XP, Vista, Win7 and Ubuntu and it works flawlessly. It has become my new standard for remote desktop.
Subscribe to:
Posts (Atom)