Slideshow for OpenLaszlo

Saturday, July 5th, 2008 at about 7:34 pm

Hello,

I had to create a Presentation some days ago. As we needed a little slideshow of pictures, within that presentation, I decided to create a little Sliteshow with OpenLaszlo. Maybe it’s useful for you, so you can use it under the terms of the GPL.

Here is a little Example, created with “Visualslider”:
Visualslider.swf

And this one ist quite the same, but with Slides sliding “circles”:
Visualslider_c.swf

You can click on the Slides, to navigate through them. Also you can use the cursor keys, to do the same. With the key “t” you can toggle between automatical sliding and manual sliding.

And here is the source code:
Visualslider.lzx

A little Documentation:
             <visualslider>

  • Description:
    The container view
  • Attributes:
    currentslide - (readonly) returns the selected slide
    slideduration - the time in ms for the slide-animation
    circular - boolean for circular-sliding
    timerms - the time in ms for automatical sliding
    istimerstarted - (readonly) returns a boolean whether automatical sliding is started or not
  • Methods:
    slideUp() - select next slide
    slideDown() - select previous slide
    slideTo(n) - select the nth slide
    startTimer() - start automatical sliding
    stopTimer() - stop automatical sliding

             <visualsliderview>

  • Description:
    A slider-view. Must be placed in <visualslider>
  • Attributes:
    originalwidth - the 100%-width of the view
    originalheight - the 100%-height of the view
    currentslide - (readonly) returns a boolean whether this visualsliderview is selected or not
    shadow - boolean to display a shadow under the visualsliderview
    factor - (readonly) returns a scale-factor with reference to originalwidth and originalheight (useful to scale subviews)
    slidenumber - (readonly) returns the number of the slider
  • Events:
    onstop - Fires when the animation is finished
    onstart - Fires when the animation is started

Here you can find the zipped source code of the example. This may be helpful to create your own slideshow:
Visualslider.tar

Regards,
Mario

Posted in OpenLaszlo
by sYnie

OpenLaszlo + Red5 = Voice chat

Friday, May 9th, 2008 at about 3:25 am

Hey there,

I have been working a long time with OpenLaszlo and Red5. As my commercial projects take months over moths to be developed, the last two days I just did something really basic. A small voice chat using OpenLaszlo and Red5. It’s for a freetime project and it’s planned to be integrated into Joomla. So maybe I will release this little app as a Joomla extention, later.
But now, I just want to show you, what you can do with OpenLaszlo and Red5 in a really short time:
Click here to visit the voice chat.

Features are so far:
- Voice chat
- Text chat
- User management
- Hardware selection
- Nice look and feel
- And so on …

Let me know, what you think about it. I hope I can show you the application integrated into Joomla as soon as possible.

Regards,
Mario

Posted in OpenLaszlo
by sYnie

AESCryptLz strikes back ;-)

Friday, April 4th, 2008 at about 1:21 pm

Hey,

it’s me, trying to write english again ;-)
My last post about AESCryptLz got real good feedback. As I’m trying out a lot of different encryption algorithms, there is the next one. But this is only a pre-version of the upcoming pack of AESCryptLz. It doesn’t include an example for Java and it’s not really commented. But you can use it anyway, because it’s doing its job.

To be done:
- Java backend example
- Better documentation
- Implementation of MD5 checksums to provide encoding via password
- Bug fixes (?)

The new Version of AESCryptLz is based on the set of JavaScript functions developed by Chris Veness and it’s released under the LGPL. Thanks a lot to him, for his great work.

In detail, it uses the AES/CTR algorithm without padding. The class generates encrypted byte-arrays and also needs byte-arrays to decrypt them. I’m not using HEX-Strings anymore, because it’s much faster, when I’m doing this calculations without any converting. As I’m using Red5 for the backend, it’s really easy to send and get byte-arrays. But I’ll explain how, next week.
Also I’ve implemented a way to encrypt using LzIdle. So you can use it to en-/decrypt things in backgrund. The used vector is stored in the first 8 bytes of the generated byte-array. The following bytes are the encrypted text. So it also needs the used vector in the first 8 byte, if you want to decrypt a byte-array, generated by other algorythms.

Here are the files:
- Example application
- AESCryptLz2 source code
- Example application source code

I think I am on a good way with this class. It’s faster and much smaller than the last one.
So stay tuned for the update, next week.

Regards,
Mario

Posted in OpenLaszlo
by sYnie

AESCryptLz: OpenLaszlo & AES encryption

