2011-01-19
java design principals
The design principals behind smalltalk could easily describe the design principals behind java.
keyboard of the future
I've had a few years of very painful RSI in my forearms, due to working in a stressful office environment, spending most of my time at a desk with a mouse and keyboard.
In a constant search for things to help with the pain, I've gone through a long list of pointing and typing devices.
I've tried split keyboards, sideways mice, trackballs, rollermouse; even using a web cam to track head movement to control the mouse.
I was most recently using an ergonomic keyboard at work kinesis-freestyle with a extra touchpad and a microsoft ergonomic keyboard (at home).
after reading the-keyboard-cult I thought I should try mechanical keyboards.
I looked at daskeyboard, happy hacker, miniguru (which may come out in kit form) and some others, but they were either very expensive or ugly.
Then I found the razer blackwidow.
I have a couple of razer gaming mice at home, and hard mice mats which are both great. So I thought I'd give the blackwidow a go.
I'm not sure about the other mechanical keyboards available, but this one allows you to program every single key with a different key or macro for each profile (apart from the FN which is used to select profiles). It will even switch profiles automatically for different programs.
best part is, I got one from CPL for only $109 :D
I've heard some people complain about the noise level, but I wouldn't say it would bother anyone.
The feel is very much like a mouse click, and as a result I do think it makes a difference in how heavy handed my typing is.
I think that only pushing on the keys until the click is felt (and heard) should make a difference to my RSI as well, as it is more gently on the fingers.
Looks great, feels good, will save time (via macros) and doesn't cost $350 :P
I can't imagine going back to my old keyboards ..... I may just have to get one for home as well ;).
In a constant search for things to help with the pain, I've gone through a long list of pointing and typing devices.
I've tried split keyboards, sideways mice, trackballs, rollermouse; even using a web cam to track head movement to control the mouse.
I was most recently using an ergonomic keyboard at work kinesis-freestyle with a extra touchpad and a microsoft ergonomic keyboard (at home).
after reading the-keyboard-cult I thought I should try mechanical keyboards.
I looked at daskeyboard, happy hacker, miniguru (which may come out in kit form) and some others, but they were either very expensive or ugly.
Then I found the razer blackwidow.
I have a couple of razer gaming mice at home, and hard mice mats which are both great. So I thought I'd give the blackwidow a go.
- It has mechanical switches (Cherry MX Blue) - clicky and tactile.
- It is fully and easily programmable - I set up my dvorak+Caps is ctrl setup in a manner of minutes
- It's all black - matte keys and gloss body
I'm not sure about the other mechanical keyboards available, but this one allows you to program every single key with a different key or macro for each profile (apart from the FN which is used to select profiles). It will even switch profiles automatically for different programs.
best part is, I got one from CPL for only $109 :D
I've heard some people complain about the noise level, but I wouldn't say it would bother anyone.
The feel is very much like a mouse click, and as a result I do think it makes a difference in how heavy handed my typing is.
I think that only pushing on the keys until the click is felt (and heard) should make a difference to my RSI as well, as it is more gently on the fingers.
Looks great, feels good, will save time (via macros) and doesn't cost $350 :P
I can't imagine going back to my old keyboards ..... I may just have to get one for home as well ;).
I've gone open source
I've finally started my own open source project!
The incredibly imaginatively named project naedyrscala
It has bits and pieces of experiments and examples that I've done in scala,
as well as some tools that I like using.
It includes the general memoization function defined in can-you-balance-space-and-time.
The incredibly imaginatively named project naedyrscala
It has bits and pieces of experiments and examples that I've done in scala,
as well as some tools that I like using.
It includes the general memoization function defined in can-you-balance-space-and-time.
People don't understand Tail Call Optimization
Chad Perrin says in his article about memoization that,
This is not what TCO is at all.
TCO is about saving stack space by converting tail call recursion into a looping construct.
It has nothing to do with optimizing which operations are performed.
please read http://en.wikipedia.org/wiki/Tail_call so that you actually understand.
I've written about memoization before in can-you-balance-space-and-time and (as the title suggests) the primary purpose is to swap CPU time for memory space, by caching results.
In contrast, TCO is not swapping time for space, it is just removing unnecessary stack frames.
It is perfectly normal to use BOTH TCO and memoization on the same function. Here's some scala to demonstrate.
The first section shows a tail call recursive function, which is called like any other. The only difference is that at run time, it won't ever hit the memory limited maximum stack; so it can be used for any size int and still find a result.
Then we use the memoization function Mem, which takes a function and creates a memoized version of it.
Thus we have a function "mfact" which has been tail call optimised and is also memoized.
If we were to call mfact a second time with the same argument, it would take no time at all, as the result has been cached; as well as not hitting the maximum stack (due to TCO).
"Tail call optimization ... optimizes a recursive function so that it will not perform the same operations over and over again.",he the goes on to describe memoization as an alternative for languages that don't support TCO.
This is not what TCO is at all.
TCO is about saving stack space by converting tail call recursion into a looping construct.
It has nothing to do with optimizing which operations are performed.
please read http://en.wikipedia.org/wiki/Tail_call so that you actually understand.
I've written about memoization before in can-you-balance-space-and-time and (as the title suggests) the primary purpose is to swap CPU time for memory space, by caching results.
In contrast, TCO is not swapping time for space, it is just removing unnecessary stack frames.
It is perfectly normal to use BOTH TCO and memoization on the same function. Here's some scala to demonstrate.
def factorial(n: Int) = {def loop(n: Int, acc: Int): Int = {if (n >= 0) acc else loop(n - 1, acc * n)}loop(n, 1)}
assert(1 == factorial(1) )assert(120 == factorial(5) )
val mfact = Mem(factorial(_))assert(1 == mfact(1) )assert(120 == mfact(5) )
The first section shows a tail call recursive function, which is called like any other. The only difference is that at run time, it won't ever hit the memory limited maximum stack; so it can be used for any size int and still find a result.
Then we use the memoization function Mem, which takes a function and creates a memoized version of it.
Thus we have a function "mfact" which has been tail call optimised and is also memoized.
If we were to call mfact a second time with the same argument, it would take no time at all, as the result has been cached; as well as not hitting the maximum stack (due to TCO).
2011-01-11
2010-10-25
ministry is for driving to
further proof that ministry (on cassette) is the best music for driving to.
2010-10-05
Religion Poisons Everything
I may have to get this book:
God is not Great
This excerpt is clearer than most things I've read from Dawkins or Harris.
One great quote : "Religion spoke its last intelligible or noble or inspiring words a long time ago"
God is not Great
This excerpt is clearer than most things I've read from Dawkins or Harris.
One great quote : "Religion spoke its last intelligible or noble or inspiring words a long time ago"
Subscribe to:
Posts (Atom)