T-shirt and sticker is fair enough for my personal effort :)
How do I do things.

After a lot of R&D and some user requests, I'd like to present the jReCo! A wireless home control station.
Posted by J@mBeL Sunday, October 16, 2011 at 21:22 0 comments Labels: Hardware, Home Automation, Project jaNET
To use Microsoft Office Live, your computer must meet one of the following requirements:
* Microsoft Internet Explorer 6, 7, or 8 running on Microsoft Windows XP, Windows Server 2003, or Windows Vista. You can download Internet Explorer from the Internet Explorer page.
* Mozilla Firefox running on Windows XP, Windows Server 2003, Windows Vista, or Mac OS X 10.2.x and later. You can download Firefox from the Firefox download page.
Update: Project jaNET has a home and a Facebook pageProject jaNET provides a framework that allows various components to communicate, controlled interactively by the user. This procedure aim to act like a digital life assistant (DLA) which I inspired by Iron Man's JARVIS.
Posted by J@mBeL Saturday, June 05, 2010 at 16:48 0 comments Labels: C#, Home Automation, Linux, Mono, Programming, Project jaNET, Ubuntu
<iframe src="http://www.jambel.net/_dev/contact/Default.aspx" width=100% height=340px frameborder=0 allowtransparency="true"></iframe> 
sudo apt-get install wmctrlbash shell script - Download#!/bin/bash
COUNTER=0
while [ $COUNTER -le 100 ]; do
sleep 0.5
POS=`cat /sys/devices/platform/lis3lv02d/position | awk -F "(" '{print$2}' | awk -F , '{print$1}'`
echo $POS
if [ $POS -ge 12 ]; then
wmctrl -o 1024,0
elif [ $POS -le -12 ]; then
wmctrl -o 0,0
fi
COUNTER=$(( $COUNTER + 1 ))
doneUPDATE Sep 8, 2009: an approach in python - Download#!/usr/bin/python
import time
import os
cnt=0
while cnt <= 100:
time.sleep(0.5)
f = open ('/sys/devices/platform/lis3lv02d/position','r')
data = f.read()
ar = data.split(',')
results = ar[0].replace('(',''), ar[1], ar[2].replace(')','')
print results
if (ar[0].replace('(','') >= '12'):
os.system('wmctrl -o 1024,0')
elif (ar[1] <= '-12'):
os.system('wmctrl -o 0,0')
f.close()
cnt += 1Note: Scripts will work when System/Preferences/Appearance/Visual Effects is set to Normal or Extra.gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type boolean "true"gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type boolean "false"gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide_size" --type integer 0
This is one of the latest project I've created for the company I currently work for. It's an intranet/CMS application developed in .NET platform.
python ensymble_python2.5-0.26.py py2sis --uid=0xE0000000 --appname=your_app_name --version=1.0.0 your_app_name.py your_app_name.sisnow you have probably successfully build your .sis file. Also, be sure that you have path your python directory.
// © J@mBeL.net
import java.util.Vector;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
public class WakeOnLan extends MIDlet implements CommandListener {
private Display display;
private Form mainScr;
private Command OKCommand;
private Command ClearCommand;
private Command exitCommand;
private static TextField tfIP;
private static TextField tfMAC;
private Alert alert;
private static final int PORT = 9;
public WakeOnLan() {
display = Display.getDisplay(this);
mainScr = new Form("WakeOnLan Mob");
tfIP = new TextField("IP Address:\n", "", 16, 0);
tfMAC = new TextField("MAC Address:\n", "", 17, 0);
mainScr.append(tfIP);
mainScr.append(tfMAC);
mainScr.append("© 2007 jambel.net");
OKCommand = new Command("Send", Command.OK, 1);
ClearCommand = new Command("Clear", Command.ITEM, 1);
exitCommand = new Command("Exit", Command.EXIT, 1);
mainScr.addCommand(OKCommand);
mainScr.addCommand(ClearCommand);
mainScr.addCommand(exitCommand);
mainScr.setCommandListener(this);
}
private class SendPacket implements Runnable {
public void run(){
SendStr(tfIP.getString(), tfMAC.getString());
}
private void SendStr(String ipStr, String macStr) {
if(ipStr.length() == 0 || macStr.length() == 0) {
alert = new Alert("Please fill IP and MAC address fields.");
display.setCurrent(alert, mainScr);
return;
}
else {
try {
byte[] macBytes = getMacBytes();
byte[] bytes = new byte[6 + 16 * macBytes.length];
for (int i = 0; i < 6; i++) {
bytes[i] = (byte) 0xff;
}
for (int i = 6; i < bytes.length; i += macBytes.length) {
System.arraycopy(macBytes, 0, bytes, i, macBytes.length);
}
String address = "datagram://" + ipStr + ":" + PORT;
DatagramConnection packet = (DatagramConnection)Connector.open(address);
Datagram dgram = packet.newDatagram(bytes, bytes.length, address);
packet.send(dgram);
packet.close();
alert = new Alert("Wake-on-LAN packet sent.");
display.setCurrent(alert, mainScr);
}
catch (Exception e) {
alert = new Alert("Failed to send Wake-on-LAN packet: " + e);
display.setCurrent(alert, mainScr);
return;
//System.exit(1);
}
}
}
}
private byte[] getMacBytes() throws IllegalArgumentException {
byte[] bytes = new byte[6];
String sep;
if(tfMAC.getString().indexOf(":") > 0)
sep=":";
else
sep="-";
String[] hex = split(tfMAC.getString(),sep);
if (hex.length != 6) {
throw new IllegalArgumentException("Invalid MAC address.");
}
try {
for (int i = 0; i < 6; i++) {
bytes[i] = (byte) Integer.parseInt(hex[i], 16);
}
}
catch (NumberFormatException e) {
throw new IllegalArgumentException("Invalid hex digit in MAC address.");
}
return bytes;
}
private static String[] split(String original, String separator) {
Vector nodes = new Vector();
// Parse nodes into vector
int index = original.indexOf(separator);
while(index>=0) {
nodes.addElement( original.substring(0, index) );
original = original.substring(index+separator.length());
index = original.indexOf(separator);
}
// Get the last node
nodes.addElement( original );
// Create splitted string array
String[] result = new String[ nodes.size() ];
if( nodes.size()>0 ) {
for(int loop=0; loop < nodes.size(); loop++)
result[loop] = (String)nodes.elementAt(loop);
}
return result;
}
public void commandAction(Command c, Displayable d) {
if (c == OKCommand) {
if (d == mainScr) {
SendPacket doIt = new SendPacket();
Thread myThread = new Thread( doIt );
myThread.start();
} else {
display.setCurrent(mainScr);
}
} else if (c == ClearCommand) {
tfIP.setString("");
tfMAC.setString("");
} else if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
public void startApp() {
Display.getDisplay(this).setCurrent(mainScr);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
You can download it here.
Posted by J@mBeL Saturday, April 26, 2008 at 21:48 0 comments Labels: Java ME, MIDlet, Mobile, Programming