Skip to main content

Posts

Visualisation of DNA

After some attention has been caought by the wonderfull Rainbow DNA project, I have decided to join the club! Here is a very simplistic, far more useless way of visualising DNA: turtle graphics. I really cannot put up a website with comlete renderings of the DNA using turtle graphics, but I uploaded two sample images to my flikr account. I wanted to find out if turtle graphics could reveal diffrent sets of patterns as those perceivable with a color plot of basepairs. Attached is source code so you can see what the program does. You can also reuse the part that proceses the contents of "gbk" files containing genome data. The code is just a hack done at night while I was waiting in a starbucks for a friend to pick me up, so if you think this code is a mess - you earned your degree, I was just curios after I found out about the rainbow dna project. Well the idea of the program is very simple: 1. Initialise the turtle to be in center of the screen 2. read the next basepair, for ...

Boyer Moore Search Algorithm

I needed to find a String in a text file, so I wrote(rather hacked) a scheme imlementation of the boyer moore string search algoritm. This is just a hack. But it is commented. What do you think? (I decided to use this blog also as my cut-paste-source from now on.) ;; searches for string using boyer moore algorithm (define (>>boyer-moore needle haystack) (define needle-len (string-length needle)) (define hs-len (string-length haystack)) (define r-needle-list (reverse (string->list needle))) ;; two tables are build ;; compute the bad character shift table ;; it contains the number of chars to skip, if a character is encountered that is not the last of the search string. ;; (this table is only used after the search cursor was replaced) (define bad-char-shift-table (let loop ((shift 0) (nlist r-needle-list) (table '())) (if (eq? nlist '()) table (if (assv (car nlist) table) (loop (+ 1 shift) (c...

on the path to enlightenment...

My (and others who I infected) reaction to playing around with erlang, scheme and common lisp, was frustration. Not because these languages are bad, but because they are so nice and fun to programm with! One could even argue, that this alone results in reduced development time and better programms, but while this is definitely true, it hides the fact, that the afore mentioned languages increase efficiency of sw development also by technical means. To provide evidence for this hypothesis is out of the scope of this document, please look for yourself, there's plenty of good material about common lisp, scheme and erlang on the web, there are even life lisp coding videos on google video! I recently bought the new erlang book. It is great and I would recommend it without hesitation. There are also great books online that I started reading: htdp and sicp. Oh and not to forget to mention "little schemers" of wich the chapter about the Y-combinator is online ...(yeahh nice!) Now...

Blub Paradox

Ich habe da einen interessanten Artikel ueber das Blub Paradoxon gefunden. Jenes besagt, das fast alle Programmierer der These zustimmen, dass Programmiersprachen sich in ihrer "Macht" und Generalitaet unterscheiden, aber trotzdem nicht bereit sind einzusehen, das andere Programmierespachen besser sind als die, die sie habituell verwenden. Verdeutlicht wird das am Beispieln eines eingefleischten "Blub" Programmierers. "Blub" ist eine P.Sprache die im mittleren Bereich des Generalitaetskontinuums liegt, das sich zwischen Maschinencode an einem Ende - und Lisp am anderen Ende erstreckt. Der Blub Programmierer kennt alle Sprachen, die schwaecher als Blub sind, und fragt sich, wie man bloss ohne eine Feature "x" vernuenftig programmieren kann(- natuerlich verfuegt Blub ueber x). Ausserdem findet er, dass Blub alle Features hat die er braucht, und ihm erscheinen features in "hoeheren" Sprachen als verwirrend und unnoetig. Er denkt in Blub, u...

functional vs oo

well it's been a while and I have come to trivial but usefull conclusions lately. Once I thought functional programming was fundamentaly diffrent then oo style programming, but I actually realized how well many aspects of fp match to elements of oop; Functions are simply Objects, Closures are anonymous class, certain design patterns ressemble monads(decorator, chain of reponsibility,...) oo style programming can be seen as a restricted variation of functional programming. That matters because the key aspects of oop is encapsulation and information hiding. This can easyly be achieved in fp through the use of closures and the fact that functions can be treated like any other data. In oop very explicit notations usually exists, wich couple certain functions to certain data through the notion of objects. Both, to increase readability of complex programms, and to lighten the restrictions that come with encapsulation, an explicit notion of inheritance is used. While all this seems pretty...

Recent Comparison of jMock 1.1 and EasyMock 2.2

My Colleges and me are in the process of figureing out wich mock frameworks to use. One of my colleges has experiences with jMock and I have used diffrent versions of easymock. We wanted a detailed comparison to help us decide what the strengths and weaknesses are of the diffrent Mockframeworks. During a web search we discovered this comparison between jMock and Easymock. Although, regarding the authors background not necessarily, but to me most likely, this comparison of Jmock to an unspecified version of Easymock is biased towards jMock. Many diffrences/disadvantages in this comparison are obsoleted by more recent versions of Easymock, and speculating on the version used in favour of the author would imho result in 1.3 wich dates way back to 2005. The desription of the link to the jMock project on the easymock project page, states that jMock opposed to easymock uses another approach to define expectations that results in more flexibility to set expectations (you may specify almost e...

Future of Webdevelopment

The longterm future in Webdevelopment is for sure associated with fading boundaries between systems that provide a service wich incorporates distributed knowledge to form new knowledge, wich it distributes, probably only to one client in a secure fashion. These boundaries are hard boundaries in terms of possible incompatibilities between interacting systems in heterogenous environment. We are confronted with securtiy issues, incompatibilies in protocol interpretations and service metadata propagation for automatic wiring of resources as opposed to hand crafted wiring as i.e. done with hyperlinks between dynamic system with a proprietary but similar structure, we are confronted wich diffrences on many layers of abstraction and orthogonal technical aspects like the necessesity to transform data not only to diffrent semiotic representationens but also to devices with diffrent availibility and diffrent means of human interaction. As diversity greatly increases, the call for unification and...

Back again

After a lot of meditation over efficient programming styles, some new ideas finally condensed in my defected mind: always underestimated is the emotional aspect of coding, in a team environment one must be able to critisize and be critizised; also bad code pisses me of so much, that it pulls down my overall productivity test driven development saves time, most of the time clear structure and good documentation helps, because maintainance will be nicer (see 1.) usefull integration testing is a far away dream, never to be reached in a pure XP manner including acceptance tests. jira is cool - combined with good ole paper on the wall does best. customer requests - the customer(or any other person not a freak) will not put sufficient details for a bug or a feature request into the bugtracker or be helplessly faced with a complex and flexible task of specifeing an issue, here improvements to the GUI to reduce complexity by providing more project specific defaults would be nice) wikis are use...

Open and closed Source voting

In several countries voices are raised against the use of voting computers. The latest objection was raised by the CCC in germany. According to security analysis, voting machines are insecure, and allow for untracable manipulation of voting results and voter privacy. The software can be exchanged and votes could be manipulated without any traces. The systems used for voting in Germany are very similar to those in the Nederlands. Similar objects were raised before in this country. Andy Müller Maguhn wrote: Die Bauartzulassung der Nedap-Wahlcomputer ist nach den nunmehr vorliegenden Forschungsresultaten hinfällig. Das Bundesinnenministerium muss daher die Zulassung entsprechend § 3 Absatz 3 der Bundeswahlgeräteverordnung widerrufen It does not surprise that similar story are percepted in the USA, where some rumour around the company "Diebold Election Systems" raised, after a group of college students found some memos about the poor security of the system from developers of this...

Java Locking

Here are some nice Articles about Double checked locking, the singleton pattern and the friendly comepetition between people doing VM level locking (aka Synchronized) and Java locking (1.5 Reentrant locks) Double Checked Locking 1 Double Checked Locking 2 Why is ReentrantLock faster than synchronized ?

AntiPattern: AbstractionInversion

After trying to understand the AbstractionInversion antipattern, I wonder if this pattern is really a unique pattern and not actually more like a combination of other, more abstract AntiPatterns. Is AbstractionInversion a special case of code duplication, where a dependend class not only duplicates effort, but also escapes its level in a stack of abstracness layers inside an application? It seems to be common to most examples I have read so far, that AbstractionInversion occurs in conjunction with code/concept duplication in two dependent modules with diffrent levels of abstraction. To explain my thought I will rely on the ADA RendezVous example mentioned here. If i.e. a mutex is implemented by using the RendezVous concept, a mutex concept is actually implemented by using something at least as complex as a mutex, and code is likely duplicated. Furthermore the one-class-one responsibility rule seems violated in the above example, as the abstraction to the gory details of the model re...

The purpose of the MOCK

In response to a much nicer blog entry, that can be found here . There are actually several distinct "tests" that make up usual unit tests, among them two that really do stand out: one kind of testing to test method flows, one to test some sort of computation. Mock objects are for the purpose of testing method flows. A method flow is a series of message transmissions to dependent objects. The control flow logic inside the method(the ifs and whiles) will alter the flow in repsonse to the parameters of the method call parameters passed by calling the method under test, depending on the state of the object that contains the method under test and the return values of the external method calls(aka responses to the messages sent). There should be one test method for every branch of an if statement, and usuale some sort of mock control objects in the mock framework will handle loop checking. BTW: I partly use message transmission instead of method invocation to include other kind...

Free Programming Books

I stumbled over some not so common class of free programming books: Although these books are not the most recent spiffy Ajax/Java books, the are worth reading: A nice book about Mozilla programming Some Free Smalltalk books(yes smalltalk ain't dead yet)

Maven Changelog plugin

I tried to use the maven changelog plugin, as described here but maven complained that it could not find the plugin! That was due to the fact this plugin is not yet stable, this wasnt mentioned anywhere I looked. To enable the plugin you must first add the apache maven snapshot repository, read this site to find out how.

AntiPatterns

I just realized some nice Articles in the English and German wikipedia about anti patterns . I was well aware of the existence of software engineering related anti patterns, but I read about two other categories of anti patterns, well explained in the afore mentioned articles: organizational&project management anti-patterns and Meta-(anti)-Patterns I found it both enlightening and shocking to learn about these patterns. Nevertheless the most funniest were IMHO: Programmer Experience Clumping Fear of success Management by numbers Single head of knowledge Sources: Programmer Experience Clumping source German Wiki Article: AntiPattern English Article: AntiPattern