Search Results: "ag"

31 January 2006

Axel Beckert: Can the spam problem be solved?

Many have tried to solve spam problem, even Micrsoft (with a quite strange solution ;-), but except personal solutions like well working and well-kept spam filters, no well-working general technical solution has been found yet. Although I really would like to see a technical solution and often think about this problem, I currently believe that this primarily is a social problem which cannot be solved solely with technic. UserFriendly’s Erwin seems to see it the same way and proposed today a quite drastical solution. There are good ideas out there (e.g. SPF, RBL, Greylisting and Teergrubing), but all seem to have their problems, too. Especially RBL often have administrative problems, i.e. if an entry is justified or not. Greylisting simply can be bypassed by being SMTP conform and trying again, so it’s usefulness will decrease permanently. And against Lutz Donnerhacke’s teergrubing, spammers seem to have found workarounds quite quickly. Haven’t heard much about it in the last years. (I just can’t remember what the drawback of SPF was.) For myself I’ve solved the spam problem with a learning SpamAssassin and sorting mail by spam-level into several mailboxes. The higher the spam-level of such an inbox, the more seldom I look into it. Works fine. For me. No general solution though, since the SpamAssassin needs to be fed with fresh spam regularly.

Wouter Verhelst: Whee.

According to the graphs, we are now officially no longer the worst architecture! Whee. Not that I feel happy for the hppa folks, but we've been in this position for way too long already, now. It's about time we got through this. Therefore: Whee! Of course, the fact that we're not the last in the list now does not mean that our problems are over. There's #345574 to care about (and, hence, #340563; and there are a bit more issues like that one that will need a bit of love to be resolved. But we're going in the good direction again, which is great. In somewhat related news, some of our ColdFire eval boards have arrived at their destinations already. Unfortunately, mine has not arrived yet; but I presume it will rather soonishly. I should probably finish patching binutils to handle those FPU instructions as well, so that I can start testing and comparing...

Zak B. Elep: Itinerary for Feb: AsiaBusinessTour and BOSF

In a little while I’ll be packing my things: clothes (with a few formal attires), a couple of (C/data structures) books, some snacks (Nerds!) and spare change (no bills). I’ve yet to see all of them fit in my backpack, so I’ll probably bring a couple of bags. Tomorrow, I will be bound for Manila yet again, much earlier than usual, for the AsiaBusinessTour on Thursday. And on the 16th, there will be the Bicol Open Source Forum in Legazpi City. Joseph Davidton Cadag invited me to be a speaker; I’ve yet to accept, but I’m leaning to it, especially since this would be a great opportunity to speak more about FOSS to my fellow Bikolanos. Also, its a nice time to meet up with Irvin Piraman who will be giving some Ubuntu CDs in the Forum too. I just hope I can finish my (re)packaging of ecb which I ITA‘d since last August. There is a package of the new upstream version already, but there seems to be a lack of Debian sponsors who can look into Emacs-related packages. sigh

Uwe Hermann: Beagle 0.2.1 released - fancy desktop search tool for Linux

