Search Results: "will"

26 December 2006

David Nusinow: Document Writing And Programmer Tools

I love that one of the benefits to working on free software is that it exposes you to tools that you wouldn't normally be aware of. A prime example is software that you can use for writing documentation, like LaTeX and revision control systems. At work I've been writing up a fairly long document. Normally at work I'm forced to use OO.o or word because I have to trade the file back and forth with my boss, but this time since I'm doing all the actual writing, I've been using LaTeX and git to manage the thing. In addition, I need a bibliography and references, so I basically needed something like LaTeX. I send my boss an rtf (made with latex2rtf) and pdf (made with pdflatex) when I want comments, and I can still use the highly structured style of LaTeX to make sure that things like my lists get formatted properly every single time. Trying to do this in Word was both frustrating and time consuming.

The best part about the experience has been using revision control though. Having atomic changesets with a log message is something we tend to take for granted in free software work, but compare it to the change tracking in OO.o and Word. It's amazing how much easier it makes it. I can actually see what I was thinking a few days ago, which was the last time I had been revising the document. Being able to visualize the changes and history with tools like qgit are even nicer. And tags... I don't think OO.o or Word lets you tag specific revisions, but I know that when I do this with Word, I end up with a ton of documents labeled "DavidRev1" and so forth, and I always mess up the revisions by using "Save" instead of "Save As".

And this doesn't even touch on the things I haven't done yet. I haven't done any branching, for example. I'm sure that when I write my thesis, I'll end up using that, but just knowing that it's available is exciting. The thing I wish I could do most though is actually put the repo up somewhere and have me and my boss actually use it the same way a normal shared source code repository is used.

The standard sorry ending to this story is that getting these things in broad use is basically a pipe dream. It continually amazes me that people will put up with Word or Powerpoint when it's so often the wrong tool for the job. The simplest things, like being able to look at a document's history and the diff and know in a minute exactly what you were thinking when you put down your work a week ago, help so much. It's sad because the technology problem has been largely solved (a small GUI frontend would be the last piece), but the evangelism problem remains. One thing is for sure, I'm not looking forward to writing my next paper in Word.

Jeff Bailey: Snow!

Yay! We finally have snow! I took a picture, but need to charge the batteries in order to get it off of the camera. And for that, I need to find the charger in one of these boxes...

It's an odd feeling, realising that this is the last Christmas that Angie and I get calmly to ourselves. Sprout will be ~9 months old next Christmas, certainly old enough to enjoy shiny light s and music and such, even if (s)he* will be unaware of what's actually happening. We've been making the most of being lazy: Sleeping in, reading books, hacking hppa on Feisty... The types of things that a person can enjoy on a lazy day. =)

Moving has been going really well. While we still have a fair bit to unpack, it's past the overwhelming stage. We spent a bit of time this weekend clearing space for things like cooking and walking. We even managed to get a tree up, although the decorations are quite minimal this year.

We have the last of our moving to do today. A last round of a few plants, and a couple breakables that we didn't want handled by the movers. The new subletters show up tomorrow and then we're basically done with the old place.

Everything so far feels like a great close to 2006.

Enrico Zini: pcmanfm-nautilus

Replace nautilus with pcmanfm I'm sponsoring the upload of pcmanfm and I think it's a very interesting piece of software. There's a new upload coming, and I'd like it to have some instructions on how to replace nautilus with pcmanfm, and possibly how to go back to nautilus. Here's the best I found. Replacing nautilus with pcmanfm To have pcmanfm start instead of nautilus:
  1. Go to Desktop -> Preferences -> Session manager
  2. Go to the 'Current Session' tab
  3. There's an entry like 40 Restart nautilus --sm-config-prefix /nautilus-SoMeThInG/: remove it
  4. Go to the 'Startup Programs'
  5. Add an entry to run pcmanfm
Alternatively:
  1. Run gnome-session-remove nautilus
  2. Go to Desktop -> Preferences -> Session manager
  3. Go to the 'Startup Programs'
  4. Add an entry to run pcmanfm
To configure pcmanfm to draw the background:
  1. Run pcmanfm
  2. Go to Edit -> Preferences
  3. Go to the Desktop tab
  4. Enable "Show file icons on desktop"
  5. Customise wallpaper as you wish