Wednesday, March 19th, 2008 at about 7:20 pm

Hello everyone,

huh? sYnie is blogging in English - doesn’t this end in undecryptable bullshit? Not this time, because now we have AESCryptLz to decrypt it ;-)
Okay, this post is written in english, because the most users of OpenLaszlo don’t understand german - But I want to provide it for everyone. However, I’m not a native english speaker, so forgive me for my mistakes.

Some days ago, I started to search for a usefull code-snipet to de- and encrypt files or strings in OpenLaszlo. Everything I found were some posts about hash creation. So I started to search for JavaScript solutions to port them to OpenLaszlo. Mixing this with some hash creation algorithms and an own class to handle all those functions is compiled together to “AESCryptLz”. It can be used to de- and encrypt everything you want.
The used algorithm de-/encrypts via AES/ECB without Padding. You can de-/encrypt with a 128 bit key only. To do so, you can either use a 128 bit hex string or an ASCII string as “password”. If you use the ASCII key, then AESCryptLz will generate a MD5 hash out of it, to use it as a 128 bit hex key. All the encrypted data will be returned as a hex string. Also the data you, want to encrypt, needs to be a hex string.
Sounds a bit confusing, but it’s explained at the top of the source code.

To create this little set of classes, I ported a JavaScript library created by Eugene Styer. He allowed me to use his source code under the GPL. Thanks a lot!
I also used an OpenLaszlo class, ported by Userfriendly and former developed by Paul Johnston, released under the BSD licence. Thanks a lot, you too.

I created an own class, modified the mentioned classes and linked them all together. So you can use it under the GPL. Here you can find a little example that makes use of AESCryptLz.

The Sourcecode:
1. The AESCryptLz code
2. The AESCryptLz example code
3. A Java backend example class
3. The example

The first one is the AESCryptLz source code. The second one is the code of the shown example. And the third one is a little, quick and dirty Java source code, that shows, how to handle AESCryptLz-encrypted data. This may be usefull for a Java backend.

I’m looking forward to your feedback.

Kind regards,
Mario

Ps.: To see if it works, try to decode the following message, using the example application with the ASCII key “synie”:

1e af f3 90 83 02 50 90 a4 9c bc bc 7e 05 d3 78 50 79 ac aa 0f 0d ad 28 98 a7 46 13 b1 49 d7 e2 b9 d1 d9 c7 7a f0 01 0e 88 0d 95 a3 7f b2 52 92 2f 9e 5b 61 e7 67 8a 93 19 d0 5c c0 0c 78 64 e3 e0 f2 4c 4f b5 64 e9 d8 43 89 9d 8e fb 07 d8 e7 b8 ea 07 49 69 fd a7 b3 8d c3 8b 04 19 92 7a be

Posted in OpenLaszlo, Misc
by sYnie

GTBot Source

Thursday, March 13th, 2008 at about 4:03 pm

Hallo,

habe nun auf Anfrage hin den GTBot Source aus den tiefsten Tiefen meiner Server rausgesucht, gepackt und unter “Dowloads” zum freien Verwenden zur Verfuegung gestellt.
Bitte beachtet, dass der GTBot unter der GPL ist.

Der Source ist mehr als grausam und mitlerweile auch viele Jahre alt (meine vor-C++-Zeit ;-)). Von daher wuerde ich euch raten den Bot als Sammelwerk, nuetzlicher Funktionen fuer den GTChat anzusehen. Ich waere aber natuerlich Jedem sehr dankbar, der sich hinsetzt und ein bisschen Struktur und eine nette OOP in den Bot bringt. Werde natuerlich gerne die Aenderungen neu veroeffentlichen.
Feedback ist willkommen. Ansonsten viel Spass mit dem Source.

Gruesse,
Mario

Posted in GTBot
by sYnie

sYnismus?

Tuesday, March 4th, 2008 at about 6:31 pm

Ich wurde heute uebers ICQ drauf aufmerksam gemacht, dass mir heute der erste Wikipedia-Eintrag gewidmet wurde. Lustigerweise komplett ohne mein Wissen. Entstanden ist die Definition durch eine Diskussion ueber Sarkasmus in einem Forum, in dem ich als Administrator unterwegs bin.
Ich befuerchte dass der Wikipedia-Eintrag nicht lange ueberleben wird - aber ein Blog-Eintrag ist es wert.
Zum Eintrag
Und hier nochmal die Definition:

