Search Results: "hle"

25 May 2006

Evan Prodromou: 6 Prairial CCXIV

Before the Mesh Conference last week, I ordered a copy of Bob Young's book Giving It Away, through lulu.com. It came in the mail today -- a 15-page pamphlet in about 10x the mass of packing material, cardboard, styrofoam and customs forms. The worst part being that after I ordered the book, I read the downloadable PDF version in about 20 minutes. What a waste of paper! I'm kind of embarassed.

23 May 2006

Meike Reichle: Back home from DC6

So, I am back home. After a 24 hour journey we arrived at Tolimar's place Sunday night, after a journey that sadly was not as nice as the one to .mx. First we departed about 1/2hr late from Oaxtepec since the backpack of a fellow traveler was ridden over by a car. Than our taxi driver charged us 900MXN for the trip to the airport, although we had agreed on 800 before we left.
Once in the airplane our machine had an engine problem and could not take off. We waited for about 2.5hrs while the inside of the plane steadily got hotter and hotter. Due to this we also missed our connecting flight at Heathrow and were rebooked on a later flight. Probably due to this Tolimar's luggage didn't make it on the same flight and had to be delivered to his house on the next day. Once we had finally reached Frankfurt we went to bed and slept for 16hrs straight. Got back up at about 5pm today, took the train to Hildesheim and am now finally home! No DebConf6 conclusions yet. I am in full EndOfEvent/jet lag mode and feel deader than the frozen chicken (Chicken! Of all things!) I just dug out the icebox of my otherwise totally cleared out fridge. At the moment the predominant feeling is a mixture of "Wow, that was a trip!", profound tiredness and regret about all the things I had planned to do but found no time then. PS: Bubulle, flattery won't help you. I'll get you for this! PPS: Time to write postcards. ;) PPPS: I'm freezing!!

20 May 2006

Meike Reichle: Materials concerning my talk ...

will be put up on my website sortly. (I.e. as soon as I fixed the typo and replaced the transparent png that f***s up OpenOffice's PDF export IN EVERY SINGLE SLIDE :( I should really start using beamer or magicPoint or something ...)

Meike Reichle: DebConf 6 - Random fun stuff

There is a couple of things that we have a real abundance of:
Some more random remarks:

Meike Reichle: DebConf6 - Formal Dinner

Not much to say about the formal dinner. It was certainly a night to remember. A couple mishaps but also a lot of fun once the excitement had subsided. For more detailed accounts of that evening please refer to Joey Hess' wonderful article. For an account of the following night, or rather its results, please refer to debian-private or this DebConf6 blog post.

Meike Reichle: DebConf6 Day Trip

As anticipated things began to run much more smoothly once the conference had actually kicked off. Which was quite good, since Wednesday/Thursday were pretty active days with the Day Trip on Wednesday and the Formal Dinner on Thursday. I had not been to sure whether I should go on the day trip or just stay home and sleep in for once, go to the pool, rest a bit and basically do all the other stuff I didn't get around to since I got here. In the end I did go though, and I am really happy about it now. At least for me the day trip was a full success! We were picked up around noon by a fleet of absolutely awesome fifties buses, all streamlined with loads of chrome, pastel colours, saints icons, playboy bunny heads and nice comfortable plush seats.
Xochicalco is a pretty interesting site and our guide gave us a really nice tour of the museum and the ruins. I didn't really mind the heat since I had put on enough sun screen and brought long loose fitting cloths and a lot of water. Such equipped I actually even enjoyed the dry heat and of course the spectacular site. As usual, I did take pictures and haven't found the time to actually upload them yet. After the tour of the ruins we went for a late lunch to some place of which I sadly don't remember the name. The food there was the best I've had through the whole DebConf and it was pretty fun. One of the kitchen ladies wanted to take a picture with me. Don't know why, but it was pretty amusing since the whole kitchen crowd seemed to have immense fun with the whole thing. So, whatever, maybe one day I'll come back and find the picture on a wall. Who knows :) After finishing our meal we went to Cuernavaca, the capital of Morelos State, which has a large handicraft market. Unfortunately I had taken much more time for the lunch than anticipated so we only had 45 minutes to have a walk and buy some souvenirs. But it was fun anyway. The only drawback of the day was that we had to skip the guided tour in Cuernavaca since we were so late and had to be back to Oaxtepec for dinner. But there is already quite a list of stuff I actually wanted to do when here, so a tour of Cuernavaca goes to the long "One day I'll be back" list. Summary: Great Day Trip! Well done. Cool buses!! Have to extend that once I am back *sigh*

