Posts

Installing FANN on Java project and NativeLibrary.loadLibrary problems with 32bit/64bit

If you try to install FANN  and get it working with a Java project you might run into a few problems. The whole process is explained on the fannj (the Java binding) project's wiki but not in great detail. Installing Fannj Get fannj Store it somewhere and add the jar to your project. Get FANN Extract it somewhere. Set up the DLL by either: copying the fannfloat.dll to System32, or adding the following line before you try to use FANN:  System.setProperty("jna.library.path", [fannfloat.dll dir path]); Solutions to common issues No Java Native "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Platform" Solution : Download the JNA and add the jar to your project. Can' find the FANN library Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'fannfloat': The specified module could not be found. Solution : Add debugging code (or better yet: use a debugger) after y...

Setting up Grails project on Oracle XE database

If you have some code already working on another database, say Postgres, and you want to set it up on Oracle XE database, there are some things to consider. You have to change the application data source (conf/DataSource.groovy) and move the Oracle jdbc driver to /lib - all that is explained pretty well here . Basically the result will be something like this: You might have some troubles with the url, here is a little explanation: I'm running the XE database on my local host, hence the host is: 127.0.0.1. 1521 is the default database listener port for Oracle XE XE is the default SID for Oracle XE Oracle XE and port setup While we are talking about ports. The default http interface port for Oracle XE management through APEX is 8080 and it might be in collision with other software you are running, like our grails app. You can read on here to find out the way to check default ports and those set on your configuration and also how to change them. Oracle XE and reserve...

Android Activity.managedQuery selection and selectionArgs arguments

Most of the examples of managedQuery don't use the selection and selectionArgs arguments, others are pretty simple like : Cursor simple(String id) { return managedQuery(getIntent().getData(), PROJECTION, "id = " + id, null, DEFAULT_SORT_ORDER); } or Cursor simple(String id) { return managedQuery(getIntent().getData(), PROJECTION, "id = ?", new String [] ={id}, DEFAULT_SORT_ORDER); } Both of the above do exacly the same thing. The '?'s are the elements in the array in order they are placed. [ Resource ] I was working on a piece of code that stored IDs in SharedPreferences and then loaded the elements with those IDs into a ListView from a ContentProvider. Basically I was trying to get that : WHERE id IN ( id1, id2, id3, id4,...) So the selection argument looked like that : "id IN ( ? " +  [",? "] + " )" and the selection args stored the ID of elements I wanted to load. SharedPreferences data = getSharedPref...

Android Virtual Machine and non-ASCII characters the path

Image
I have found a job ! =) For a month (and hopefully more) I'll be working at Espeo Software. I've started last Wednesday and I've really enjoyed it so far. Currently I'm working on an android app. During its developement I've encountered a bug when trying to launch the AVM on Windows with a profile containing the letter 'Ł'. This is the message I got : ERROR: no search paths found in this AVD's configuration. Weird, the AVD's config.ini file is malformed. Try re-creating it. It appears that while the sdk can be in a folder with such a path that contains non-ASCII character the emulator does not like it. Specifically to .android/avd which on default is stored in your windows user folder. The solution is to add a local user/system variable ANDROID_SDK_HOME with the path to a place you want .android to be. For example ANDROID_SDK_HOME=C:\AndroidDev. You might have to restart your Eclipse or other IDE after doing that. But that fixed it...