DISKTREE.NET // PANZERKUNST

Avatar

PANZER Schokolade

wife: light, me: noize, people: crazy

Open source updates

Latest experiments on disktrees opensource front …

  • HXMPP.console
    A themeable XMPP transfer console for HXMPPs browser targets (screenshot). Long live my eyes!
  • HXMPP.test
    Moved unit tests into a seperate repo and added some more tests.
  • HXMPP SASL-MD5
    SASL authentication using MD5 is finally working.
    Uff, the bug was in the ‘removeNullDigits’ method of the base64 decoder; arrg, who would have thought it.
  • HXMPP jingle
    Added experimental jingle/RTMP support for flash.
    Allows you to negotiate RTMP streams between jabber entities, aka: make video phone calls in the browser.
  • SCM/Jabber roboter
    A jabber bot for (presence based) source control repository update notifications. Just git support right now.
  • WebSocket server
    A simple, standalone, hx/neko websocket server, just for testing purposes.
  • Google chrome extension external JS wrapper
    ..can be found in disktrees core library.
  • Google chrome content script haXe remoting
    haXe remoting for contentscript 2 website (and vice versa) communication.
  • LOKI
    Google chrome extension to add XMPP client functionality to the browser. Pretty useless implementation up to the point where it makes some sense ~#~#~
  • hype-framework
    Generated, external haXe classes for the (AS3) hype framework.
    As far as i’ve stumbled cross the source code the framework feels pretty well organized, easy to use. Good for designers i think, but no plans to use it here right now.

ROAR version 7

A new version of ROAR, our public microblogging web app is now online.
Its a complete haXe/javascript rewrite using BOSH (no SWF bridge for the socket connection anymore).

Enjoy, http://roar.disktree.net

haXe/XMPP remoting

I have added a (async) haXe remoting remix to the HXMPP library using XMPP as transport, and created following example to test it:
[ HXR flash example ]

The app:
* embeds the same SWF twice in a HTML site
* the SWF logs into the jabber server with passed account information using SASL-MD5 authentication (password is hidden)
* creates an instance of the application
* create a haXe remoting host in context of the instance to listen for incoming calls.
* create a haXe remoting proxy in context of the instance for outgoing calls.
* on button click:
** creates random values for the next circle to add to the other entities canvas
** adds a circle to the remote entities canvas by calling a function on the proxy

A great benefit of HXR (haXe-remoting) over XMPP is that EVERY entitiy/target, also clients, can act as remote host. Which means i can call methods on a client from any other entity (a server or another client). Pretty cool for round based games and stuff.

Important thing missing is a access model for the remote host.
Currently every entity is allowed to call methods.
(Workaround would be be to add a IQ/HXR filter to block remaing packet collectors)

Source code of the app:
http://paste.disktree.net/82

99 bottles of beer

Here is my haXe submission to the 99 bottles of beer song collection.
( The website holds a collection of the song ‘99 bottles of beer’ in 1311! programming languages. )
I got annoyed of a comment on the previous haXe version claiming that its twice as long as the COBOL version. So i thought it can be done better/shorter.

It builds the complete song/string before output, so i was able to do some performance measurements:

Run program 100 times:
neko: 0m0.618s
cpp: 0m1.106s
php: 0m2.292s
js (rhino): 0m41.954s

Run 1000 times in a loop (internal):
flash-standalone(10.0.32.18): 0m0.277s
flash-plugin(10.0.32.18,firefox3.5.5): 0m0.294s
php: 0m0.291s
js (rhino): 0m0.474s
neko: 0m0.529s
cpp: 0m8.793s

Web based chat for coders

I’ve started to write a web based multiuser chat, intended to get used mainly by developers. Nothing massiv so far. Last feature i’ve just added: syntax highlight code in serveral languages, which might come in handy.

Give it a try

EDIT:
* Make sure your firewall does not block ports 843, 5222.
* User a HTML5/CSS3 enabled browser.

Apache/Openfire BOSH setup