David Pashley: Choosing Member Functions at Runtime in Java

Have you ever wanted to call a member function in your class, but not known what it will be at compile time? I'm writing a SAX parser and would like a function for every element name. I could write a massive switch statement in the startElement function, but this will quite quickly become unmanagable for a large schema. The alternative is to look to see if a particular member function exists and call it. To do this little bit of magic we need to use Java's introspection API. The first thing to do is to get a Class object for our class. We can do that by calling:
Class klass = this.getClass();
We can then look up the method we are looking for using Class.getMethod, but this function requires an array of types that the method we are looking for takes as parameters, so we get the right version of an overloaded method. We can do this with:
Class[] arguments =   Int.class, String.class, URL.class ;
Method method = klass.getMethod("foo", arguments);
Now we have our method, we can call it using the Method.invoke() call. This takes an object as the first parameter, which we can use this, and an array of Objects for the parameters.
Object[] values =  bar, baz, quux ;
method.invoke(this, values);
But what happens if our class has no member method called foo()? Well, Class.getMethod() will throw a NoSuchMethodException, so we can just throw a try/catch block around the code to deal with unhandled functions. It's worth pointing out that Class.getMethod() also throws SecurityException and Method.invoke() throws IllegalAccessException, IllegalArgumentException and InvocationTargetException, so you'll want to catch Exception too. We can chain some of these calls together and the result for my SAX parser is:
public void startElement(String uri, String localName, String qName, Attributes atts) 
            throws SAXException  
   try  
       Class[] argTypes =   String.class, String.class, String.class,
               Attributes.class  ;
       Object[] values =   uri, localName, qName, atts  ;
       this.getClass().getMethod("startElement_" + localName, argTypes)
               .invoke(this, values);
     catch (NoSuchMethodException e)  
       log.debug("unhandled element " + localName);
     catch (Exception e)  
       e.printStackTrace();
    
 
With this arrangement, when I want to handle a new element in my code I can just make a function like:
public void startElement_foo(String uri, String localName, String qName, Attributes atts)
            throws SAXException  
   ... 
 

19 May 2006

David Pashley: IO::Handle

Another article for your viewing pleasure. This article describes how to use Perl's IO based IO::Handle IO system and a couple of modules that allow you do to some interesting things like seamlessly handle compressed files and calculate MD5 sums as you read a file in.
use IO::Digest;
my $fh = new IO::file($filename, "r");
my $iod = new IO::Digest($fh,  MD5 );
read_and_parse($fh);
print $iod->hexdigest

17 May 2006

David Pashley: The case against backticks

I hate backticks. They have no place in modern shell programming. Here is a couple of reasons why this is the case. Not nestable backticks, by their nature, are not nestable. You can not have a command expansion inside another with back ticks.
command  foo   bar   baz 
Should the shell expand foo and baz or bar and then foo <output of bar> baz? As it happens it will run the first one. Using the modern command expansion syntax you can write:
command $(foo $( bar ) baz)
command $(foo ) bar $( baz)
Backticks are invisible The backtick symbol is too small and too easily confused with a single quote to be used for writing maintainable code. The alternative is significantly larger and therefore more obvious.
ls "' !! '"
ls "'$(!!)'"
Here is a zoomed version of the line above in my terminal: Please consider using the bracketed version of command expansion rather than backticks and make the world a nicer place

Meike Reichle: DebConf 6 - the first days

DebConf6 has now officially started! So far I sadly haven't seen any talks, since I've been busy with orga stuff (making signs, collecting reimbursement forms, receipts, passport copies etc, speaker training, chasing people for information/keys/cables/...). I hope I'll have more time once things get going. I've also given two speaker training sessions already, one on Saturday and another one on Sunday evening. They've both been pretty well attended (six to eight people, which is the almost ideal size to have a decent number of opinions but still don't have it take too long for everybody to have a go.) The Sunday evening session was a bit shorter since it was scheduled pretty late (21:30) and most participants (including me) felt tired after a while. I also noticed that I started being rather unconcentrated, so I only did a few more active exercises and skipped the rather dreary pronunciation stuff. I haven't yet received much feedback on the sessions but all attendees seemed to have fun, and there definitely was noticeable improvement in people's speaking skills over the time of the workshop. It is now Wednesday morning and everyone is getting ready for the day trip. I am really looking forward to it, even though my ankle is still acting up a bit (sprained it last week). I will also take my camera along and hope to finally take a few pictures.

15 May 2006

Aigars Mahinovs: Debconf6 day 1: Intro

