Interaction
Categories
Thursday
May102012

Not ready for the switch

Yesterday, for some unknown reason, Pentadactyl decided that it didn’t want to work any more. I still have no idea why, and since I’ve been suspending my computer for quite a few days now, it might actually have to do with me upgrading Firefox from 11 to 12 quite recently. The problem was actually pretty easily solved by downloading the latest nightly and just fire that up, but before I did that, the sudden loss of Vim-style navigation inspired me to pick up an old project of mine:

Moving from Firefox to uzbl.

It sounds so beautiful

For those who don’t know what uzbl is, it’s basically a browser that adheres to the UNIX philosophy of “doing one thing and doing it well”. What that means is that the browser is split up into small pieces; you have uzbl-core which is not much more than Webkit with some interfaces on top of it, and the actual thing that resembles a browser is either uzbl-browser or uzbl-tabbed.
You know you’re in for a ride if the developers initially didn’t have uzbl-tabbed at all since “window managers should be handling the different instances of the browser, not the browser itself”. All the basic functionality that one takes for granted in other browsers that aren’t strictly browsing are extras here; bookmarks, downloading, completion and other functionality that you come to expect are scripts that are loaded by the main configuration file.

But the beauty comes at a price

If the application is nice then I’m willing to put the time into configuring it. Whether it’s my ZSH terminal, Vim, Firefox or something else, I’ll put in the work to get it just right if I know that I can get that magnificent end result that I envision. uzbl sounds fantastic because I like the notion of being able to configure a system from the ground up, to see what happens and to know what does what.

There’s just one big problem however:

The work necessary to get uzbl to the state my Firefox is in with the numerous extensions and custom configurations would take ages, if at all possible. I decided that I can try to live without NoScript, BetterPrivacy, Firebug and some other nice extensions, as long as I get what I consider to be core functionality to work smoothly. Even this (what I would consider modest) aspiration is a challenge to say the least.

The default configuration gives you Vim-like control, with hjkl-movement and some other things that you might recognize if you’re coming from Pentadactyl/Vimperator, but the similarities end fairly quickly. Once the basic keys were reconfigured to my liking, one of the first things I wanted to tweak was that since I use uzbl-tabbed, I’ll want to reconfigure the NEW_WINDOW action to load links in new tabs. The fact that only the action NEW_TAB worked and not the other two potentially nice ones (NEW_BG_TAB and NEW_BG_TAB_NEXT) was a shame, doubly so when there’s no information for how get it to work.

You’re on your own

This was the first encounter (out of many, I might add) with what eventually led me to give up on the browser. There’s no comprehensive source of information about uzbl… anywhere.
I use Archlinux on my main computer but I know that I might not have been if it wasn’t for the fantastic Wiki. I don’t know if that huge source of information has spoiled me, but I feel like I’m done with the days of guessing myself forth when configuring software. I don’t enjoy being in the situation of “Well I’d really like to do foobar, so I guess I’ll scour tens of config files to see if someone has done something remotely similar from which I can extrapolate some kind of solution”.

I’m done with that shit.

The Arch Wiki proves that even if you put docstrings for every line in your configuration, a Wiki page with some quick and helpful tweaks that every new user would make, is a thousand times better.
As soon as I got any idea on how I’d like to tweak the interface of uzbl, it was followed by the realization that there’s neither a quick nor an obvious way to do it.

The official Wiki is so barren that it seems to be made by and exclusively for the current/future developers. Google isn’t much more helpful, the usual searches for HOWTOs or tutorials yield not much more information than what one would derive from the sample configs that one can find in the Wiki.

See you some other time

The impression I get is that if you’re not ready to figure it out, then you shouldn’t even start. I gave it quite a few hours and at a certain point decided that fixing Pentadactyl would be far more beneficial and far less time consuming.

Some day I’ll probably give it another shot, but by that time I’ll probably come prepared with far more patience and without the expectation to actually replace Firefox.

Thursday
Mar152012

When the tools just don't work

Every once in a while you stumble on that area of software that Linux just doesn’t have covered. You might now be thinking that I’d like to talk about audio and video editing. A fair guess, since you’ll hear people talk about these two as areas where the other platforms have significantly more sophisticated software available. But this isn’t what I’m going to talk about.

You see, I’ve had a look at the video and audio editors out there for Linux, and while it’s generally not as good as what you’d have on OSX or Windows, there are projects that make honest efforts to compete (Rosegarden comes to mind). I think even the cynics can at least call the tools in these areas “rudimentary”.

“Streaming your desktop” in Linux, however, is one area you can’t even fucking call rudimentary. The appropriate description I’ve come up with is “technically working with the help of wizardry”, and I’m thinking about whether that’s too generous.

