Posts for Sunday, January 24, 2010

avatar

Fosdem 2010

I'll be at fosdem - 10th edition - again this year.
I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

I'll be presenting a lightning talk about uzbl.
Also, Arch Linux guys Roman, JGC, Thomas and me will hang out at the distro miniconf. We might join the infrastructure round-table panel, but there is no concrete information yet.

More stuff I'm looking forward to:

I'm suprised myself how there are much more topics of interest to me then last year, and I'm not sure if the program is even finished.

avatar

Wikisurfing, the latest in extreme sports.

Say, my good sir, have you gone Wikisurfing before? No? Well- it’s time to expose yourself to the latest and greatest addiction.

Wikisurfing is the act of a group of people starting on a predetermined page on Wikipedia.org (in whatever language). Their objective is to navigate through Wikipedia to another predetermined article, using only inline links on the page excluding "See Alsos", disambiguations, and any lists (eg: list of countries, list of singers, etc). The first person to arrive on that page wins.

So for example we’d have 5 people all on the page on the Sultan Iskandar of Johor (Malaysia), who died a few days ago, all trying to click through links to navigate to Old Ephraim – and depending on your level of general knowledge you’d know that Old Ephraim was a very large grizzly bear that lived quite happily in Utah until he got shot in the head by an unwitting shepherd. You’d have to plan your strategy – you could go through the countries-america-utah route or instead try the animals-bears-grizzlys technique. It’s very hard to find a page that you really can’t find a link to, but I’m willing to bet Old Ephraim is one of them (30 minutes without success!)

There are many variations of the game, such as one where every 5 minutes you must switch computers, another where at random times you may click a link on your neighbour’s computer, or ones where you must navigate through many topics in a sequence of your choice.

An experienced wikisurfer can tell you that there are certain topics that are dead-ends and others which are self-sustaining spirals of disaster – you will be stuck in that topic once you enter it. One example of this would probably be some complex topic in hypothetical physics. Once somewhere within the topic it’s very hard to move to another. Whereas in other topics, such as sociology, would be able to link directly to the most random of articles with almost guilty relevance.

A great way to describe this situation is that it represents the depth of a topic. A topic where it would be hard to reach other unrelated topics would be seen as an in-depth and technical topic, whereas one which could easily be changed to another (such as in 5 clicks or less) would be seen as a shallow, academically unchallenging topic. The problem when trying to measure this is determining exactly which page would be used as a base-page to attempt to navigate to. For example, hypothetical physics would be very deep compared to your average McDonald’s hamburger, whereas detailed biology, though arguably as complex as physics, would be significantly easier to get to your burger.

The way to get around this is to divide our intelligence into several different categories, such as music, art, physics, biology, chemistry, math, etc – and use a representative article for each of these subjects. The next step is to proceed from each page in an article into the representative of each of the other subjects. Thus you could find an average depth of a subject.

I find that since we have a massive repository of knowledge instead of simply using it as a portal we should use it as a data-source for these sorts of fun facts – like for example exactly how useful would it be to know what a tomium is? If mapped to a specialised personality profile we can actually start sorting out knowledge that would be useful for people, so instead of searching for information it would be fed to us.

Someone remind me why I’m wasting their bandwidth when they need help? Shame on me.

Related posts:

  1. Achieving what?

Posts for Saturday, January 23, 2010

avatar

Social Networking

After having resisted for a long time last week I finally created a facebook account. I still prefer e-mail or instant messages (jabber!) but I have to admit it is a nice way to get in touch with a lot of people and to follow activity.

So now that I have sold my soul I decided to create an extra box on the blog with direct link to my various social network profiles. Just to make it look pretty!

So far I am active on 3 social networks:

  • last.fm: I actually created my account in order to improve QtMPC, however it is now also coupled to my amarok and I upload the scrobble log from my ipod (with rockbox).
  • linkedin: I created this to join the OpenStreetMap group.
  • facebook: Now since a few days facebook.

Now I think that is (for now) enough to keep track of but it makes me wonder why there aren’t any good desktop apps to manage some of this. Like the facebook notification thingy at the bottom right. Why isn’t there a cool Qt app to just make this sit in the system tray? A well maybe a cool project for the upcoming semester :)

Destroying an LVM Array

Alright... So one of my hard drives failed in my backup server LVM array, and I received the new replacement disk today.

So, I turn on my computer and even though the volume group isn't initialized (due to the missing disk), it still exists, and has all the other drives in the array still held captive.

So, this is how to completely destroy your LVM array and all the data within it after a drive has failed.

DO NOT DO THIS IF YOU WANT TO KEEP ANY DATA ON THE ARRAY. (you have been warned)

The procedure is really quite easy.

First, do pvdisplay to see which disks are still part of the array you wish to destroy. (in my case it was /dev/sdb /dev/sdc and /dev/sdd)

simply run the command : "pvcreate -ff /dev/deviceyouwanttokill"

that will initialize the disk, even if it is part of another array.

Do that to all the disks you want to be part of your new array, and voila!  You're done.