The day was started by a welcome speech from the organizers saying thanks to all (most) the helpers and sponsors. The tower room was almost full, I wonder how will it look like when the real talks start. The next talk is only planed after an hour and a half as no BOF claimed this time slot. Well - a bit more time for hacking, socializing and sunbathing. :) After an hour of working on a good tan I went to "Debian vs. Open Solaris" discussion. After a bit of time the discussion about CDDL broke out. Debian basically objects to choice of venue clause and there are also GPL-incompatibility problems that might go away with GPLv3. The core of the discussion was more of the explanation of why those clauses were placed there in the first place. The sense that I got for the discussion is that Sun would modify CDDL in a way that will most probably make it DFSG-free and compatible with at least GPLv3. Also it was told that in fact usually choice of venue only applies to court suites between multi-regional corporations with overlapping regions. The legal discussions went over my head more then once especially when GPLv2, GPLv3 and CDDL license interaction on one system and distribution of such where discussed. On the OpenSolaris front there is a move from indoor source control system to Subversion. So far there are only around 100 non-Sun commits to OpenSolaris, but a big jump is expected after the transition to SVN is complete. Joey Hess had a wiki talk in paralel, which I did not see. Off to lunch! At the lunch I got to sit at the one table with Paul Allen from Intel and Ted Walther. It was discovered that Ted is actually just coming out of fasting so he does not eat anything, but only drinks juices. Well, that's one way to avoid foreign food problems. On the way back from lunch I got a lead on my first mark. I will now start a separate article about the Assassins game that I will publish when the game is over. The second talk was from Enrico about waisting time. He waisted a lot of our time with that :). I loved vigor - a paper clip assistant for vi :D. xlaby - a labyrinth for your mouse pointer. Read the man page! On the later part of the day I was busy mourning my death, preparing and trying to print papers fr the travel reimbursement stuff, so I missed all BOFs between Enrico and dinner, but had a bit of time for some local tetrinet fun. While I was doing that Ted was at the marketplace and got me a few bags of fried grasshoppers - a great souvenirs, thanks! :) Some evening hacking in the hacklab after the dinner and I already wanted to go to bed when I saw in the IRC an announcement about Speaker training BOF. The event was very interesting - Meike Reichle showed and made us do us several nice things that will definitely improve our public speaking. After that I just could not go buy a group of people playing Mao and I immediately joined the game. Luckily they were not playing long so I got the rules in seconds. The game nearly imploded after one of the players was very inconsistent with his rules (he had to rethink them all the time), but then another winner just reset the game and it went on with a lot of fun from that point. The game had three newbies, so it was a lot of fun, but also a bit of waiting for people to catch up and pay attention. Well, off to bed now - tomorrow will be busy.

13 May 2006

Andrew Pollock: [life] Dinner with The Reg

A while ago, I read an article on The Register, written by a journo based in Mountain View of all places, which had a tagline at the bottom that said to email him if you wanted to "drink like a vulture" on some sort of corporate drinkies or something. Being in Mountain View and all, I could hardly resist. Said journalist actually emailed me back, after Googling me, and it turned out he was half Australian himself, so what better excuse to catch up for dinner? Tonight we had dinner with Ashlee Vance and his wife Melinda, at the Cantankerous Fish in downtown Mountain View, and had a really great time. It's cool when you meet the sort of people you can just chat with for hours and get along with, and they're complete strangers you've never met before. It was a good night out.

Meike Reichle: Arrived in Mexico

It's taken a while, but now I am finally in Oaxtepec and online! The journey was not too bad, pretty long of course, but otherwise fine. The vacational centre in Oaxtepec is a great venue! Tasty food, nice rooms, comfortable hacklab, beautiful surroundings and a laaarge pool. It's really warm here and I am truly enjoying myself. The internet uplink caused some trouble during the first days, which is why I haven't posted earlier, but everything is fixed now and everybody is in good spirits. There are still the usual minor annoyances, but overall we're fine. Tomorrow the official conference will kick off with the DebianDay. A special day with more general talks aimed at beginners and interested locals. The day after that the actual developer conference will start, featuring talks, workshops, round tables and lots of BoFs. I am particularly looking forward to tomorrow since it's also the day when maxx arrives, bringing along his old laptop for me to use. I've been without one since I arrived here, since my own one is still broken, and it hasn't exactly been fun being without a laptop. (Not to say it truly sucked!!)

Meike Reichle: Finally!

