Posts tagged Geeky
What does CodingHorror have in common with Apache H-Base?
Feb 18th
As I was in my “Advanced data management” class today I realized that CodingHorror aka Jeff Atwood of stackoverflow fame agree quite alot with Apache H-base. Apache H-base is a column-store database system based on the Google BigTable ideas leveraging Apache Hadoop.
Jeff Atwood was is not very happy with the default “incredibly pessimistic out of the box” setup of databases in his “Deadlocked!” post. Along the same lines, the H-store people published an article[1]:
The End of an Architectural Era (It’s Time for a Complete Rewrite).
They claim that the time is up for “legacy systems” like the model used by current RDMBS’ like MySQL and SQL Server. The assumption of the H-base people that reasonates with Jeff Atwood – I believe – is:
Every effort should be made to eliminate the cost of traditional dynamic locking for concurrency control, which will also be a bottleneck.
I don’t know if it is something Jeff Atwood is aware of, and I don’t know if that is a sign that a traditional RDBMS is maybe not what he wants, but it is worth think about – IMHO.
[1]Stonebraker, M., Madden, S., Abadi, D. J., Harizopoulos, S., Hachem, N., Helland, P., 2007. The end of an architectural era: (it’s time for a complete rewrite). In: VLDB ‘07: Proceedings of the 33rd international conference on Very large data bases. VLDB Endowment, pp. 1150-1160. URL:http://portal.acm.org/citation.cfm?id=1325981 pdf – Bibtex
Logging vs. debugging
Jan 18th
It is probably no news that measurements in an experiment almost by definition affects the experiment.
This is true also for IT systems, where logging is a very used way for observing running code.
From Jeff Atwoods Coding Horror blog about a problem during the beta of stackoverflow.com:
We spent days troubleshooting these deadlocks by .. wait for it .. adding more logging! Which naturally made the problem worse and even harder to figure out.
This illustrates my point exactly. 99% of the time logging affect the system in a neglible way. But you have to keep in mind that it actually could affect the “experiment”. In this case the performance or the behavior of your program.
My job is “Production Support” in the ITIL way. IE. ensuring quality of running services with Incident Management and Problem Management. That means that for anything not related to normal operations we often need the logs.
Also in these days of powerful IDEs and remote debugging is that much logging really nescisary?
Yes it is! We are supporting an ESB developed and customized during the last 3-5years and attaching a debugger isn’t really an option.
So we are basically totally dependent on good logging for troubleshooting.
We have been dealing with a problem relating to big batches of large messages and the 2GB limit of our JVM’s. We started by initiating a project to throw some dedicated hardware after the code handing these large messages so it wouldnt affect the rest of the “stuff” running on the same application server. But unfortunately hardware acquirement and machine setup can be a slow process, and worst of all: It’s out of our hands!
So our current guru took a quick look at the code and started grabbing for some low hanging fruit:

Before ifDebugEnabled

