Monthly Archives: August 2009

Beez

Phantome.org template vote-off?

So: I’m working on the design and content for Phantome.org, which is apparently what a lot of you guys are going to be using for Phage-related work. In the interest of making the page “have cool stuff” and “look cool” and generally “be cool, and stuff.” I’m putting it to the vote: what do you want phantome.org to look like? Read more for details and stuff!

 

Continue reading

SEED Web services using Java in Eclipse

Here’s how to use SEED Web services in Eclipse:

You’ll likely need these plug-ins for Eclipse:

  • wsdl4j Download this, unzip, and copy the whole directory into your eclipse plugins directory.
  • axis.jar
  • org.apache.commons-discovery.jar
  • javax.wsdl.jar
  • jaxrpc.jar
  • org.apache.commons.logging
  • saaj.jar

Once you have these set up, create a Java project. Choose the folder, and select

  • New -> Other
  • Web Service Client

Enter the URL in the box. Note that it should provide a yellow warning triangle (which you can ignore). Click next, and then finish, and you will get the WSDL parsed and included into your project as a gov.anl.mcs.bioseed.* diirectory if you use this URL (its better than the one above):

http://bioseed.mcs.anl.gov/~redwards/FIG/wsdl_seed.cgi

Finally, import that in your code.

Take the jump to see example code.

 

 

Continue reading

Mobile Metagenomics & Concurrency

Ladies and Gentlemen, we have concurrency! By that, I mean that my test application for MM with Käppler’s interface seems to be working 100% as expected. All that I need to do now is patch the concepts from my proof-of-concept into real MM. I’m going to do my best to get that done between today and tomorrow, and hopefully have a video made by mid-next week.

Things are going to be a little crazy once the semester starts, I’d imagine, but I’m going to try to keep up with MM. I’d like to be able to keep improving on it through the semester, potentially adding things like the Notifications that Daniel found for me. Rob and I have also talked about working up some cool ideas for the hierarchy views, which is particularly exciting!

Stay tuned for a new MM video which should be dropping by the end of next week!

Android Update Grab Bag

I thought I’d post a few miscellaneous updates now that I’m back from my vacation. Multitasking MM is going well; I’ve implemented Käppler’s task interface that I discussed in my last post. There are still some issues with saving state (and null exceptions) which I need to debug, but things are looking good. With any luck, we should be able to start MM, hit the home key, and go about our business within the week.

I paid a visit to xda-developers today to see what the Android modding underground is up to. There’s a pretty cool (if slow) full Hero OS out for the Ion now. Several, actually, but I picked the one that looked the most fully-functional. Hero has a lot more ‘desktop pages’ than pure Cupcake Android does, but that was about the only really cool thing I saw before I had to uninstall it. Others have posted ‘super fast’ Hero roms, but these seem to be less fully developed as of now. This is definitely worth watching, because I’m sure these roms are only going to get better.

One definitely worthwhile find over at xda is Amon-Ra’s updated recovery image. He’s the same developer who wrote the image I previously linked in my Android rooting guide, but the new recovery is even better! The Hero roms require some very specific SD card formatting, and the recovery automates this. (It also automates returning the sd card to the stock partitioning). Finally, it allows for patching of a chosen rom.zip as opposed to every previous recovery, which forced you to rename your zip to ‘update.zip’. This one is a godsend for me because I found that to be incredibly annoying as well as confusing.

As a bonus to this grab bag of topics… I’ll throw in a cool Slashdot/Scientific American link about some exciting new hardware. Hardware that lets blind people see. With their tongues. No, I’m not kidding, give it a read!

Introducing BioJava!