Alternatively, I wrote a little script that will generate a ~/.pcmanfm/main configuration file from you taking some settings from gconf:
#!/bin/bash
# Generate a pcmanfm configuration file reading values from gconf
echo "# ~/.pcmanfm/main configuration file generated by $0"
echo
echo '[General]'
echo 'terminal=gnome-terminal'
echo
echo '[Desktop]'
echo 'showDesktop=1'
# Detect wallpaper setting
WALLPAPER= gconftool-2 --get /desktop/gnome/background/picture_filename 
if ! [ -z "$WALLPAPER" ]
then
    echo 'showWallpaper=1'
    echo "wallpaper=$WALLPAPER"
fi
# Detect color setting (doesn't really work: I could not find significant keys)
#COLOR= gconftool-2 --get /desktop/gnome/background/primary_color 
#if ! [ -z "$COLOR" ]
#then
#   R=$(( $(printf %d 0x$ COLOR:1:2 ) * 65536 / 256 ))
#   G=$(( $(printf %d 0x$ COLOR:3:2 ) * 65536 / 256 ))
#   B=$(( $(printf %d 0x$ COLOR:5:2 ) * 65536 / 256 ))
#   echo "Bg1=$R,$G,$B"
#fi
Getting nautilus again
  1. Kill pcmanfm
  2. Run nautilus: it will register itself with the session manager
Open questions Originally, I had nautilus registered in the session manager as something like nautilus --sm-config-prefix /nautilus-SoMeThInG/. After removing it and having it reregister itself, I have it only as nautilus. I have not been able to find out what is the difference. It would also be cool to have a little program that registers pcmanfm as a 'Restart' entry with priority 40, just like nautilus.

Eric Dorland: Breaking the Silence

So it's been a while since I have actually posted something. The last few weeks has just been full of new stuff and changes. Google is a challenging but very enjoyable place to work. I found a pretty nice place to live in Brooklyn that only costs an arm every month, rather than an arm and a leg. I'll be moving this week, but I'm still trying to find a good gym with squash courts and an active squash ladder (and hopefully not ridiculously expensive) and a good place to continue my classes.

I was in Montr al for the holidays, which was nice, but so brief. Nice to see the family and the cats though. I also briefly saw my friends, and also Olivier who I haven't seen for a year. I'm hoping they will come visit me. Wish I could hang with them for New Year's Eve, they're renting a cottage and the whole deal. I'll pretty much need to be in New York, hopefully I will find a fun place to go.

My Debian work has been suffering a fair amount the last month. I sent a good deal of my time off getting Iceweasel into better shape and I've uploaded the result, but I need someone (hopefully Mike) to sign it and get it in the archive, since I'm away from my key.

Adam Rosi-Kessel: They Might Be Giants Are Marketing Geniuses

When They Might Be Giants started releasing kid’s albums back in 2002 with “No!”, I didn’t really understand why they had chosen to go in that direction. Two years later, though, I had a kid, and now I realize They are marketing geniuses.
(my kid)
They Might Be Giants made their mainstream debut in 1986. The oddball audience that really got it would have been between 13 and 25 years old at the time (as was I). Most of those folks now have settled down into stable jobs, disposable income (read: can afford to purchase music), and kids. For those of us worried about inculcating our children with an appropriately developed sense of irony to get them through the next century, TMBG is the perfect prescription. We can play our kids these new albums and rest assured that our kids will eventually appreciate Terry Gilliam, Ze Frank, John Belushi, and the like. And learn the alphabet (mp3) (ogg) while they’re at it:
F is far too fussy and only eats with fancy wine
G eats only gourmet but never can decide
H burns food so horrible
all I tastes is smoke
J just likes drinking juice
and K drinks only soda
(Please note the Cake tribute — which is interesting, since Cake was undoubtedly influence by TMBG.) (If you don’t get the joke, it’s “soda.”) The target audience, of course, is still “us” — those of us over 30, who are more likely to actually purchase music rather than copy it. It’s an interesting reversal of the more typical marketing plan which involves getting kids to nag their parents to buy things. It thus makes a lot of sense that TMBG is selling tracks direct online from their website in unencumbered formats — $9.99/album in MP3 format, or $11.99/album as FLAC files. An extra two bucks for lossless audio? Of course I’ll buy that! You should too.

25 December 2006

Russell Coker: DOSing Windows Vista

Chris Samual writes a good summary of Peter Gutmann's analysis of the cost of Vista (in terms of DRM).

