Hier mal wieder ein lustiges Video für die JavaZone!
(via Bilyana)
... Tech / Arts / 'n' / Stuff ...
Hier mal wieder ein lustiges Video für die JavaZone!
Nachdem ja neulich eine Lücke in php bekannt wurde, durch die es Probleme beim Parsen von Dezimalzahlen geben kann, wird jetzt bekannt, dass ein ähnliches Problem auch bei Java existiert.
Besonders interessant dabei: Nicht nur die Runtime ist betroffenen, sondern auch der Compiler.
Näheres unter: Java Hangs When Converting 2.2250738585072012e-308 - Exploring Binary
(via Fefe)
This little issue has been nagging me for a while, this is why I post it here hoping it will help others as well.
So if you want to
- upload images to your own (or somebody else's) MediaWiki
and you
- want to do it using java
and
- you happen to use the Java Wiki Bot Framework (aka jwbf)
then this one is for you:
String localPathToFile = "/home/klausbert/tmp/myTestImage.jpg";
String urlToWiki = "http://mydoma.in/wiki/";
String wikiUser = "klausbert";
String wikiPassword = "klausbertsPassword";
String descriptionText = "Some text to describe the image";
MediaWikiBot mwb = new MediaWikiBot(urlToWiki);
mwb.login(wikiUser, wikiPassword);
SimpleFile file = new SimpleFile(localPathToFile);
file.addText(descriptionText);
mwb.performAction(new FileUpload(file, mwb));
Almost two months ago I wrote a first post about TweetMountain. Back then I only had a faint idea of what I wanted to do and what it could look like. Now - several weeks later - the idea still is the same but the look and a lot of technical details have changed. This post will summarize what has changed since then.
Before
AfterI am using twitter now for quite a while. It has been a never ending source of inspiration and a great tool to implement and communicate some of my ideas. In the last few days I somehow realized that there are times in which the output of my twitter timeline just gets "somehow" overwhelming.
In the last view months I also started to dig a little into a programming language called processing (see processing.org). It is basically Java tweaked in a way that allows easy access to all graphic routines. Surfing thru the examples on OpenProcessing.org (a site built to share and exchange processing projects) I stumbled upon this cool sketch by antiplastik. I shows how simple physics and the use of OpenGL are in processing. This is a screen shot of the sketch in action:
Both inputs (the twitter overflow and the stacked boxes by antiplastik) fermented in my backbrain for a while till they came together in a small processing project I call TwitterMountain:
It uses little boxes that fall from the ceiling to create a pile of letters. The input is taken from my twitter timeline tweet by tweet, split into little boxes/letters and dropped onto the pile. Every now and the letters are lost and their boxes get deleted, but as twitter keeps on generating output the pile never vanishes.
My first implementation looked like this image above. The physics where there and I got the letters in the image. Twitter was connected and kept sending input.
Today I reworked it a little. First of all I added some limitations to box creation so the pile never fills my sketch completely. Secondly I created a nice sprite map that I can use as textures for the blocks. This way now the letters rotate correctly with their boxes.
So for now the TweetMountain is running and running, flooding my screen with an endless stream of tweets and letters.
There is some work left to do:
- clean code, write comments, use logging (gna gna gna... you know the routine)
- there seems to be a newer (and faster) version of jbox2d that I should check out (jbox2d is the library that does all the physics simulation in the background)
- build an Applet that can by used by everybody to watch his own twitter timeline
Maybe I even come up with some more ideas to put into the algorithm as well... I will keep you up to date with new versions.
Heute gab es am FZI einen "Lightning Talk" zum Thema "Groovy on Grails" von
Raphael Volz. Hier ein "Live-Mitschrieb" von der Session, also eher knapp gehalten und nur wirklich verständlich, wenn man die Folien dazu kennt (Folien gibt es hier)
Kurz und knapp
Grails: Framework für das schnelle Bauen von Webapplikationen
Groovy: Die Sprache, auf der Grails aufbaut
Insgesamt sind das also zwei Frameworks, die auf diversen Frameworks für Java aufbauen. Die Argumentation für so ein vorgehen ist, dass man so das "Prototyping" einfacher macht. Java ist nach dieser Argumentation zwar gut, aber oft zu kompliziert, um agile Webentwicklung zu betreiben und/oder einfache Prototypen zu entwickeln.
Einführung in Groovy
Baut auf Java auf.
Einführung in Grails
Grails ist ein MVC Web-Framework, das auf Spring, Hibernate, Groovy, Ant etc. aufbaut
Als Default-Web-Server wird Jetty verwendet.
"Programing by Convetion" oder auch "Convention over configuration"
So mach ich ein Programm damit:
%> grails create-app
Domänenobjekte beschreiben
%> grails generate-all
%> grails run-app
Hinweise und Sachen, die mir nebenbei aufgefallen sind
|
|
|||