No audience

I can’t say I’m particularly surprised by this situation, because apart from the occasional recorded screen cast for some brand new package, there isn’t that much of a need, it seems. We don’t have the games to stream, which I would assume is a large part of what drives the revenue of a page like Justin.tv.

I assume most of the people who code in Linux aren’t exactly eager to stream and narrate their work, which could have been that “other area” of content that would have driven the development of tools for streaming. I understand that the Linux community might have less scenarios under which one would want to stream one’s desktop, but I’m still surprised by how dire the software situation is.

The tools

From what I’ve gathered, the most “mature” application available for handling the various aspects of streaming (sound, picture, overlays and so on) is WebcamStudio, which didn’t exactly work. At the best of times it was giving me something that looked like the stream I wanted to pass on, but I never managed to actually get any streaming site to accept the data.
This completely sidesteps the issue that is the buggy as fuck interface, that neither looks good nor works well.

The most stable solution I’ve found, that has actually let me see my desktop on the internet, is the combination of:

  • Letting VLC capture your desktop with a wide array of flags to make sure it comes out right. Figuring out those was a ton of fun.
  • Having a script called “jtvlc” catch the data and send it in through the Justin.tv API.

It’s way better than nothing, but this gives me absolutely no ability to customize the output, except choosing what part of my monitor set-up it should grab.

Conclusion

In a way, I hope I’ve missed something; I hope there’s an obscure package that simply grabs the part of the desktop you want, has a nice interface, and just works. If that magic package exists however, then I haven’t found it.

There are times when I really would have liked to share the view of one of my screens, with some embedded microphone commentary. When the ideas pop up, I’d like to go ahead and just try them out, but in this case, I’m completely hindered.
It might be that the process of getting these things to work under the other systems is also a chore, but at least I’ve seen plenty examples of there being an end result. That’s something I’ve yet to see here in Linux.

Monday
Feb272012

Code I enjoy

Being a CS student means that I will be forced to code in a variety of languages. A lot of our code will be written in Java or C++, but we’ll necessarily get in touch with many other languages, spanning over multiple paradigms.

By no means am I a good programmer yet, but the exposure to the different ways of crafting code has led me to think about what I value (as a novice programmer) in a language. It’s, after all, my main tool of expression.
Is it the brevity of the code? What the community surrounding the language is like? Paradigm or strong vs. weak typing? Or could it be that I need the language to be as “simple” as possible for me to be able to formulate ideas?

My roots, or the lack of them

My first language I got to code in was actually Borland Delphi. I didn’t really know what I was doing, I just followed a guide that let me create a “guess what number I’m thinking of”-application with a GUI that I got to draw.
I was probably about ten years old at that time, and it wasn’t until late elementary that I got acquainted with Java, in a programming course.

Since a bit of Delphi was all I had under my belt at the time, Java was quite the challenge at first. I didn’t like the notion of there being things that I had to write that I didn’t fully understand the purpose of (the concept of “static” was a prime example). Also, while I understood the necessity of getters and setters, it felt weird that I had to write them everywhere; I already had something against boilerplate.

Java has been with me for more than a decade, so I’ve gotten used to its intricacies, but it wasn’t the language that got me really interested in programming.

Inspiration and motivation

While I tried borrowing introductory books for both Java and C++, neither of the languages really interested me. I felt that there was so much to learn, just to accomplish the simplest of things. That’s when a friend of mine introduced me to Python.

The thing I immediately liked about Python was the brevity. To this day I find that there’s something special about seeing text no longer than a screen full (very reminiscent of pseudo code, one might add) execute and work its magic.
It’s empowering in a way, to so easily make so much happen. To let ideas transform into code at such a quick rate becomes not only a tool, but a motivation; when scraping together an application gets easier, the imagination takes over.

Another thing that I hadn’t experienced up until my encounter with Python was easily readable code. I didn’t know of the expression at that time, but “self-documenting code” was something I really enjoyed; whether the names got longer or the code had to be restructured, it was worth it for the readability.

Today it so happens that I code more Ruby than I do Python, but I still love the language. Python both motivated and influenced me, but not to the extent that Haskell did.

A different way of doing things

Haskell is special to me because it showed me a totally different way of crafting code while still keeping it short and expressive. Once I got past the peculiarity of functional programming it made me re-evaluate what I’d consider “comfortable” when I write code.
As soon as I got the taste for higher order functions, currying, lazy evaluation and all of the other facilities that Haskell offers, I started to think about why other languages hadn’t introduced me to these concepts.

