Search Results: "spa"

8 December 2008

Alastair McKinstry: Storm World: Hurricanes, Politics and the Battle over Global Warming

Storm World, by Chris Mooney is an account of the development of the science of Hurricanes and their links to Global warming, against the background of Katrina and the politics of global warming.

read more »

Tags , , ,

7 December 2008

Joey Hess: haskell and xmonad

I came back from Thanksgiving in California to find my copy of Real World Haskell had arrived. I've spent the last several days making my way through it up through chapter 10. I'd read a few of the first chapters last year when I was struggling to learn Haskell, and posted enough comments that I'm amoung the (many many) people credited in the Preface. Amusing, since I still don't consider myself proficient in the language. Reading back through those and on through Chapter Nine has swapped back in the basics I learned last year, and built on them. I was able to get all the way to Chapter Ten before hitting real brain-melting stumbling blocks. That's progess! I can't help but feel that Chapter Ten should come later, perhaps after monads are covered. Only other quibbles so far are some typographical problems introduced in typesetting the book, and a few bugs and problems that were pointed out in comments on the web site, but not fixed in time for the first edition.
Anyway, I know more than enough Haskell now to configure xmonad. While I'm still perfectly happy with awesome, xmonad has some cool things going for it. Playing with it this evening, I especially like: My current set of gripes with xmonad is small:

Biella Coleman: Nerds, Geeks, and Nerd/Geek Grrrls