sYnismus
Synismus (von griechisch σύνταξις [’sʏntaksis], Syntax „die Zusammenstellung“) Wird oftmals als Sarkasmus in Bezug auf das Phänomen der neuzeitlichen IT-Gesellschaftsstruktur und dessen Auswüchse gewertet. Jemand, der synistisch ist nimmt stark ironischen Bezug auf Programmierstil und Methoden und stellt diese negativ dar.

Ich habe beim Entdecken des Eintrags wirklich Traenen gelacht. Danke ;-)

Posted in Misc
by sYnie

OpenLaszlo und Red5

Sunday, October 7th, 2007 at about 3:16 am

Hallo,

ich musste mich beruflich bedingt mit Red5 auseinandersetzen um Video-/Audiostreaming via Internet zu ermoeglichen. Fuer das Frontend wurde Flash eingeplant. Da ich mich aber ungern komplett in Flash und Actionscript einarbeiten wollte, habe ich nach alternativen gesucht. Im Hinterkopf hatte ich da noch OpenLaszlo. Damit kann man Flash-Applikationen via XML erstellen. Und durch die von OpenLaszlo bereits bereitgestellten Moeglichkeiten zur Kommunikation mit Red5 bekam ich es innerhalb weniger Stunden hin, ein komplettes Frontend fuer Video-Meetings via Webseiten zu schreiben.
An dieser stelle ist nur zu sagen, dass beide Komponenten, also Red5 und OpenLaszlo, wirklich die perfekten Werkzeuge zur erstellung von Video-/Audiostreaming Applikationen sind.

Wer Interesse an dieser Mixtur von Entwicklerwerkzeugen, sowie Video-/Audiostreaming hat, der kann sich hier gerne kurz melden. Dann werde ich ein kleines Tutorial schreiben und hier veroeffentlichen.

Viele Gruesse,
Mario

Posted in OpenLaszlo, Misc
by sYnie

Update

Thursday, August 2nd, 2007 at about 12:23 pm

Hallo,

habe eben das Wordpress upgedatet und hoffnungsvollerweise die Commentfunktion wieder aktiviert. Mal schauen, ob sich der Spam mit den neuen Plugins wieder Schnee von gestern ist.

Gruesse,
Mario

Posted in Misc
by Administrator

Mr Burns

Wednesday, July 11th, 2007 at about 3:49 am

Hallo,

Ich bin seit kurzem stolzer Besitzer eines Macbooks. Aber als Administrator und bisheriger Linux User bin ich sehr Shellbezogen. Ich war auf der Suche nach einem Brennprogramm, das via Terminal steuerbar und nicht so aufgeblasen ist. Leider fand ich nur hdiutil, welches aber ein wenig kompliziert zu benutzen ist, bzw. Befehle schwer zu merken sind. Also habe ich mich hingesetzt und ein kleines Programm zum Brennen von CDs/DVDs auf basis von hdiutil (das mit aktuellen Macs ausgeliefert wird) geschrieben.
Unter dem Namen “Mr Burns” findet man es im Bereich Downloads.

Eine kleine Erklaerung zum Programm:
Aufgerufen wird das Programm via `mrburns`. So, also ohne Parameter, Brennt er Disk2Disk mit den als erstes gefundenen Laufwerken.
Moechte man das Brennlaufwerk festlegen, so kann man das via `mrburns -o X`, wobei X eine Zahl fuer das Laufwerk ist. Die Zahl bekommt man anhand der Liste via `mrburns -l` heraus.
Mit `mrburns -i X` kann man das Input Device festlegen. Dies kann ein Image, ein Ordner oder eine Laufwerksnummer sein. Die Nummer fuer ein Laufwerk bekommt man wieder via `mrburns -l` raus. Gibt man stattdessen einen Ordner an, so wird dessen Inhalt auf die CD geschrieben. Schreibt man den Pfad zu einem Image hinter -i, so wird eben das Image geschrieben ;-).
Ansonsten ist es hilfreich mal in `mrburns –help` reinzuschauen.
Beispiele:
Disk2Disk vom zweiten Laufwerk, auf den default-Brenner:
mrburns -i 2
Folder2Disk auf den zweiten Brenner:
mrburns -i /Users/synie/EinOrdner -o 2
Image2Disk auf den default-Brenner:
mrburns -i /Users/synie/image.img

Ich hoffe, dass es fuer den Ein oder Anderen ganz hilfreich ist.

Gruesse,
Mario

Posted in Misc
by sYnie

Visual Basic .Net Blocksatz

Tuesday, June 12th, 2007 at about 2:47 pm

Hallo,