The following paragraph in the article however seemed more interesting to me:
Once a weakness is found in a particular driver or device, that driver will have its signature revoked by Microsoft, which means that it will cease to function (details on this are a bit vague here, presumably some minimum functionality like generic 640x480 VGA support will still be available in order for the system to boot). This means that a report of a compromise of a particular driver or device will cause all support for that device worldwide to be turned off until a fix can be found.

Now just imagine that you want to cause widespread disruption - a DOS (Denial Of Service) attack against Windows users. What better option than to cause most of them to have hardware that's not acceptable to the OS? I expect that there will be many instances of security holes in drivers and hardware being concealed by MS because they can't afford the PR problems resulting from making millions of machines cease functioning. But just imagine that someone finds hardware vulnerabilities in a couple of common graphics drivers or pieces of hardware and publicly releases exploits shortly before a major holiday. If it's public enough (EG posted to a few mailing lists and faxed to some major newspapers) then MS would be forced to invoke the DRM measures or lose face in a significant way. Just imagine the results of stopping 1/3 of machines working just before Christmas!

Of course after the first few incidents people will learn. It shouldn't be difficult to configure a firewall to prevent all access to MS servers so that they can't revoke access, after all our PCs are important enough to us that we don't want some jerk in Redmond just turning them off. Of course disabling connections to MS would also disable security updates - but we all know that usability is more important than security to the vast majority of users (witness the number of people who happily keep using a machine that they know to be infected with a virus or trojan).

If this happens and firewalling MS servers becomes a common action, I wonder if MS will attempt the typical malware techniques of using servers in other countries with random port numbers to get past firewalls. Maybe Windows updates could be spread virally between PCs, this method would allow infecting machines that aren't connected to the net via laptops.

Finally, I recommend that people who are interested in such things read Eastern Standard Tribe by Cory Doctorow, he has some interesting ideas about people DOSing corporations that they work for which seem surprisingly similar to what MS is doing to itself. I'll post about my own observations of corporations DOSing themselves in the near future.

Jose Carlos Garcia Sogo: Python tips for vim

I am using Vim a lot to code in Python. One of the most important thing in Python is indent code properly as t uses indent to mark code blocks, and making that right is a bit painful, as you usually end mixing tabstops with white spaces, which makes code almost unreadable when you open it with an editor with a different tabstop setting. To avoid that, using whitespaces is recommended, but it would be nice that those could be inserted automtacally, and that is what the following lines of code added to your ~/.vimrc file make.
" Tip: set indent parameters for python files.
" Version: 0.1
" Date: 13 May 2006
"
" Description: most python scripts use four spaces for indenting, but
"              sometimes you will end up editing a script where tabs
"              are used; in these situations it can be useful to
"              automatically detect whether spaces or tabs were used,
"              and set some parameters (or call some functions) consequently.
"
" Usage: you can put this script in you vimrc and call the PyIndentAutoCfg
"        function with an autocmd associated to python files, or call
"        it manually, or put it in the python.vim syntax script, or... :-)
" Function to set parameters for python scripts that use
" spaces for indention.  This is also the default.  YMMV.
function PySpacesCfg()
  set expandtab " use spaces in place of tabs.
  set tabstop=8 " number of spaces for a tab.
  set softtabstop=4 " number of spaces for a tab in editing operations.
  set shiftwidth=4 " number of spaces for indent (>>, , ...)
  set smarttab
  set autoindent
  set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
endfunction
" Function to set parameters for python scripts that use
" tabs for indention.  YMMV.
function PyTabsCfg()
  set noexpandtab
  set tabstop=4
  set softtabstop=4
  set shiftwidth=4
  set autoindent
endfunction
" This function returns 1 if the file looks like a python script
" that uses tabs for indenting, or 0 otherwise.
function PyIsTabIndent()
  let lnum = 1
  let max_lines = 100 " max number of lines to check.
  let got_tabs = 0
  let got_cols = 0 " 1 if the previous lines ended with columns.
  while lnum = max_lines
    let line = getline(lnum)
    let lnum = lnum + 1
    if got_cols == 1
      if line =~ "^\t\t" " at least two tabs, to prevent false-positives.
        let got_tabs = 1
        break
      endif
    endif
    if line =~ ":\s*$"
      let got_cols = 1
    else
      let got_cols = 0
    endif
  endwhile
  return got_tabs
endfunction
" Check the file, and run the relative function.
function PyIndentAutoCfg()
  if PyIsTabIndent() == 1
    call PyTabsCfg()
  else
    call PySpacesCfg()
  endif