After announcing it for ages I've finally managed to move almost everything I have online to my own (v)server. It's being hosted by Ganneff (Thanks! :)) and already hosts my webpage and my blog which has also gotten a full redesign. The horrible table mess has been replaced with css and clean html, Sartre and Nirvana gave way to Johnny Cash. There might still be some changes on the blog, since I am still fiddling with it, but the rough layout stands.
Big thanks to youam and aba who hosted the sites in the meantime. If you have any bookmarks or feeds pointing to the old blog url at youam.de please change them to point to blog.alphascorpii.net instead, since the old blog will probably be taken down soon.

10 May 2006

David Pashley: Oracle User Sessions

Ever wanted to know who was logged into your oracle server and where from? This SQL will show you the username connected, which machine they are connected from and what time they connected.
SELECT s.username, s.program, s.logon_time 
   FROM v$session s, v$process p, sys.v_$sess_io si 
   WHERE s.paddr = p.addr(+) AND si.sid(+) = s.sid 
   AND s.type='USER';

6 May 2006

Martin F. Krafft: Travel medicine

In preparation of the Debconf6 conference in Mexico, the question has to come up how to prepare for the hygienic circumstances in developing countries. While Mexico was also described to be on the top end of the developing countries, certain issues are still left to be addressed. I have travelled to developing countries a bit and have gathered some experience, which I would like to share. However, keep in mind that I am not a doctor, just a globetrotter with a strong interest in pharmaceuticals. Let me address the most common problem first: "Delhi belly", as travellers' diarrhoea is sometimes referred to (because almost no traveller makes it through India without dysentery). I know of three preventative and four reactive treatments. The best preventative in my experience is to stay well above the necessary level of hydration by drinking lots more than you usually do, especially when it's hot. Prefer bottled water and juices, stay away from ice and fresh juices and shakes (as hard as it may be). Hygiene (i.e. hand disinfectant) is important, but you cannot control what's in the pot that way, especially not in restaurants (though upscale ones are generally safer, so don't be greedy). In extreme cases (when you have no other choice), another approach worth a shot is to drink enough high-percent alcohol with anything you take in orally. It's no guarantee and often not a very preferable solution (especially when it's hot), but it's kept me running a bunch of times before. Instead of growing paranoid about it, consider the treatments: the most common two treatments I have seen among other travellers were Loperamide ("Immodium") and Ciprofloxin (or Ciprofloxacin), an antibiotic. Both are suboptimal and to be used as emergency medication only (and many traveller's don't know that). While Loperamide regulates your urge to go to the toilet by blocking and binding that which comes out the behind, it also prevents the body from ejecting the bacteria which caused the digestive system to malfunction. Thus, Loperamide should only be used when you cannot get to a toilet as often as necessary (e.g. on a bus ride), and it must not be used for more thantwo or three days without medical advice from a doctor. Ciprofloxin, the antibiotic, is almost always a sure-fire cure against diarrhoea, but it must be taken for around seven days, usually up to four days after the symptoms faded, or else the body can build up a resistance to the chemical. During this time, you should not consume alcohol (or other drugs), and limit the amount of physical exercise, which makes it not suitable for e.g. hiking or trekking trips. Note that Ciprofloxin is a prescription-only medication. Apart from staying hydrated, my favourite cure is medical coal (tablets at 250mg each; "Kohle Compretten"), which have negligible side-effects and can thus be used on-demand. If I feel my stomach going a little wobbly, I pop two of them 2-4 times a day, and that settles it after 24 hours. If the diarrhoea does come through, double the dosage. It'll help regulate the need, but at the same time won't block it. If you do get unlucky, try to rest, switch to food known to be safe (e.g. packaged food), and drink a lot, ideally electrolyte solution, but a slight salt-sugar solution will also do. I actually like fresh orange juice with sea salt, which will do the trick. I am generally not a big fan of taking pharmaceuticals, but I always have some important ones with me:
  • Ibuprofen: mixes well with alcohol and is thus a perfect small-scale pain-killer against pre- or post-party headaches, or headaches that would ruin a nice dinner with friends. Make sure to drink a lot of water, and even more if you also take in alcohol
  • Paracetamol: medium-scale pain-killer, helps reduce fever. Does not mix well with alcohol. Primary symptom treatment for malaria and dengue fever, influenza, and colds. Drink lots of water.
  • Diclofenac: against swellings and inflammation. Does not mix with alcohol, and the tablets may seriously affect your digestive system. Consider combining with Pantozol, even prophylactically.
  • Valium, or preferrably something less strong: on the bus or on the plane, if you cannot sleep because it's too uncomfortable. Make sure to have the dosage right or you won't make it off the bus, even if someone wakes you.
  • Ciprofloxin: whether it's diarrhoea or any other sort of infection, or bacterial infestation, it's good to have Ciprofloxin with you. If in any way possible, I recommend calling your doctor back home before you start taking it, just to be sure. Antibiotics are really not suited for experiments.
  • Hydrocortisone: insect bytes and sun burns. Use sparingly because it attacks (thins) the skin.
  • Loperamide: see above. Try to avoid it unless you really need it.
  • Bisacodyl: congestions can be quite painful.
