Recent blog entries for federico

Mon 2010/Aug/30

  • Rooting the file chooser

    Christian Hammond has been working on a very cool branch of GtkFileChooser to let you define roots for the file dialog. Normally, this is what my file chooser looks like — it lets me browse anything on my file system:

    Unrooted filechooser

    In the following screenshot, the file chooser has been rooted to show only my $HOME. Note that no volumes or shortcuts that are outsideof my $HOME show up in the shortcuts pane.

    Filechooser rooted to $HOME

    The API makes it easy.

    GSList *roots;
    roots = g_slist_append (NULL, "file:///home/federico");
    gtk_file_chooser_set_root_uris (chooser, roots);

    And in the following example, the filechooser has been constrained to my $HOME and to /tmp:

    Filechooser rooted to $HOME and /tmp

    This is basically the infrastructure we need to support proper lockdown in the file chooser. At some point it may be interesting for sysadmins to say, "don't let users wander in the filesystem, but constrain them to their home directory, the corporate shares and their USB stick".

    This is bug 609886 - multiroot support for GtkFileChooser.

    The patches are not quite ready yet (in particular, passing a GSList of strings is not very nice for language bindings, I think), but it should be easy to fix for production. Any volunteers?

Syndicated 2010-08-30 14:36:00 from Federico Mena-Quintero - Activity Log

20 Aug 2010 (updated 20 Aug 2010 at 22:04 UTC) »

Fri 2010/Aug/20

  • Which document is open in a window?

    Yesterday I mentioned a patch for Evince to add an "Open Containing Folder" command. In the bug that tracks the patch, Milan Bouchet-Valat asked about having an X window property that apps could set to let the environment know the URI that is being shown in a window.

    This sounds pretty useful. I told the Zeitgeist hackers about this, and Michal Hruby told me about exactly the same proposal, which had some discussion in the wm-spec-list.

    The basic idea is to add a _NET_WM_CURRENT_URI property to windows, whose value is a string with the URI of the document being viewed. From the application programmer's viewpoint, this would be something like gtk_window_set_current_uri&nbsp(window, string). You would call that function when you load a document.

    Gnome-shell and window managers could use this information to do several things — offer the "show in file manager" command themselves, provide information to Zeitgeist about the documents that are open at any one time, etc.

    The discussion has an interesting mail from Luboš Luňák. It seems that KDE has already been considering something similar.

    Extending the idea a bit further, gnome-shell has mockups to show a list of tabs that are open in your web browser. If you make that window property be a list of URIs (for all the open documents) instead of a single URI, then the window manager can list the open web pages easily. You would need a human-readable list of document titles (and possibly favicons and other nasties), but details, details...

    I think we would also need some sort of message that the window manager can send to windows, like "focus this document" for when you select your tabbed web page in gnome-shell's lists. This message should be the only command that we add to communicate from the window manager to apps; in theory you should be able to do everything else from the app itself, once you have focused the documents — close the document, move it, etc.; there is no need to complicate the window manager with that knowledge.

  • For my Mexican friends — correlación entre municipios PANistas y violencia.

Syndicated 2010-08-20 15:09:00 (Updated 2010-08-20 22:04:52) from Federico Mena-Quintero - Activity Log

Thu 2010/Aug/19

  • "Open Containing Folder" for Evince

    Remember the lack of bidirectional navigation in our document windows? The problem is that you can go down in the folder hierarchy with the file system until you open a file, but you cannot go up from the document app to visit the file system again.

    I just made a little patch for Evince to add an "Open Containing Folder" command, similar to the one that Firefox has in its Downloads window.

    Open Folder command

    This patch is is at bgo#627443.

    Unfortunately, Nautilus currently seems to have a bug. If you launch "nautilus file:///blah/blah/foo.pdf", Nautilus complains that "foo.pdf is not a folder". I'm sure this worked at some point before — you could make Nautilus open a window showing a folder *with* a certain file already selected.

    In the meantime, my patch for Evince just causes Nautilus to open a folder window. It would be nice if it could also select the file in that window.

Syndicated 2010-08-19 17:56:00 from Federico Mena-Quintero - Activity Log

Mon 2010/Jul/26

  • Not attending GUADEC

    The bad news is that I am not attending GUADEC this year. I miss you, people! This is the first GUADEC in which I fail to be a fixture of the conference.

    The good news is that I have a good reason for not attending. I will be at the inaugural event for the Talleres Libres de Artes y Tecnologías, or Free Workshops for Arts and Technologies.

    Talleres Libres
	      de Artes y Tecnologías

    There are several ideas behind the Free Workshops:

    • Resurrect traditional techniques for agriculture, woodworking, metalworking, permaculture, textiles — all the arts and crafts that no one longer knows how to do because everyone buys everything pre-made.

    • Publish that knowledge in online form, under a Creative Commons license.

    • Create physical workshops with the tools and knowledge for those arts and technologies. You need a space to make stuff; we make it happen.

    • Form an internal economy based on import-replacement. It's better if I use soap that my friend Joaquín makes, than to buy soap at the supermarket. I can make the wooden molds that he needs for his soap, or I can trade it for some vegetables that I grow.

    • Work to improve the quality of life of each workshop's local community. Are people filling their house's water tank from a truck? Help them build a rainwater-harvesting system. Are people going to the supermarket to buy bread? Start a bakery with a hand-built oven.

    Think of it as a 21st-century, networked, distributed, copyleft hippie/maker commune.

    My starting contribution to the Free Workshops is knowledge in woodworking and building techniques, and space in our backyard orchard and woodworking shop.

Syndicated 2010-07-26 15:12:00 from Federico Mena-Quintero - Activity Log

