Yann Vernier’s Blog

2011-11-06

Moving the blog

Today I helped my mother getting a wordpress site up on our domain, vernier.se. Mostly so that I won’t forget to keep it running, I decided to move my own blog over there, too. I apologize for any inconvenience, but please head on over.

Yann Vernier’s blog at yann.vernier.se

2010-08-27

TestDisk & PhotoRec

Filed under: Free software — yannv @ 00:47

Allow me to present you with a few scenarios, all of which recently happened.

    A friend intended to boot his Windows partition, in order to update a laptop BIOS. By mistake he picked the “recovery” partition, easily done when GRUB’s OS prober can’t tell them apart. Without warning, it erases his GNU/Linux partition, leaving him stranded without a functioning bootloader (it couldn’t be bothered to install a functioning MBR while overwriting that sector). Luckily, he has a bootable USB memory, but all the data he cares about is in the lost partition.

    Another friend is presented with a freshly erased memory card off a camera, from which photos need to be recovered.

    I wanted to extract the music from a Playstation Portable game I own.

This is exactly what the two tools TestDisk and PhotoRec help with. The first finds lost file systems, and the second finds lost files. Both are incredibly easy to use and should be in your disaster recovery arsenal. They work, in many situations (don’t be fooled by “Photo” in the name), and are quite free. This is why I cared not one iota when my Lexar memory card didn’t come with the promised Image Rescue software.

2010-08-26

FrankenCamera

Filed under: Free software — yannv @ 17:11

My question on camera selection, for the moment, has one answer. Unfortunately I can’t afford it, and it still needs a lot of work. The Frankencamera project now supports one consumer available hardware platform, the Nokia N900. There’s lots going against it, too, such as really slow switching between live preview and high-resolution photo capture, but they are things I could work on – if I had anything it worked with. I might look at using it with UVC, but it won’t be nearly as useful as the raw sensor access it has in the N900.

2010-04-27

Literate programming

Filed under: Free software, Programming — yannv @ 21:18

That’s right, I’m finally beginning to take my first small steps towards literacy. I’ve known of the concept for quite some time, joining documentation and program code together into a unified document, but haven’t really been using it. Sure, I’ve used plenty of automatically extracted API documentation, but rarely (if ever) written any. And today, I needed something slightly different – I needed a report on a programming project.

As with earlier reports, I fired up LyX, because I’m a sucker for easy interfaces. I’m not really at home in LaTeX, and had prior experience that LyX could make entry of formulae, tables and such easier. This time, though, I needed some circuits, state diagrams, and above all, source code. So, looking at the options, I found LyX now supports both Noweb and Listings. So I sat about writing bits, documenting the circuit using CIRC, and inserting code with Noweb “scraps” as LyX calls them. Pretty soon, this got me tired.

LyX provided me with two options for the source code: scraps, where I had to use Ctrl+Enter to get halfway reasonable spacing, and had no indentation or syntax assistance, or Listings, where code was reformatted for printing but not in the editing view. Besides, my CIRC drawing was just literal code anyhow, so LyX didn’t help very much in the WYSIWYG department. Even looking at the file, it was clear that LyX was just adding overhead – my document would be cleaner in Noweb directly.

Having written just a little code inside LyX, I now knew I wanted back to a proper programmer’s editor. That meant Emacs or Vim. Emacs did open Noweb documents happily, but the syntax highlighting turned out to be a bit bipolar. It was switching, depending on the cursor (point?), between TeX and C sub-modes, and reinterpreting the whole document each time – which destroyed the source context. I did find a simple workaround by using /* and */ in TeX comments, letting the C mode know the text wasn’t code. Not really a big deal, but I’m not used to Emacs, and this swapping (reminescent of per window palette switching in X) was annoying either way. Vim is usually my editor of choice, but it didn’t recognize Noweb at all. For Vim, I found a few scripts, and the highest rated one actually worked. It’s not perfect – it has a few hardcoded languages it can recognize within Noweb – but it’s easy enough to modify if needed, and it does the job.

Noweb style programming is a considerable change for me. My code is now migrating from lots of different files into one larger document, within which I’m writing the structure of the code in an easier, modular fashion. It’s not perfect, but I’m learning. The current question is why double dashes (as in decrements in C) are converted to single ones in print. The same thing even happens here in wordpress. Still, a few steps forward.

2010-04-09

54321, a forgotten game pack

Filed under: Free software, Games — yannv @ 09:22

