sunrise.ch sms via shell

July 18th, 2009

quick and dirty hack:

#!/bin/bash
message=$2
recipient=$1
username=
password=
curl -s  –cookie /tmp/cookies.txt –cookie-jar /tmp/cookies.txt –user-agent Mozilla/4.0 -d “username=$username@sunrise.ch&password=$password http://mip.sunrise.ch/mip/dyn/login/login?SAMLRequest=fVLLUsIwFN074z9ksu8LYdQMLYM4jsz46EB14S6klxJpb2puCvr3lqKCC13m5OQ8bu5w9F6VbAOWtMGYR37IGaAyucYi5k%2FZjXfBR8npyZBkVdZi3LgVzuCtAXKsfYkkuouYNxaFkaRJoKyAhFNiPr6%2FEz0%2FFLU1zihTcja9jjkuQNeIugD1ihKUXC9yqM2ywHVRrMqFkRIqhWvOnr9j9XaxpkQNTJGcRNdCYXjphedeNMiivugNxFn%2FhbP0y%2BlK477Bf7EWexKJ2yxLvfRxnnUCG52DfWjZMS%2BMKUrwlal29qkk0psWdrYBzsZEYF2bb2KQmgrsHOxGK3ia3cV85VxNIgi2261%2FUAlkQA1aTe1pFUhFPOkGK7pu9mii%2FyeX39Y8OYgPgyOp5OvDdj2m16kptfpg47I024kF6X5K3BhbSfe3W%2BRHHaJzb9lRRYNUg9JLDTlnQbJ3%2Fb0Z7b58Ag%3D%3D
curl -s –cookie /tmp/cookies.txt –cookie-jar /tmp/cookies.txt –user-agent Mozilla/4.0 -d “message=$message&recipient=$recipient http://mip.sunrise.ch/mip/dyn/sms/sms?.lang=de

freEBook: Practical Artificial Intelligence Programming in Java

November 15th, 2008

mark watson offers a free ebook onPractical Artificial Intelligence Programming in Java

mark watson offers a free ebook on
Practical Artificial Intelligence Programming in Javagrab it on is opencontent website.

“Each chapter follows the same pattern: a mo-
tivation for learning a technique, some theory for the technique, and a Java example
program that you can experiment with. “

The BitC Programming Language

November 12th, 2008
“BitC is a new systems programming language. It seeks to combine the flexibility, safety, and richness of Standard ML or Haskell with the low-level expressiveness of C.”

BitC seems to be an effort to get provable correct programs and thus maybe an Operating System which works flawless. They also develop coyotos    which is a step in this direction.

maybe this would be a starting point to have a lightweight OS for Performant Virtual Servers.

Ur programming language

October 29th, 2008

Ur is a programming language designed to introduce richer type system features into functional programming in the tradition of ML and Haskell. Ur is functional, pure, statically-typed, and strict. Ur supports a powerful kind of metaprogramming based on row types.

http://www.impredicative.com/ur/

lisp flavored languages for existing virtual machines.

October 17th, 2008

im just watching the clojure  (lisp flavored lang for the JVM) presentations from Rick Hickey.
then i found LFE  lisp flavored erlang. i think i already mentioned Tim Burks  Nu earlier.
(Rick Hickey also did dotlisp guess what? yup lisp for .net. there are also others e.g. IronLisp) so now we have a lisp for BEAM, JVM and the Objective-C runtime, seems like  something that was in the air.

combine: there is a need for a dynamic language which is scalable but still can leverage existing code.
thinking a bit further and adding the other main stream approach to scale these days (virtualization) we get pushed to a new light-weight operating system which supports just a VM and basic IO like TCP/IP.

already with these large scale rails setups we have today, i see no point to have a fully featured OS with a 5+M LOC kernel running just to provide a VM which does just some calculating on proxied data from client data to its persistance.

hmm… erlang for minix 3 anyone?

installing Quickfix with Ruby 1.9 on OS X 1.5.4

October 14th, 2008

installing Quickfix with Ruby 1.9on OS X 1.5.4download ruby 1.9

 sudo su (or add a sudo where appropriate)
