Posts tagged java
Biomolecular computers and programming
Jun 7th
I have recently handed in a report as a part of my masters/candidate in Computer Science at University of Copenhagen – “Visualizing blobs and computation in a biomolecular computation model“. It sounds very fancy and I would like to introduce the subject and my report here in hopefully a less dry way than in the report it self. (This post will be in a “anecdotal” style and will not contain citations for all the facts. The report above should be up to academic par on citations)
Biomolecular computers and computation
Biomolecular computers or “biocomputers” is an area that have been research the last 20 years. At first much hype and hope was attached that this would provide some kind of break through to overcome the limitations of normal silica-based chip computers as we know and use today – your average PC and every microchip controlled device around. This is the same hope that surrounds quantum computers – a new approach for doing currently very long computations, for example integer factorization of large prime products within feasible time. The jury is still out on the possibility of biomolecular computing to deliver on that hope/potential. Other research have also shown “niche” interest in the area of “DNA Doctor” usage of biocomputers where a “biocomputer” is implemented to interact directly with the cells in for example humans.
A biomolecular computer can be seen as a computer that ”.…use systems of biologically derived molecules, such as DNA and proteins, to perform computational calculations involving storing, retrieving, and processing data.“(From wikipedia). Why is this interesting?
First of all: Why not? Tinkering, and playing around with things is interesting IMHO: By drawing the parallel between a biocomputer and a (human) brain you can say that it is a way to learn about ways nature works.
Second of all, a biocomputer will have different properties compared to conventional computers. Some of the first explored ideas was to use DNA interactions to solve very computational hard problems (NP-complete, traveling salesman like problems, Adleman 1994). This is interesting because it is possible to have millions and millions of molecules in lab-tube and thereby allowing for massively parallel computations – compared to a conventional computer which might have 4 (or at least not millions of) cores for parallel computations.
The Blob programming model
When I contacted my supervisor about writing a project this winter I was introduced to “the blob programming model”. At that time it was mostly an article in progress. Just now it has been accepted for the CS2Bio workshop as “Programming in Biomolecular computation” in Amsterdam, June 10, 2010.
The authors, Neil Jones in particular, read lots of the articles around biomolecular computation, turing universality of the models, and formal algebras for describing molecular interactions (Like Kappa calculus and Biochemical Ground Form) but his background as a computer scientist found something missing: Where are the programs?
Lots of interesting computational properties was proven but as a programmer there is no way to write a program as we know it.
Based on that “hole” a machine language was developed and described in the article which might theoretically could be used on a biocomputer. The models was dubbed “The blob programming model” and the article can be found at http://blobvis.appspot.com/blob
My Project – Visualizations of Blob programs
Based on this article I defined a project for doing a literature review of biocomputing literature as well as visualization theory applicable to visualization of blob programs. Normal progrogramming visualizations exists and have been used for many years, but in this case there was a special angle attached to the visualizations. The blob model has a potential physical analog as it might be possible to create a “biomolecular computer” that can execute the instructions and as the instructions is formed to be somewhat like an abstract molecule or similar a visualization of the blob instruction set could/should reveal interesting properties of blob programs with regards to their physical presence.
At http://blobvis.appspot.com my report is available for download as well as the BlobVis visualization tool I developed. From there you can play around with a few simple “Blob Programs”, for example a “list append’” program and see a video of a program executing in BlobVis. As I focused on physical properties the tool uses a physical based algorithm for layouting the blob programs(Via prefuse) which allows you to drag around programs and data in a way that looks like it is immersed in water or similar. That gives an interesting effect and is fun to watch.
What I like about Unit Tests
Jan 5th
They are included with the source code, committed to SC and build along with the code pretty automatically these days!
Actually I dont really care if it’s unit tests, integration tests or any other kind of test, I just see unit tests every day as part of my work. The part I like is that it’s such an integrated part of the code.
When I do a code review, it’s not always possible to just load in the code as a project into my eclipse and run findbugs, pmd, checkstyle and eclemma.
In these cases I go straight to the included testcases to see what is being tested. I always have the (maybe naive?) faith that by looking at the test I at least get a view of the “main” function of the code parts and that way I can start to dig through the code. This has helped me likewise when trying to reuse some old code. The unit test showed me very easily how to initalize the functionality, what I need to supply, and what needed to be present (the mocked out parts).
So shame on you who don’t write unit tests! (or other kinds of directly included tests).
Eclipse setup
Apr 3rd
Image from WikipediaI work with eclipse all day, so I’ve spent some time messing around with plugins. Lots and lots of plugins.
The plugins I’ve current stablized on is:
- Maven2 plugin: http://m2eclipse.codehaus.org/ (update-site: http://m2eclipse.sonatype.org/update/)
- PMD for static analysis of java code: http://pmd.sourceforge.net/integrations.html#eclipse (update-site: http://pmd.sf.net/eclipse )
- Findbugs for static analysis of java bytecode http://findbugs.sourceforge.net/manual/eclipse.html (update-site: http://findbugs.cs.umd.edu/eclipse/)
- Checkstyle for doing code the Right Way(tm). http://eclipse-cs.sourceforge.net/ (update-site: http://eclipse-cs.sourceforge.net/update)
- EclEmma http://www.eclemma.org/ for junit codecoverage (update-site: http://update.eclemma.org/) Very nice to get a view of how much your tests cover your code. 50% should be possible right?
- SpringIDE for code completion in spring bean xml-files. Very very nice! http://springide.org/project/wiki/SpringideInstall, (Update-site: http://springide.org/updatesite)
I use the code formatter extensively as possible. It’s very nice to get these things like a gift instead of spending time on wrapping lines and formatting by hand.
When using the codeformatter you really can benefit from “Save Actions“. The most timesaving feature for me so far. My setup currently includes all checkboxes, and a stack of additional action. No more time spent inserting spaces between ) and {
Good stuff!
For my sparetime project I’m currently exploring other plugins:
- Mercurial eclipse plugin: http://www.vectrace.com/mercurialeclipse (Update-site: http://www.vectrace.com/eclipse-update/)
- new Scala plugin : http://scala.sygneca.com/tools/eclipse
The mercurial plugin isn’t quite ready yet, but it’s getting there. Things are happening, and as the mail and website for the new scala plugin suggests that plugin isn’t quite there yet.
I dont mind, it gives you that pioneering feeling
If anybody should pop by and see this list, feel free to suggest all those nifty plugins I’m missing!
Happy coding
Focus on the technology – 2
Mar 7th
So, progress is slow, and currently I’m looking into the base “architecture” of the show. I’ve been looking into different ESB’s as in:
Im pretty hooked on using SQS for queues which Mule supports out-of-the-box. On the other hand is it tempting to code it my self. But then again. Ill take ages to make it robust enough.
So currently I’m trying to choose between Mule or code-it-myself. Today I’m on the Mule side
Java and closures – YAPOJC
Nov 28th
YetAnotherPostOnJavaClosures
So, I fell over some articles with both the words closure and java in them this week.
It was this article about JavaFX closures.
Since I’ve done some of my non-mandatory classes in my stud.scient. days (like the last 4years) it kinda woke my interest.
It seems like lots of things has happend in the Java world since I last had any real interest in it (somewhere around 1½ year ago).
- Java 6 and 7.
- Scripting languages on the JVM, like Scala and Groovy. Scala looks quite interesting in my opinion.
- And all the stuff that I’ve been ignoring when coding small things in Java 1.4 SE and having fun with generics in Java 5 SE.
- Like for example J2EE, the bean concepts and Application servers and everything
- Spring
- Hibernate
- JUnit
- Test-driven-development
Maybe “fell over some articles” is a bit inaccurate. I’ve actually been trying to catch up. My main focus has been on the things I needed in my day-to-day work. That included JUnit and Unit-testing, Spring and the Application Server Enterprisy way of doing things.
Luckily I already spent some time reading up on the concept of SOA.
There is a ton of material online about all these things. Currently(as in the past year) there’s alot of talk about feature request for Java 7. Including closures. I tried to do a “quick” catchup on the subject and decided to share my findings with the world:
As far as I gather there currently exist two proposals:
- CICE – Concise Instance Creation Expressions by Josh Bloch, Doug Lea and Bob Lee
- BGGA – Gilad Bracha, Neal Gafter, James Gosling, Peter von der Ahé
and as in any other good war on the internet, it seems like we are at a point where religion is the turning point. The CICE people believes that the BGGA is “overly complex”, and will alienate users by “pushing the complexity of the language beyond the point where Joe Java can’t use the language anymore”
Another interesting twist is the fact the Neal Gafter – who I see as the current “main-man” behind BGGA, is working at Google as well as Josh Bloch and Josh Blach is the JCP representative for Google as pointed out by Ricky Clarkson (and down played by Neal Gafter).
So no real catfight there. But among the readers there’s a very Web2.0-ish involvement in the debate. Lots of evangelists on both sides. (I’m a BGGA’er myself! To me it seems like CICE is like sitting between two chairs). Among these debates and blogentries there’s lots of interesting reading (and hearing; podcasts).
Apart from the other links in this post I recommend:
- Gafter with closure examples
- Gafter with prototype for javac and a rewrite of fork/join code to use closures.
- (Actually all of Gafters blog is very interesting if you like programming language issues)
- JavaPosse podcast. (BGGA people as well)
- IBM on the debate: Java theory and practice: The closures debate
If you need even more reading try some of these googlesearches:
- Comments to Gafter and closures
- Josh Bloch and Closures
- Gilad Bracha andClosure (Actually i really like his blog all in all. Just the name and Im sold “Computational Theology”. Too bad it’s discontinued, but hey, he still writes a bit on Blogspot)
Running JMS tutorial examples in Eclipse without deploytool
Nov 9th
I’ve currently been reading up on JMS via the J2EE 1.4 tutorial. (Chapters 33 and 34). I use Eclipse J2EE.
The deploytool way of doing things annoyed me quite a bit. When I had to edit the /jms/simple/src/* code for the first example (remove the jupiter prefix used for the next example in the Connection Factories) I really wanted to use eclipse. But in Eclipse I needed to emulate all the magic that asant.bat and appclient.bat made to build the class-files and run the code. After lots and lots of browsing I found the jars I needed in my build (and run) path. I created an Application Client project for each of SimpleProducer, SimpleSyncConsumer and SimpleAsyncConsumer.
Each of these in the buildpath.
- C:\Sun\AppServer\lib\install\applications\jmsra\imqjmsra.jar
- C:\Sun\AppServer\lib\appserv-admin.jar
- C:\Sun\AppServer\lib\appserv-rt.jar
- C:\Sun\AppServer\imq\lib\imq.jar
besides from being created with the Sun Application Server 8.2 Default Configuration in the eclipse wizard. Here’s a .classpath
I also tried to emulate the deploytools .jars. To be able to create jars usable by appclient (and everything else) you need to manually fix the MANIFEST.MF. Set the Main-Class: to the right class. For examples like this for SimpleProducer:
Manifest-Version: 1.0
Main-Class: SimpleProducer
Synopsis
Mar 7th
Nu har Sune og jeg afleveret en synopsis for vores bachloropgave. Jeg havde udtrykt min interesse for et emne og pludslig fik jeg en mail om at der var en som havde lyst til at lave det samme emne. Vi mødtes, og i løbet af en efter middag fik vi afleveret en forside.
Så næsten stik imod planerne er jeg midt i at skrive bachloropgave. Vi afleverede en synopsis sidste fredag og holdt forsvar i onsdags. Spændende emne. Vi har nu en lille grammatik klar, som vi skal snakke om på torsdag. Vi har ugentlige møder så vi rigtig kan blive holdt til ilden.