Since HXMPP supports BOSH connections (flash/js) it’s time to write a little setup instruction….
In my (local) case for apache2/openfire 3.6.4 on ubuntu 9.04.
What has to be done is to be able to connect your client to the BOSH adress of your jabber server. Default on openfire is http://localhost:7070/http-bind/

Your apache server doesn’t know about your jabber server, so you have to setup a proxy to forward requests:
http://localhost/jabber/ > http://localhost:7070/http-bind/

Here we go:

#Activate the mod_proxy apache module if required
sudo ln /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled

#Add following line to proxy.load for loading the module
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

#Add the proxy directive to the host settings in your http.conf
ProxyRequests Off
ProxyPass /jabber http://localhost:7070/http-bind/
ProxyPassReverse /jabber http://localhost:7070/http-bind/
ProxyPass /jabbers http://localhost:7443/http-bind/
ProxyPassReverse /jabbers http://localhost:7443/http-bind/

#Restart apache
sudo /etc/init.d/apache2 restart

Thats it!
Using HXMPP, you can now create a connection by passing in the path in the constructor, like:
var cnx = new BOSHConnection( “myjabberserver.net”, “127.0.0.1/jabber/” );

HTML5 audio/video .ogg extension quirks

While adding support for wrapping media files into the according html5 tag (audio or video) to my realtime microblogging application at roar.disktree.net i discovered a nasty situation as follows:
How to know if a file with the ‘.ogg’ extension is video rather than audio from within javascript ?

Possible workarounds to distinguish (in case of my application):

  • Read the file header serverside and save the result somewhere.
    Ok, but requires extra work.
  • Try to discover filetype from the ID3 tag.
    Not save.
  • Read the file header in flash (which is able to read data at byte level).
    Ok for files served from same domain only.

Anyhow, no solution for javascript, so it would be good to agree on:

Name audio files ‘ogg’, video files ‘.ogv’ and tell everybody to do so!

Or am i overlooking something ?

Push style microblogging

A small project i am lately working on is a microblogging service, utilizing jabber/XMPP to push new messages (sent from a jabber client) to the users browser in realtime without need of page reloading.
It uses anonymous authentication, which allows to consume it without logging into a jabber account.

haXe really unfolds its power for this project since i target 4 different platforms from one language and use the same jabber library clientside and for the commandline bot. Flash for the jabber client, JS for printing html, PHP for delivering HTML and nekoVM for the jabber bot.

Go test it:
http://roar.disktree.net

The site uses the css3 font-face feature, .. a compatible browser is needed to view the site correctly!
(displays nice in firefox3.5 and safari, shitty in opera)

rare spektral server photo

Below is one of the very rare shots of our shitty, energy unfriendly hardware, hosting the public jabber.spektral.at service, taken by zmo at the last crash/reboot some days ago (someone drilled a electric cable, no USV!).
( computer left/below runs the openfire jabber server )

THX to the 0xFF for everything !

haXe on android !

Seems to be christmas time !

haXe 2.04 released !

.. introducing 2 new awesome improvements:

OMG, haXe rules so much ;)

DJ mix on air

A fresh electro-house dj-mix of mine will be aired at the substral show on radio helsinki tonight (starting 22:00 CET).
Listen 92,6FM (graz/austria only),  internet stream or download.

Playlist:
Soulwax - Most Of The Remixes - Gravity’s Rainbow
? - Leisure - Armageddon_Edit
Soulwax - Most Of The Remixes - Lovelight
Boys Noize - Lava Lava - My Head (Para One Remix)
D.I.M. - Is You (JFK Remix)
Teenage Bad Girl - Cocotte - Cocotte
Teenage Bad Girl - Cocotte - Hands of a stranger
Justice - Waters of Nazareth (Erol Alkan’s Durrr Durrr Durrrrrr Re-Edit)
Fake Blood - Little Boots - Stuck on Repeat
Masterkrft - Goose - Bring It On (JFK)
Shadow Dancer - Landlines Original Mix
Buraka Som Sistema - Kurum (Dj Manaia Remix)
Shadow Dancer - Lower Left
Guns n Bombs - Riddle Of Steel
? - Unstoppable - Tom Wrecks Remix