ich arbeite gerade an einem sehr grossen Projekt. Damit es schnell geht schreibe ich dazu ein Programm in Visual Basic .Net. Nun hatte ich das Problem, dass ich ein paar Textpassagen als Blocksatz ausgeben muss. Aber Visual Basic bringt da leider keine Funktionen mit um dies zu machen. Unter VB6 gab es ein paar Erklaerungen zu setTextJustification, aber damit habe ich unter VB.Net rein garnichts zu Stande gebracht. Also hab ich nunmal die Zaehne ein wenig zusammen gebissen und einen kurzen Algo geschrieben, der via GDI+ einen Blocktext auf ein Bitmap zeichnet. Dieses Bitmap kann dann auf eine Picturebox, oder whatever geladen werden.
Da ich im Internet rein garnichts dazu gefunden habe, dachte ich mir, dass ich den Snippet veroeffentliche, in der Hoffnung, dass jemand was damit anfangen kann.
Bei Fehlern oder Problemen steh ich natuerlich gerne zur Verfuegung. Der Code ist frei verfuegbar. Jeder kann damit machen was er will. Aber: Benutzung auf eigene Gefahr ;-)

 Sub BlockJustification(ByRef pic As Bitmap, ByVal txt As String, ByRef x As Short, ByRef y As Short, ByRef w As Short)
  Dim g As Graphics
  g = Graphics.FromImage(pic)
 
  Dim fnt As New Font(”Times New Roman”, 10)
  Dim cnty As Integer = 0
 
  Dim ar As String() = txt.Split(Chr(10) + Chr(13))
  For m As Integer = 0 To UBound(ar)
  Dim newTxt As String = “”
  Dim array As String() = ar(m).Split(” “)
  For i As Integer = 0 To UBound(array)
   Dim newTxtTmp As String = newTxt + array(i)
 
   If g.MeasureString(newTxtTmp, fnt, 9999999).Width >= w Then
   Dim spacearray As String() = newTxt.Split(” “)
   Dim spacecnt As Integer = UBound(spacearray) - 1
 
   If spacecnt < 1 Then
    newTxt = newTxtTmp
    Dim tobreake As String = ""
    Do While True
    If g.MeasureString(tobreake, fnt, 9999999).Width >= w Then
     g.DrawString(tobreake, fnt, Brushes.Black, 0, cnty)
     cnty += 15
     tobreake = “”
     If g.MeasureString(newTxt, fnt, 9999999).Width < = w Then
     newTxt += " "
     Exit Do
     End If
    End If
    tobreake += newTxt.Substring(0, 1)
    newTxt = newTxt.Substring(1, newTxt.Length - 1)
    Loop
   Else
    Dim newTxtlength As Integer = 0
    For n As Integer = 0 To UBound(spacearray) - 1
    newTxtlength += g.MeasureString(spacearray(n), fnt, 9999999).Width
    Next
    Dim space As Integer = w - newTxtlength
    Dim spaceperword As Integer = space / spacecnt
    Dim cntmeasure As Integer = 0
    Dim dotcnt As Integer = w - (newTxtlength + (spaceperword * spacecnt))
    'MsgBox("space: " + space.ToString + " -- wordspace: " + spaceperword.ToString + " -- measure: " + newTextlength.ToString + " -- width: " + w.ToString + " -- spacecnt: " + spacecnt.ToString + " -- dotcnt: " + dotcnt.ToString + " -- txt: '" + newTxt + "'")
    For n As Integer = 0 To UBound(spacearray) - 1
    g.DrawString(spacearray(n), fnt, Brushes.Black, cntmeasure, cnty)
    If n = 0 Then
     cntmeasure = cntmeasure + dotcnt
    End If
    cntmeasure += g.MeasureString(spacearray(n), fnt, 9999999).Width + spaceperword
    Next
    g.DrawLine(Pens.Blue, cntmeasure - spaceperword, 0, cntmeasure - spaceperword, 300)
    i -= 1
    newTxt = ""
    cnty += 15
   End If
   Else
   newTxt += array(i) + " "
   End If
  Next
  If Not newTxt = "" Then
   g.DrawString(newTxt, fnt, Brushes.Black, 0, cnty)
   cnty += 15
  End If
  Next
  g.Dispose()
 End Sub

Nun kann er z.B. so angesprochen werden:

Dim img As New Bitmap(500, 500)
BlockJustification(img, Text1.Text, 0, 0, 250)
PictureBox1.CreateGraphics.DrawImage(img, 0, 0)

Viele Gruesse,
Mario

Posted in Misc
by sYnie