Beagle screenshot 1 Beagle 0.2.1 is out. Beagle is a very useful desktop search engine for GNOME (but you can use it with KDE, too, or even without any desktop environment like I do). Despite the low version number it is already quite stable and usable, and has lots of features. It can index all kinds of files and information on your computer (txt, pdf, doc, emails, IM logs, IRC logs, source code, images, music, and whatnot) and provides a very nice (new) search interface (see screenshot). Yes, Google Desktop Search and Spotlight do the same thing, but neither is available for Linux, and neither of them is Free Software. They can "phone home" without telling you and do other funny things. With Beagle you can easily check what it does (use the source, Luke!). Oh, and Beagle can now also parse Ruby files, a simple filter I had written and submitted has been included in the latest release (well, actually it was there in 0.2.0 already, but I didn't tell anybody ;-)).

Joey Hess: sleepd 1.3.0

Recently I put a new drive in my laptop, and unlike the last one (but like the one before), the 2.6 kernel cannot handle apm sleep with this drive. So I had to, horrors, switch to using acpi and software suspend and hibernate. Which, suprisingly, is working ok. But it was missing a little piece, something to put the machine to sleep if the battery got too low, and so I remembered this sleepd program that I wrote years ago and have been tying to ignore ever since despite people who persisted in using it for some strange reason. Apprently there's still nothing else to handle this job. So now I'm releasing version 1.3.0, with a bunch of patches and improvements.

Christine Spang: Books, books

I finally got out to Barnes and Noble today to spend the last of my Christmas/birthday gift certificates. Bought the last two books in Robin Hobb’s Farseer Trilogy as I have the first book but haven’t read it yet, as well as the third book in Robert Jordan’s Wheel of Time series. Incidentally, I was told by a friend that it’s only worth reading the first three books of the Wheel of Time, as it goes on forever and ever with little development. Please correct me if I’m wrong. I was tempted to buy The Atlas of Middle-earth but was swayed by my OCD at having unfinishes series (what on earth is the plural of that word? serieses? I want to say it doesn’t change, but that sounds funny) in my bookshelf. I’m still not sure when I’m actually going to read all these books, but, uh, I’ll figure that out eventually.

30 January 2006

Edd Dumbill: Beginnings with Ruby GNOME

A while back I started porting the GTK examples from Mono: A Developer's Notebook to IronPython and Boo, the results of which are available in my Subversion repository. Although I've not finished that task yet, I thought I'd investigate the state of the Ruby GNOME bindings by porting those same examples. They have the advantage of increasing gently in complexity. Before I go on, you can find the work in progress posted in the ruby-gnome/monodn branch of my Subversion repository. Now for a few observations. At the basic level, Ruby GNOME has a lot in common with all the other GNOME bindings out there. One distinguishing feature however is signal handlers, which take a Ruby closure as an argument. Look at this handler for closing the window, for example:
w = Gtk::Window.new("My Window")
w.signal_connect("delete_event") Gtk.main_quit
This is fine for simple handlers. Developers wanting to reuse handlers might wish to specify a method here to use. The best way of doing this I've found is:
def my_handler(but)
   ...
end

button.signal_connect("changed", &method(:my_handler))
This involves a little bit more magic, as you can see. I've also run into an unexpected barrier with subclassing and the class default signal handler. The subclassing example from the Mono Notebook shows an example of overriding the clicked method of a Button. In C# this looks like this:
class MyButton : Button  
...
protected override void OnClicked ()

  hitcount++;
  base.OnClicked ();
In Ruby I would write this:
class MyButton < Gtk::Button
...
def clicked
  self.hitcount += 1
  super
end
However, when you click the button it's clear the overridden method isn't being called. I've filed a bug with what I think is the underlying problem. In this instance, I worked round it by adding a signal handler in the constructor:
self.signal_connect("clicked")    b  b.hitcount += 1  
At the moment it feels like I'm writing rather C-like Ruby, rather than it being idiomatic. But then again, I am porting examples from C# in as literal manner as possible, in order to facilitate comparison.

David Welton: Disaster strikes

Where I'm working, they wanted to try "netoffice", a PHP collaboration/time tracking/productivity thing. I downloaded the "dwins" version of it, and ran the install script after reading the instructions. Being a bit late, I hit the return key one too many times, and noticed some funny error messages about problems deleting files in /dev. Oh shit... Turns out the script has the following line:
rm -rf $ INSTALL_DIR /*
Simply brilliant. Thanks a lot, guys... So at this point I'm sitting there with two shells opened via ssh, no /bin/, no /etc/ and nothing much in /dev. For reasons I won't discuss here we don't have backups - suffice it to say that it wasn't my decision. Not good. ssh didn't work any more, either in or out, because it needs files in /etc/ and /dev, and so I couldn't just copy new stuff in. Luckily, I had a fully stocked /usr/bin, and I did the first thing that came to my head: a small server in Tcl that copied its input into the specified file. Using that and netcat on the other side to send the files, I recreated enough of /bin to get MAKEDEV working in /dev. Phew... a little bit better, but /etc/ was still gone. I brought in a few more bits and pieces like /etc/passwd and /etc/group using my Tcl server, which was enough to get scp working from the machine. At that point, I brought in the rest of /etc. I was starting to think about going home when I ran the fateful script, so at this point it was pretty late, I was starving, so the rest will have to wait for tomorrow. The biggest problem, I think, is how to restore the files in /etc at least to the pristine installed state required by the packages that own them? The other problem is that the password file uid's are now out of sync with the file system, which is causing problems here and there. Unless I think of a brilliant way to fix those two issues, I'll probably consider myself satisfied that I got things running to a point where I can get the important data off the system, set up some temporary services on other machines, and reinstall the whole thing. This is all on Ubuntu systems, by the way.

Martin F. Krafft: Justin Hall

If you've been on the web for long, you will know Justin Hall and his infamous links.net. I know Justin from college and I've always respected him for the freak that he is -- which is not supposed to sound derogatory in any way. I've often envied him for what he was capable of. ... and we lost contact a while ago. So much that I didn't even take note of his breakdown. If it had been anyone else publishing this movie online, I'd have hit 'q' about 10 seconds in. As it stands, seeing it really had an impact on me. I don't know how, time will tell, but I feel it. Dropping him a note now.

Martin F. Krafft: This laptop has Super Cow Powers

Working on the German translation of my book, I find myself swearing loudly at the translation from time to time (German just sucks, and the deadline is tomorrow. ARGH!). Since we all know that swearing isn't nice, I've set out to find something else, possibly even more relieving. The solution comes via the tpb package:
$ cat ~/.tpbrc
THINKPAD /usr/bin/aplay /usr/lib/openoffice/share/gallery/sounds/cow.wav
Now all I have to do is bounce on the blue Access IBM key of my lovely X40 whenever I need fast relief. And if that isn't going to be enough, I'll implement more variety. MOO! PS: Thanks to astronut for the title.

Ross Burton: Sound Juicer "J'd Up To The Boom" 2.13.4

Sound Juicer "J'd Up To The Boom" 2.13.4 is out. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Bug fixes: Translators: Adam Weinberger (en_CA), Ales Nyakhaychyk (be), Ankit Patel (gu), Clytie Siddall (vi), Evandro Fernandes Giovanini (pt_BR), Francisco Javier F. Serrador (es), Funda Wang (zh_CN), Gabor Kelemen (hu), Ignacio Casal Quinteiro (gl), Ilkka Tuohela (fi), Jean-Michel Ardantz (fr), Kjartan Maraas (nb, no), Lasse Bang Mikkelsen (da), Theppitak Karoonboonyanan (th), Tino Meinen (nl). NP: Gorillaz, Gorillaz

Antti-Juhani Kaijanaho: Counting lines

Insipired by Daniel Burrows’ tests, I decided to do mine. The object is to come up with a Haskell program that performs the job of wc -l as efficiently as possible. My test material is a randomly generated file with all lines less than 80 characters long. Summary: my final idiomatic version is twice as slow as wc -l, and my final nonidiomatic version is as fast as wc -l, or at least within the margin of error. First, the baseline:
$ time wc -l testfile
7798137 testfile
real    0m12.127s
user    0m0.765s
sys     0m0.399s
Then the most idiomatic program. Honestly, I expect it to suck performance-wise:
main = getContents >>= print . length . lines
And it does:
$ time ./wcl1.hs < testfile
7798137
real    1m14.993s
user    0m54.182s
sys     0m0.573s
But only by a factor of six. My first hypothesis is that garbage collection is the culprit. And, indeed:
$ time ./wcl1.hs +RTS -sstderr -RTS < testfile
./wcl1.hs +RTS -sstderr
7798137
25,236,174,340 bytes allocated in the heap
5,070,193,924 bytes copied during GC
117,484 bytes maximum residency (3750 sample(s))
96274 collections in generation 0 ( 26.36s)
3750 collections in generation 1 (  0.74s)
2 Mb total memory in use
INIT  time    0.00s  (  0.00s elapsed)
MUT   time   27.17s  ( 42.72s elapsed)
GC    time   27.10s  ( 33.72s elapsed)
EXIT  time    0.00s  (  0.00s elapsed)
Total time   54.27s  ( 76.44s elapsed)
%GC time      49.9%  (44.1% elapsed)
Alloc rate    928,824,966 bytes per MUT second
Productivity  50.1% of total user, 35.5% of total elapsed
real    1m16.616s
user    0m54.278s
sys     0m0.700s
As you can see, GC takes half of the processing time. Unfortunately, minimizing GC time does not have as big an effect as I hoped:
$ time ./wcl1.hs +RTS -H100M  -RTS  < testfile
7798137
real    1m1.354s
user    0m44.371s
sys     0m1.171s
Here, I’m effectively telling it to use a 100-megabyte heap. A separate GC profiling run tells me that GC time has dropped from 50 % to 1 %. The memory problem seems to be a red herring. What we’re doing here is creating four separately allocated memory cells for each character in the input. Of course, the cells are generated lazily, that is, a cell pair is allocated when the lines function demands another character; it then creates another cell pair to denote the same character in a list of lines. As soon as each line has been counted, the four cells become garbage. This sounds like a lot of work! But apparently it isn’t; I tried a few variations that did away with the stream of input altogether, not much unlike what Daniel did in his tests. Surprisingly, the performance worsened a lot. The lesson: functional programming language implementations, unlike typical imperative ones, are built on the assumption that you’ll be doing a lot of allocation. What I suspect is taking a lot of the time is arithmetic. Haskell’s Int is boxed, and lazy by default, adding a lot of overhead. I hand-fused length and line, yielding a tail-recursive countLines function, and I added the command-line switch -funbox-strict-fields, which enables a few significant optimizations of the laziness of Int. The results were nice:
ajk@kukkamaljakko:~/scratch$ cat wcl4.hs
module Main (main) where
main :: IO ()
main = getContents >>= print . countLines 0
countLines :: Int -> String -> Int
countLines n ('n':r) = countLines (n + 1) r
countLines n (_:r) = countLines n r
countLines n [] = n
ajk@kukkamaljakko:~/scratch$ ghc -O -Wall -funbox-strict-fields --make wcl4.hs -o wcl4
Chasing modules from: wcl4.hs
Compiling Main             ( wcl4.hs, wcl4.o )
Linking ...
ajk@kukkamaljakko:~/scratch$ time ./wcl4 < testfile
7798137
real    0m37.961s
user    0m29.853s
sys     0m0.495s
ajk@kukkamaljakko:~/scratch$ time ./wcl4 +RTS -H100M < testfile
7798137
real    0m25.153s
user    0m13.497s
sys     0m0.803s
ajk@kukkamaljakko:~/scratch$
With a large heap, the program is only twice as slow as the baseline. This is pretty good, considering that the code is still idiomatically functional. The following rather ugly, imperative program does away with the lazy stream and carefully avoids any laziness without doing any too dirty tricks:
ajk@kukkamaljakko:~/scratch$ cat wcl7.hs
module Main (main) where
import Data.Word
import Data.Array.IO
import IO (stdin)
count :: Int -> (Int, Int) -> IOUArray Int Word8 -> IO Int
count 0 _ _   False = undefined -- force ac evaluation
count ac (l,u) _   l > u = return ac
count ac (l,u) ar
    = do a < - readArray ar l
         let ac' = case a of 10 -> ac + 1
                             _  -> ac
         count ac’ (l+1, u) ar
maxn :: Int
maxn = 4096
main :: IO ()
main = do
  arr < - newArray (0,maxn) 0
  let loop :: Int -> IO Int
      loop acc = do n < - hGetArray stdin arr maxn
                    if n == 0
                       then return acc
                       else do acc' <- count acc (0,n) arr
                               loop acc'
  res <- loop 0
  print res
ajk@kukkamaljakko:~/scratch$ ghc -O  -Wall -funbox-strict-fields --make wcl7.hs -o wcl7
Chasing modules from: wcl7.hs
Compiling Main             ( wcl7.hs, wcl7.o )
Linking ...
ajk@kukkamaljakko:~/scratch$ time ./wcl7 < testfile
7798137
real    0m13.431s
user    0m10.342s
sys     0m0.467s
Of course, this program is not Haskell 98, but the nonstandard things it uses are fairly common. As can be seen, this version’s performance is, considering the margin of error, equal to the baseline. The compiler used in this test is The Glorious Glasgow Haskell Compilation System, version 6.4.1, as packaged in Debian sid.

Ross Burton: Blog Comments

This morning before work I hacked up a few Pyblosxom plugins to do word blacklisting and a basic Turing test on comment posters. The blacklist currently only contains 'phentermine', 'poker', 'xanax', and 'viagra', but that should filter out 90% of the comment spam. For the rest, the Turing test asks the poster to add together two small numbers. The lazy bit is that these numbers are hard-coded at the moment, I'll add that later... Hopefully I haven't broken something and if people pass these tests then comments actually work, if not the please email me. I'll release the plugins later this week when I've added documentation and ensured they work. NP: In Between Dreams, Jack Johnson

Martin F. Krafft: Windows Vista and IPv6

Sinead O'Donovan, product unit manger for networking at Microsoft, believes IPv6 offers securer data transmissions through longer IP addresses. Ah, I can hardly wait for "new application experiences," "richer collaboration," and all the other buzzwords MS uses to tout their next failure. Here's more from the article, this time about NAT: "If you had to route all the file-sharing traffic in MSN Messenger through your server it's very expensive to build that application because they must have a lot of servers to support the application. IPv6 allows them take advantage of end-to-end connectivity, so if it makes sense for the traffic to go between two peers they can." Yeah, granted, InformationWeek.com seems to be pretty crap too. But someone tell Donovan about routing, please? At the end of the article Donovan is also proud to address problems with Vista's connectivity features with IPv6: "The connectivity features in Vista must have a reachable IP address from remote locations. If the connection is initiated from outside the home the NAT locks up and you don't have a way of addressing the PC. Reaching the devices isn't possible unless you custom configure an application." Can anyone else picture trojan authors rubbing hands?

NOKUBI Takatsugu: File::Magic 1.26

Today I released File::MMagic 1.26 and uploaded to CPAN. It would be appeared soon. And already uploaded it in the Debian unstable archives.

Daniel Burrows: How much speed are you willing to give up for pretty code?

After experimenting a bit with Haskell and using it for some toy projects, I decided to see if there was any chance it could be used for a non-toy task; i.e., one where it might one day be necessary to actually have fast code. As a proxy for this, I decided to try a very simple task: counting the number of lines in a file. As input, I generated a file with a million lines of random data and an average of 40 bytes per line; all the Haskell programs were compiled with the current GHC in Debian unstable and with optimizations enabled.

The baseline is, of course, our friend "wc":

real    0m0.084s
user 0m0.043s
sys 0m0.040s


(this and all other timing data was taken after "cat /tmp/testwc.txt > /dev/null" to ensure that the file was cached) Now, it's probably too much to hope that a Haskell program will run as fast as a C program does, since the C program can run in a tight loop. But it seems reasonable that it should be possible for Haskell to be competitive with the trivial Python implementation of this program -- after all, Python is interpreted and Haskell is compiled.

import sys
n = 0
for line in sys.stdin:
n += 1
print n


Running this simple Python program under "time" produces the following statistics, a bit less than 10 times slower than the C version:

real    0m0.698s
user 0m0.643s
sys 0m0.050s


The trivial Haskell program to count the lines of its input is:

main = do c <- getContents ; print $ length $ lines c


Note that this is basically identical to the Python program, but expressed in a functional style. Pretty, but how does it stack up?

real    0m6.744s
user 0m6.426s
sys 0m0.213s


OW! Ten times slower than the Python code, and a good 80 times faster than "wc"! The gap can be lowered to "only" 50 times with the following program --

do c <- getContents; print $ length $ elemIndices '\n' c


-- but surely it's possible to do better. I'd expect that the expense here is in the use of lazy streams for IO; eliminating them gives us the following code:

wc :: Handle -> IO Int
wc h = do a <- mallocArray bufSize :: IO (Ptr Word8)
loop a 0
where loop a n = do amt <- hGetBuf h a bufSize
elts <- peekArray amt a
(if amt == 0
then return n
else loop a $! n + nlCount elts)


At this point, we're basically using Haskell as a (bad) imperative language. This function allocates a buffer, repeatedly reads into it, and counts the number of newlines in the buffer (I dropped some auxillary code to keep the post short). The $! is important; without it, even though this routine is tail-recursive, Haskell will still allocate an unbounded amount of memory to store the return value. (because, of course, it's terribly important to remember that you're actually returning "1+2+3", not "6")

So, how does this unreadable, hand-optimized version of the code perform?

real    0m1.980s
user 0m1.757s
sys 0m0.094s


That's right -- I've eliminated most uses of higher-level functional techniques, and the Haskell version is still two times slower than an ultra-high-level interpreted language, while also being uglier and harder to read! Ouch. It appears the old performance albatross of functional languages is not quite dead yet.

29 January 2006

Radu Spineanu: Oops

It seems i managed to upset at least one person with my previous entry. Sorry for that.

I am sure students at famous uni's do A LOT more work than us, and in no way did i want to offend them. From now on, I'll restrict myself from posting school related stuff.

David Moreno Garza: MiniDebConf all the time

Jos , as I saw Debian activity in Maracaibo, I could bet every meeting on free software in Venezuela is a MiniDebConf :-) . Now, how cool is that! :D

Clint Adams: Charlie has a PhD

Dear Geoff, Hi there, thanks for the email...and although this seems ridiculous, I have a rule against dating Aquarians. Nothing personal (I know, right, HOW can it not be personal?) It's just that every Aquarian I've ever known cannot seem to handle deep emotional intimacy. More thinkers, more logical than I tend to be. I wish you well. Zen rocks. ~Charlie.

Jonathan McDowell: I'm becoming a wedding bore

Kathy and I went out for dinner last night at Tootsies with Becca, Dave, Eli, J, Kaz and Will. It was a good night (even if the girls beat us at Cranium), but I found myself having to stop talking about weddings - I could see J and Kaz starting to glaze over early in the evening. This a frightening event. Is this how people become baby bores? Anyway. Kathy and I managed to look at a couple of potential venues yesterday and have another one arranged for next Sunday, and a few more to ring this week to hopefully see next weekend. It's all still very scary.

Next.

Previous.