Posts

Showing posts from April, 2010

Elementwise processing 2.1 for common keys in Haskell

Here's a neat little utility function which I commonly find useful.

ef2_1 :: (a -> a -> a) -> (a -> a -> Bool) -> [a] -> [a] -> [a]
ef2_1 = ef0 [] where
 ef0 zs f lt (x:xs) (y:ys) | lt x y = ef0 (x:zs) f lt xs (y:ys)
 ef0 zs f lt (x:xs) (y:ys) | lt y x = ef0 (y:zs) f lt (x:xs) ys
 ef0 zs f lt (x:xs) (y:ys) = ef0 (f x y:zs) f lt xs ys
 ef0 zs _ _ xr yr = reverse $ xr ++ yr ++ zs

main = print $ ef2_1 (\x _->x) (\(x,_) (y,_)->x<y) d1 d2 where
 d1 = [(1,9), (3,8), (4,7), (5,6), (7,5)]
 d2 = [(2,5), (4,4), (6,3)]

Making metropolitan travel more ergonomic

It would make a difference if they have published the exact synchronization of traffic lights and/or broadcast timely phase signals (via UDP over GPRS or such).

Using this data combined with the readings of the bicycle odometer, software on your PDA or mobile phone could continuously suggest a velocity that should minimize idling at each traffic light. Manual settings for maximal speed, acceleration and cardiovascular pulse could be given.

Note that this strategy only works well for uncongested networks, like dedicated bicycle lanes or paths.

Trained cyclist already apply a similar technique manually, however, not all lights are synchronized to each other.

Can you guess which conjecture these try to test?

let f l 1=l++[1];f l k|mod k 2==0=f(l++[k])(div k 2);f l k=f(l++[k])(3*k+1)in putStr $ unlines $ map (show . f[]) [1..11]

let f l 1=reverse(1:l);f l k|mod k 2==0=f(k:l)(div k 2);f l k=f(k:l)(3*k+1)in putStr $ unlines $ map (show . f[]) [1..11]

let f 1=Nothing;f k=Just(g k,g k);g k|mod k 2==0=div k 2;g k=3*k+1 in putStr $ unlines $ map (show . \n -> n:unfoldr f n) [1..11]

let f 1=Nothing;f k=let x=(if mod k 2==0 then div k 2 else 3*k+1)in Just(x,x)in putStr $ unlines $ map (show . \n -> n:unfoldr f n) [1..11]

Silent voice - input method innovation

They have conducted the following interesting experiment. Electrodes were placed on the skin of a subject at the neck. Then a specially trained person imitated a phone call without sounding an utterance or even moving his lips!

They say, when "articulating" text in one's mind, the nerves relevant to speech are activated similarly to when reading the text aloud. They have achieved fair decoding accuracy from these signals.

There could exist many use cases for an interface built around these findings. On top of all previously known applications for speech recognition, those could also be realized which were inappropriate at certain locations because of the noise induced by speech. Imagine the workplace perspective of talking on the phone without opening your lips or making any sound, all with the speed of speech!

Too bad it has such a low speed in practise today. I wonder how far they can push it.

You can also view a video demonstration at the original article: Nerve-tapping n…

Constructing a simple portable bike

I've been considering if it would make sense to construct a bike "from scratch" using general materials for a frame. It could also be equipped with standard bicycle components to make repairs much easier.

The concept of building the frame (and thus the bike) akin to playing with a metal toy construction set sounds interesting. It would allow great innovation in portability.

Replayable keylogging for yourself

It would be feasible to protect as much information created by the user as possible. Certain software have evolved the ability to partially provide a feature similar to this via periodically created temporary document copies (editors) or constantly refreshed configuration files (browsers). Most of them use their own, unconfigurable, error-prone ad-hoc solutions.

I propose that a solution be found at the operating system level which any software can reuse.

Keyboard input could be considered the most entropy rich for most users, however, selection and positioning via the mouse pointer must also be taken into account. The good solution would probably model widget activation in an abstract manner.

Best buy elsewhere

WorstBuy Trains Employees to Boo Linux to Customers [linuxinnovations]Microsoft 'indoctrinates' Best Buy workers with anti-Linux 'lies' [DailyFinance]

"First they ignore you, then they laugh at you, then they fight you, then you win." - Mohandas Karamchand Gandhi

You just have to love monopoly

Nice creative homebrew bike project implementations

This guy is committing some wicked do-it-yourselfing! His portfolio also include tree perches and full featured low-cost mobile homes for the homeless.

High mileage trikes and more

Bike replacement

I have replaced my portable bicycle with a small kick scooter a few months ago. Testing is still underway. Average commuting speed is in excess of 10km/h for longer intra-city trips. Riding comfort is fair on sidewalks not made of bricks. Bicycle lanes with bricks are a bit rough, but still doable. I agree that the device does give you a better workout than a bicycle.

At around the same time, I'm beginning to use one of my mountain bikes in the city.

My Psion MC218 got retired

I have input more than 1 million characters of notes, coursework, ideas, plans and doodling on the device. I've programmed some simple calculations on it to aid my purchases. Sadly, I never got around to develop in Java for the device. I've finished all 50 Sokoban levels on it for the delight of my good old mathematician roommate many years ago. :-)

All in all, it was worth it. However, I've retired it in favour of my netbook last year.

Though, I still carry it around in my backback as a backup solution to this day. I also accompany it with an extra set of rechargeable batteries.

Computer replacement - Asus Eee PC

I've purchased a new Asus Eee PC 2g (700x) portable "netbook" computer last year. It cost the equivalent of about 128 Euros in a local shop nearby, though prices were very close citywide back then. At least I found good use for my aging 4 GiB USB flash drive.

I'd been considering this exact purchase since the manufacturer has announced this line. Though for business reasons, it took them some time to market the smallest model.

I've loaded Pupee Linux on it, installed Google Chrome, disabled a few background processes, developed a few simple scripts for it and made some other small customizations. I may share my exact customizations later on.

Battery life varies greatly with usage. If you disable all onboard devices and turn down the backlight to about 10-20%, you can study from PDF or HTML documents for 3:07 (187 minutes). The biggest consumers are the processor and the wireless radio, so heavily browsing the web on a wireless network reduces this to a bit over two …

online interpreter and collaboration tools: codepad, ideone, tryhaskell

Visit the cool site codepad.org, where you can try out any esoteric programming language online which you never had the spirit to install so far. You can also view, try out or even modify programs that others have typed in previously. Supports the following languages: C, C++, D, Haskell, Lua, OCaml, PHP, Perl, Python, Ruby, Scheme, Tcl. (via verdelyi) ideone.com also supports a heapload of languages: Ada, Assembler, AWK, Bash, bc, Brainf**k, C, C#, C++, C99, CLIPS, Clojure, COBOL, Common LISP, D (dmd), Erlang, Forth, Fortran, Go, Haskell, Icon, Intercal, Java, JavaScript, Lua, Nemerle, Nice, Ocaml, Pascal, Perl, PHP, Pike, Prolog, Python, R, Ruby, Scala, Scheme, SmallTalk, Tcl, Unlambda, Visual Basic .NET, Whitespace.tryhaskell.org - specialized for Haskell, but does its job in light-weight JavaScript!

New poll of mine

A new poll is available for you to vote on. ;-)

Back in business

I'll be back online in the upcoming days, stay tuned! :-)