#include "msp430g2231.h" //—————————————————————————— // Hardware-related definitions //—————————————————————————— #define UART_TXD 0×02 // TXD on P1.1 (Timer0_A.OUT0) #define UART_RXD 0×04 // RXD on P1.2 (Timer0_A.CCI1A) //—————————————————————————— // Conditions for 9600 Baud SW UART, SMCLK = 1MHz //—————————————————————————— #define UART_TBIT_DIV_2 (1000000 / (9600 * 2)) #define UART_TBIT (1000000 / 9600) //—————————————————————————— // Global variables used [...]
So some time ago I made calculator “software” for TI launchpad. Since I’ve received few messages about the video asking for source code, here it is.
The basis has been copied from Timer_A example which is in TI’s sample package.
And here is the demo video: http://www.youtube.com/watch?v=A7d2l06Z2KA
More info about launchpad: http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_(MSP-EXP430G2)
You [...]
Our host’s server was under attack, so there were a few days downtime in weekend. Now everything should be fixed. (Thank god we have backups =)).
Today I was looking for really simple and small “function” to generate random strings for password salt usage but I was unable to find any one-liners so I made one. It generates random strings with n-length with charset A-Z,a-z,0-9.
$randomString = preg_replace("/[ ]/e",’chr(array_search(mt_rand(0, 62) ,array_flip(array_merge(range(48, 57), range(65, 90), range(97, 122)))))’, str_repeat(" ", 8)); echo $randomString; [...]
Very simple PHP-script that shows when your favorite series next episode airs. Uses epguides.com.
Currently it needs that you look csv urls by your self, but that’s not hard.
Go to epguides.com -> search your series -> see link “list as .csv” and take that url and add to config
Live [...]
So I had boring afternoon and decided to test WebSocket. Here is the result =)
I found nice phpwebsocket-class from google codes.
server.php
<?php include "websocket.class.php"; class Chat extends WebSocket{ function process($user,$msg){ $this->say("< ".$msg); $msg = htmlspecialchars($msg); foreach($this->users as $buf){ $this->send($buf->socket,$user->id."> ".$msg); } } }; $master = [...]
So I made little bundle of scripts to enable mouse.pl gestures only for n900, but disable them for other ssh clients (like putty on windows).
Original mouse.pl doesn’t have this feature and I could not find such so I made one =)
All necessary files can be found here.
Please read [...]
Bot’s idea is that it follows person and log’s his/her activity on IRC. It auto joins to all channels target is using and then logs all activity to file. It doesn’t have any “commands” or etc., it just spies .
PS. This is good base for your own IRC-bot if you’re interested about making your [...]
functions.php
<?php function raiseError($msg){ $error_msg = $msg; ob_start(); include "error.tpl.php"; $body = ob_get_contents(); ob_end_clean(); $title = "Error: ".$msg; die(include("frame.tpl.php")); } function connectMySQL(){ $c = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASSWORD); mysql_select_db(MYSQL_DATABASE); return $c; } function plainify(&$i){ $i = htmlspecialchars_decode($i); } ?>
index.php
<?php /* Simple pastebin script using mysql OR files Made by Style- @ QuakeNet / Ilari [...]
So… Our LAN-party Solid Rebirth is coming up next weekend and in our event TMNF-tournament will be one of the compos (competitions). Event has lot of dedicated servers, but I don’t have access to any of them before event so I decided to use one of my “bonkservers”. Server has now Debian Lenny, TMNF-server, Aseco (XASECO) and remoteCP4. [...]
ILLUMINATED
About this blog: at this moment I don't know should I write in English or in Finnish, so I decided to do both :). My actual articles I will write in Finnish, but code snippets I'll write in English. If my reader group turns out to be mostly English people I'll do all blogging in English!