Enjoy.

WeFeelFine jabber bot

I’ve created a jabber bot for the WeFeelFine API.

Bots presence:

We Feel Fine is an exploration of human emotion on a global scale.
Since August 2005, We Feel Fine has been harvesting human feelings from a large number of weblogs. Every few minutes, the system searches the world’s newly posted blog entries for occurrences of the phrases “I feel” and “I am feeling”. When it finds such a phrase, it records the full sentence, up to the period, and identifies the “feeling” expressed in that sentence (e.g. sad, happy, depressed, etc.)

You can add wefeelfine@jabber.spektral.at to your contact list and request the bot with chat (or normal type) messages like:

returnfield, returnfield,… $ option=value+option=value+…

..where the returnfields specifiy the data which should get loaded (sentence is default).
Possible returnfields are:

  • imageid
  • feeling
  • posttime
  • postdate
  • posturl
  • gender
  • born
  • country
  • state
  • city
  • lat
  • lon
  • conditions

Key-value pairs after ‘$’  specify optional settings, which are:

  • limit=0-1500 (num feelings to return)
  • feeling=a-z (specify feeling)
  • gender=0/1 (0=female,1=male)
  • conditions=1-4 (1=sunny, 2=rainy, 3=snowy, 4=cloudy)
  • counry=a-z
  • state=a-z
  • city=a-z
  • postdate=date (YYYY-MM-DD)
  • postmonth=1-12
  • postyear=0-2009

The bot will return 5 values if no ‘limit’ options is specified.
Type ‘help’, ‘fields’ or ‘options’ to display the possible request fields.

Here are some examples:

“Give me the most recent 5 sentences from vienna”:
$city=vienna

“Give me the last two sentences from people in canada who feel loved”:
$limit=2 + feeling=loved + state=canada

“Give me the last 3 sentences plus city, gender, latitude and longitude from people in paris who feel angry”:
city,gender,lat,lon $ limit=3 + city=paris + feeling = angry

HXMPP Personal Event Protocol

The next new XEP implemented by HXMPP is the Personal Eventing Protocol.

Abstract:
This specification defines semantics for using the XMPP publish-subscribe protocol to broadcast state change events associated with an instant messaging and presence account. This profile of pubsub therefore enables a standard XMPP user account to function as a virtual pubsub service, easing the discovery of syndicated data and event notifications associated with such an account.

You can communicate following information:

  • Tune: Communicate information about music to which a user is listening.
  • Mood: User moods, such as whether a person is currently happy, sad, angy, or annoyed.
  • GeoLocation: Information about the current geographical or physical location.
  • Activity: Extended presence data about user activities.

HXMPP Publish Subscribe

Today i’ve added PubSub support to our HXMPP library.
Pubsub is a notification system like web syndication (RSS, Atom, ..) for the XMPP protocol with some great advantages:

* Realtime. Unlike regular web syndication, pubsub is a pushing system.
As soon as a new item is published at a node, the service notifies all registered subscribers. This is the last hurdle (in terms of time) evolution of global information technology is overcoming by delivering information for human unrecognizeable delays (millisecondes). Unlike rss, email,.. more like global smoke signals. )

* Bandwith. New information is pushed only once.
Assume you have 50 feeds on your watchlist and every feed is about 10k in size and gets polled every 30 mins (the default configuration time in my RSS-reader), .. you end up having 1mb polled in 1h (720mb/month) mostly for /dev/null space since a lot of feeds just update in day intervals. This produces unecassery cost$ if you don’t have a flatrate connection (keyword mobile). Not to mention the extra costs for network transfer at servers (and power consumption)!

* Configuration is built into the service itself, not in the software you use for.
Publishers are able to config their service to their needs (like: manage subscription requests, cache items, not routing events to offline storage, block users,..).
Subscribers can config their subscriptions, for example: to get just the title of the published data (bandwith again!) or to set the presence types which are allowed to receive notifications.

Overall the current system (RSS stuff) is doing it completely wrong and hopefully gets dropped and replaced by pubsub like systems very soon!

Next,