Posts

Showing posts from October, 2009

Erlang vs. Scala

From Yariv’s Blog: Erlang vs. Scala - aspects discussed: concurrent programming, hot code swapping, garbage collection, scheduling, distributed programming, mnesia, tail recursion, network IO, remote shell, simplicity, libraries, reliability and scalability See also: bkil: Haskell vs. Erlang vs. Scala

C/C++ refactoring support

EDIT: updated on 2016-02-06 (fixed links, added QtCreator) The people I've discussed refactoring with usually got pretty enthusiastic about it when showing them what can be done in properly designed languages like Java, Erlang or Haskell. They asked whether these kind of things were doable for weaker programming languages like C and C++ by free open source tools. I don't have much experience in this topic, as I haven't done bigger projects in this language yet, and the small ones I did were usually properly designed for the purpose from the start. So I looked around for possible solutions , and doing a few web searches yielded the following links. I may try some of these in the future just for curiosity. Be warned that not all listed features are available or complete. If you have experience with any of these, or with any refactoring tool for that matter, please let us hear your voice in the comments. (Maybe it would be worthwhile to open a wiki about available ref

Food Waste: Canada $3-5+ billion, UK $10+ billion per year?

Elimination of food waste could lift 1bn out of hunger, say campaigners (The Guardian) Food Waste: Canada $3-5+ billion, UK $10+ billion per year? Supermarkets throw away two million tons of food a year (UK) An Apple a Day Gets Thrown Away (UK) Hunger and food waste (in Sweden, Switzerland and elsewhere)

Scala in practice

Here are some nice pointers related to the promising multi-paradigm (OOP, FP, COM), multi-platform ( .NET +JVM) language we all adore. Some introductory guides: The Scala Programming Language - a quick and conscious overview [2009] Catching Up with Scala - another conscious overview [2007] Some background: The Scala Experiment – Can We Provide Better Language Support for Component Systems? - explains the intentions behind designing the language [2004] Java yields to other languages on the Java Virtual Machine an overview of some alternatives by Paul Krill from InfoWorld [2009] Some applications: Twitter on Scala - A Conversation with Steve Jenson, Alex Payne, and Robey Pointer by Bill Venners [April 3, 2009] Scala at Stanford Pervasive Parallelism Laboratory [2009] Ray tracer language comparison ported to Scala (and Groovy) - performance is on par [2007]

FreeArc - advantage of developing in Haskell

FreeArc, a great performing free software archiver written in combined Haskell/C

Typing speed tests

Yesterday's "party" prompted me to do some drills of typing in order to improve my accuracy. :-) Results are the following on a random acceptable, but not new keyboard in our lab: A simple single sentence test without much caps: 70 A large paragraph (about one minute) of well-balanced text: 62(2), 66(1), 70(0), 66(1) Crazy phrases (two sentences each): 61(0), 67(0), 66(0), 69(0), 74(0), 70(0), 62(0), 63(0), 77(0), 65(1), 63(0), 79(0), 114(0), 56(0), 76(0), 61(0), 61(0), 70(0), 65(0), 57(0), 73(0), 87(0), 79(0), 77(0), 62(0), , 72(0), 72(0) Random letters (59 characters): 38(0), 39(0), 49(0), 45(0), 40(0), 39(0), 39(0), 36(0) Random letters, numbers and punctuation (59 characters): 35(0), 37(1), 36(0), 35(0) One minute of well-balanced text: 72(0), 69(0), 72(0), 74(0), 72(0), 71(0), 75(0), 80(0), 76(0), 72(0)

The balance between meat and plant consumption

The following article explains that if most of us would follow a healthy, but rational diet, then not only would obesity problems be a nightmare of the past, but it would also greatly reduce our ecologic footprint . U.S. could feed 800 million people with grain that livestock eat, Cornell ecologist advises animal scientists (with David Pimentel, professor of ecology in Cornell University's College of Agriculture and Life Sciences)

Why do telephone keypads count from the top down, while calculators count from the bottom up?

I've been thinking about the very same thing not too long ago: A Staff Report from the Straight Dope Science Advisory Board: Why do telephone keypads count from the top down, while calculators count from the bottom up?

Haskell for embedded: C output, compilers, monads, Timber

Tricks to use Haskell for developing embedded systems: Re: [Haskell-cafe] compilation to C, not via-C - question involving if you could output prettier C (answer: YHC/LHC or monadic generators) CUFP 2008 Program - see Controlling Hybrid Vehicles with Haskell by Tom Hawkins, Eaton Corporation TIMe - eMBEdded - Reactive - a promising O'Haskell inspired strict embedded research language

Unary math Towers of Hanoi in naked (D)ASH and BASH

The following solution assumes neither BASH extensions, nor any external executables. Hence it could be ran from a preboot environment like a frugal initrd. A slight compromise was to use unary math. Did you know, that you can access an animated version from Emacs by typing M-x hanoi ? pop(){  shift  echo $* } top(){  echo $1 } print_towers(){  echo "a=[" $a "], b=[" $b "], c=[" $c "]" } hanoi(){  [ "$n" ] || return  local ln  ln=$(pop $n)  n=$ln  hanoi $1 $3 $2  print_towers  echo "$1 -> $2"  eval $2=\"$(eval top \$$1) $(echo \$$2)\"  eval $1=\"$(eval pop \$$1)\"  n=$ln  hanoi $3 $2 $1 } main(){  a="1 2 3 4 5"  b=  c=  n=$a  hanoi a b c  print_towers } main "$@"