The other day there was some discussion of a 4-dimensional game in an IRC channel I frequent. This immediately led me to think of 54321, a collection of 5 games in 4, 3 or 2 dimensions for 1 player – it’s the first four-dimensional spatial game I played. So I looked it up again, and found no hint of its existence on the author’s site (apparently now Mac-dedicated). I’d expect at least a mention of why it was taken down, but the page is simply removed. The source is still available in various places (my own copy), though, and still works today. It requires SDL and SDL_Image.

2010-04-02

Fossil: project management on the quick

Filed under: Free software, Programming — yannv @ 11:11

Sooner or later, development projects need some revision tracking. Usually right about when you either need an experimental branch for a new feature or sharing the project, which would include releases. You’ll also need to document the work, and if you’re maintaining it at all, probably track issues. Even better if this can all be done publically.
Traditionally, all these tasks are done in central repositories with specialized tools – perhaps RCS (with descendants like CVS and Subversion), Bugzilla, and so on. They’ve been more or less difficult to set up and serve, which lead to services like Sourceforge, Github, and Google Code. There are tools to handle the combination, like Trac. Most of these work, and sometimes they’re just the thing – because you know you’ll want to share the project and spend the time to set up that infrastructure.
Other times, you’re just doing a quick hack. And then you give it to someone. And, two months later, you run into an indirect friend who’s using that same hack, with their own changes, and experiencing an issue you solved later on.. but the code has grown so much you can’t easily track down the changes needed, let alone figure out which release their version is based on.

We’ve seen a move lately towards distributed revision control, with the likes of Git, Mercurial, Darcs, Bazaar and so on. They can, and do, solve the issue of independent development – but only if people use them. Mostly that tends to get stuck on either learning how to use them, or having the tool available. The first is an issue mostly because each tool is different, and the second because they have varying requirements. This is not at all unique to revision control; people hesitate all the time to install software because of complex requirements and so on.

Fossil is a project management tool intended to solve some of these issues. It’s not necessarily best at anything it does, but it does it with a minimum of setup. It has a discoverable web interface, works as one program file, stores data in self-contained files, and offers revision control, a wiki, account management for access, and issue tracking. All set up at a moment’s notice, anywhere. Of course there’s a command line interface too.

I intend to use it for a few minor projects so I get a good sense of how it’s used. At this moment, the most nagging question is if it does anything like Git’s bisection (also available in Mercurial), which is very convenient when tracking down regressions.

2009-10-04

Text mode web browsers

Filed under: Free software — yannv @ 01:14

Recently I encountered a quiz question about what a “command line web browser” for GNU/Linux was called. It was apparent that text mode was intended rather than command line – a command line program won’t actively use the whole screen, only the (current) command line itself. What caused more confusion, though, was that several of the answers were existing text mode browsers.

Both Lynx and Links were mentioned. The latter is about in at least two major flavors, ELinks and Links 2. The latter actually supports graphics more and even Javascript, but it’s lightweight enough that it long was my main browser (currently I tend to use Iceweasel, for convenience). The final text mode web browser that came to mind was w3m, which also bears the somewhat unusual distinction of supporting images inside a graphical terminal.

2009-09-27

Metakit

Filed under: Free software, Games — yannv @ 00:50

Some years ago, I encountered a neat puzzle game called Deadly Rooms of Death. While an interesting game in itself, this post is not about that. Having caught my eye, though, I had a thought to port it to some portable gaming platform. I made some effort, unfinished, to port it to Nintendo DS, and then found out more about its structure.

During Software Freedom Day 2009, this came to mind again, as someone mentioned column-oriented databases. DROD happens to use one of these, which also eschews the tradition that database engines are squeezed into SQL interfaces. Instead it’s an embeddable library, with support for file based, in-memory, or indeed overlaid databases, simultaneous reads and writes, and automatic format conversions. It’s called Metakit. This quite remarkable bit of software struck me as convenient yet remarkably unknown. It would do an excellent job in many places SQLite is now used, and I’ve long had a slight distaste for that engine because it not only relies on reparsing SQL statements, it forces conversion to text strings for any data content – particularly numeric entries. I vaguely hope this post will bring Metakit some deserved attention.

2009-09-20

Hearse

Filed under: Free software, Games — yannv @ 00:49

I’ve been asked to post occasional tips about free software. Not some particular type, but merely things I know of that might perhaps be of interest to others. So, today I will mention Hearse. This is a small add-on program for NetHack, one of the most well known and expansive Roguelike games. Ordinarily, in the game you may encounter graves and ghosts of earlier players, but only those who played on the same host. Hearse adds a service for exchanging the “bones” data, meaning you can enjoy this small bit of interaction with your friends even though you play on separate machines. Enjoy!

Create a free website or blog at WordPress.com.