After using if debugEnabled
It turns out that developer had used the same politic as mentioned in the stackoverflow post:
<…
DEBUG Level
- Any parameters passed into the method
…>
The parameter in this case was 1-2MB xml-data which was logged like this:
LOG.debug("Entering part 2.1 of method MyMethod with msg: "+msg.toXml());
In production only INFO and above is logged so the debug message was discarded. But the concat of 2MB data was still performed several times per message (10-12 as far as I recall). So the difference between the above to memory graphs is:
if (LOG.isDebugEnabled()){ LOG.debug("Entering part 2.1 of method MyMethod with msg: "+msg.toXml()); }(as also mentioned here: http://wordstoday.wordpress.com/2007/11/26/log4j-why-use-isdebugenabled-in-your-code/)
This should buy us some time before we can isolate this process on it’s own hardware/jvm.
The guru is currently looking into writing a xpath expression for PMD run over our giant codebase. Could be fun to see what it’ll dig up
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
Mere googlemania
Dec 2nd
Så har jeg også fået googledesktop.
Nu ejer google ca. alt hvad jeg har på diverse af mine maskiner. Det er noget af en fest!
Google desktop plugins er nu så meget sejere end yahoo-widgets. Jeg elsker de små korte beskeder man får hele tiden med updates på ens rss-feeds, emails og lign. Og TODO listen er god!
(jeg er så meget google-fanboy)
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)
Eliteprofessionel!
Nov 19th
ADVARSEL: Buzzwords og partisk indlæg!
Jeg har den store glæde at kunne præsentere mig selv som en af de få rå:
Ægte Eliteprofessionel!
ComputerWorld interview med vores administrerende direktør
At kommentarene til den tilhørende artikel ikke er helt så fine kan ikke ryste mig
Man kunne måske mene at eliteprofessionel måske er lidt meget buzzword, men det bakker faktisk meget godt op om hvordan det mærkes at arbejde hos Netcompany. Et konsulentfirma som ved at deres værdi ligger i den summerede værdi af medarbejdere.
Jeg kan kun sige at det er et dejligt sted at være, og har indtil nu været meget inspirende at være en del af “showet”.
Jeg sidder sammen med mange kolleger hos PFA og er javaudvikler i Produktions-Support. Dvs. vi holder infrastrukturproduktionen i luften. Før, under og efter nye releases med hotfixes, bugsøgning, nyudvikling og mange andre fine ord. Jeg har aldrig før prøvet at være med på så store projekter og slet ikke på så store udviklingsprojekter. Voldsomt spændende må jeg sige.
Jeg brugte selv lidt tid på research inden jeg var til samtale. At google dem og søge efter dem på diverse sites(CW, Børsen) er ok spændende:
- DIKU om administrerende direktør Carsten Gomard
- Ernst & Yong – Entrepreneur of the year
- Administrerende direktør Carsten Gomard i Søndagsavisen
- Version2’s top10 i forskellige kategorier. Ouch en lav plads i “God balance mellem arbejdsliv og privatliv”
Derudover er der jo altid netcompanys site som faktisk har meget spændende om karriere i Netcompany.
</salgstale>
Vidste du det?
Nov 13th
.
Der findes simpelthen en papegøje som er nattedyr og ikke kan flyve.
Det lyder dælme som en freaky fugl!
Den hedder en kakapo
.
.
Spørg evt. Douglas Adams
"(The kakapo boom) was like a heartbeat: a deep powerful throb that echoed through the dark ravines.It was so deep that some people will tell you that they felt it stirring in their gut before they could discern the actual sound, a sort of wump, a heavy wobble of air." - Douglas Adams, British author, 1990.
eller LiveScience om denne spændende fugl
Ikke nok med det er en freaky fugl. Efter min research igår aftes drømte jeg så om denne sære fugl. Den havde lange ben så den var på højde med et lavt voksen menneske. Der var nogen forskere der havde opdrættet sådan en fugl, så når den tog sig sammen kunne den gå rundt og ligne et menneske lidt. De havde så iført den en skjorte og givet den en mage. Det er da en vildt freaky drøm ?!
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
Min google-mania
Nov 7th
Jeg er ved at blive ret meget google-fanboy.
Jeg bruger
Udover det er Google Documents på vej sammen med at jeg flytter min mail til Google Apps
Jeg har min gmail som bookmark i min telefon, bruger ofte gmail notifier i enten firefox, eller via Yahoo Widgets eller bare googles eget program.
Jeg har selvfølgelig google som searchbar ting i min firefox, og jeg bruger “Better Gmail” pluginnet i firefox. Det er super. Derudover har jeg Gmailspace plugin i firefox bare for sjov. Indtil videre
Ja, alt i alt fylder det en del i min hverdag
EDIT: De har opdateret google så better-gmail er ikke super godt med den “nye version”. Oppe i hjørnet kan man vælge “Gammel version” og better-gmail virker igen.
Update
Nov 24th
Ja! jeg er kommet hjem fra Schweiz. For lææænge siden.
De sidste par uger var rigtig gode, selvom mange var begyndt at tage hjem. Bla. var jeg i Zürich og Luzern og se de gamle fine byer. Flot tur. Weekenden efter fik vi arrangeret to biler der kørte til Ardeche floden i frankrig
Turen hjem gik rigtig fint, og jeg var hjemme i købehavn til fødselsdag lørdag den 14. september. Derfra har tingene gåetsin slagne gang med Grafik forelæsninger og opgave.
Grafikkurset gik jo ikke så godt sidst. Denne gang gik det en del bedre. 11 fik vi for projektet, så det var virkelig virkelig dejligt at det kunne betale sig at udskyde det.