Tue 2010/Jul/20

  • A Roubo bench for woodworking

    Since I got interested in woodworking, I have used various inadequate surfaces to work and hold the wood. A wooden saw-horse that our builders left behind, the edge of the balcony, the quasi-vertical edge of the bathtub. This is all extremely uncomfortable, and so for the past months I have been working on a real woodworker's bench.

    Roubo workbench

    This is the back view of the bench, with a few bar clamps and a chisel holder.

    Back of the workbench

    André Roubo was a French cabinetmaker from the 18th century, who wrote a massive treatise on all the then-known techniques for working wood. The woodworking community online has been abuzz with a translation of Roubo's book that is being prepared by the editors of Popular Woodworking magazine.

    In his book, Roubo describes a workbench and its accessories in detail. This bench is a variation of that one.

    My bench is built from a thick slab of cedar on pine legs. The thick slab makes the bench heavy and stable — it is a royal pain in the ass to use hand planes on a bench that slides around the room. The legs are joined to the surface with through-dovetails and tenons. I am not exactly sure why Roubo built dovetails and tenons like that, but it has something to do with wood movement — you want the face of the legs to remain flush with the front face of the top, so that you can have a continuous surface for clamping.

    The legs have short stretchers with double-wedged tenons, and long stretchers with tusk tenons. This kind of joinery is done without glue; that way if any joint comes loose, I can just hammer it back into position.

    This is how the bench top is joined to the legs.

    Through-dovetails and tenons

    The main function of a workbench is to hold a piece of wood steady when you are working on its faces, edges, or ends. The bench needs to let you hold things in the X/Y/Z axes so that you can work on them.

    Here you can see the leg vise. You can use it to hold a board to work horizontally on its edge or vertically on its end. The leg vise is built using a commercial steel screw. The bottom rail keeps the vise vertically parallel to the leg. The holes in the rail are so that you can fit a metal peg on the outside of the leg, which acts as a fulcrum for the vise.

    Leg vise

    To hold the wood down and work on its face, you use holdfasts. A blacksmith made these for me. They have a 3/4" shaft, which you then fit through holes on the surface of the bench. To secure a holdfast, you just bang on the top of the curve with a mallet. To loosen it, you bang on the back of the curve. The holdfast gets "stuck" inside the hole where it fits, and that is what keeps it steady. The main advantage of holdfasts over clamps is that while you can only use clamps close to the edge of the bench, you can use a holdfast in any place that there is a hole.

    Holdfasts Holdfast in secured position

    Finally, there is a square block of wood which you can move up and down to use as a stop for planing the faces of boards. The stop keeps the wood from moving forward as you plane it. There is also a crochet, or hook, which you use to hold the end of long boards while planing their edge; the other end gets clamped in the leg vise.

    Crochet and planing stop

    People have been talking a lot about workbenches. This is the material that I used as reference:

    Bob Rozaieski's epic videos on building a workbench without using a workbench, using only hand tools:

    Chris Schwarz builds (yet another) workbench:

    Too many parts to list, but see 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,

    Roy Underhill makes sliding dovetails look easy:

    Parts 1, 2

Syndicated 2010-07-20 11:40:00 from Federico Mena-Quintero - Activity Log

28 Jun 2010 (updated 28 Jun 2010 at 23:05 UTC) »

Mon 2010/Jun/28

  • Twelve Lectures on Architecture, by Nikos Salingaros:

    1. Recursion and the Fibonacci sequence. Universal scaling. Biophilia.
    2. Geometric Recursion and Fractals: the Sierpinski gasket. Perforation, bending, and folding. Anti-gravity anxiety. Architecture of the horizontal.
    3. Universal distribution of sizes. Fractal design, ornament, and biophilia. Sustainable systems.
    4. Cellular automata. Sierpinski carpets and sea-shells. Design in hyperspace and connection to the sacred.
    5. Architectural harmony. Christopher Alexander’s theory of centers. Design as computation. Computational reducibility.
    6. Alexander’s 15 Fundamental Properties. Three laws of architecture.
    7. Biologically-inspired computation. Genetic algorithms. Computation versus memory retrieval. Evolutionary regression.
    8. Emergent systems. Examples from Artificial Life. Inhuman experiments. Architectural education.
    9. Symmetry production. Symmetry breaking. Classical moldings. Elementary particle symmetries. Binding energy.
    10. Generative codes and their application to building and urban morphology. Secularization destroys public space. Spiritual architects. Legalizing codes.
    11. Duany-Plater-Zyberk (DPZ) codes. The New Urbanism. Stephen Mouzon’s project. Tall buildings.
    12. Implementation of generative codes in design. Urban plazas. Designing for children. Favelas and social housing.

  • Harmony-seeking Computations, what Christopher Alexander has been working on after the publication of The Nature of Order.

Syndicated 2010-06-28 15:19:00 (Updated 2010-06-28 23:05:45) from Federico Mena-Quintero - Activity Log

Thu 2010/Jun/17

  • Custom prompt for jhbuild

    I used to have a hard time distinguishing jhbuild-controlled shells from normal shells. To help with this, I just pushed a small change to jhbuild. Now it sets an UNDER_JHBUILD environment variable, so your "jhbuild shell" can customize its prompt. You can add this to your .bashrc:

    if [ -n "$UNDER_JHBUILD" ]; then
        PS1="[jhbuild] $PS1"

    With this, my prompt now looks like this when I'm inside a jhbuild shell:

    [jhbuild] guanabana$

Syndicated 2010-06-17 12:15:00 from Federico Mena-Quintero - Activity Log

198 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!