I have not sat behind the helm of teaching for very long but I already have a few tricks up my sleeve. One of them is that I assign some of my favorite readings at the end of the semester so as to counter the downtrodden and tepid spirit and mood (not to mention attention) of my students, which drops precipitously with each passing day. Let’s face it post Thanksgiving, we are all a little tired and I try to find the readings, which uplift, intrigue, and challenge cherished assumptions about marriage and sex. So far it seems to pay off and I often can tell because the conversational pitch and excitement in class is high and the student writings are good, great, even exceptional, which, again, is hard to produce/induce this late in the semester. Readers of this blog would probably be most interested in one of these lively readings, Ben Nugent’s American Nerd (and it might be interesting to hear how the European Nerd story would diverge or converge with this one). One of my students, an audio geek and Free Culture President/Free Software junkie, by the name of John Randall produced a very nice little response (not research) paper on the Nugent reading as well as a short piece by Sarah Seltzer from Bitch Magazine
The(Girl) Geek Stands Alone (and thanks to Joe> for cluing me into this piece). Seltzer piece basically argues, in her own words, the following:
Imagine this scene from a comedy: a group of female friends sit around smoking a bowl and working on the Wikipedia page for Lord of the Rings. Their fashion sense is decidedly iconoclastic and several sport thick-rimmed glasses. Without a trace of self-consciousness, they have a hilariously ribald discussion on the relative traits of elves and orcs.
Awesome as it is, you’ll never see this scene onscreen. No mainstream movie or TV series would dare group so many female nerds together, or celebrate them so unabashedly
So John’s whole response paper is here and here is the pdf. In the paper, he makes a number of excellent points but what I loved most about it was his very geeky move at the end of the paper to prove Sarah (somewhat wrong) by listing all the girl geeks that do and have appeared in mainstream (and not-so mainstream) entertainment venues/shows, etc. They are as follows and in his own words:
I will now showcase my own geekiness through my knowledge of geeky female characters. Why? Because I can. But also because I want to demonstrate that if you look hard enough for representations of female geekyiness in pop culture, you will find plenty. Moreover, if you pick the right ones, you can make them support your argument about gender relations, whatever that argument might be. Some of these charters and personalities are hardly gendered, some are hyper-sexual. Some are incredibly attractive but completely asexual. Some undergo a transformation into/out of geekiness, while others to not. Some are powerful, while some are powerless. Some (most?) celebrate their geekiness, others are tortured by it. They are all geeks take your pick: Aeon Flux, a sexy geek who’s technological gadgets give her super powers (Comic drawings then Charlize TheronAeon Flux) Wonder Woman, attractive pilot of an invisible plane Lara Croft, a female Indiana Jones in short shorts, wielding guns and cracking computer codes (CGI and then Angelina Jolie in Tomb Raider) She-Ra, who was way smarter than He-Man (Masters of the Universe cartoons) Gadget Hackwrench, beautiful chipmonk technician for Chip and Dale (Rescue Rangers cartoon) Velma, featuring eyeglasses, awkwardness and brains (Scooby Doo), Hermonie Granger, a geek who is temporarily rejected because she is a geek, remains a geek, and finds love and happiness (Harry Potter) Barbarella, who, through comic strips and a 1968 film, helped introduce science fiction and sex to young women (Barbarella) La Femme Nikita, a skillful, savvy, and very feminine girl who doubles as a covert spy Kate Libby, aka ‘Acid Burn’, uber-sexualized hacker (played by Angelina Jolie in Hackers) Kathryn Janeway, smart and powerful captain of the USS Voyager (Star Trek Voyager) Starbuck (Battlestar Galactica), Dana Scully, FBI agent with encyclopedic media knowledge. The bizzare subtex of non-realized sexual tension was part of the magic The X-Files. Willow Rosenberg, geeky sidekick turned geeky supervillian (Alyson Hannigan in buffy the Vampire Slayer) Michelle Flaherty, hyper-sexual band geek (Alyson Hannigan in American Pie series) Dr Ellie Sattler, heroniene scientist (Jurrasic Park) Ellie, scientis hero (played by both Jenna Malone and Jodi Foster in Carl Sagan’s Contact) Dawn Wiener (Heather Matarazzo in Welcome to the Dollhouse Enid and Rebecca (Thora Birch and Scarlett Johanson in Ghost World) just about every charater ever played by Jenna Malone (Donie Darko, The Dangerous Lives of Altar Boys, The United States of Leland, Saved!, etc) half of the charaters played within the last decade by Jodi Foster (Panic Room, The Dangerous Lives of Altar Boys, Flightplan, The Addams Family half of the charaters played by Christina Ricci (Mermaids, The Addams Family, Little Red Riding Hood, The Ice Storm, Buffalo ‘66, Prozac Nation, Pumpkin, Speed Racer) half of the characters played by Natalie Portman (The Professional, Mars Attacks!, Star Wars, V for Vendette, The Darjeeling Limited, Mr. Magorium’s Wonder Emporium, Garden State) Molly Ringwald. characters played by Molly Ringwald. Rock musician Ani DiFranco and geeky Riot Grrls everywhere. Sarah Vowell, NPR commentator celebrating her geeky life. Voiceover for geeky cartoon characters. Rachel Maddow, for being Rachel Maddow.
First, awesome list, though he forgot a few (like one of my favorites, Bionic Woman and a more recent one, Juno) and it is nice to have it in one compact place. But, I have to say, I still agree to some degree with Sarah Setlzer, though I also agree with John. On the one hand there are representations and it is as important just to strut this stuff publicly as it is to claim that there is not enough female geeky representations in mainstream media. This is what John has done quite nicely. One the other hand, as he himself says ” if you look hard enough for representations of female geekyiness in pop culture, you will find plenty.” I think those words, “if you look hard enough” also speaks volumes of the continued disparity that does exist. One should not have to look “hard,” and the only blockbusters, so to speak, which feature a female geek, is Tomb Raider, which for being so hyper-sexualized is not so geeky to me, no matter how good she is with the gadgets. That said, what I find so important, and have emphasized in different contexts, is the need for what I think of simultaneous positive and negative form of critique, the former being about pointing to already exisitng examples to get people jazzed and excited and to put things in perspective. The later form of critique, negative critique, identifies a lack, a void to fill, just the type of excellent commentary in the Seltzer piece… But now for the most important question, who has John overlooked?

Kapil Paranjape: A double blow

On the 26th of November 2008, there was a double blow. It had been raining almost all night in Chennai and we put on the TV to figure out what the weather was going to be like only to find out that there had been attacks with guns and bombs in multiple areas in Mumbai. The attacks in Mumbai and the rain in Tamil Nadu continued over the next 36 hours or so --- with disastrous effects all around. All this was more than a week ago and so it feels as if one can write about it with a modicum of objectivity. The cyclone that hit Tamil Nadu was not man-made, but many of its consequences were. The attacks in Mumbai were carried out by people who were human beings once upon a time, but they had their humanity stripped by those who run the camps which trained them. So to some extent it feels as if we have suffered from a natural disaster --- but one which could have been mitigated by humans. The Indian state and people seem to be returning back to "normal" and this is said be a sign of our resilience. On the other hand that may only be because we suffer a thousand cuts every day --- self-inflicted. Indeed, each one of us is a minor terrorist carrying out little acts of rebellion against the state; acts that also threaten the well-being of our fellow citizens. Some examples follow: The list could go on and on ... All of these acts weaken our state and our people to the point where we cannot act swiftly in an emergency: This is what makes us a "soft target for terror". If the Indian government were to indeed go after all those who are weakening it and terrorizing its people, then a good percentage of our citizenry and an even larger percentage of our well-off citizenry would find itself in the cross-hairs. To paraphrase what an assistant commissioner of police once said: If 100% of our citizens are 2% terrorists then it is very hard to catch the 2% of the citizens who are 100% terrorists.

6 December 2008

Biella Coleman: Fast, Fiery, and Fantastic.

I like dance music. A lot. So I am extra happy to have been clued into the musical world of Buraka Som Sistema and Nordloef (playing tomorrow night at the Blip Festival). Genre wise they are pretty different, but both are fast, fiery, and fantastic. Enjoy.

Biella Coleman: FLOSS Manuals: How to Bypass Internet Censorship

If you don’t know about this great project, you should. The nitty gritty details are to be found here. FLOSS Manuals Release Circumvention Book, How To Bypass Internet
Censorship December 4, 2008, Amsterdam A new book released by FLOSS Manuals, How to Bypass Internet Censorship,
describes circumvention tools and explains why you might want to use
them, and honestly describes the risks you must consider before
circumventing blockers or monitors. Blockers and monitors restrict
access to areas of the Internet, and this book describes simple
techniques for bypassing those restrictions. The book can be read or
downloaded for free as a PDF from flossmanuals.net, or you can purchase
a high-quality printed copy of the 200 page book through Lulu, an
on-demand printer, at http://www.lulu.com/content/4904448 for 10.83
($14.00). The growth of the Internet has been paralleled by attempts to control
how people use it, motivated by a desire to protect children,
businesses, personal information, the capacity of networks, or moral
interests, for example. Some of these concerns involve allowing people
to control their own experience of the Internet (for instance, letting
people use spam-filtering tools to prevent spam from being delivered to
their own e-mail accounts), but others involve restricting how other
people can use the Internet and what those other people can and can’t
access. The latter case causes significant conflicts and disagreements
when the people whose access is restricted don’t agree that the blocking
is appropriate or in their interest. Problems also arise when blocking
mechanisms and filters reduce access to useful business, health,
educational, and other information. Because of concerns about the effect of internet blocking mechanisms,
and the implications of censorship, many individuals and groups are
working hard to ensure that the Internet, and the information on it, are
freely available to everyone who wants it. There is a vast amount of
energy, from commercial, non-profit and volunteer groups, devoted to
creating tools and techniques to bypass Internet censorship. Some
techniques require no special software, just a knowledge of where to
look for the same information. Programmers have developed a variety of
more capable tools, which address different types of filtering and
blocking. These tools, often called “circumvention tools” help Internet
users access information that they might not otherwise be able to see.
This book documents simple circumvention techniques such as a cached
file or web proxy, and also describes more complex methods using Tor,
which stands for The Onion Router, involving a sophisticated network of
proxy servers. How to Bypass Internet Censorship was written by eight writers in a
FLOSS Manuals ‘book sprint’ - a week-long intensive writing session, and
it also includes content from many different authors’ previous works on
the subject.
How to Bypass Internet Censorship will always be available for free from
the FLOSS Manuals Website. Each sale of the book generates $2.50 (USD).
100% of this income goes back into the development of more manuals about
free software. About FLOSS Manuals
http://www.flossmanuals.net
FLOSS Manuals is a non-profit foundation and community creating a
collection of manuals that explain how to install and use a range of
free and open source software. The manuals are friendly and simple, and
they are intended to encourage people to explore the wide range of free
and open source software. FLOSS stands for Free, Libre Open Source
Software, and FLOSS Manuals intends to provide free manuals for free
software. The manuals on FLOSS Manuals are written by a community of
people, writers, editors, and technicians do a variety of things to keep
the manuals as up to date and accurate as possible. The way in which
FLOSS Manuals are written mirrors the way in which FLOSS software itself
is written: by a community who contribute to and maintain the content. FLOSS Manuals produces printed books, PDF books, and HTML output. Each
chapter from each manual can be recombined with other chapters to create
a new manual, which we call remix capability. An embed API lets you use
FLOSS Manuals to write the content and then embed the content into your
website. For more information contact:
Adam Hyde
Founder, FLOSS Manuals
adam@flossmanuals.net

5 December 2008

Uwe Hermann: Dancing omnidirectional robot base controlled via Linux shellscripts based on IGH EtherCAT Master

Dancing omnidirectional robot base Here's a quick intro to what I'm hacking on at university. This is a new omnidirectional robot platform we got in the lab. It's controlled via CanOpen-over-EtherCAT (which is a realtime Ethernet protocol "extension", more or less). As we don't want to deal with any of the Windows software that's usually used for such stuff, we're employing the IGH EtherCAT Master (r1549) implementation (GPL/LGPL) on Linux and it works quite nicely. I hacked together a few shell scripts that invoke the ethercat command line tool with certain parameters to control the motor velocities "by hand", which then soon turned into a "dancing" demo of the robot ;-) See http://www.youtube.com/watch?v=n_vF4NK26fM for the YouTube video of the dancing bot. It's just a quick (hardcoded) hack for now, there's lots of room for improvements, of course (e.g. detect baselines of random music you throw at it). The demo in the background is the fantastic Masagin by Farbrausch. I've also hacked up a small Python script to control the robot with a Wiimote (using cwiid on Linux), which also works quite nicely. I further plan to make a small program for controlling it via a 3D mouse or the like in the future... The longer-term plan for the robot platform is that it'll get a "backbone" and two very nice robot arms for grabbing stuff etc.

4 December 2008

Jeff Bailey: Coming up to the third night in the new place...

I found the camera this morning, but I haven't taken pictures of the new place yet. I think that'll have to wait until this weekend.

I'm sitting in the corner of what will be the office space. Right now, it's got the cordless phone, the wifi router, the cable modem, and the Vonage (codec? modem? codec seems likely, how wonderfully archaic). Off to the side is a sewing table of some sort that the former owners left behind which has the power brick for our cell phones and Angie's laptop on it.

We're running laundry for the first time in the washing machine downstairs, and seasoning the new cast iron frying pan. Leif had a bath earlier and actually went down at about the normal time. He woke up at 05h30 this morning, probably due to the lack of curtains. It apparently starts to get bright early, and none of us are sleeping well with three of us in a double.

Our furniture is due to arrive somewhere between the 15th and the 18th. I phoned today and the moving company told us that the stuff hasn't left California yet. Ah well. We've purchased a toaster over and electric kettle so far. We bought the stove, washer and dryer from the former owner. There was a spare fridge downstairs that we're using, but mostly we're using the step outside the kitchen door. We're back in Quebec and it's cold enough to keep things out there. =)