(hope you didn't just do all that hoping to do anything but COMPLETELY DESTROY your LVM array.)

Posts for Friday, January 22, 2010

avatar

Webcam

Since my girlfriend is going to do her research and write most of her thesis on Curaçao I will only have contact with her trough email/skype for some time.

She already has a webcam build into her webcam. Not great quality but good enough for skype. Also there was an old webcam which was bought approx 5 years ago, a Creative Webcam NX Pro, now I have not yet figured out what is so “pro” about it but it works like a charm!

The GSPA ZC3XX driver is the one I need! After that some programs need to be compiled with video4linux (2) support but that is to be expected. The only problem I ran in so far was skype itself! For some reason skype does not work with v4l2 so in order to run skype I have to use the following code:

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

Long story short. The webcam works like a charm and thanks to the hard work of many people I had it working in no time!

Spring Schedule

I apologize for not posting in a (very) long time. I have been busy. Additionally, I haven’t had many topics to talk about.

Currently, I’m in limbo waiting for the new MacBook Pro laptops to be released. It is rumored that a refresh might happen at Apple’s January tablet event. I’m purchasing a MacBook Pro due to the endless volley of issues being thrown at me directly by Dell’s abomination of a service department.

School has started back. I will be listing my schedule below:

MWF Fundamentals of Calculus 8:30-9:20

MWF Operations Research 2:30-3:20

TTH Personal Finance 8:30-9:45

TTH Database Systems 1:00-2:15

TTH English Composition II 2:30-3:45

TTH Astronomy 5:00-6:15

Monday Committee Meetings at 6:30-7:30

Work:

Monday 1:00-2:30

3:30-4:30

Tuesday 12:00-1:00

Wednesday 1:00-2:30

3:30-4:30

Desk hours: 9:30-12:30

Duty on some Sundays and every other Thursday night.

Posts for Thursday, January 21, 2010

How free music could become even more available

After hacking for a while on the beforementioned Jamendo helper KTorrent script and learning about Libre.fm I got a great idea!

How about if we made not only a central system to promote all free music, but also to make all the free music available to users/listeners in a more natural and easy way and at the same time lessen the load and costs of the netlabels?

Well, I have a plan and I think it could work!

Because I'm quite busy lately, I'll just quote my own e-mail that I sent to the Libre.fm mailing list with my battle plan in it:

Hullo,

I've just recently learnt about Libre.fm and it made me think about the
possibilities...

Because this will be a longer e-mail, I'll try to put some structure in it. At
first I'll talk in short about what I imagine Libre.fm could provide that
Last.fm doesn't (and couldn't), then show you the big picture and at the
end a detailed example of a real-life use case.

// Libre.fm and Downloads //

One thing that Libre.fm has that Last.fm didn't (and couldn't by this day) is
access to all of the music it promotes and streams. It would be a shame
to let this wonderful opportunity pass us by!

What I propose is to have next to every album that is promoted on
Libre.fm:
* a direct HTTP/FTP link to the download
* a torrent or magnet link to the album

The direct download link was proposed already, from what I gathered from
IRC, so I'll concentrate on the latter idea.

The idea behind having a BitTorrent link — either as a torrent link with
Libre.fm running a tracker or better yet a tracker-less magnet link — has
many positive side effects.

Firstly it would shift the web traffic from the indie net labels (and Libre.fm)
towards the users, which would lower the hosting costs. A possible
downside would be that the net labels wouldn't have their own track then
on how many people downloaded the album, but a) since it's under a
copyleft license, the users could share it otherwise anyway; and b) they
could always check Libre.fm for that data (via API?).

Secondly the fact that it was handled via P2P would mean that even if a
net label went away, the albums would still be shared. Here the magnet
link would IMHO fare even better then a tracker, in case Libre.fm gets into
trouble (knocks on wood).

// The Big Plan (TM) //

Of course, just having a direct download and a P2P link is a nice touch, but
it's nothing really revolutionary. But using the Libre.fm API to extend this
idea, Libre.fm could bring the music directly to the user's fingertips and
ears with minimal effort from the user him-/her-self.

What I imagine is that by using the Libre.fm API integrated into music
players and P2P clients we could make access to music a lot more natural:

1) Let's say the Jimmy listens to a music stream either in the browser or
favourite music program.
2) Jimmy likes the current song and wants to check out the album, so he
clicks on the "download" button.
3) Automatically his computer (or other device) downloads the album and
puts it into his music collection, without bothering him about it.
4) When Jimmy goes offline he can still enjoy the music, without bothering
too much where, how and using which protocols his got his music.

So, from Jimmy's point of view, he would just click (or drag and drop or
whatever) the download button and that was it!

// Technicalities of the Use Case //

Here's how I imagine the above use case would work in the background
(be warned, I'm not much of a coder!) with already existing technology:

1) Jimmy launches Amarok and tunes into the Libre.fm plugin to check his
recommended artists.
2) When he hears something he likes, he clicks the little "download" button
in Amarok.
3) Amarok uses the Libre.fm API to check out the torrent/magnet link and
uses the user's default BitTorrent application to open it — let's use
KTorrent, because I'm somewhat familiar with its scripting API.
4) KTorrent has a script implemented, which would check where the
torrent/magnet link came from and/or which tracker, and because it came
from one of the free music net labels, it would automatically apply the
user's settings for it (e.g. download to the music collection folder, any
bandwidth restrictions, add it to the appropriate torrent group etc.).
5) At the same time the same KTorrent script would check if there's any
seeds available. If there aren't any (for a longer period of time) it would
trigger a direct download, which it would get from the Libre.fm API,
uncompress the album (if needed) and move its contents into the music
folder accordingly. Then it would start seeding that same album, so the
next user(s) could already use the benefit of P2P.
6) Amarok would automatically notice the new album in its local collection
and Jimmy would see it there with artwork and all.

For this to work optimally, all the albums in the torrents would have to be
ready for use the moment they finish downloading — e.g. not
compressed, all tracks (including artwork and license) in a folder.

I imagine we could stretch this even further, so that even if the user didn't
start the download from a Libre.fm page or service, the system (e.g.
browser, music player, BitTorrent client or all of them) could check via API
if there is a torrent/magnet link available on Libre.fm for the album. Maybe
it would be plausible (I doubt it though) even to get BitTorrent clients to
upload torrent/magnet links to Libre.fm.

Of course, it shouldn't be limited only to KDE software — that's why I think
it would be a great idea to use Libre.fm and its API as the central
intermediary for it all.

// Conclusion //

