Index ¦ Archives ¦ RSS > Tag: en

Erlang sudo solver

Estimated read time: 1 minutes

First, sorry I'm not yet publishing any code. It's about there is a race at the uni where the fastest implementation wins, so I don't want to share anything before that ends. It'll end in a month, actually. ;)

Other than that, it's a generic sudoku solver, it can solve NxN sodukus, not only 9x9 and it handles extra rules. A detailed description is here (gt).

But of course the purpose of this post is to bookmark a few useful page I found while working on my implementation:

The important part of the later links is three lines:

1> fprof:apply(foo, create_file_slow, [junk, 1024]).
2> fprof:profile().
3> fprof:analyse().

That makes profiling Erlang programs really easy, once you get used to the output, which is a bit weird for the first time. :)


HTTP head support in darcs-fast-export

Estimated read time: 1 minutes

Ian merged my work today, so bzr-fastimport (which contains darcs-fast-export) from bzr now has it out of the box.

This feature is about the following use-case: if you wanted to import a darcs repo to (for example) git, then you had to 'darcs get' the darcs repo first, then import it to git. Now darcs-fast-export can do this without a 'darcs get' if the repo is available via http, reading much less files, resulting less data transfer. :)

(The trick behind it is that darcs-fast-export reads only the patches, while darcs get reads boths snapshots of the repo and the patches, so a darcs get takes much more time than a darcs-fast-export.)


Pairing with kbluetooth

Estimated read time: 1 minutes

Here is the use case I saw: I try to run 'gammu identify' from commandline, it finds my phone, the phone asks if I want to pair with my notebook, I say yes, it asks for a pin code, and whatever I answer, the pairing fails.

Looks like the way it works is the other direction: start kbluetooth, choose settings, devices, then set the mode to discoverable (for 3 mins, that should be enough). Then go to paired devices on the phone, choose delete pairing, then add the notebook again, it will ask for a pin and pairing will succeed.

A bit weird, but it works at least.


gammu2gcal

Estimated read time: 1 minutes

Here it is.

A simple script to first convert your phone's calendar entries to the ICS format, then to synchronize it with Google Calendar.

The first part is pretty trivial, the second isn't. The main problem is that there is no standard API for doing so. At the end I ended up using the web UI from curl, which is pretty hackish, but at least works. :)

Update: there is a new version here. I moved all cookie/form stuff to the curl config, so probably it'll be usable after 2 days as well... :P


Best "first patch", ever

Estimated read time: 1 minutes

If someone is a major contributor in a project, it's always funny to search back the VCS logs to see what was the first contribution. Usually a typo fix or a oneliner patch.

Partly related, cleanups are usually done by major contributors, so a cleanup is typically not e "first patch". Unless we are talking about me and gitmagic.

The funny story is that my first patch is really just about removing two parts of the book. Both were listed as "known git bugs", one was solved a long time ago, and I just fixed the other one a few days ago.


Free beer for a git patch

Estimated read time: 1 minutes

I just received today a free beer, just because I contributed a patch to git. See here.

Hacking is fun! :)


iwiw.net vs firefox

Estimated read time: 1 minutes

So iwiw.net has some flash + js interface to upload photos, but it seems firefox just segfaults here when I want to upload ones. Good idea, I should not bother with doing so.

I've wrote a small script to merge all the lilypond PDFs I have to a single one. Far from perfect, but it's a start.

I've just found album. It's an HTML index + thumbnail generator, it's a bit bloated, but it's not hard to tell it you don't want any extra features. Just downloading the script to $HOME/bin is enough and it can live without downloading any bloated themes.

Ah and the thread on fw-dev about the intel driver vs kms just sucks. I don't have time to build 2.6.32rc1 right now...


launchpad brute-force maintenance

Estimated read time: 1 minutes

Funny, when there is a maintenance on launchpad, they just filter the ssh port on the server, so you get:

ssh: connect to host bazaar.launchpad.net port 22: Connection timed out

Snip. I spent my time earlier today to make package moves in FST easier. Finally I modified the checkout plugin of our git hook framework so that if a FrugalBuild is moved from one dir to another, then the other files from the old dir are moved to the new dir as well.


Interactive revert in git

Estimated read time: 1 minutes

It's a long time since 'dg rev' could be replaced by 'git checkout -p', but that feature was missing from git.git. In the near past it got implemented and you can even avoid hitting enter after every y/n by saying:

git config interactive.singlekey true

One less feature which is unique to dg! (In the long run it would be nice if I could stop recommending its usage to users.)


a2beamer and scalable graphics

Estimated read time: 1 minutes

I spent some time with figuring out how to include piecharts and graphs in presentations.

The nice fact is that both metapost and graphviz output eps, so the result is totally scalable. ;)

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.