This place is easily the largest place I've lived in since my parents split up when I was 8. Angie and I are really trying hard not to fill it with crap, but actually think through what we need.

I signed Angie and I up for gym memberships today after work. Yesterday was cell phones. Angie picked up some new pots and pans. Tomorrow will be towels and some dishes.

Anyone know if it's better to buy a fridge and dishwasher before Christmas or after? =)

The new home number, cell numbers and such will be in Facebook and Orkut in a moment.

Raphael Geissert: php now has name\spaces support


Finally, the long-awaited release (just alpha atm) of PHP with namespaces support is out, go, get it, and enjoy the sub\spaces\separator before you get\mad\with\it.

Pablo Lorenzzoni: Debian crashing the Internet!?

I just read on Slashdot a pointer to an article about GitTorrent and it made me wonder about these meta-distributed systems. Although I don t share the article s author enthusiasm, it s a really good idea. Anyways, browsing that article, I ended up on another one about Debtorrent. This I ve already read about and decided to keep an eye on for some time now It happens that one line on that article called my attention (and I quote):
At the last major upgrade of Debian/Stable, all the routers at the major International fibreoptic backbone sites across the world redlined for a week. (emphasis added)
Well that was a surprise. Of course I know of the size and importance of Debian, but I thought our systems were more efficient (or that our release-generated-traffic were not of that magnitude). I began googling for a pointer on that Anything: a quote, an URL, a list message anything that could make that claim verifiable: Guess what: I found none! Meanwhile, on Slashdot, other people started following the same subject... So, is it true? Does anyone have any pointers to that? It seems quite unlikely to me But hey! That s just me: maybe the Internet is not that big :-)