The thing I love the most about the language is that solving problems in it is a satisfying experience. When the recursive thinking became more natural, and I devoted the time to expand my vocabulary of functions that Haskell offered, magic happened.
A friend jokingly referred to Haskell as a “set of glorified one-liners”, and while there’s more to it than that, there’s joy in crafting those one-liners.

Learning one’s preferences

In his work “Epigrams on Programming”, Alan J. Perlis wrote:

“A language that doesn’t affect the way you think about programming, is not worth knowing.”

I can’t say that I had the greatest time during my struggles with Prolog, or that fighting with all the details one has to keep in his head when writing Assembly was a pleasure, but it made me see things differently.

I guess it’s a “coming of age” thing for a programmer to realize not what you want to code, but how you want to do it.

Thursday
Jan262012

Att stå still gåendes

En ny vecka gryr och jag står med hopp.

Jobb jag har av varje storlek och slag,
nog till att fängsla mig natt som dag.

På måndagen är brådska mig främmande.
Jag lär ej jobba alls, trots att arbetsbördan är skrämmande.

Jag börjar strax, efter lunch, ikväll, inatt.
Imorgon jobbar jag säkert ifatt.

Tisdag och onsdag far fort likaså,
jag vet inte ens vad jag skall jobba på.

Vid torsdag morgon är det dags att rappa på,
halva veckan har gått och resultaten är som bäst små.

Idéerna och visionerna rusar då förbi,
alla saker som det vore bra om man avklarat i tid.

Men det är ju bara tankar, drömmar som hägrar var dag;
de ändrar inte något, minst av allt att jag är så svag.

Utan att minnas vad jag gjort, de timmar jag haft allt redo för drift,
jag sitter där vid midnatt, slagen av min lathet och apatisk som av ett gift.

Natten är dock ej slut för mig, midnatt är blott sen kväll.
Med småtimmarnas tystnad skall det här väl vara en bagatell?

När fredag dagas är allt för sent och hoppet borta.
Det enda jag klarade av var att få dagarna att kännas korta.

Skall man ens påbörja dagen när man redan igår var slagen?

Jag kan säkert lura mig själv en dag till,
“Jag tar igen allt, bara jag vill!”.

Värst är det då jag bara har helgen kvar,
för det är då tiden som snabbast far.

Flykten från arbete med sig oftast skulden bär,
men ej på helgen, inte den minsta tyngd på mig tär.

Vet något i mig att ambitioner skall stängas ned? Att lättjan skall skölja över?
Ohämmad kommer jag göra precis vad jag vill, men ej det jag behöver.

Måndag nalkas och ännu en vecka har försvunnit;
all den tid man kunde ha använt har mest uti sanden runnit.

Är något annat möjligt?
Kommer jag att ändras under årets lopp?

Jag kastar bort dessa tankar…

…ty en ny vecka gryr och jag står med hopp.

Tuesday
Aug172010

Just a toy

Yesterday I had an experience that was moving. It felt special, yet to the casual observer it would have been anything but special.

It involved a Rubik puzzle that I hadn’t solved yet, and I just felt like finishing it. After all, I know how to solve a 2x2x2, so this one shouldn’t have posed a problem.

Handle with care

Inherent to the puzzle’s design was that it turned strangely. In some cases the turns were smooth, in other it felt like the contraption worked against you.
Regardless of it’s intricacies, I treated and used it like a regular 2x2x2; for me it was as simple as them both being solved in more or less the same way.

So with the first of three “cubes” solved I started twisting and turning the second one. As mentioned, it was normal that it occasionally stuck and made a fuss about simple turns, but i kept on going, a couple of time forcing a turn through instead of wiggling in the opposite direction.
After some work however, I had the second cube finished and only the last one remained. Halfway through the third one however it happened.

Something broke.

Something inside the middle cube went loose, and the entire construction along with it. This was with me being one and a half algorithm away from finishing the puzzle for the first time.
I clasped the puzzle, realizing that if I let go of any one loose piece, the entire thing would fall apart. Greedily, all I thought about was solving it, despite its fragile state. Holding all the pieces on the first and the middle cube together took a hand and some pressure, making the cube very hard to maneuver, but this didn’t sway me; there was no giving up. Slowly I approached the last few moves, and I suddenly hit me that this thing was dying.

It was on respirator and intravenous, and I was still pushing it.

To make things worse, I got to be about four turns away from finishing the entire puzzle when the thing stuck, there was no moving it. It was as if it had given up; the last turn was made.
Seeing that there was no way to complete the puzzle, despite being so close, I gave up. Putting it down on the table it went to pieces, its entire structure crumbling part by part.

It was a strange moment because it felt like I had witnessed and been part of a toy’s death bed experience.

After looking at the pile of coloured plastic I stepped back and reminded myself that it was just a toy. I left it at that.