svn co http://svn.ruby-lang.org/repos/ruby/trunk /usr/local/src/ruby19
./configure --program-suffix=-trunk --prefix=/usr/local/ make make install

#temporary move ruby bin, you can reverse it after building quickfix

mv /usr/bin/ruby /usr/bin/ruby-osx
ln -s /usr/local/bin/ruby-trunk /usr/bin/ruby

#go to /usr/local/src or wherever you want the quickfix sources to stay#HEAD is currenty broken. i used the newest version where something in the ruby dir was changed

svn co -r 1939 https://quickfix.svn.sourceforge.net/svnroot/quickfix/trunk/quickfix qf1939
cd qf1939
./bootstrap
./configure --with-ruby
./make
./make install

#if you get errors the following bugs havent been fixed yet:#patch your /usr/local/include/ruby-1.9.0/ruby/ruby.h

#patch QuickfixRuby.cpp
2145c2145
< #include "ruby/io.h"
---
> #include "rubyio.h"
2643c2643
<       printf( "%s\n", RSTRING_PTR(message) );
---
>       printf( "%s\n", RSTRING(message)->ptr );
2676c2676
<       printf( "%s\n", RSTRING_PTR(message) );
---
>       printf( "%s\n", RSTRING(message)->ptr );
2709c2709
<       printf( "%s\n", RSTRING_PTR(message) );
---
>       printf( "%s\n", RSTRING(message)->ptr );
2742c2742
<       printf( "%s\n", RSTRING_PTR(message) );
---
>       printf( "%s\n", RSTRING(message)->ptr );
2782c2782
<         printf( "%s\n", RSTRING_PTR(message) );
---
>         printf( "%s\n", RSTRING(message)->ptr );
2849c2849
<         printf( "%s\n", RSTRING_PTR(message) );
---
>         printf( "%s\n", RSTRING(message)->ptr );
2922c2922
<         printf( "%s\n", RSTRING_PTR(message) );
---
>         printf( "%s\n", RSTRING(message)->ptr ); 

#place a symlink

sudo ln -s /usr/local/include/ruby-1.9.0/i386-darwin9.1.0/ruby/config.h /usr/local/include/ruby-1.9.0/i386-darwin9.1.0/config.h

#try to ./make and ./make install again

irb-trunk

and

require 'quickfix_ruby'

YAY!  1.9 porting notes:http://boga.wordpress.com/2008/04/15/ruby-19-porting-notes/ 

programming languages

September 29th, 2008

altough not new i just discovered hecl.

The Hecl Programming Language is a high-level, open source scripting language implemented in Java. It is intended to be small, extensible, extremely flexible, and easy to learn and use. Infact, it’s small enough that it runs on J2ME-enabled cell phones!”

sounds like fun. http://www.hecl.org/

on to something new and cutting edge, here is reia:
all the goodies from erlang, the lang of ruby and python intendation. can’t wait to try.
meanwhile check: http://wiki.reia-lang.org/wiki/Reia_Programming_Language

Writing a compiler in Ruby bottom up

June 5th, 2008

Vidar Hokstad has a nice series on writing a compiler in ruby: http://www.hokstad.com/tag/compiler%20in%20Ruby%20bottom%20upa more general view on computer science is given in this lecture:Building a Modern Computer from First Principleshttp://www1.idc.ac.il/tecs/http://video.google.com/videoplay?docid=7654043762021156507

links about merb, datamapper and AOP

April 22nd, 2008

some nice merb urls

a comparison with rails

an open source book about merb

AOP for ruby

interesting post about deferred requests with merb ebb and thin by ezra

Installing ruby from trunk

March 24th, 2008

Today i installed Ruby 1.9 from trunk.

1) get ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.0-1.zip
or ( http://mirror.judofyr.net/ruby/1.9/ruby-1.9.0-1.tar.gz )

2) tar xzvf ruby-1.9.0-1.tar.gz && cd ruby-1.9.0-1
3) ./configure –prefix=/usr/local/ruby1.9 –program-suffix=-trunk
4) make
5) sudo make install
now you have ruby 1.9 in /usr/local/ruby1.9
you can now either put /usr/local/ruby1.9/bin to path or copy or softlink the bins