I know this is quite an enthusiastic idea, but I'm already working on
something similar for Jamendo using Amarok (the plugin's there) and
KTorrent (I'm writing the script) — and it seems possible to do!

So far the biggest problem I encountered was that KTorrent is not
forwarding some methods that I need to their API, but the devs already
have that planned.

Of course, doing this on such a grand scale as I propose, would be more
difficult, but I think it'd be worth it! As I said, although I'm not much of a
coder, I'll be happy to at least write the Amarok and KTorrent scripts in
order to make it work.

So... what do you think of it?

Cheers,
Matija "hook" Šuklje (a.k.a. "silver_hook")

hook out >> studying, going to bed
<!--break-->

avatar

Review of Doteasy hosting.

Some time ago I received an email asking for a sponsored post about a website called Doteasy.com which offers domains, webhosting and the usual hubbub with a shared server account. There were some delays but I’ve finally come ’round to writing what I hope will be an honest and relative review about this service.

To start with, I peeked at their plans page and scanned through. The plans page is an easy to follow comparison chart that divides features into clear-cut categories. A first read through only serves to confuse as it seems as though paying an extra $5 means you don’t get as many features – but apparently the justification lies in the control panel choice "Ensim" instead of the almost standard "CPanel" which comes with most providers.

A slightly closer inspection shows that you have to pay at least $8 bucks in order to get anything worth your time. The free package doesn’t even come with PHP support (and from that, no MySQL databases!), no ASP, if you’re into that sort of masochism, CGI/Perl nonexistent, and a measly 100MB space, which is quite depressing indeed. Together with the lack of support for SSL, key management and a unique IP really just makes you think it can’t get any worse.

It does however come with a generous 10 add-on domains and 10 parked domains, a rare sight among providers. Even rarer and quite a gem in their service is the provision of custom DNSes even with their free account. Interestingly although not allowing any sort of server-side scripting whatsoever they do allow .htaccess rules. Not quite sure how useful that’ll be with only html files in your account, but who knows.

The paid services don’t fare that much better. If you’re going to pay $7 a month, you might as well jack that up to $10, because you’ll miss out on a lot of the vitals. With $10 you get yourself a decent account by today’s standards but might still be annoyed by the lack of SSH. With a name like unlimited hosting it’s hard to not provide this. The IIS packages are much saner, giving you bearable functionality by the $15 price-level.

The next step was to get a free hosting account and revie- nope. I tried to grab myself a "free" account. Doteasy is one of those companies which try their best to throw hidden charges in your face. The $0 of the price has a lovely asterisk superscripted next to it. Yep, they don’t give any sort of subdomain or subdirectory URL but instead want you to to transfer or buy a domain name with them for a hefty price exceeding $20. Although this waives the technical knowledge required on DNS management for those who know what they’re doing it’s quite unacceptable. The registration process would put GoDaddy’s to shame – a 5 step process that in-between tries to sell "Spam & Virus Protection", "MailPro Email Service", and uh, what, um, yep – a "Photo Gallery"?

Doteasy is a hosting provider that aims to provide services with the account instead of giving a flexible environment for the more technically literate. (Note: these are available with a "free" account, which is a great thing) For example they provide a set of in-house scripts for the blogs, forums, e-commerce systems, mailing lists, etc that you might want installed. If these were good in-house scripts with excellent customer support I might be persuaded but a quick demo shows otherwise.

For those who didn’t see me saying that the scripts were in-house, I might want to emphasize that point. You won’t find your PHPBB, Wordpress or OSCommerce here – no, you’ll get a couple half-baked scripts that were probably cooked up in somebody’s spare time. The only one probably worth mentioning is the "Site Creator", which will initially give you an excellent website worthy of a Google Sites creation. The others are poorly designed (both aesthetically and technically) and should’ve been replaced by OSS-equilvalents long ago.

Given the rather expensive services and unmatching value for money I was determined to find out exactly what made them "The Leading Business Hosting Network" for over 160,000 domain owners – or so they claim. Apparently it lies in their groundbreaking customer service – I was wondering why they mentioned that several times in their comparison chart. The service is non-discriminatory and provided you don’t know jack, they provide quick and helpful responses.

Despite the lack of technical freedom we cannot say Doteasy is a bad webhost – it simply has a very clear-cut market segment. Hosting providers normally belong in one of three categories – the people who know absolutely nothing about it and don’t want to learn about it, such as Google Sites, the other extreme, of people who want to be able to do things with their account with freedom (which may be severely more costly), and finally – where Doteasy lies, somewhere in-between, for those who don’t know anything about it but want to learn.

Given the definition of quality as fit for purpose, Doteasy definitely knows how to cater to its audience – it does the job, and for what it does, it does well.

If you lie in that category, then Doteasy is definitely one for you – visit Doteasy.com for more information.

Related posts:

  1. Is there such thing as a good monopoly?
  2. Windows 7 Review
  3. ADOM: Game review.

Posts for Wednesday, January 20, 2010

avatar

TEDIndia: The thrilling potential of SixthSense technology by Pranav Mistry – how could I have missed this?

<object height="306" width="500"><param name="movie" value="http://www.youtube.com/v/YrtANPtnhyg&amp;fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed allowfullscreen="true" allowscriptaccess="always" height="306" src="http://www.youtube.com/v/YrtANPtnhyg&amp;fs=1" type="application/x-shockwave-flash" width="500"></embed></object>

No related posts.

a firewall in layman’s terms

Dealing with companies can be frustrating, because they like to appear opaque to the outside world. When you look on the website you find a page with contact information. You’ll find a phone number and an email address, and maybe more than one if it’s a large company with several departments. But they all point to the reception. Few companies are generous enough to give you direct access to their personnel with a listing of employees and their contact information.

So if there is a person you have to get to you have to do it through the reception. “Yes, I am blah and I need bleh and why don’t you just transfer me to the person I need to talk to, per favore!” It’s not a lot of fun, but this way whoever makes this decision to give out only the number of the reception can also decide who may and may not receive calls. And even on what conditions. If you say the magic word then, yes, you can get Frank on the line, otherwise not. And maybe Steve has been known to say too much and has a history of divulging information he wasn’t supposed to. So no, you can’t talk to Steve.

Well, this is the principle of a firewall. The reception screens calls with the discretion to reject or divert according to the protocol that has been instituted. Some people can be reached anytime, others only at certain intervals. Some are available depending on your request, and some are completely unreachable.

This picture, however, conflicts with the original meaning of the word firewall, which is a wall erected to stop a fire from spreading. Unconditionally.

Out of memory... ouch

I've written before about how I'm running four Clojure-driven websites out of a single JVM on my VPS. No problems for many months, but today I tried to make a blog post and got all kinds of out-of-memory errors. Hopefully I didn't lose any / many user comments on this blog in the past couple days, but it's possible.

I restarted the JVM and gave it a bit more RAM to play with, I imagine this will fix things. But we'll see. It occurs to me now that there may be such a thing as too much caching.

Virtualbox looking good

I blathered on a bit about VMWare a while back, and lots of people recommended VirtualBox. I'm trying VirtualBox 3.1.2 with Windows 7 host and Linux guest, and it works surprisingly well. I've used it successfully to hack on a bunch of projects while I'm stuck on a Windows laptop (shudder).

Installing was essentially self-explanatory. I never read any docs, except when it came to installing those "Guest Addition" programs to allow better mouse-handling. And I had to look up how to go about sharing folders between host and guest. But the documentation was clear, I found a short description how to set up the share and then and a command to run to mount the host folder:

sudo mount -t vboxsf ShareName /mnt/mountpoint

I'm using Gnome in my guest, because I haven't used it in a long time and I was curious what'd changed. I'm amazed even Compiz works in the guest. I recall a time in the very recent past when my computer couldn't even handle Compiz natively, let alone in a virtual machine.

Perhaps the best part about VirtualBox compared to VMWare is that there is one product called "VirtualBox" and one download link that took me a matter of seconds to find. Fancy the thought.

Dive Into Python 3 - Review

When I started learning Python, I already knew some programming cause I had had to learn Java at university and I had already done some work in PHP. I was looking for something fun that would allow me to do non-webby things and someone, I can't remember who it was, recommended Python to me. I looked at the website and docs and kinda got things going but I relatively quickly decided I wanted to learn things in a more structured way so I got myself a book. That book was not the first Edition of Dive Into Python, it was some other book, I can't even remember its name. It had the usual dry examples that never felt "real" and it treated you like a dummy not giving you the feeling of real progress.

A few weeks later I got the first Dive into Python (you can read it for free on the Dive Into Python website). I don't know how broken my mind already was from all the Java and PHP but Dive Into Python fixed it: Great writing style and real-world examples that you could apply to your day-to-day problems without trying too hard. I have recommended Dive Into Python to numerous people asking about Python and everybody was really happy with it.

When Python3 (a newer version of Python that introduced a few backwards-incompatible changes to the language to clean it up and remove a few "warts that it had grown) the author Mark Pilgrim (he works for Google on HTML5 and has an absolutely brilliant blog, he also is on Twitter) decided to update the book to Dive Into Python 3. A few months ago he asked on Twitter who wanted a review copy, I said yes and yesterday got a package from him containing a review copy of the book and a few nice words handwritten on the first page - to make a long story short [Disclaimer] I did not pay for the book I'm writing about, it was a gift by Mark, so take this with a grain of salt [/Disclaimer]. With all that said, let's go into detail.

When starting at the beginning with the first chapter I instantly got the impression that this book might actually work better for complete programming newbies than the first edition did. The old book was sometimes hard to understand if you didn't know how to program, you kinda needed to already know the basics and Dive Into Python supplied you with Python's syntax and more importantly a pythonic approach to solving real-world problems. But you had to bring something to the table. Dive Into Python 3 makes it easier to get into the whole topic, but I still wouldn't recommend it to a complete newbie: Knowing any other programming language (well maybe not Prolog) will enable you to quickly pickup what's going on and learn Python with this book. Being able to hack some PHP is enough. On the other hand this book does try to teach you a pythonic approach. There is a lot of bad Python code out there (often written by people with too much Java background) that is not idiomatic, that does things in a way you might use in Java but that's just not how you should use Python. So if you know a lot about some other programming platform, it might actually help to "forget" a little before reading the book to allow you to understand everything. That is not a weakness of the book, I just wanted to make sure who the target audience is.

I'll skip over the "howto install python on your machine" chapter because ... well ... a trained monkey can probably install software and there are more screenshots than there are in ... something really screenshotty. It's clear it's explicit but most people probably won't need that chapter.

Chapter 1 introduces you to Python. You get a real world example ("humanize a number" as in write a readable representation for X bytes as for example 1.3 TB). You get the full code and Mark walks you through how Python modules work, how functions are defined and how you call them. Simple straightforward. Throughout the book there are little info boxes that summarize important hints or gotchas which I found really helpful.

The next chapters deal with Python's native datatypes and how to work with them, but instead of just listing them and going through them, Mark first focusses on lists (lists are really important in Python, you do pretty much everything with lists) and list comprehensions. This allows him to do interesting things (like working with directories and files) at a rather early stage and people can write cool programs after having read the first 3 chapters.

Then he dives into the big one: Strings. Strings have changed a lot from Python2 to Python3 (since Python3 all strings are unicode) so he spends quite a lot of time in the beginning of the chapter explaining what strings actually are and why there are problems. I enjoyed the text but I can imagine that some people might actually not care too much about the underlying thoughts and problems. Maybe a quick note in the beginning of the textblock would have helped because it looks kinda scary considering how the book had been rather "light" with big text paragraphs before. But after that you just get a quick walk through how to deal with strings which kinda fits to the chapter following: Regular Expressions.

Many people think regular expressions are weird or scary and Mark doesn't even try to explain them completely. He builds the chapter around a case study (Street Addresses) and that works really well: Instead of throwing too much theory at the reader, the example helps you to get into the topic and with Mark holding your hand, you walk through the whole case study without any troubles. You will not be able to write huge regex all by yourself, but you know how they work and there is enough groundwork laid out for you to understand the official documentation (which is rather theoretical) a lot better.

The next chapters go through "generators and closures" with "classes and iterators" following. Which might look weird to you considering that Python is object-oriented, but allowing that kind of learning is actually one of the strengths of Python. It allows Mark to build on all the topics he covered earlier and allows him not to use interesting examples for classes (in this case he builds a fibonacci number iterator). What I missed in that chapter was an explanation of inheritance and how it works in Python. "X inherits Y" is used in the iterator explanation but I think that should have been made more explicit and it also should probably have gotten another example to show people when it might make sense to generalize some functionality into a superclass. If people have no idea how inheritance works that part will be quite a hard nut to crack I think.

Chapter 9 goes through unit testing. Unit testing is important but most people don't do it. Why? Cause it looks like a lot of extra work. Mark does build on a previous example of "Converting numbers to roman numerals" and shows how unit tests can really save your ass. Especially in connection to chapter 10 "refactoring" it's make clear why you want to use unittests and how to write them with the build-in unittest module. Those two chapters should be read by unittest-sceptics no matter what language they write code in. Great work here.

Chapters 11 to 14 ("Files", "XML", "Serializing Python Objects" and "HTTP Web Services") work together really well. You learn how to read data from files, how to deal with XML files (using the lxml package) and how to access HTTP apis. Those are real work problems and from the book it all flows really very naturally. Knowledge gained from reading data from files smoothly gets "upgraded" to knowledge about querying for example Flickr or Google apis. At this point the reader can solve many of his (or her) real-world problems with Python. The HTTP chapter is somewhat struggling with the fact that there is quite a lot about HTTP that you have to know (GET vs POST, redirecting, headers) so it does not really work as well as the other chapters: It ends with short code examples on how to post a dent to Identi.ca but the chapter before that throws a lot of "basics" at the user that he (or she) doesn't really care that much about. Maybe having one clearer example would have helped here. It's not that the chapter is bad, every subsection in itself is clear and explains exactly why something is relevant and how it works, I just find the subsections don't tie into each other as they do in previous chapters.

For those amongst you that already know Python2, Chapter 15 is pure gold. Mark goes through the whole process of porting a real life Python2 library to Python3 explaining all the tools to support you Python3 comes with and where and how to fix stuff manually when automatic translation fails. Really helpful and cool chapter!

The last "real" chapter deals with something bad... packaging. If you know Python you also know that its packaging is a huge pain. "easy_install" doesn't integrate well with linux distributions' own package management facilities and it cannot uninstall which completely sucks. On the other hand I think it makes sense to tell people how to publish their code in a rather sane way instead of letting them fight PyPI (Python Package Index) and Distribute all alone. The chapter provides the user with a clear and simple walkthrough on how to package and publish python code. It suggests a directory layout and adds some more best practices so while Python packaging still sucks, I think that this chapter will still help people a lot.

The book finishes with 2 appendices, one showing you how to port code from Python2 to Python3 automatically and the other one listing the "magic functions" python objects have and what to do with them (good reference material).

All in all this is a great book if you want to get into Python. The examples given in most chapters are way better than what many programming books offer, they feel "real". Another great thing is the whole flow of the book: The book goes through aspects not based on some abstract categorization but based on what works together and what allows the user to use the knowledge gained in the previous chapters directly in the next one to do something cool. "Classes" is a good example: Instead of just throwing them at the user very early ("cause Python is object-oriented") it's kept simple for the user, purely based on functions and classes enter the mix only when we need them. The language (as in writing style) is very accessible and avoids unnecessary complexity, I think even people with English as a second language will not have trouble understanding the book.

The layout looks beautiful and the fonts are quite good, too, even though code sometimes "drowns" in text. Choosing somewhat more differing fonts might have been a good idea just for quick scanability of the page.

The Website states that the book is:
The book is freely licensed under the Creative Commons Attribution Share-Alike license. You can download it as HTML or PDF. Über-geeks can also clone the Mercurial repository
. On the other hand the book says that
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.

I send an email to Mark, maybe he can clear that up, I guess the copyright is not about the content but the layout and stuff, but I'll keep you guys updated.

Dive Into Python 3 is available on Amazon(affiliate link, this one isn't ;-))and most other bookstores so don't hesitate, it is a great book. And if you are unsure and want to check a chapter out or two (or the whole book), visit the Dive Into Python 3 website
avatar

oxygen-molecule

A couple of days ago some friend came by for a beer (or multiple beers, who keeps count anyway?). However after some time I had to show something on my laptop and firefox was still open. So I got some complaints that GTK+ apps in KDE look horrible, which is true.

Now I am a konqueror user but every now and then I need to start Firefox. For some reason my bank can’t seem to properly write web apllications, they do a browser check and konqueror is not supported, faking the bowser string is not that hard but for some reason all the firefox specific things they want to do then fail on konqueror, long story short I sometimes have to use firefox!

So one of the guys suggested to use oxygen-molecule, it is in portage so it is just a matter of compiling and following the README. And I have to admit all of a sudden firefox looks awesome! So to all KDE users that have to run GTK+ apps every now and then get yourself oxygen-molecule!

Posts for Tuesday, January 19, 2010

Gentoo XFCE4 / XDM / TWM Problems

Okay... So with the latest update to xorg-server (I think it was 6.5), xdm stopped loading XFCE4 and I couldn't get it to load anything but TWM.

Here was the problem:

Somehow, an important file got removed.  The file is this one:


  • /etc/env.d/90xsession



The contents of the file is simply:

XSESSION="Xfce4"

With that, (and all the other /etc/rc.conf and /etc/conf.d/xdm settings in place), xdm and slim will now properly load XFCE4!

Just thought I'd share because google was totally confused.  Hopefully this will straighten things out.

Got my T400s!

On Thursday I finally got my brand spankin' new shiney matt laptop — the wonderful Lenovo ThinkPad T400s.

And I *love* it! :D

Everything from the design, matt finish, display, weight (or lack thereof) to the keyboard seems just perfect for me!

Whatever you heard positive about ThinkPad keyboards is true ...and even more so for the new keyboards on the T400s! It's the best keyboard I ever touched! The moment my fingers touched the keys, I knew this will be the laptop on which I'll write my thesis, save the world and do many wonderful things in hopefully as many years as possible.

Another small feature that I adore is the hardware mute button with an integrated red light indicator. As it kicks in already after BIOS it's ideal for dragging along to lectures and into libraries.

The only grudge that I hold against Lenovo on this box is that it comes with only ExpressCard/34, so a SecureCard reader won't fit in it — so much for a flush reader for my fancy Fellowship card :\

I hope I'll sort the problem with the MS Windows tax as soon as possible, so I can wipe the HDD clean and get my nice Gentoo GNU/Linux on it :]

hook out >> going to bed

Posts for Friday, January 15, 2010

avatar

The economics of technology

The long-term success of a company is caused by its people. The long-term success of a product is caused by the producers. Consumers are not the cause of success, they are a symptom of success.

That was the ideaology I got into a debate with my friend the other day. I was pro and he was con – mainly citing how the age-old laws of economics don’t simply break down in an industry and should be the be-all and end-all. I still disagree and have always believed there was something very fundamentally wrong with the whole science of economics. Before I continue I will have to admit that I’m not a fan of economics – you cannot put people on a graph. Even if you were dealing with statistically large enough numbers of people to create an average behavior we must still look to the very core of our behavior – why we do what we do.

A while back I told people why you do what you do – in a nutshell, every action you take is the action that you believe will cause yourself the most happiness, given the conscious or subconscious knowledge you have at the time. If being sad will make you happy – be sad! If you purposely choose to hurt yourself to prove me wrong, it is the satisfaction you gain from proving me wrong that gives you that happiness. If you sacrifice yourself for the benefit of others, it is because you prioritise the happiness of others, and following your belief will make you happy. If you choose to stab yourself, it’s because you believe stabbing yourself is the best thing you could possibly do (otherwise you would’ve have done it). This creates the question on whether or not “which” happiness is the best, but that’s a highly subjective question and thus we must leave delusion to a topic of its own. For this reason instead of referring to it as happiness I would refer to it as the “best”, to remove confusion as to the actual definition of happiness.

When applying this mentality to a society, it still doesn’t change one bit – and will never change no matter how large the sample. When looking at this from an economic perspective, for example in the labour market, we understand that people choose jobs because of this very same trait – and will not leave the job until the benefits of leaving are greater than the benefits of staying. For the factor of production enterprise, we understand that they take the risks and shape the market from what they believe is best. Capital and land are simply instruments of the former two and are therefore only tools that will accelerate the choices of the former two. When looking from the demand-side of things, we see that consumers purchase what they believe is the best to purchase – and it is empirically evident that their purchases will affect the choices of labour and enterprise.

However what I propose is that this influence is very much a short-term effect. If somebody invents a product, that product will exist as long as there is developer interest in the product. The greater the developer interest, the higher potential success of the product. In the long-term, seeing as all factors of production are variable we see that there will always be developer interest in the product as long as one person believes it is the best thing to do at some point to develop the product.

Developer interest is what causes the product to evolve. The product can evolve in either a market-orientated view or a product-orientated view. The market-orientated view is when the actions of labour and enterprise are being influenced by consumers, whereas the product-orientated view is based solely on the producer’s own beliefs. For a product to be successful in the long-term it has to undergo innovation – without this it will be pushed out through the process of creative destruction. Innovation by definition, no matter what its orientation must be producer-originated – and fundamentally the producer will produce what they believe is best. If other developers believe in the same, they will contribute and offer support, causing the product to grow, continue to innovate, and ultimately succeed in the long-run. Why? Because the very reason consumers will buy the good or service is due to this growth and innovation.

The conventional view is that this is a circular process – that consumers influence developer interest and developer interest influence consumers. However I believe otherwise – that producers have the final say in the long-run, but more importantly, in the very-very short-run. The reason is that there two root causes of what might seem to be a circular process, society and money.

  • Money is seen as the primary medium through which consumers can influence enterprise and labour. However in the very short-run money is almost completely disregarded in people’s decisions. Ideas will be chosen on the basis of their substance, not their potential earnings. In the long-run, money is as unpredictable as any other factor and it’s inflow is actually determined by the original short-run ideas.
  • Society is when the decision is based on the reactions of others. When dealing with an idea owned by a single entity, such as in innovation, society plays an almost negligible role in determining the realisation of the idea, even though it may play a role in either impeding or accelerating its progress.

From this we see that the circle is merely a single line of processes. What consumers buy depends on what producers make. How much a consumer will buy in the short run depends on the magnitude of developer interest. In the medium-term consumers will determine what happens to the product but the product will only survive in the long-run if developer interest is maintained.

A quick look at today’s market shows that this “long-run” period is indeed extremely long – almost synonymous with the business cycle. This inability to survive in the long-run is understood, yet disregarded as it is too far into the future to infer any meaningful derivations. This is very true – for most industries. However for the technology industry simply because it is at the forefront of progress this business cycle has been shrinking at an alarming pace, meaning that understanding how ultimately goods and services are producer-determined becomes very important. The implication is that trying to influence consumer-related symptoms, such as advertising, prices, quantitative or qualitative restrictions should be given second priority to trying to influence the mindset of producers.

To illustrate how this mindset is currently not understood I will ask a simple question. You work for a company. Let’s say your manager comes up to you and tells you to create a computer program of your liking. You scratch your own itch, so to say, and develop a product. A few weeks later your manager comes back with the production department manager and takes a look at your product. Both of the managers say “I really like that! I think it’s going to be a huge success!”. Now is the manager a producer or a consumer? If you said producer, you are wrong – they are both consumers. They have the ability to consume the good, but not to develop the good. It is important not to confuse the accelerating properties of capital and land with the developing properties of labour and enterprise. For this reason the success is not likely until other potential developers recognise merit in your work.

Some examples of how success has been producer-originated is in the iPhone, where the main reason consumers buy it is due to the amount of applications available on it. The Windows Mobile phones, due to the large number of applications on it, but failing because there is a lack in core developer interest (the OS has not been updated in ages). Android by Google, whose producer-embracing philosophy of so-called open-source has spun up almost 20,000 applications since its launch and is currently seeing a huge acceleration in market share. Linux – whose stubborn developers continue to progress despite the desktop market saying the complete opposite is now appearing like hot cakes in the market. Firefox and their thousands of add-ons – and its current battle with Chrome, which has exhibited innovation in browsers (and will be pushed out of the market if developer interest is lost or transferred to Chrome). Internet Explorer 6, where developer interest is finally moving away because they finally realise they don’t care about the customers when making websites that much (thank goodness). You think you use Windows because it’s good? No – it’s because it became a standard (even though back then Apple’s OS was miles ahead), which is what attracted developer interest. The list goes on.

This trend is most easily recognised in the technology industry (software, specifically) but is starting to be seen elsewhere, especially in other creative industries. A simple measure to determine the extent to which this trend has progressed in an industry is to ask an employee “why did you choose the job in the first place?” In the future this trend will start to bleed into other industries due to the increasing mobility of factors of production, increasing integration of markets into a worldwide affair, and of course the results of mass-amateurisation.

Finally as a closing note I’d like to throw in the topic of dogfooding – when producers use their own products, thus duplicating the roles of consumers as well as producers (hint: used really extensively in Google for a long time). This is a recipe for a self realising upward spiral of developer interest and consumer interest – finally creating the conventional circular process we think will always exist otherwise.

Related posts:

  1. Chrome in the Clouds: The Google OS
  2. Future of the Workplace due to Technology
  3. Is there such thing as a good monopoly?

Ubuntu and DVDs: Still pathetic in 2010

I'm a little blown away that Ubuntu 9.10 still has no DVD support and can't even install it. Pretty amazing 0_o.

Ah well, after seconds of googling I found a slightly popup laden answer:
http://shibuvarkala.blogspot.com/2009/10/how-to-make-ubnutu-910-karmic-koala.html

Not bad. a) install Mediabuntu repos, b) install DVD support.

Still, it's 2010 and Ubuntu has no support for DVDs. In any way. Lame.

avatar

Greek adblock plus filter on the official subscription list

Six months after my original post on the creation of Greek Adblock Plus filter, the filter is finally added on the official subscription list thanks to Wladimir Palant.
Apart from Adblock Plus add-on for Firefox/Iceweasel/etc, the filter is also usable by the AdThwart extension for Google Chrome/Chromium

Until today the list peaked at 70 subscribers…I hope this will make more people trust my filter list and reach at least 100 subscribers.

As a sidenote, my RBL for Greek spam has moved to a new, better server thanks to a very kind person who donated it and some people administering mail servers have already added it to their spam filters. Since the original announcement the RBL jumped from 500 reqs/min to 2000 reqs/min.

avatar

Three BB apps that are a must have!

Let's face it, you have a blackberry which means:
1. Your employer forces you to use it.
2. You just hate the kiddy phones (read iphone and clones)
3. You love it, you try out every application that gets reviewed on Crackberry and unsuccessfully try to make it replace your laptop/desktop. But then, you do kind of succeed one step at a time and then you give yourself a smug look in front of the mirror.

If you are the no 3 kind, you would definitely understand the problem I am talking about (Because I am the no. 3 kind too!). I try out almost every BB app that floats around. Sometimes, I like them and use them, but most of the times I install an application, try it out and then just forget about it. This has made my phone worse than a Windows XP box : it's slow and it drains battery like someone is actually sucking it out of it with a vacuum cleaner. One other reason my phone's battery drains quickly is that I have wifi always on by default. Although, the main reason I do that is to increase battery life (3g modems typically suck up a lot of power), the end result is probably what I wanted to avoid in the first place although I will never ever admit that. So, in the end, starting with a full charge in the morning, I am almost out by the time I get home around evening.

With most applications running on Blackberries, unless you don't specifically exit the application, the application will just run in the background. That's a major pain and can make things really slow. Quickpull can be a good passive solution for such problems. Its approach is simple, it simulates a battery pull every day (or night) at a specified time. That kills all those nasty background processes! The only downside is the long wait before your phone boots back up. So, the time for the reboot has to be set carefully! There is yet one more impressive application : Memory Booster . Unfortunately, it's a paid app but it does a pretty good job of what it claims to do. Just open it up and click on "boost memory" and it's gonna do its magic to free up some memory. It has also a nice graphical memory map option that shows memory used and java objects in a bar graph. What I like most about it is that it doesn't require a reboot! : very useful to quickly free up some memory when you are trying to open your calendar for example but all you see is a busy icon.

The last application that I am going to mention is SmartWifi. Unfortunately, that's a paid app too but it diligently remembers to turn off your phone wifi on your behalf. Add a wifi location to its list (such as your home) and it will turn it back on once you are home. That does save a lot of battery that would normally go waste on wifi scanning in unwanted places.

So, if your story is somewhat similar to mine, take note of these three apps : Quickpull, SmartWifi and Memory Booster. There's a fair chance that they will make your BB life a little better if not perfect.

read more

Posts for Tuesday, January 12, 2010

libnoise-viewer


i’ve just fixed most bugs in libnoise-viewer [1] and the software is really usable now. it features a QGraphicsScene and a QGraphicsView and to make it faster i’ve used some it::blackmagic called threads. Actually i used QThread and this was my first real use of multi-threading and it works pretty well. When i scroll the planar area small tiles are generated, two at a time are dispatched so that a dual core system is ’saturated’ cpu load wise.

This viewer uses the ‘noise::module::RidgedMulti‘ module to generate the surface in a black/white fashion. All i did was to apply a color-band according to the relative height. As you might have seen already, there is a black/white vs color toggle. Using this you can visualize the heightmap.

if (job.colorstate) {
renderer.ClearGradient ();

renderer.AddGradientPoint ( 1.000000, utils::Color (0, 90, 0, 255));
renderer.AddGradientPoint ( 0.740000, utils::Color (0, 129, 0, 255));
renderer.AddGradientPoint ( 0.700000, utils::Color (0, 190, 0, 255));
renderer.AddGradientPoint ( 0.650000, utils::Color (0, 250, 0, 255));
renderer.AddGradientPoint ( 0.600000, utils::Color (120, 250, 250, 255));
renderer.AddGradientPoint ( 0.390000, utils::Color (20, 120, 200, 255));
renderer.AddGradientPoint ( 0.340000, utils::Color (20, 50, 250, 255));
renderer.AddGradientPoint ( 0.200000, utils::Color (0, 0, 120, 255));

renderer.EnableLight();
renderer.SetLightContrast (3.0); // Triple the contrast
renderer.SetLightBrightness (2.0); // Double the brightness
}

The rendering speed is very good. But see yourself (the upload of the ogv video to wordpress media didn’t work, so i host it somewhere else).

http://lastlog.de/misc/wordpress/libnoise-viewer.ogv

If you want to visualize other ‘libnoise graphs‘ you can edit the sourcode (see renderThread.cpp) , all you need is to add 3 or 5 lines of code:

module::RidgedMulti myModule;
myModule.SetOctaveCount (job.octave);
myModule.SetFrequency (job.frequency);

Again: if you ever have to use threads, use QThreads since signals/slots are threadsafe (coming with qt ~4.2 if i recall correctly) communication between the threads is very easily done using the signals/slot mechanism, which means using the event loop.

I need to say, this is the 3rd project i’ve migrated to cmake and to do that i needed about 30-50 minutes since i also cleaned up the sourcode and did some other things as renaming of files and re factoring of class names.

I’ve also updated to =dev-util/kdevelop-3.9.97 this release fixed all the crashes the previous release had and i absolute love this ide. Currently i can’t think of ever using something else! The cmake integration is very good and makes a lot of fun using it. Renaming of classes or member functions as well as object’s names works like a charm!

Unlike other KDE components kdevelop 3.9.97 works reliably stable for me!

links

[1] http://github.com/qknight/libnoise-viewer

[2] http://github.com/qknight/libnoise

avatar

Unlocking Zimbra Advanced Searches

Hi and welcome to 2010!  This year I plan to blog more, read more, do more, learn more, and have more time left over...

This is a quick post to tell you how to do some nice advanced searching in Zimbra - the webmail client.
  1. In your Zimbra interface, select Preferences then General.
  2. Under the Searches heading, select Show advanced search language in search toolbar.
  3. Save and go back to Mail.
  4. In the Search box, select the Advanced link
  5. Choose some options (my favourite is status:unread; status:flagged; and time is today)
  6. By default this ORs some and ANDs the result with others, giving you a very small set of results:
    ((is:flagged) OR (is:unread)) date:-0day
    Edit the search string and replace everything with OR, and change 0day to 1day:
    (is:unread) OR (is:flagged) OR (date:-1day)

    You will now have a very powerful search, that gives you a quick summary of all todays messages, plus any unread or marked message from the beginning of time!

  7. Save the search, and you can access it at any later time.  Note that other preferences such as the sorted-by column is also saved with this search.

Well that sounds easy enough!  Why can't other email clients do the same thing?  Evolution's advanced search folders were unmatched until I discovered this..

Claws has no advanced cross-folder search that is persistent across instances of the application.


Thunderbird 3.0b2 (the last I played with) has persistent search folders, but they can't pull in related emails (up or down the thread) like evolution can.


Evolution is equipped to handle my business and personal email accounts:
  • I have thousands of emails in multiple pop and imap accounts.  I have no choice but to separate my multiple work and home accounts like this.
  • I have some folders with thousands of emails each, dating back years, which helps with long projects, contracts, and a bad memory!
  • I need some way to keep track of important emails, and at the same time see and sort new emails

Evolution can handle large folders with thousands of emails each.  It can of course filter messages based on mailing lists, subjects, sender and even run an external application test over an email.  I've mentioned it's search folder goodness, and it has powerful quick-searches too that can search the current folder or account.
avatar

Tech tip #4: Copy a random set of files from a directory.

More for archival purposes than anything, today I wanted to copy some songs out of my serious mess of a music "collection" onto my microSD card. I didn’t want to have to choose and I haven’t rated my songs so that wouldn’t help. Instead I wanted a random selection of songs. I’m not a bashmaster (absolutely pathetic at it, actually) but this is what I ended up using – after symlinking all of the various directories I had my files under together:

find -L /home/drive/music -type f -name "*.mp3" | sort -R | tail -n100 | while read file; do cp "$file" /media/disk/music/; done

-n100 represents how many files are going to be copied. Hope it helps somebody! Of course any improvements are welcome.

Related posts:

  1. Tech tip #2: MPlayer play music recursively in a directory.
  2. Tech tip #3: Rip audio from an .FLV file.
  3. Tech Tip: Speed up Firefox to use less CPU.

Posts for Monday, January 11, 2010

The Amazon Kindle and Linux

This year for XMas/my birthday my lovely girlfriend decided that me thinking about buying this or that EBook reader was just not getting anywhere so she'd decide for me and got me an Amazon Kindle. I won't bore you with the technical specs here, it's an Ebook reader with an EInk display (which means you can easily read it in the sunlight and the battery lasts for ages) but it has one feature the other Ebook readers don't have: "Whispernet".

Now I use Linux on all my machines, I avoid proprietary software and hardware as much as the next guy (though the Kindle does run Linux to be fair) and Amazon's files are DRMed and all that crap, but wow, is that Whispernet thing handy. It basically means that I can access the Amazon Store from all over the world wireless for free and that I can access the English wikipedia wireless for free everywhere (well obviously there needs to be a GPRS/3G network). It means that if I subscribe to some magazine or newspaper on the Kindle I get it delivered automagically and without hassle everywhere.

This has already worked on me quite well, I was on a business trip to Brussels, had a book I was reading finished but some time, so I just spend a few minutes to look around and downloaded "The Gunslinger" which I had always wanted to read anyways. It was really convenient (I wished I had had that on my last trip to Malta where I ran out of books and with Malta being an Island they were bloody expensive over there) and simple, just how I like my electronic devices.

Ebooks are not as cheap as they should be (usually around 5 to 10 US Dollars which is a lot considering that I cannot lend the ebook to someone else or resell it when I'm done with it) but there are also free Books in the Kindle store (old stuff, like the Sherlock Holmes books and similar classics). So to make a few things short, the Kindle is really useful for me, it makes it easy for me to read stuff while on the road, which I really enjoy.

Apart from the DRM crap thing it also has one big problem: It doesn't handle PDFs all too well. It can display them without problems but it cannot zoom properly so I cannot setup the font size as I could with "real" ebooks which basically makes reading PDFs of books a huge pain.

But I found a really cool cross-platform Application to deal with that called Calibre. Yes it is Qt which makes it kind of a pain on Gentoo since compiling Qt takes literelly ages, but it doesn't look as terrible as most Qt apps do and it rocks. It automatically detects your Kindle and what's on there, it can convert PDFs and .CBRs (comic book archives) to .mobi Ebooks which the Kindle can handle perfectly, and it can automatically download missing metadata so the Ebook has the proper author and title. Awesome application for Ebook management, can't say enough good about it.

The Kindle is just a mass storage device to the computer, so I could do all this by hand (calibre comes with command line tools like "ebook-convert" to convert files into ebooks without a GUI) and drop the .mobi files on the Kindle folder but Calibre makes it rather simple and pleasant so I'll probably stick to it.

I should maybe mention that amazon also has a conversion service that is actually quite cool: You send an email to a special address customed to your kindle @kindle.com and the document is converted into an Ebook for you, but the big caveat is that you'll have to pay for the whispernet transfer (a few cents).

All in all the Kindle is a really nice device, the display rocks, pageturns are quick, it's really slim and the whispernet is quite cool. The device works great with Linux and if Amazon could maybe just get their heads out of their asses and drop the DRM I'd be a perfectly happy camper. On the other hand there's many authors like Cory Doctorow out there that already offer free ebook editions of their works and I still got some catching up to do in that department so the next few months of reading are basically already on my Kindle.

If you are thinking about getting an ebook reader the Kindle works great. Other might have fancier features (like the B&N Nook with its color touchscreen) but the Kindle works and whispernet is quite a big deal once you gotten used to it.

Planet Larry is not officially affiliated with Gentoo Linux. Original artwork and logos copyright Gentoo Foundation. Yadda, yadda, yadda.