endfunction
" Call the PyIndentAutoCfg function.  Uncomment this line if you've copied
" this script in the python.vim syntax file or something like that.
" call PyIndentAutoCfg()
au BufNewFile,BufRead *.py call PyIndentAutoCfg()
Also, if you want to convert a file using tabs to spaces, you can do it by using the following Vim commands.:
:set expandtab
:%retab
Update: Stefano posted about using filetype hook files instead of au groups. I think it is smarter, and I didn't knew about after/ dir in ~/.vim. So following Stefano's advice, you should put the ebove script in ~/.vimrc/after/ftplugin/python.vim, so it gets loaded automatically when you open a Python file.

Stefano Zacchiroli: use filetype hooks luke

Xmas Vim tip: use ~/.vim/after/ftplugin/XXX.vim Jose Carlos posted some Python tips for vim. I haven't yet looked thoroughly at the code, but still here is my Xmas Vim tip:
Avoid putting filetype-specific customizations directly in your ~/.vimrc using au groups which rely on specific filename extensions. It's better to put filetype-specific customizations for the filetype XXX directly in the file ~/.vim/after/ftplugin/XXX.vim (in the example it would be ~/.vim/after/ftplugin/python.vim), this way they would be loaded even when you manually do "set ft=XXX" on a file with whatever extension.
For the interested reader the "after" path step is justified by the vim "runtimepath" we use in Debian (cfr. /usr/share/vim/vimcurrent/debian.vim). It ensures your customizations will be loaded after system-wide customizations so that they can be overridden. Oh-Oh-Oh, Merry Christmas.

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

24 December 2006

Lars Wirzenius: Anecdotes: Finnish as an encryption method

Watching my sister's Welsh boyfriend slowly learn Finnish, I'm reminded of the fact that the language is often considered difficult. At any rate, it is spoken by a very small percentage of the world's population. Some Finns therefore think they can safely use it abroad to talk about anything, even if it is embarrassing or sensitive. I've found that not to be true. There's other Finns everywhere. There's always someone who will hear and understand if you say something not meant for outsiders. A couple of anecdotes might prove this. In 1990, I was abroad for the first time, in Eindhoven, the Netherlands, for an ACM programming competition. I and a team mate spent one evening in a local bar, talking with each other. After a while we were interrupted by a Finnish woman who lives in Eindhoven. Luckily, we hadn't said anything too bad, she just recognized fellow Finns and wanted to say hi. In 1999, I was in London for a conference, and had a bit of free time, which I spent walking on Oxford Street. At some point, I was walking behind two young men, in their early twenties. They were speaking fairly loudly, commenting on the physiological features of the woman walking in front of them. The woman eventually stopped, turned around, and started swearing at them. Loudly. In Finnish. My theory is that Finns are slowly taking over the world by spying on each other abroad. That's why there's always at least two Finns anywhere.

Russell Coker: MythTV

I've just been trying to set up a MythTV system, I've had the hardware for this for a while but until my TV broke I hadn't found the time to work on it.

My planned hardware was a P3 system for both frontend and backend. However the Debian MythTV packages take over 250M of memory for each of the frontend and backend programs (more than 500M for Myth programs alone), combine that with some memory use for MySQL, for the X server, and for the rest of a functional Linux system and a machine with 512M of RAM does not perform well. Unfortunately it seems that most (if not all) desktop P3 systems only support 512M of RAM (at least none of my collection of P3 machines does). P3 server systems support considerably more RAM (I used to have a SMP P3 server with 1G of RAM), but a server class machine is not what you want in your lounge room. P4 systems support more RAM but also take more than twice the electricity of P3 systems. The extra electricity use is a waste for a machine that will probably run 24*7, and also requires extra cooling (and therefore probably louder fans which is bad for a machine used for playing audio). Given that I desire the capabilities of a P4 in terms of RAM support and electricity use that is not excessive, my options are one of the recent Intel Core CPUs or AMD64 (both of which apparently use less electricity - not sure whether they would use as little as a P3) or a CPU designed for low power use (maybe a Via). Either option costs more than I prefer to spend (I want to use a second-hand machine valued at $129).

Of course if I could get Myth to use less memory then that would allow me to run both parts of MythTV on the one machine. Please offer any advice you can think of in regard to minimising memory use for Myth on Debian.

