Monday, March 5, 2012

3d object file viewer in browser

Wavefront .OBJ and ascii .STL file viewer using the Three.js rendering library.
The 3D files are directly processed in the browser.
Works best in browsers supporting WebGL.
HTML5 FileAPI support is a must to load the files.

Monday, May 30, 2011

Dump a file in hexadecimal directly in the browser

Direct URL

This webapp reads the selected file and displays the content in hexadecimal. The prefix, suffix, separator and line length is configurable. You can generate hex dumps to be used directly in C/C++ by setting "0x" as prefix and "," as separator.

This will work in browsers supporting HTML5 FileReader API and typed arrays.
Tested with Firefox 4 and Google Chrome 11.

Thursday, May 26, 2011

Online PE (Portable Executable, .EXE, .DLL) header viewer, no upload needed

Direct URL

This webapp reads the selected executable file with the HTML5 FileReader and displays the PE headers.

The most important information is the "Import directory" where you can check what dlls are used by the application and see the functions imported from the dlls.

This will work in browsers supporting HTML5 FileReader API and typed arrays.
Tested with Firefox 4 and Google Chrome 11.

Friday, May 6, 2011

Inclinometer in Python, for Symbian phones with accelerometer

An example of a simple inclinometer (tilt meter, tilt indicator, slope alert, slope gauge, gradient meter, gradiometer, level gauge, level meter, declinometer, and pitch & roll indicator).

But first you need to install Python for Symbian S60. This can be installed on phones with Symbian OS 3rd or 5th edition. Download PyS60 binaries and install the runtime and the shell (copy the .sis files to phone and launch to install or install with your phones software).
The setup for Windows OS is for creation of installable packages from your Python application.

The code is the following:

from sensor import *
import e32
from appuifw import *
from random import randint

print "Accelorometer by Lazar Laszlo (c) 2009"

# Define exit function
def quit():
app.exit_key_handler = quit
app.screen = 'large' # Screen size set to 'large'
c = Canvas()
app.body = c
mx = s1[0]
my = s1[1]
m2x = mx/2
m2y = my/2
sleep = e32.ao_sleep

# Function which draws circle with given radius at given co-ordinate
def circle(x,y,radius=5, outline=0, fill=0xffff00, width=1):
  c.ellipse((x-radius, y-radius, x+radius, y+radius), outline, fill, width)

class Inclinometer():
    def __init__(self):
        self.accelerometer = \
        self.counter = 0

    def sensor_callback(self):
        # reset inactivity watchdog at every 20th read
        if self.counter % 20 == 0:

        # redraw at every 5th read
        if self.counter % 5 == 0:
            circle(m2x+self.accelerometer.x*2, 160-self.accelerometer.y*2, 7, fill=0x0000ff)
            if self.accelerometer.z > 0:
            if self.accelerometer.z < 0:
        self.counter = self.counter + 1

    def run(self):

if __name__ == '__main__':
    d = Inclinometer()
    App_lock = e32.Ao_lock()
    App_lock.wait()  # Wait for exit event
    print "Exiting Accelorometer"

The appuifw module contains the functions and objects for the graphical user interface. You can set the applications window size with the app.screen variable. To use the whole screen as a drawing canvas set app.screen = 'large' and set the application body to the Canvas object.

The application gets the accelerometer data through a callback. In order to do not redraw the screen at every read, a simple counter is used. I doubled the accelerometers values to increase the circles movement. The x and y values are displayed as a circle centered to the screens center. The z value is displayed as a green bar.

I reset the phones inactivity watchdog with the e32.reset_inactivity() function to keep the back-light on while the application is running.

If your phone has a magnetometer (compass) you can switch the sensor from AccelerometerXYZAxisData to MagnetometerXYZAxisData and the self.accelerometer variables to self.magnetometer to display the direction to North.

To run the application just save the code to a text file with .py extension, copy the file to the phones \DATA\PYTHON directory (or into the \PYTHON directory in the phone memory).

Screen shots from my Nokia E52:

Feel free to use and play with this small code.

Thursday, April 14, 2011

Online AES-256 file and text crypter, at client side in javascript

Direct URL

A simple file and text encrypter using AES-256 implemented in javascript. The cypher implementation is from HERE.

If your browser supports HTML5 file-api you can encrypt/decrypt local files without uploading to a server.

The upper Encrypt/Decrypt buttons are for file encryption. The file size is limited to a few megabytes because of the data-URL saving. The file is read directly with the FileAPI. The encrypted file is padded up to a multiple of 16 bytes, but the original file size is saved in the first 4 bytes, so at decryption will be truncated to the original size.

The lower buttons are for text encryption/decryption. The action is applied to the upper text box. The encrypted text is displayed in hexadecimal. The same format must be used for decryption. The text is padded with spaces up to a multiple of 16 characters.

The password (key) is padded with zeros up to 32 bytes.

Direct URL

Wednesday, March 30, 2011

Online EXIF reader without uploading

Read EXIF data without uploading the photo to a server. Works only with FileAPI capable browsers (Firefox, Chrome).
I used the EXIF data reader from Nihilogic and modified to read data from the FileAPI.

Try it bellow:

EXIF data: