1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | void setup (){ Serial.begin(9600); Serial.flush(); digitalWrite (13, HIGH); //turn on debugging LED } void loop (){ int i=0; char commandbuffer[100]; if(Serial.available()){ delay(100); while( Serial.available() && i< 99) { commandbuffer[i++] = Serial.read(); } commandbuffer[i++]='\0'; } if(i>0) Serial.println((char*)commandbuffer); } |
Thursday, 14 October 2010
Arduino code to read lines from serial input
Here is short and useful example to read lines from serial port in Arduino.
Saturday, 9 October 2010
python euromillion key generator with filters
From python, perl and ruby i selected python to start playing around (learn the language). I started with this nice tutorial "Learn Python in 10 minutes", and decided to port and old C program that generates all combinations of euromillions and then apply some filters.
The generator is for numbers only, it does not take into account the stars!!!
The solution is composed by two parts, the generator and the evaluator. The generator generates the combinations with the given filter list (e.g, python gnerator.py columns d_tens).
The evaluator, evaluates the success of the specified filters individually, and can evaluate all filters at same time.

As example the filter "first_number" rejects combinations with the first number more than 30
sh avaliator.sh first_number
################# first_numbers #####################
Running...
2044588 results 74172 rejected
~96.56160458452722063037%
###############################################
the report says that 15504 combinations was rejected and 97% of euromilions results are in the generated combinations file
However combining all filters (16 for now, and individually with 90% success), the success rate drops to 70% !!.
################# ALL #####################
Running...
1516959 results 601801 rejected
~70.77363896848137535817%
##########################################
Download here
Monday, 8 February 2010
How to change openfire password or how to login in openfire



Im having some problems with SSL certificates, i reinstalled openfire to see if that would fix.
At login, it seems not be working the password i set in setup installation. Theres a way to change the password and resolve the issue of not be able to login.
1- Access openfire database
2- Select table ofUser
3- Edit admin row
4- Set encryptedPassword to NULL
5- Enter a temporary pass on plainPassword
6- Save and restart openfire server
7- Use temporary password to login (username is always "admin")
8- Go to Users and edit admin
9- Enter a new password
10- Have fun :)
Monday, 14 December 2009
xfce4 verve plugin as standalone application

I liked very much this plugin, when i tried xfce4 last time, also i liked xfce4, but i didnt like the root menu, so i switched back to fluxbox.
This plugin is nice because:
- application launcher
- url, ftp and file launcher
- auto complete
- saves history commands
I did some changes on verve-plugin.c (mostly was deleting code, and fixing)
i didn't bore in putting the code 100% ok, may concern at the time was just to put it working...
For now i didn't notice any bug or crash :D
Download here
Tuesday, 8 December 2009
Sunday, 29 November 2009
Farmville auto-clicker
New GUI here
Simple autoclicker script, needs xdotool installed
Download here
For default settings (12x12) use: sh farmville_click.sh
Or custom mode: sh farmville_click.sh num_rows num_columns click_interval_time wait_interval_before_pointing
If give this error(Syntax error: Bad for loop variable), use bash (bash farmville_click.sh)Download old script here (bash script for *nix based)
Sunday, 6 September 2009
Subscribe to:
Posts (Atom)