Given that I am unlikely to be able to optimise memory use as much as I desire it seems that I will have to go to a split model and try using an existing Pentium-D server machine as the backend and the P3 as a frontend. The up-side of this is that I can turn off the frontend machine when it's not being used (the server runs 24*7 anyway). I will need to get more RAM for the Pentium-D machine, but I had wanted to do that anyway.

The next thing I will have to do is to write SE Linux policy for MythTV and find out why /usr/lib/libmp3lame.so.0.0.0 needs both execmod and execstack (and either fix the library or write policy to permit that accss). I'm happy to have a MythTV server program running on a stand-alone machine with unrestricted access to all resources, but when it's going to run on a machine that is more important to me I need to lock it down.

Now to the design of MythTV. It's unfortunate that they don't support better multitasking options. One feature I would like to see is the ability to play MP3s in the background and then have the music pause whenever TV is selected. When I watch a live show (such as the news) I would like to listen to MP3s before it starts and then at the end of the show (and maybe during commercial breaks) have the MP3 playing resume where it left off. This is exactly the traditional lounge-room functionality we are all used to, when a commercial starts you mute the TV and un-pause the CD player! The advantage of MythTV is that you could do both with a single button - or even automatically with advert recognition!

The method of selecting MP3 files to play is also a little cumbersome and the option to add a song after the current one in the play list doesn't seem to work. Also it's a pity that there is no convenient option to sort the music list by artist, genre, or sone name - there are grouping options but they are all separate and I would like to change the sorting via a single key press.

The startup sequence of MythTV regenerates some images (which takes a few seconds), it seems that this is something that could be cached for a faster startup. Also when I add new MP3 files to the store I have to manually request a re-scan. It's a pity that it can't just check the size and time-stamp of the directories which contain MP3 files and do an automatic re-scan if they change.

Evan Prodromou: 3 Niv se CCXV

We had a tough time getting out of Encinitas yesterday. It seems like everything was going wrong. I'd forgotten to order food for a sick aunt and her family in New Jersey the night before, so I was scrambling with apologies and new orders all morning. Then, when we finally got out of town, we hit traffic for about an hour near Santa Ana. Blech! Fortunately, it's a nice stretch of California highway, and we could see Catalina Island off on the horizon to the west. Our Christmas-eve-eve (or Festivus, if you will) was spent at Maj's parents' house in Long Beach, with about 30+ Jenkinses plus various offshoots and friendly relations. They have a huge house near Long Beach/Belmont Shore, with a giant tiled patio area that goes right into the house. It was a good place for a party. Amita June got some nice gifts from family, including a screaming monkey doll dressed as Superman. Yeah, we already have one screaming monkey doll with an "I LA" t-shirt, so this new one will join our growing collection of screaming monkeys with poor sartorial taste. tags:

Typewriters are broken Yesterday Amita June and I were playing with pyKeys, from the awesome pyToddler suite of tools, and I realized that typewriter keyboards are broken. I was showing her that when she pushed on the key marked "Q", a "Q" would appear on the screen. But that's not what happened: instead, a "q" appeared on the screen. That's not a bug in pyToddler, of course: that's just the way typewriters work. If you click on the button marked with a capital letter, it prints the lowercase letter on the paper or screen. To get the capital letter itself, you have to put the keyboard in another mode, or use a modifying chord key. I'm not sure why this is the case. It's clear why we use modifier keys to make capitals, since we type lowercase keys much more often. But why do keyboards show the capitals printed on the keys, then? tags:

Free Culture Christmas If there's anything that gives a bracing jolt of Christmas cheer, it's 235 Creative Commons Christmas songs. Thanks to Uwe Hermann for compiling this fine list. tags:

Julien Blache: pommed v1.0

mbpeventd has just got a new name for Christmas, and it’s now called pommed :-) I went toward a more generic name as we’re adding support for the PowerBook too (plus it’s a semi-private joke for Yves-Alexis and me). This should, by the way, make it in the next release or the one after the next. New features: gpomme is a GTK+ client suitable for all environments; you should start it when your session starts.
wmpomme is a WindowMaker dockapp, as the name shows. The next version will feature set methods in the DBus interface, and PowerBook support if it’s ready by then. Due to the name change and new packages, the package is in NEW. You can grab it on http://people.debian.org/~jblache/pkg/pommed in the meantime. This release means the mbpeventd-dbus branch is closed :-) Merry Christmas to you all.

David Welton: Apples, Oranges, and Culture