To put it simply (and in the words of the creators), “BioJava is an open-source project dedicated to providing a Java framework for processing biological data”. It is a package that contains class files and objects that implement Java code to be used for a variety of things. It is a great toolbox for those in the bioinformatics field that want to use Java to do “bioinformatics stuff” on their data, like analyzing and manipulating sequences. You can check out the wiki at http://biojava.org/wiki/Main_Page if you would like to get more details about BioJava. In this post I will be explaining the installation procedure to add BioJava to the Eclipse(Ganymede) platform on Windows Vista. If you already had the experience of adding library files to Eclipse this will probably be a bit of a review for you. Also, the BioJava wiki offers an installation guide if you would like to just follow this, although it does not explain the Eclipse work that must be done but only the part to add the .jar files to your machine’s CLASSPATH. Click the Read More for install help. Continue reading

The First Rule of Programming

If I were clever, I’d say that it is “you don’t talk about programming”. Since I’m not clever, I submit that the first rule of programming is “check to see if somebody else already figured it out”. The answer is yes at least 85% of the time, and usually that person did a better job than you would if you’re rushing towards a bigger and better goal. On that note, I found this cool thing today.

I’ve been thinking over approaches for dealing with the issue of MM getting onPause()’d, and have tried my hand at a few snippets of code so far. I still rather like my approach of the downloads happening in a service while the background thread deals with sorting results. I believe that Käppler‘s approach will save me a lot of time on coding my onResume()/onPause() and generally laying out the structure. I haven’t studied his code intesively enough yet, but it already looks much more promising than what I frantically hacked up last week on the subject.

So, next time you’re about to scratch-code something difficult, talk to Uncle Google and see if some helpful person already solved the problem for you! 🙂 …and that is all from me for the week, as I’m going on vacation. Enjoy the silence!

ServiceProofOfConcept

Multitasking MM Update

So far I’ve learned some interesting things about services in Android. I also discovered that the issues with my build path (re: file manager troubles) are, well, known issues. Apparently the Android/Eclipse environment used to handle imports just fine, but nowadays it messes things up a bit when it builds .apk packages for phone deployment. A search on the Android Developers google group for ‘verify error’ turned up a detailed, though difficult for me to understand, explanation of exactly why Eclipse doesn’t build in method dependencies into apks. Either way, I’ve resolved myself to not importing methods – I’ll just cut and paste!

The AIDL tool for creating service interfaces is pretty cool, though a bit confusing to learn. From my current (limited) understanding, you can write Services which use Java primitives (and String… is that a primitive now?!), as well as any classes you write (provided you implement Parcelable!). As far as I’ve been able to discern, already-built classes like Hashtable are not in that list of usable classes. (Unless I change the class to implement parcelable, which I don’t have any real interest in doing…) Look for more on this tool when I have a better grasp of it – perhaps a future N&B article!

In my case, this unfortunately reduces me to the awkward approach of background threading for doing my JSON -> Hashtable conversion, list creation, and list sorting. Meanwhile, all http/cgi queries/uploads/downloads will be done in a background service. This approach isn’t terrible, however, as the difficult part to resume and recover would have been the download. If the background thread is interrupted, I can easily save the data and restart it when the app hits onResume(); Generally the time window on interrupting the sorting/list creation is a few seconds at most, so this will rarely come up.

The other issue I’ve been struggling with today is that for some reason my download buffer is coming up as expecting 0 bytes to download when I run it from the service. Ugh, and that took me 1+ hours to track down even with the awesome Eclipse debugger. I had sort of hacked it into the service when I finally got my initial test running, so I went back and reconstructed everything from the pure MM classes (which still work). I now have a sort of pseudo-MM set up inside of my service test app, which I’ll get to test first thing tomorrow!

Edit, 8/18/09, Morning: It helps when you give your program good values to run tests on… (peek behind the read more)

Continue reading

Android: Nuts and Bolts VII

Today we continue our lesson on Activities and Intents. In Part One of our discussion, I explained how to switch Activities within a single application. This time, we’ll discuss how to launch an Activity belonging to another application. I will use as an example some code from my work with the OpenIntents FileBrowser. Check out the Read More!

Continue reading