Scala tutorial for programmers
Finally I get myself together and publish my Scala tutorial for programmers (it is linked under menu -> documents).
I started working on two years ago, but didn’t have enough time to finish it. This year I almost didn’t make any update (fortunately Scala also has’nt much of them). If you find any errors please contact me.
I started fascinating Scala in 2008, when I found this language as an impressive work on JVM, and how many clever features can be work on top of it. Scala shows that programming on JVM can be fast and compact. Just dive into and read!
Unfortunately I dislike Scala implicits overhead and abuse of symbolic functions literals, like :%, :=>, ~>, \/, \\/ (here I typed 5 different names). For a Scala expert it can be fun. But Scala world is tight to Java one and not everyone a programming master. When someone needs to look into implicits mess, I’m sure he will need some painkillers. Neverless it contains a lot of brillinat constructs and state of the art solutions from programming languages theory and programming patterns (eg: cake pattern).
At the end I’m still Python evangelist :)
Blog moved
I’ve just moved my blog from http://robert-zaremba-it.posterous.com/. I migrate most of the content. Here you can find my new posts.
The blog was redesigned. It is based on my previous blog. Big thanks to Marta Zaremba who makes the final design, which is so cool (at least for me).
Previously I used http://posterous.com platform for blogging. But since twitter bought it there was no development and progress in the palatform.
Keep your session open
Have you ever thought how to keep session open on remote host, or want to run multiple processes in a background?
You may hear about nohup, but it is uncomfortable and doesn’t allow you to come back to this process.
tmux and screen
Multiplex virtual consoles are the way to go. Both are well known and widely used in the Linux world.
I prefer tmux. It has more features, is more comfortable and beauty out of the box. According to tmux FAQ:
Hash function benchmark in python
I got a task to process a documents which might change. So there need to be some worker process which crawl for processed documents, read new version and check the difference. I don’t want to get into details, but there was no point to store whole document, or some part of it to detect if document changed. If it changed it needs to be reprocessed from the beginning.
The simplest solution is to keep hash of the document, and than compare to hash of the new version. If it is different, than document was changed.
There are a lot of hash function. We can divide then into two groups:
- noncryptographic
- cryptographic – we have additional requirement – having only hash result must be hard to find a document which hash equals result.