Apples and Oranges A number of people wrote irate comments after my article about Ruby's eBay API beating PHP hands down. They complained that I was comparing apples to oranges, because the Ruby library I was using was nicely crafted, whereas the PHP one was some crufty crud that just happened to be one of the first things you find when you go to developer.ebay.com. First things first, let's look at some better PHP code:
require_once 'EbatNs/EbatNs_ServiceProxy.php';
require_once 'EbatNs/EbatNs_Logger.php';
require_once 'EbatNs/GetItemRequestType.php';
require_once 'EbatNs/ItemType.php';
$session = new EbatNs_Session('config/amd.ebay.config.php');
$cs = new EbatNs_ServiceProxy($session);
$cs->setHandler('ItemType', 'handleItem');
$req = new GetItemRequestType();
$req->setItemID(5652664344);
$req->setDetailLevel($Facet_DetailLevelCodeType->ReturnAll);
$res = $cs->GetItem($req);
echo "<pre>";
if ($res->getAck() != $Facet_AckCodeType->Success)  
echo "we got a failure<br>";
foreach ($res->getErrors() as $error)
 
    echo "#" . $error->getErrorCode() . " " .
    htmlentities($error->getShortMessage()) . "/" .
    htmlentities($error->getLongMessage()) . "<br>";
 
  else  
//#type $item ItemType
$item = $res->getItem();
echo "ShippingTerms : " . $item->getShippingTerms() . "<br>";
print_r($item);
 
versus our Ruby code:
require 'rubygems'
require 'ebay'
include Ebay
include Ebay::Types
require 'localconfig'
ebay = Ebay::Api.new
begin
  response = ebay.get_item(:item_id => '110011765264')
  puts "ShippingTerms : # response.items.shipping_terms "
rescue Ebay::RequestError => e
  e.errors.each do  error 
    puts error.long_message
  end
end
So, they get closer with that, but the Ruby code is still clearer and more concise. If you look around at some PHP5 based examples, they start to be decent as well. As one tutorial writes:
These components combine to create a kick-ass tool that PHP 4 can't replicate without lots of work, if at all.
Leaving aside the fact that a lot of people are still more or less stuck on 4, I think there is something more important to be learned. Culture There are a lot of really smart people who work with, and on PHP. As much as anyone grumbles about any language, it's not easy to create one, let alone create one and make it as popular as PHP. However, as I've said elsewhere, one of the things that made PHP so successful was its ability to "scale down". Part of its value is that it made it much easier for more people with less advanced skills to create things. That is, without doubt, a very fine accomplishment, but it does bring some baggage with it. Namely, that there are a great deal of PHP programmers who do not write very nice looking code. Going back to the eBay example, the code featured on their site is not very tasteful, if you ask me. My bet is that in Ruby-land, that sort of code would not be displayed very prominently. Why? It's not the computer, it's the culture that has grown up around the different languages. Computers do not care one bit about programming languages. They interpret bits and bytes, whatever language is used, so it's really all the same to them. Programming languages matter only to people, because they are the tool we use to comunicate our instructions to machines. This means that they are a very human thing in some ways, and that human aspects of them matter a great deal. What this means is that it's important not only to design a cool language, but to create a good culture around it. To take aim at something nearer and dearer to me than PHP, one of the major failings of the Tk toolkit was that there was little to no attempt to create a good design culture around it. Anyone who was using Linux 10 years ago will surely remember some of the truly horrible things that were created with Tk. Why? Tcl and Tk made creating a GUI an order of magnitude easier than with C and Motif (or whatever windows used at the time), and turned them loose with no instructions or idea whatsoever of how to go about creating a good, intuitive user friendly one - the Tk docs themselves make little to no mention of usability, and even the best Tcl/Tk books pay almost no attention, even in the form of recommended reading, to what to make with this beautiful tool whose hows are explained very well. The unixy community also wasn't exactly a wellspring of creativity and critique in terms of good guis, either. So, yes, I know that it's possible to write good, clever, readable PHP (or Perl, or FORTRAN) code, and bad Ruby (or Tcl, or Python, or whatever) code. However, I'm also convinced that culture counts. People who value clean, beautiful code gravitate to cultures, and, where possible, workplaces where they find other like-minded people. Others, not having as many options, find themselves staring at 13000-line PHP files that grow malignantly by dint of cut and paste, wondering how to tame that which others have wrought!