Other stuff you may want to carry along includes wound disinfectant (Dexapanthenolum; also any high-percent alcohol would do), fruit/grape sugar (Dextro-Energen), stuff against sickness on cars/boats/etc. (Vomex), bandages, Diclofenac gel, ice spray, a fever thermometer, a bunch of wet hygienic towels, single-use eye drops, steroid-based ear drops, and so on. Your pharmacy will have a complete list. Anyway, given the proximity of medical assistance to the conference campus in Mexico, most of the above won't be necessary. Nevertheless, I think it's important that travellers to countries with lesser hygienic standards than their home countries are familiar with the above, and if only to consciously decide for or against a treatment. In general, I think it's always best to try to isolate and treat the cause rather than the symptoms. And surprisingly often, dehydration is (one of) the cause(s), so electrolytes are among the most important to have with you, in my experience. But again, I am not a doctor.

4 May 2006

David Pashley: Gnome Terminal and Character Encodings

Since upgrading to GNOME 2.14, I have been revisited by an annoying problem with gnome-terminal. Gnome-terminal sets your character encoding to being the same as your locale by default, which unfortunately was being detected as ANSI_X3.4-1968, while I had my $LANG set to en_GB.UTF-8 in my ~/.bash_profile. The reason it wasn't being detected was because nothing between logging in and starting gnome-terminal looked at that file, so gnome-terminal thought the locale was C. The result was corrupt display when programs attempted to display unicode characters. I could fix it by changing the character encoding using the menu, but I'd have to do this for every tab, which quickly becomes annoying. Time to find a fix. Turns out that you need to tell gdm to set the right locale, which you can do by configuring ~/.dmrc. Mine now looks like:
[Desktop]
Session=gnome
Language=en_GB.UTF-8
Obviously, the important section is the Language line. You need to set it to a locale that exists on your system, which you can find using locale -a. Once you've set that and logged in again, everything should be working correctly.

28 April 2006

David Pashley: Dealing with blog spam

Julien, the majority of comment spam can be dealt with very simply by including a turing test. On my blog, when I first started getting comment spam, I added a check box asking if the poster was a human. For a human, it's not a massive inconvience to tick a box, but for an automated tool, it's a major problem. Was implemented in 3 lines of html and one line of python. Since I added it, I haven't recieved a single piece of spam. I don't believe it's had a major effect on people commenting, although I currently can't tell. I could change it to hide posts that claim to be non-human until I've checked them. If spam tools work out this simple problem, I could change the nature of the test to randomly change between "I am a human" and "I am not a human". After that I could include a simple sum or some other simple question. It also has an advantage over captchas that it is accessible. It is a simple change which massively reduces spam by increasing the cost of spamming and I'm surprised that most people don't do something similar.

23 April 2006

David Pashley: Installing Oracle XE on Debian

I've spent the weekend playing around with the new Oracle XE Debian packages in preparation of having to use them at work in the near future. I've written up my experiences of setting the server and connecting remote clients in my latest article. Talking of work, we have a position for a junior support role open. If you live in or around Brighton, England and know a little bit about Linux, Debian, Tomcat, Java, PostgreSQL and Oracle and willing to learn more, have a look at the job description and get in contact.

22 April 2006

David Pashley: Empty elements in XSLT

I recently wanted to deal with docbook <ulink> elements that didn't have any contents by displaying the url as the link text. I wanted to convert:
<ulink url="http://www.example.com">Example.com<ulink>
<ulink url="http://www.example.com"/>
to
<a href="http://www.example.com">Example.com<a>
<a href="http://www.example.com">http://www.example.com<a>
I originally had:
<xsl:template match="ulink">
   <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>
This sucessfully dealt with the first form of <ulink> that had content, but not with the second example with an empty element. The solution is the use an <xsl:choose> element with a test to see if the current node has any child nodes. Using child::node() we can get any child nodes. We can then test if the node has any children using the count() function. The resulting xslt is:
<xsl:template match="ulink">
   <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
      <xsl:choose>
         <xsl:when test="count(child::node())">
            <xsl:apply-templates/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:value-of select="@url"/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:element>
</xsl:template>

Next.

Previous.