Jon Dowland: planet spamming

I've just migrated hosts for my website and managed to spam at least one aggregator in the process. (I think this is because git does not preserve timestamp metadata for blobs but I haven't investigated properly yet). Apologies to those affected. Luckily, I have my feed configured to only show the most recent 5 items, so the impact was quite small. I think this should be the default for applications that generate feeds for precicely this reason: It is for blosxom (#373570) and pyblosxom (#373658), and ikiwiki specifies a limit, at least. Asides from feeds, I think blog web pages that display an enormous number of posts on the front page (or inside category pages) are demonstrating some pretty bad usability. I thought that Jakob Nielsen may have included this in his Weblog Usability: The Top Ten Design Mistakes, but he didn't. Thomas Watson writes we have celebrated with finally scrapping our blog archive. Instead we are now just showing the latest 50 articles on the front page, followed by a link to the previous 50., which pretty much the opposite of what I'd advise. The point he makes, though, is that the alternative (an ever-expanding "archive", accessed by calendar) is bad form, too. That is one of the points in Nielsen's list. Jonathan Boutelle describes an interesting compromise which he calls the "Mullet style" - a short list of full posts followed by a list of older posts, containing only their titles and date.

3 December 2008

Romain Francoise: Cleaner

In the productive procrastination department: I repackaged rcs using debhelper (it feels like the future) and while I was at it, I implemented MadCoder's git maintenance scheme where changes from upstream are maintained in a rebased integration branch and serialized as patches in the Debian branch (master in my case) using git format-patch. It's pretty nice:Of course this is a very low-maintenance package (the last upstream release was 13 years ago) so it doesn't matter very much which maintenance strategy it uses, but after implementing it I'm pretty confident that it works and I might switch my other packages to it.

If you're interested in knowing more about clever ways to use modern VCS for packaging, you may want to join the vcs-pkg mailing-list.

David Bremner: Using GLPK from C++

Recently I suggested to some students that they could use the Gnu Linear Programming Toolkit from C++. Shortly afterwards I thought I had better verify that I had not just sent people on a hopeless mission. To test things out, I decided to try using GLPK as part of an ongoing project with Lars Schewe The basic idea of this example is to use glpk to solve an integer program with row generation. The main hurdle (assuming you want to actually write object oriented c++) is how to make the glpk callback work in an object oriented way. Luckily glpk provides a pointer "info" that can be passed to the solver, and which is passed back to the callback routine. This can be used to keep track of what object is involved. Here is the class header
#ifndef GLPSOL_HH
#define GLPSOL_HH
#include "LP.hh"
#include "Vektor.hh"
#include "glpk.h"
#include "combinat.hh"
namespace mpc  
  class  GLPSol : public LP  
  private:
    glp_iocp parm;
    static Vektor<double> get_primal_sol(glp_prob *prob);
    static void callback(glp_tree *tree, void *info);
    static int output_handler(void *info, const char *s);
  protected:
    glp_prob *root;
  public:
    GLPSol(int columns);
    ~GLPSol()  ;
    virtual void rowgen(const Vektor<double> &candidate)  ;
    bool solve();
    bool add(const LinearConstraint &cnst);
   ;
 
#endif
The class LP is just an abstract base class (like an interface for java-heads) defining the add method. The method rowgen is virtual because it is intended to be overridden by a subclass if row generation is actually required. By default it does nothing. Notice that the callback method here is static; that means it is essentially a C function with a funny name. This will be the function that glpk calls when it wants from help.
#include <assert.h>
#include "GLPSol.hh"
#include "debug.hh"
namespace mpc 
  GLPSol::GLPSol(int columns)  
    // redirect logging to my handler
    glp_term_hook(output_handler,NULL);
    // make an LP problem
    root=glp_create_prob();
    glp_add_cols(root,columns);
    // all of my variables are binary, my objective function is always the same
    //  your milage may vary
    for (int j=1; j<=columns; j++) 
      glp_set_obj_coef(root,j,1.0);
      glp_set_col_kind(root,j,GLP_BV);
     
    glp_init_iocp(&parm);
    // here is the interesting bit; we pass the address of the current object
    // into glpk along with the callback function
    parm.cb_func=GLPSol::callback;
    parm.cb_info=this;
   
  int GLPSol::output_handler(void *info, const char *s) 
    DEBUG(1) << s;
    return 1;
   
  Vektor<double> GLPSol::get_primal_sol(glp_prob *prob) 
    Vektor<double> sol;
    assert(prob);
    for (int i=1; i<=glp_get_num_cols(prob); i++) 
      sol[i]=glp_get_col_prim(prob,i);
     
    return sol;
   
  // the callback function just figures out what object called glpk and forwards
  // the call. I happen to decode the solution into a more convenient form, but 
  // you can do what you like
  void GLPSol::callback(glp_tree *tree, void *info) 
    GLPSol *obj=(GLPSol *)info;
    assert(obj);
    switch(glp_ios_reason(tree)) 
    case GLP_IROWGEN:
      obj->rowgen(get_primal_sol(glp_ios_get_prob(tree)));
      break;
    default:
      break;
     
   
  bool GLPSol::solve(void)    
    int ret=glp_simplex(root,NULL);
    if (ret==0) 
      ret=glp_intopt(root,&parm);
    if (ret==0)
      return (glp_mip_status(root)==GLP_OPT);
    else
      return false;
   
  bool GLPSol::add(const LinearConstraint&cnst) 
    int next_row=glp_add_rows(root,1);
    // for mysterious reasons, glpk wants to index from 1
    int indices[cnst.size()+1];
    double coeff[cnst.size()+1];
    DEBUG(3) << "adding " << cnst << std::endl;
    int j=1;
    for (LinearConstraint::const_iterator p=cnst.begin();
         p!=cnst.end(); p++) 
      indices[j]=p->first;
      coeff[j]=(double)p->second;
      j++;
     
    int gtype=0;
    switch(cnst.type()) 
    case LIN_LEQ:
      gtype=GLP_UP;
      break;
    case LIN_GEQ:
      gtype=GLP_LO;
      break;
    default:
      gtype=GLP_FX;
     
    glp_set_row_bnds(root,next_row,gtype,       
                       (double)cnst.rhs(),(double)cnst.rhs());
    glp_set_mat_row(root,
                    next_row,
                    cnst.size(),
                    indices,
                    coeff);
    return true;
   
 
All this is a big waste of effort unless we actually do some row generation. I'm not especially proud of the crude rounding I do here, but it shows how to do it, and it does, eventually solve problems.
#include "OMGLPSol.hh"
#include "DualGraph.hh"
#include "CutIterator.hh"
#include "IntSet.hh"
namespace mpc 
  void OMGLPSol::rowgen(const Vektor<double>&candidate) 
    if (diameter<=0) 
      DEBUG(1) << "no path constraints to generate" << std::endl;
      return;
     
    DEBUG(3) << "Generating paths for " << candidate << std::endl;
  // this looks like a crude hack, which it is, but motivated by the
  // following: the boundary complex is determined only by the signs
  // of the bases, which we here represent as 0 for - and 1 for +
    Chirotope chi(*this);
    for (Vektor<double>::const_iterator p=candidate.begin();
         p!=candidate.end(); p++) 
      if (p->second > 0.5)  
        chi[p->first]=SIGN_POS;
        else  
        chi[p->first]=SIGN_NEG;
       
     
    BoundaryComplex bc(chi);
    DEBUG(3) << chi;
    DualGraph dg(bc);
    CutIterator pathins(*this,candidate);
    int paths_found=
      dg.all_paths(pathins,
                   IntSet::lex_set(elements(),rank()-1,source_facet),
                   IntSet::lex_set(elements(),rank()-1,sink_facet),
                   diameter-1);
    DEBUG(1) << "row generation found " << paths_found << " realized paths\n";
    DEBUG(1) << "effective cuts: " << pathins.effective() << std::endl;
   
  void OMGLPSol::get_solution(Chirotope &chi)  
    int nv=glp_get_num_cols(root);
    for(int i=1;i<=nv;++i)  
      int val=glp_mip_col_val(root,i);
      chi[i]=(val==0 ? SIGN_NEG : SIGN_POS);
     
   
 
So ignore the problem specific way I generate constraints, the key remaining piece of code is CutIterator which filters the generated constraints to make sure they actually cut off the candidate solution. This is crucial, because row generation must not add constraints in the case that it cannot improve the solution, because glpk assumes that if the user is generating cuts, the solver doesn't have to.
#ifndef PATH_CONSTRAINT_ITERATOR_HH
#define PATH_CONSTRAINT_ITERATOR_HH
#include "PathConstraint.hh"
#include "CNF.hh"
namespace mpc  
  class CutIterator : public std::iterator<std::output_iterator_tag,
                                                      void,
                                                      void,
                                                      void,
                                                      void> 
  private:
    LP& _list;
    Vektor<double> _sol;
    std::size_t _pcount;
    std::size_t _ccount;
  public:
    CutIterator (LP& list, const Vektor<double>& sol) : _list(list),_sol(sol), _pcount(0), _ccount(0)  
    CutIterator& operator=(const Path& p)  
      PathConstraint pc(p);
      _ccount+=pc.appendTo(_list,&_sol);
      _pcount++;
      if (_pcount %10000==0)  
        DEBUG(1) << _pcount << " paths generated" << std::endl;
       
      return *this;
     
    CutIterator& operator*()  return *this; 
    CutIterator& operator++()  return *this; 
    CutIterator& operator++(int)  return *this; 
    int effective()   return _ccount;  ;
   ;
 
#endif
Oh heck, another level of detail; the actual filtering actually happens in the appendTo method the PathConstraint class. This is just computing the dot product of two vectors. I would leave it as an exercise to the readier, but remember some fuzz is neccesary to to these kinds of comparisons with floating point numbers. Eventually, the decision is made by the following feasible method of the LinearConstraint class.
 bool feasible(const
Vektor<double> & x)  double sum=0; for (const_iterator
p=begin();p!=end(); p++)  sum+= p->second*x.at(p->first);  
      switch (type()) 
      case LIN_LEQ:
        return (sum <= _rhs+epsilon);
      case LIN_GEQ:
        return (sum >= _rhs-epsilon);
    default:
      return (sum <= _rhs+epsilon) &&
        (sum >= _rhs-epsilon);
       
     

Uwe Hermann: Playing Starcraft on Linux using Wine

Wine logo Here's a quick HOWTO for using Wine to play Starcraft on a Linux machine.
  $ apt-get install wine (as root)
  $ winecfg
The winecfg (graphical) utility will setup some config file defaults in your ~/.wine directory. Click on Graphics and activate Allow DirectX apps to stop the mouse leaving their window. Also, click on Audio (a dialog will pop up, just click OK). This will autodect your soundcard and setup Wine to use it. Under Drives click Add (this will add D:) and change the path to /media/cdrom, so that Wine knows about your CD-ROM drive. Finally click OK to close winecfg and save the settings. winecfg screenshot The next step is to insert the Starcraft CD-ROM into the drive and start the installer using Wine:
  $ mount /media/cdrom (as root)
  $ wine /media/cdrom/setup.exe
Follow the instructions in the installer until the Starcraft install is finished (you'll need your CD key number), then exit the installer (don't start playing Starcraft right away). The next step is to get the latest patch and get rid of the need to insert the CD-ROM every time.
  $ wget http://ftp.blizzard.com/pub/starcraft/patches/PC/SC-116.exe
  $ wine SC-116.exe
After the patch is installed click OK and Starcraft will be started (very annoying). Leave the game again. We'll get rid of the CD-ROM requirement now:
  $ cp /media/cdrom/install.exe ~/.wine/drive_c/Programme/Starcraft/StarCraft.mpq
That's a pretty big file, it may take a while. You might have to change "Programme" in the path (I have the German Starcraft version). That's it. You can now play Starcraft (without needing the CD-ROM) using:
  $ wine ~/.wine/drive_c/Programme/Starcraft/StarCraft.exe
A good thing is, it even works nice and fast with the open-source nv NVIDIA driver (no need to install the proprietary driver). I noticed one very annoying "bug" with the mouse behaviour at first. The mouse would sometimes just get stuck during the game (which is a total disaster of course, if you're in the middle of a fast-paced game). Left-clicking somewhere would "unstuck" the mouse, but it's still very bad. After many, many hours of reading bugreports and trying various patches I finally found out the root cause for the problem. It's somehow related to my window manager (IceWM); whenever you move the mouse to the bottom of the Starcraft screen (where the IceWM status bar is, even though it's not on top or even visible, and even though Wine/Starcraft runs in full-screen mode!), something funny happens with X11/IceWM and the mouse gets stuck. I haven't yet found out if/which IceWM option could fix this behavior, but I have a small work-around. Just start Wine directly on a second X11 server with Starcraft (without any window manager being involved):
  $ xinit -e '/usr/bin/wine ~/.wine/drive_c/Programme/Starcraft/StarCraft.exe' -- :1
No patches needed (stock Wine from Debian unstable works fine, that's version 1.0.1 right now). I hope this saves other people some debugging time...

Jose Carlos Garcia Sogo: Fanatics did it again

Once again, a person died today murdered by terrorists in Spain. He was a businessman, who had a construction company in his town (Azpeitia) at Basque Country region. Close his house, he was murdered by gunshots. Just because his company was a contractor in the construction of AVE infraestructure in Basque Country, which will connect it with Madrid and France. Once again, a family has been hit forever. I was going to include a black strip with the article, but it’s better to see an image.

2 December 2008

Jon Dowland: free kilowatts

I've just learnt that KiloWatts, one of my favourite artists to emerge from the "Soulseek" scene, has two of his EPs available for free for a limited time only. I already own Teknopera which is a fantastic slice of furious breakbeat, but I haven't heard "Quickfire" yet. "Perfected Everything", KiloWatt's song originally available as part of soulseek records compilation 001 is one of my all-time favourite electronic/dance tracks. It's also a track from an album of the same name. If you like electronica, go and give these a try!

Aigars Mahinovs: iPhone review from a free software guy

I got an iPhone on the very first day it was available officially in my country. I have used it every day since then and am now ready to decide how good it really is. Summary: it is a great piece of technology and the only tradeback is the locked down platform. I have abandoned my Palm and am not looking back. Hardware: the hardware is just perfect. 4 buttons (Home, Power, Volume Up and Down) and 1 switch (Mute) are all very clear, easy to find and press and frankly are enough. The touchscreen is reasonably fast and very precise nicely corrected by software that guides your presses toward UI points of interest if such are within your finger. The casing is absolutely solid - there is no gaps, no wobble, nothing. All glossy surfaces attract fingerprints, but a couple passes with a microfiber cloth (included) clean it up easily. The loudspeaker is phenomenal - all sound comes from a single small hole, but it can easily fill a small room with music. Call sound quality is impeccable. You can plug in any headphones, but if you use the included headphones you get a microphone with a button that can pickup and hand up calls, start/pause music and skip to the next track. I also love that the only charger included is a very small power brick that provides a power-only USB port and a USB charging cable. That is a good way to reduce number of power bricks for gadgets. The iPhone 3G (that is what I have) also has a GPS build-in, but let us be clear - it is not good enough to replace a car GPS, the iPhone GPS is slow (takes several seconds to refresh the location and tens of seconds to find it first time) and the precision is measured in meters or even tens of meters. The WiFi is very good at getting a connection and doing it very fast. Oh and there is an acceptable camera. Out of the box software: the software included surely is better than on any other phone I have seen (including Palm). The UI widgets are nicely written specially for a touchscreen interface - the best example is having click wheels instead of drop down menus. It is much easier mentally to flick a wheel up or down then to click on a list, click to scroll the list and then click to select an entry. And the click wheel makes it much easier to correct off-by-one errors. Switches that look like regular physical switches instead of checkboxes is another very useful UI concept. I think a lot of this can be reused on the desktop as well. iTunes: and here comes the bad spot, the lock-in part. To get anywhere with the iPhone you need to associate it with an installation of iTunes. It fails to work in Wine or even in a virtual machine - apparently there are some errors related to avahi or something. Unfortunately, this means that you need wither Windows or MacOS to do nything with your iPhone. iTunes is the only way to backup, restore and upgrade your iPhone, it is the only way to get contacts and music on the iPhone (there is an iTunes Store app in the newest version that allows purchasing music over the air). Even after doing a jailbreak (see further) it is currently not possible to add music to the iPhone from any third party applications, because the iTunes database has a hashed checksum that the build-in iPhone music player (and iTunes) check before doing anything. If the checksum is wrong the only thing you can do is a full restore of the phone from backup. Crypto geeks - please help decrypt that hash, so that we can sync iPhones to amaroK. The iTunes itself is a bit weird - to get music onto the phone you need to create a playlist and then you can sync that playlist over. One of the playlist options is a smart playlist with a random feature and a limit on number of matches. That is the way to get random music from your collection onto the phone. I do dislike the fact that iTunes syncs all the contacts from Google to the phone and not only contacts for a certain group or only those that have a phone number, for example. Search and favorites do help here. Third party software (iTunes Store): it is very easy to install new software on the phone over the WiFi and there is plenty to choose from. You do need a Mac to develop this software which restricts the developer base a bit. The main bases that I needed (or did not know I needed) are covered: Last.fm player, TwitterFon, LockBox password storage, Stanza ebook reader, Shazam music identificator, Wordpress client, BigOven cookbook and lots of fun games. Have not used any paid-for apps due to the fact that iTunes store is not available in Latvia and the official documentation recommends registering with a fake address in UK or US. :) Most of the software is rather stable and useful, but there is also a lot of fluff. User reviews and ratings help a lot, can we have those for Debian packages? Jailbreak and third party software (Cydia): thanks to some anonymous hackers, we have the ability to break the software jail on the iPhone and install software that Apple did not approve. The process is made very simple, but again it does require you to boot into Windows or MacOS X. The main thing the jailbreak process does is install an installer on the phone. Currently the best one is Cydia which is built on top of … apt-get and dpkg! After that is done, you can install a terminal, a ssh server and BossPrefs advanced preferences. There are also other interesting programs there - a different dock, file manager, caching youtube player, quake, themed app launcher with categories and startup page (winterboard). Theoretically the ssh server allows you to manage your music over WiFi from any platform, but unfortunately until the iTuned database hash algorithm is decoded, we can only copy music from the phone to the PC and not back. It is possible to copy files over using ssh and then play them using third-party players, but those players are very crude and featureless. To summarize: an iPhone is a great phone and a decent application platform. To make using an iPhone with Linux easier we need to make iTunes run in Wine (and allow it to see the iPhone) and reverse engineer the iTunes database hashing algorithm so that we can get music on our phones with Linux tools. I also wish there was a way to develop iPhone apps in Linux, but that really is reaching for the stars.

1 December 2008

Russell Coker: Gmail and Anti-Spam

I have just received an email with a question about SE Linux that was re-sent due to the first attempt being blocked by my anti-spam measures. I use the rfc-ignorant.org DNSBL services to stop some of the spam that is sent to me. The purpose of rfc-ignorant.org is to list systems that are run by people who don’t know how to set up mail servers correctly. But the majority of mail that is blocked when using them comes from large servers owned by companies large enough that they almost certainly employ people who know the RFCs (and who could for a trivial fraction of their budget hire such people). So it seems more about deliberately violating the standards than ignorance. The person who sent me the email in question said “hopefully, Google knows how to make their MTA compliant with RFC 2142“, such hope is misplaced as a search for gmail.com in the rfc-ignorant.org database shows that it is listed for not having a valid postmaster address [1]. A quick test revealed that two of the Gmail SMTP servers support the postmaster account (or at least it doesn’t give an error response to the RCPT TO command that is referenced in the complaint). However Gmail administrators have not responded to the auto-removal requests, which suggests that postmaster@gmail.com is a /dev/null address. However that is not a reason to avoid using Gmail. Some time ago Gmail took over the role of “mail server of last resort” from Hotmail. If you have trouble sending email to someone then using a free Gmail account seems to be the standard second option. Because so many people use Gmail and such a quantity of important mail is sent through that service (in my case mail from clients and prospective clients) it is not feasible to block Gmail. I have whitelisted Gmail for the rfc-ignorant.org tests and if Gmail starts failing other tests then I will consider additional white-lists for them. Gmail essentially has a monopoly of a segment of the market (that of free webmail systems). They don’t have 100%, but they have enough market share that it’s possible to ignore their competitors (in my experience). When configuring mail servers for clients I make sure that whatever anti-spam measures they request don’t block Gmail. As a rule of thumb, when running a corporate mail server you have to set up anti-spam measures to not block the main ISPs in the country (this means not blocking Optus or Telstra BigPond for Australian companies) and not block Gmail. Not blocking Yahoo (for “Yahoo Groups”) is also a good thing, but I have had a client specifically request that I block Yahoo Groups in the past - so obviously there is a range of opinions about the value of Yahoo. Someone contacted Biella regarding an email that they couldn’t send to me [2]. I have sent an email to Biella’s Gmail account from my Gmail account - that should avoid all possibility of blocking. If the person who contacted Biella also has a Gmail account then they can use that to send me email to my Gmail account (in the event that my own mail server rejects it - I have not whitelisted Gmail for all my anti-spam measures and it is quite possible for SpamAssassin to block mail from Gmail). It turns out that the person in question used an account on Verizon’s server, according to rfc-ignorant.org Verizon have an unusually broken mail server [3]. If your ISP is Optus, BigPond, Verizon, or something similarly broken and you want to send mail to people in other countries (where your ISP is just another annoyance on the net and not a significant entity that gets special treatment) then I suggest that you consider using Gmail. If nothing else then your Gmail account will still work even after your sub-standard ISP “teaches you a lesson” [4].

30 November 2008

Asheesh Laroia: RDFa for the Debian Package Tracking System?

I was happy to read Zack's post about adding machine-readable metadata for the Package Tracking System. Not only can one query it via SOAP, he also provides XPath recipes for how to screen-scrape data out of the web pages. He writes:
Well, on top of [SOAP] I've implemented something along the lines microformats, that just make a clever use of ingredients already available in XHTML like classes and unique identifiers.
This is awesome. In fact, as you can see when he links to the SOAP backend, the SOAP interface is implemented using that XPath screen-scraping! What I think would be even more awesome would be to present the data to a machine user of the web page as RDFa, "RDF in attributes." RDF (short for Resource Description Framework) is a standard for metadata statements. Although it is involved in early versions of RSS used for web site syndication, in general it has nothing to do with that. A sample few RDF statements might be: RDF generally uses URIs to represent information (though you can still literal values like numbers where appropriate). This allows different users to create namespaced terminology. That way, when Debian defines what "maintainer" means, Fedora choose if they want to use the Debian term meaning "maintainer." If they do, then Fedora people and Debian people could use the same query (on a different set of data) to answer the same question. And if they choose to use a different term, the two data sets can co-exist; the namespacing prevents any conflict. As for the term URI: URIs ("Uniform Resource Indicators") are just like URLs, except that instead of names of locations, they are just identifiers. So it's true that every URI is a URL, but you aren't necessarily intended to be able to wget every URI; they're just names. Ben Adida and Mark Birbeck wrote a fantastic RDFa primer that explains the concepts and implementation, peppering it with diagrams where they might help. The key is that using RDFa gives you the ability to automatically interoperate with the world of RDF-aware tools, including query and reasoning systems, and it is architected in a way that anyone can add RDFa data to any page without possibly stepping on the toes of other extra-metadata technologies. (Microformats don't have most of these benefits.) Ben and Michael Hausenblas at W3C also wrote a document listing some further use cases for machine-readable web pages. When I have some spare time, I'd be happy to help. But first I hope to make Zack and others aware that there is a standard for machine-readable metadata, designed with use cases like ours in mind!