Steve Kemp: I m going to give it all of my loving, its going to take up all of my time

New computer is working in a nice stable fashion although with no working USB for no reason that I can fathom. (Plug in a device and nothing happens. No kernel messages, etc) I will document this properly a little later, and update the map to match. All told the new machine is: The graphics give me 1280×1024 which is as much as I can handle on my 17″ TFT display, and didn’t require any non-free drivers. I wandered into a couple of local stores and said “I’m looking to buy a graphics card, what do you have in the PCI express flavour?”. The answers ranged from: So whilst I wanted to get an NVIdia card since they traditionally have had drivers which work for me I was happy to get the cheaper one and hope for the best. As it turns out I’m using xserver-xorg-video-ati with no problems and playing DVDs over NFS works without any visible lagging/artifacts/errors. The system has 512Mb to itself, and the rest set aside for Xen guests. Right now I have six instances of Sarge running with 64Mb each. Things are nice and snappy :) (Since debootstrap failed on the 64 bit install of Sarge I had to download pre-made Sarge images, but still a painless process.) Talking of Xen I found a weird problem where when starting up a new Xen guest the host would lose networking. I think this is an artifact of the NVidia 4 chipset - but adding irqpoll to the boot flag(s) seems to have fixed it. OK enough about my new toy(s). Happy Holidays (No complaints about my new cheesy Christmas Logo yet. Result!)

Marc 'Zugschlus' Haber: A christmas wish for exim

Dear Lazyweb, dear Santa Claus, One thing I wish for exim is a patch for Exim Bugzilla Issue #66, which will incidentally fix Debian Bug #244724, which has become a recurring issue in various complex ISP configuration schemes. A patch solving this would add an option to an SMTP transport which allows the transport to set the authentication credentials instead of the authenticator. The transport still knows the host name given to it and can look up the right authentication credentials, while the authenticator only knows the IP address that we are connected to and thus needs to rely on reverse DNS information to look up the credentials. Which leads to numerous kinds of confusion regarding CNAMEs and broken reverse DNS on the ISP side. So, please dear Santa, give me a patch for that. It shouldn’t be too hard to do.

Erich Schubert: Website meta langauges