Derudover skal der jo arbejdes, og det gør jeg. Jeg har ikke valgt nogen nye fag i denne blok. Jeg kunne ikke finde på noget der kunne motivere mig, og med lidt held, hvis studienævnet snart kan sige noget, ved jeg om jeg er bachlor. Jeg overvejer kraftigt at starte på ITU til sommer og tage min kandidat der istedet for på DIKU. Jeg kan ikke finde på nogen fag som rigtigt siger mig noget på diku. Forhåbentlig på ITU, så jeg kan blive færdig med det her uddannelsesnoget.
Jeg havde fødselsdag den 15. oktober, hjemme ved mor og far, en dejlig lille ferie, på trods af en truende grafik-eksamen den 23/10.
CERN – II – Chamonix og Mt. Blanc
Jul 10th
Gruppebilede ved en gletcher
Chamonix-img_4940.jpg
Så er den første uge overstået. Togaparty og hollandskfest blev der holdt torsdag fredag. Lørdag valgte jeg at tage med 8 andre til frankrig. For foden af Mt. Blanc ligger en fransk by Chamonix, hvor vi spiste frokost, og fandt de to lejligheder vi havde lejet. Lige uden for hytten var der en sti til en gletcher på vej ned af bjergene, så vi tog straks en gåtur. Derefter var der aftensmad. Vi havde taget vores helt egen franskmand med, så Renaud havde forestået indkøb af rødvin og kød, og var hovedkok på måltidet. Fremragende vin og kød
Lejlighederne lå et lille stykke oppe af bjergsiden så vi havde perfekt udsigt fra “terassen” ned over dalen og Chamonix. På de skrå marker gik køerne rundt med klokker om halsen, så det lød meget alpeagtigt når de gik rundt.
Søndag stod vi op før kl 6, for at nå op til Aguille du Midi inden der kom for mange skyer, og inden der kom for meget kø ved kabel-banerne derop. Så kl. lidt over 8, stod vi i 2graders varme i næsten 4km’s højde. I den højde bliver jeg forpustet og svimmel af at gå tre trin på trapperne. Sikke en oplevelse at kunne mærke den tynde luft på egen krop. Man kunne uden for kabelbanestationen se folk der kravlede rundt på klipperne, sov i telt nede i sneen. Sikkert for at vænne sig til den tynde luft inden de skal ud og kravle rundt. Det var ret spæende at se folk med pigsko,ishakker. lange reb og oppakning forladede bygningen og begive sig ud i sneen. Meget facinerende.
Efter at have taget 1000billeder af Mont Blanc (som var meget tæt på Aguille du Midi) tog vi kabelbanen et niveau ned til Plan du Midi, og gik derfra på langs af bjerget hen til Mer de Glace gletcheren, ca. 2 timer, og derfra ca. 2timer ned af bjerget tilbage til Chamonix. Det var en virkelig god tur, men med meget ømme lårmuskler igår
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.
En nørds store problemer
Jan 10th
Jeg går og hygger lidt med at planlægge om hvordan og hvorledes der skal se ud i lejligheden her når jeg engang får sat lidt flere møbler ind. Glæder mig så vildt til jeg kan lave en kop kaffe btw!
Men mit store dilemma:
Skal jeg have en workstation på mit “kontor” eller bare en docking station?
Jeg har haft gang i min gamle VIA, og den laver og er sløv, så jeg synes ikke der er den fede ide i det.
I halen på ovenstående problem er der også:
Skal jeg have kontor i soveværelset eller i stuen?
Det vil sikkert være godt for min nattesøvn ikke at have TV ved sengen men det er nu meget rart. Men en rigtig stue med lidt spise plads skal man jo ikke kimse af, og der er muligvis plads til at have mit “skrivebord” i soveværelset. Tjah.
Umiddelbart er mit valg:
- Docking station
- Kontor i soveværelset
Men det kan jeg jo nå at lave om igen



Fast inverse square root
Dec 5th
Posted by svrist in English
Comments
Beyond3D(Rys) wrote an article (almost a series!) about the history of the magic fast inverse square root found in for example the quake code. With the explantions it doesn’t seem quite that much as magic. As this pdf says, its not magic at all(page2)
The history article is all about paying homage to the author(s) and finding the origin. And it really is very very slick way of doing it. The article even uses this as an example of why it’s good that games and software gets release as open source in some form.
I’m just wondering: Why isn’t there any comments in this very sleek code?
If it was me using übercool constants for nice approximations in my code I sure would hope i would comment it!