Jon Dowland: x40 suspend

Do you own a thinkpad X40, or a similar device - specifically one which needed the S3 hacks to get the backlight back on after resume? If you aren't sure, lshal grep quirk should tell you (if you have hal). You're looking for something like power_management.quirk.s3_bios = true (and s3_mode). Kernel 2.6.26 added a lot of quirk handling into the drivers, meaning an end to user-space hacks. pm-suspend, from the pm-utils package, assumes that all of these quirks have been resolved, but it seems that the S3 ones for my hardware have not. This means broken suspend/resume out-of-the-box. This is fixed in a version of pm-utils to be released in a week or thereabouts, after the freeze begins. The X40 at one point seemed to be the Debian hacker's laptop of choice. I bought mine after glowing recommendations from Steve McIntyre, Stephen Gran, Mark Hymers, Amaya Rodrigo, Daniel Stone, Matthew Garrett, Rob McQueen and several others. It's one of the best pieces of hardware I've ever had the pleasure of using, and I'm concerned that we might even be going backwards in terms of supporting this device from release-to-release. If you do have such a device, can you please try the following:
  • install the 2.6.26 kernel
  • boot into single user mode
  • modprobe i915
  • echo mem > /sys/power/state
  • resume your laptop
Please try this and report to me whether the backlight came back on - either in the discussion page for this post, or via email (jon.backlight@alcopop.org). The kernel bug to try and get this fixed is http://bugzilla.kernel.org/show_bug.cgi?id=10985, but it might not be possible to backport a fix for this to the Lenny kernel. The bug against pm-utils regarding assuming 2.6.26 is quirk-free is https://bugs.freedesktop.org/show_bug.cgi?id=16453 (Debian bug http://bugs.debian.org/488144).

Next.

Previous.