Zack asked for website meta languages for redoing his homepage. Well, I redid my homepage last february, using XML and XSLT. A monster XSLT stylesheet, because I wanted to keep my template outside of the stylesheet. I can not recommend XSLT. Using it for templating is quite messy. XSLT is okay if you want to transform one representation of the data to another; it's not if you want to add a lot of surrounding markup and things like a sitemap and similar navigation tools. This is next to impossible in pure XSLT, it gets better once you have some extensions (dubbed EXSLT, and supported by pretty much any xslt processor) or maybe with XSLT2. String manipulation is also a pain (at least with XSLT1); I gave up on generating a nice "last modified" date from my subversion tag. Supposedly XSLT2 has some functions that could make this easier (i.e. for parsing and printing datetime information), but the common approach with XSLT is to only supply the required minimum of function you need, and I'm not aware of an easy way to add custom functions, not to mention any large standard library that can efficiently be used (which is the true strength of Java, Python and C#, that they bring a huge collection of pre-written ready-to-use code with them). Of course there are some efforts to write XSLT libraries (especially for XSLT2), and this aforementioned EXSLT is some kind of standard library that even might be efficiently implemented in some interpreters - you can't rely on it to be there and to just work. XSLT isn't useless, but when it comes to presenting data to humans or writing clean, compact code it's not satisfactory at all. I'd give you my Makefile and XSLT file, if they weren't that messy... too many features; I'm generating two languages, a partially expanded navigation menu, etc. - my XSLT is 10k, my sitemap currently 4.5k, the template file is 5k. Anyway. Half a year ago, my favourite templating language was KID templating. I used it for some small projects such as my DNSoupdate tool to edit DNS zones via the DNS protocol (requires a nameserver such as bind which has support for DNS update, uses encryption). It was a perfect match for such tiny pages, but I'm no longer that convinced I still like it for larger projects. What's good about Kid: XML templating language, Python based, easy to use in whichever way you want by writing a few lines of python (i.e. easy to write a Makefile to generate a static version of you homepage) What's not good about Kid: only works with a Python interpreter. I'd prefer to have a templating language that can be used from multiple languages. However the Kid syntax relies on Python, which is really bad. Also I'd prefer to have some component-render model for more complex websites. The current setup is IMHO okay if you have one default layout and one content layout; but if you have multiple components that could be combined differently on the pages, it gets too messy. With my turbogears experiments, Kid was also not very performant (but that might as well be Turbogears fault). Right now, I'd probably still go with Kid. But I've been having a look at JSP 2.1, and JSF / Facelets in particular. There are some things about facelets that I really like (for example, that they use a proper XML syntax, instead of this bastardized almost-XML that JSP usually (ab-)uses). There is also some stuff that I don't like (e.g. the massive overengineering of everything surrounding it), and I have no idea how easy it will be to generate static pages in a scripted fashion, i.e. using it without a real webserver. Or I might just write it all in python, which is a nice language for manipulating XML, usually. Please don't just send me an email with your favourite templating engine. Like zack, I'm only interested in XML-based templating engines, which does not apply to most templating solutions out there. Clearsilver for example is another bastardization of XML. I'm aware of TAL/METAL, and find them quite interesting, but they were also not having this kind of componentization that I'm usually thinking in. [Update: some people have pointed me to Genshi, which is mostly Kid compatible. However, it still has mostly the same problems, e.g. the templates being not reusable in other languages than python, and that certain constructs are a pain to do (e.g. the page_specific_css recipe with more than one css file). Others have pointed me to smarty, but it's string-based and doesn't ensure valid XML output. (Which is very useful for e.g. generating atom or rss output) For example this is probably valid in smarty: if 0 <b> /if </b> - allowing errors is bad. Oh, and smarty is PHP, which is broken by design, a no-go. The best match to my ideas so far is XML::Template (for Perl, Python, Ruby, PHP) which is pretty close to what I've been doing manually when not using a templating solution. I don't know yet how well it handles recursion - I need recursive templates for the navigation menu on my homepage.]

23 December 2006

Russell Coker: installing Debian Etch

A few days ago I installed Debian/Etch on my Thinkpad. One of the reasons for converting from Fedora to Debian is that I need to run Xen and Fedora doesn't support non-PAE machines with Xen. Ironically it's hardware supplied to me by Red Hat (Thinkpad T41p) that is lacks PAE support and forces me to switch to Debian. I thought about just buying a new dual-core 64bit laptop, but that seems a bit extravagant as my current machine works well for everything else.

Feeling adventurous I decided to use the graphical mode of the installer. I found it a little confusing, at each stage you can double-click on an item or click on the continue button to cause the action to be performed. The partitioning section was a little unclear too, but given that it has more features than any other partitioning system I've seen I wasn't too worried (options of creating a degraded RAID array and for inserting a LUKS encryption layer at any level are really nice). The option to take a screen-shot at any time was also a handy feature (I haven't yet inspected the PNG files to see what they look like).

Another nice feature was the way that the GUI restarts after a crash. While it was annoying that the GUI started crashing on me (and would have prevented a less experienced user from completing the install) the fact that it didn't entirely abort meant that I could work around the problem.

I have not yet filed any bug reports against the installer because I have not done a repeatable install (there is a limit to how much testing I will do on my most important machine). In the next few days I plan to do a few tests of the graphical installer on test hardware for the operations that are important to me and file appropriate bug reports. I encourage others to do the same, the graphical mode of the installer and the new encryption and RAID features are significant improvements to Debian and we want them to work well.

I have realised that it won't be possible to get SE Linux as good as I desire before the Etch release, even if the release is delayed again. I'm not sure how many fixes can go in after the release (I hope that we could move to a model similar to RHEL - but doubt that it will happen). So I now plan to maintain my own repository of Etch SE Linux packages and for other packages which need changes to make them work in the best possible manner with SE Linux. I will append something like ".se1" to the version of the packages in question, this means that they will be replaced if a security update is released for the official package. Apart from the SE Linux policy packages (for which any security updates will surely involve me) the changes I am going to make will not be major and will be of less importance than a security update.

I will also add other modified and new packages to my repository that increase the general security of Etch. Apart from SE Linux all the changes I intend to host will be minimal cost issues (IE they won't break things or increase the difficulty of sys-admin tasks), and the SE Linux related changes will not break anything on non-SE systems. So someone who wants general security improvements without using SE Linux might still find my repository useful.

Gustavo Franco: We have a tree


Santa Claus arriving early.


My tree. I bet that if i start looking around i will find final Etch, Duke Nukem Forever and Chinese Democracy CD's somewhere. =)

Next.

Previous.