Search Results: "erich"

27 March 2008

Julien Danjou: PHP applications code quality

Ah, Erich, that IS so true. I never found a well written PHP application anyway, or it was only 10 lines long. I guess that's primarily the language fault. It permits to do a lot of stuff and does not simplify, help nor force the simplest implementation methods like MVC which should be the base in Web developement. Well, take as example what we would do with Python and GTK+ if they were like PHP and HTML (I do not have the API reference so it will be somewhat improvised):
#finally we do not need this module I wrote everything myself
#import somemodule
def main():
    # Well we want to do some printing
    window = GtkWindow()
    # Connect to the database without any abstraction, that sucks
    db = mysql.connect()
    data = db.query("select RANDOMLYTYPEDDATA from MYONLYTABLE");
    while data:
        # Ah, we do not have include() so we cannot reuse code
        # I'm a PHP developer, I do not know functions
        import somestuff
    window.print(somestuff.result)
    # Obviously, forgot to close db connection, etc.
    if form.data.field == "hello":
        # The user asked for hello, print hello
        window.print("hello")
    # debug
    print data[0]
    if form.data.anotherfield[0] == "morning":
        data = db.query("select anotherdata from MYONLYDATA")
    else:
        sys.exit(42)
    label = GtkLabel()
    # Yes know we construct the view!
    window.add(label)
    label.print(data)
That is typical PHP code: we just take randomly typed data from our DB eng... no wait, from MySQL (remember that's LAMP!!! Not LAPP or anything else, bitches!), then we print some HTML code with data, and we do tests on environment, forms, etc, and we get back data, reprint them, do not use functions but include() multiple times thousand of files and then do not close/free anything. It's so easy to do bad code that lot of people coming from nowhere and who did not learn anything from other languages are doing it. Another hypothesis coming from my experiment: PHP is a language which can be developed under any OS since it's server-side executed. A link between mostly brain dead "developers" from the Microsoft world and whose from the Free Software world. A clash. I apologize to some of my coworkers doing better PHP all the day. :-)

26 March 2008

Erich Schubert: Measuring code quality by database support...

Do you know why so many (mostly PHP) developers have problems porting their applications to PostgreSQL?Because PostgreSQL actually enforces constraints on the data.MySQL, which can even have values that are NULL and NOT NULL at the same time (yes, this is not a joke, Details are found here), is not particularly good at that. And people get used to all kind of stuff they can throw at MySQL and it will try to make the best out of it, instead of forcing the programmer to correctly specify what he intends to do.That's the reason why I so far have been avoiding any application which only support MySQL: If it only supports MySQL, it probably means they can't get it to work with anything else. And that is a really bad sign.I was looking for some cheap WebCMS. The big names are Typo3, Joomla, Drupal. Joomla is MySQL only. Plus it doesn't support iCalendar. Typo3, I've had had a look on that one before, it was ugly, used things like line numbers for layouting. And Drupal was pretty much the only one I heard not just negative things about (I was mostly talking to tech guys, not "web designers"). So I thought I'd give it a try. With PostgreSQL, since I want a consistent database.Drupal (6.1) installation with PostgreSQL worked fine. Then I tried installing the add-on modules I was most interested in: Date and Event; since the web site I'm considering it for will be mostly around organizing events, so I do need some solid calendaring functions.Apparently, the Date module of Drupal currently does not support PostgreSQL, it failed creating or filling it's timezone table in the database.How come that pretty much all PHP stuff is broken on so many levels? I figure the Drupal people have spent a lot of time in getting their core working well, and I also believe that the cores of the other systems might all be okay. But when it comes to extension modules, it seems to be as bad as ever before with PHP...Some people might just say "well, run MySQL, and it would be working".If a module isn't capable of storing timezone information in other SQL databases, how can it be of good code quality?(Yes, I know that I'm not being entirely fair. Picking on Drupal or even on the not yet finished Date extension is probably not really fair. But you have to admit that an application which can work with multiple databases probably has received more attention to doing database things the proper way, right?The Date module is not yet "released". I'm not saying it's worthless, it just does not work for me yet. And it actually backs my first claim: working support for other SQL databases is a sign of code maturity.And in most (if not all) PHP web applications, extension modules with their varying code quality are known for introducing security issues again and again.)

21 March 2008

Erich Schubert: Google Summer of Code 2008

Debian is part of the Google Summer Of Code again this year (2008).Last year was quite successful, so we hopefully will get at least as many slots as last year.Applications will be possible March 24th to March 31st. This means, you should already starting writing your project proposals and get feedback by possible mentors. Ideas can be found in the Debian Wiki, but notice these are just ideas. You are by no means limited to what we're proposing there.As for writing an application, here are some general notes: In turn, we (= the mentors and admins) will try to (again - we did that last year) have at least three mentors read through your application, provide feedback on it and judge it. We don't draw lots for the slots, but we'll rank the applications based on the scoring by the mentors. We'll also try to assign you a fallback mentor in case your mentor has to step back for whatever reason and to give you additional people to talk to.

20 March 2008

Erich Schubert: Art Deco Web Design?

Do you know some web sites sporting an Art Deco or Roaring Twenties web design? I find that period (the Swing and Jazz age, where Gangsters were still stylish) very fascinating, and I'm looking for things to get inspired.Art Deco is usually described as being "simple shapes, geometric, vibrant colors", which would fit to web design restrictions quite well, wouldn't it? Other important aspects seem to be the use of materials; which obviously isn't really possible in web design (mind you, textures are only a bad approximation).If you know some sites where you'd say "this is Art Deco Webdesign", please let me now via EMail, erich (AT) debian (DOT) org[Update: Web Designer Wall has a list with a couple of nice pages. Not all of them are Art Decoish or Roaring Twenties, but some a pretty nice.I'm looking particularly for Art Deco and Twenties, but any Vintage and Retro Design can be inspiring.And I'm not looking for pages to blindly clone, but to get some inspiration from. I don't copy, since I do pages in my own particular (XMLish) way anyway.]

15 March 2008

Daniel Burrows: Full upgrade and conflicts

Erich Schubert wonders how to improve the handling of conflicts in package managers, particularly in aptitude full-upgrade and apt-get dist-upgrade. From the point of view of the package manager, conflicts are a bit tricky to deal with. The problem is that a conflict only really tells you not to install two packages at once; it doesn't tell you which package should end up on the system by default. Worse, aptitude has two approaches to this:
  • When a package is marked for installation in the visual interface or listed on the command-line, then if Aptitude::Auto-Install is enabled, aptitude will automatically resolve conflicts in favor of that package. The same applies to packages that are upgraded by pressing U or by full-upgrade.
  • When aptitude's dependency resolver encounters a conflict, it considers both resolutions to the conflict to be equally valid. If there are no other reasons to choose one package over the other, it will be unpredictable which one gets removed first, and even when there are reasons to choose, the user may not understand what they are.
I don't think it's possible to always make upgrades predictable. But I think that even just making Auto-Install stick to installing packages and not removing conflicts would be a plus. Installing obvious dependencies up-front is good because it means less work for the resolver and a more predictable starting point. Many trivial dependency problems can even be completely solved this way. But removing conflicts is a lot trickier and should probably kick the problem into the full resolver. Unfortunately, the code enabled by Auto-Install is all deep in the guts of libapt. I've tried to avoid duplicating this code so far, but it does seem like I periodically run into cases where it doesn't do exactly what I need, so maybe I'll have to eventually. :-(

28 February 2008

Erich Schubert: Vote Green, please.

There are communal elections in my region this weekend.Green campaignI'm a supporter and member of the Greens. Please support us by voting for us.Don't vote for CSU. Ever. Just think of what they've been doing towards spying on citizens, data retention and such. They fight against your freedom by blaming the "terrorists".We could use up to 20% greens, and there is no way we're going to reach that anytime soon. So it's save to vote for the Greens. Even with your vote, they'll probably just reach 10%, and that definitely is a good thing for democracy. Nobody is talking about the Greens becoming the strongest party, you know... but we could use more Greens than we currently have in the parliaments. If we have 4-5 reasonably strong parties and changing coalitions, that helps fighting corruption.

Erich Schubert: Vote Green, please.

There are communal elections in my region this weekend.Green campaignI'm a supporter and member of the Greens. Please support us by voting for us.Don't vote for CSU. Ever. Just think of what they've been doing towards spying on citizens, data retention and such. They fight against your freedom by blaming the "terrorists".[Yes, I am aware that these topics are national, not communal topics. But in communal topics it's the same thing. CSU wants to waste billions of money on a train which is 10 minutes faster at the airport, and which nobody is going to use because it's quite a bit more expensive. The money could be used for much better purposes, but I guess they owe some construction companies ... It is a fact that they have introduced study fees, despite the need for more high-qualified people; they should be putting more money into our universities instead of driving people away from higher education.]We could use up to 20% greens, and there is no way we're going to reach that anytime soon. So it's save to vote for the Greens. Even with your vote, they'll probably just reach 10%, and that definitely is a good thing for democracy. Nobody is talking about the Greens becoming the strongest party, you know... but we could use more Greens than we currently have in the parliaments. If we have 4-5 reasonably strong parties and changing coalitions, that helps fighting corruption.

20 February 2008

Erich Schubert: Enigma on Nokia N810 with tilt device

Watch the youtube video of the n810 with a tilt device.It's pretty cool to see Enigma running on the n810. The tilt device seems to be suprisingly good for playing Enigma, I wouldn't have expected that - Enigma is heavily designed to be played with a mouse.Congrats to the tilt stick makers and the Enigma porters for the n810.There will be a new release of Enigma in a few months, with serious engine improvements (several algorithms have been replaced with more efficient ones, leading to serious speed improvements in certain levels!). The code got a pretty big overhaul by the main developers, and the level API was also redesigned, so this will really be a major thing.

12 February 2008

Erich Schubert: New flash, usability++

With the latest flash for Linux update, two of the biggest annoyances have disappeared. Yay for usability!It still sucks, and I'm only using it in rare cases by selectively loading Flash. I love FlashBlock, which replaces any flash crap with a 'Play' button. Now if we could only do the same for some of the Web 2.0/DHTML annoyances...[Note: it's not a particularly new version. r115 according to about:plugins. I was told it's like 3 months old. I just noticed the difference, maybe cause the Debian flash-installer package was just updated to this release, or because I use Flash so little. It was so unreliable for like ever that I wouldn't even start using any site that uses Flash for anything serious. Granted: I do use youtube, because there are some great Swing dancing clips there. But that only uses a tiny fragment of Flash but still has been killing my browser every now and then.][Update: I was misled by a clever Javascript that actually disabled the flash or shrank it or so when the menu popped up. E.g. the Toyota site http://www.toyota.com/corolla/ is still unusable unless you're using some flash blocker or do not have flash installed (apart from the flash assuming it were transparent, but it's rendered on all white). The menu still pops up under the flash, making it impossible to access many pages.]

23 January 2008

Erich Schubert: Fixing Windows - Linux to the rescue

My mothers computer had died. Well, the Linux on it was still working, so she was able to open her document files, read her email and use chat. Pretty much everything works under Linux, with the exception of using the Fax functionality of the AVM Fritz!Box via CAPI-over-TCP. (Ironically, the Fritz!Box itself runs Linux, so it's just because AVM doesn't bother to supply a Linux client too).Anyway. Logging in remotely, I quickly found out that the hard drive had serious issues, with lots of bad sectors on the main Windows partition (fortunately, we kept system data and user data separate!). So I'm not blaming Microsoft for dying (but Samsung; since this is the second time within three years the drive has died, I guess I won't be buying a Samsung HD anytime soon).Last weekend, I bought a new hard disk and went to my parents to fix it. I copied over the partitions (some 64k data could not be read any more), and tried to get Windows up again, too. (Linux was trivial; copy, boot record, done)So I ended up doing a "rescue" Windows installation, using the XP service pack 2 CD. I figure this is still the latest setup for XP available? It went through the usual driver-loading, did the first part of the installation, rebooted into the new system, did this "estimated time 39 Minutes" setup screen. After like 10-15 Minutes, it had a bluescreen, dumped memory and rebooted. And cycled through that again and again.It took me like 6 hours total to get the Windows system fixed (mostly waiting for the Microsoft setup to run through again). I figure that there aren't many users out there that actually could have fixed that Windows. The reason is simple: Microsoft crappy setup. Probably to protect it's serial number thingy or just to display fancier graphics, setup refuses to work in safe mode. And the bluescreen even suggested to try the safe mode, just to display the message "setup.exe doesn't work in safe mode, click OK to reboot".If I could have used that "safe mode", fixing would have been a lot easier. The bluescreen mentioned a device driver ati2something.sys; apparently part of the ATI video driver. So I tried the rescue console of the XP CD to just kill that driver, but setup kept on actually reinstalling the file.The way I fixed it in the end is simple: Linux to the rescue. I booted the (working like a charm) Linux installation, accessed the main Windows partition using ntfs-3g, found all references to the ATI driver in the Windows\Inf driectory and removed them.After I had removed these references, Microsofts setup.exe completed, and I had a working-again Windows in VGA mode. Then I could install the ATI drivers again. Microsoft really needs to work on that setup, it needs to allow disabling certain drivers and similar rescue things.Maybe Microsoft should start shipping a Knoppix CD with Windows, for repair.

14 January 2008

Andrew Pollock: [tech/security] Tracking email address harvesters

Erich Schubert's two posts about embedding spamtraps in web pages got me wondering about trying to track the web crawlers that harvest such addresses. If the pages that had the embedded spamtraps could be dynamically generated, it'd be interesting to generate email addresses that encoded the time of the crawl (well the page load I guess) and the IP address of the remote host. I expect that most of the harvesting is done by botnets, so it possibly wouldn't tell you a lot, but it'd be kind of cool to maintain a central blacklist of known harvesting IP addresses, that sites like mailing list archives could use to try and block the harvesters with.

6 January 2008

Christian Perrier: Number of bugs reported in Debian per year

This week-end, among other things, I played a little to get the number of bugs reported overs years in the Debian BTS. Here are the results:
2007: 53337
2006: 59665
2005: 57436
2004: 62327
2003: 50836
2002: 47618
2001: 46289
2000: 27181
1999: 22448
1998: 15002
1997:  9987
1996:  4205
1995: 2158
First bug for each year:
2008: 458489 Petter Reinholdtsen -> sysqrd Closed (in unstable)
2007: 405152 Martin-Eric Racine -> myspell-lv Closed
2006: 345487 Erich Schubert -> lintian Opened
2005: 288051 Nick Sillik -> gstreamer-misc Closed
2004: 225724 Peter van Rossum -> mldonkey-server Closed
2003: 174888 Chris Garguzi -> hotkeys Closed
2002: 127270 root@ttimo.net ->libapache-mod-auth-pam Closed
2001: 80981  William Steve Applegate -> php4 Closed
2000: 53800  Hamish Moffatt -> sattrack Closed
1999: 31352  Richard Stallman -> dselect Opened LOOK THIS ONE
1998: 16350  Joey Hess -> xbase-clients Closed
1997:  6363  Andreas Jellinghaus -> mgetty-fax Closed
1996:  2158  Ian Jackson -> ncurses3.0 Closed
1995:   563  Ian Jackson -> tar Closed
A few interesting things there: Anyone feeling like doing the same for Launchpad? And, for those who wonder, I of course did all this by hand. No fancy automated script, just my hands and some (little) hammering of the BTS.

4 January 2008

Erich Schubert: Safari on Linux

If you are doing websites, you might want to test them with Safari as well.Sure, konqueror and midori (which uses GTK webkit) already provide a pretty good approximation on Safari rendering, but there might still be differences.Here's how to run Safari on Linux: The biggest 'trick' for me was to install the Microsoft fonts. Without them, Safari would segfault when rendering the URL bar the first time.Step 2 assumes you have the Microsoft fonts already installed on your system in the place typical for Debian and Ubuntu users. If you don't find out how to get the required ttf files yourself. You maybe also can just symlink them.Wine can indeed run most Windows applications by now...P.S. ies4linux claims to have a way of installing and running MS IE 7 on Linux. I didn't test this. But that would give you the full array of major browsers on Linux: IE6, IE7, Safari, Iceweasel (Firefox), Opera. And tons of more usable and better integrated browsers such as Epiphany. :-)

2 January 2008

Erich Schubert: Earth and the sun

When I first read this comic strip [sinfest], I was about to complain "Dude, you know that the earth doesn't go round the sun once a day".Then I realized that this was the 1.1.2008 strip, and well, I guess once a year it is more appropriate.Thats what you get for reading comic strips in the morning (and mind you, it's a comic strip showing a sunrise, with no hint about it being an annual and not a daily thing)So, did you pat earth for completing another lap around the sun yet? :-)Happy new year, everybody!

31 December 2007

Erich Schubert: Google results WTF

It seems like Google broke something in their search. For example, searching for "iTunes-library-xml Python" (I've just written a parser which will turn Apple PropertyList Pseudo-XML into a useable Python object consisting of hashes, arrays, integers etc. btw.) actually gives me results (at least the one around #4) that don't contain "iTunes" (and I'm pretty sure also never contained).OUCH:Looking at the cached version of the result when searching for "iTunes library xml python" contains the notice "The word iTunes is only found on pages linking to this page". Google knows two pages linking there, neither contained the word iTunes.This is not what I understand as an "exact phrase match".

30 December 2007

Erich Schubert: Waiting for a process

Some people will have come across this: They've started some long-running process, e.g. some computation for their thesis, and want to be notified when it's done. Depending on the setup, they can't just background it and run wait in the shell.Or you might want to run some expensive process somewhere, but there is some larger thing going on right now, so you want to wait for that to finish (you know, it's often better when people don't fight for memory and put all the load on the swap drive...).Or you need to monitor some process that might crash, and want to schedule a notification or restart.Here's how I'm doing that now:
busywaitpid command-of-process && notify-send "Computation is finished!"
Which will singnal a popup bubble when the process is finished.Here's the script:
#!/bin/sh
mypid=$$
pid= pgrep -of $@   grep -vE "^$mypid$" 
if [ -z "$pid" ]; then
  echo "No pid found." >&2
  exit 2
fi
echo "Waiting for pid $pid."
while test -d "/proc/$pid"; do
  sleep .1
done
# Make sure it's gone...
test -d "/proc/$pid"   exit 1
exit 1
Note that it will wait for the oldest (-o) process where the full command line (-f) matches the given parameter.Bugs: it doesn't handle when there are multiple processes matching the query - it will use the oldest (as given my pgrep).[Update: Specto, aptitude install specto, is a GNOME GUI application that you should be able to use for this purpose (amongst others such as website change monitoring)]

Erich Schubert: The 'iwlwifi' driver

I've switched back to the Debian stock kernel 2.6.23 from a self-compiled 2.6.23.9. The reason: I wanted to give the iwlwifi driver for my Intel 3945 wireless a try.I think the 'iwlwifi' driver will be included upstream in 2.6.24, I guess the Debian people have added it to the 2.6.23 package themselves. At least I didn't come across it when configuring my 2.6.23.9, and I've seen it in the 2.6.24rc changelogs.So far, the iwlwifi driver has been clearly superios, except it still lacks support for the LED. There seems to be a patch around for that though. So maybe my wireless is still disconnecting from time to time and I'm just not noticing it because I don't see the LED flashing. :-)

28 December 2007

Erich Schubert: Spamtrap followup

A few days ago, I asked about how to properly embed spamtraps in web pages.Well, noone could tell me if using display: none is appropriate. I actually do not want Google to index the contents in that div. So as long as they don't punish me for using display: none at all, it's okay. And the page I placed the spamtrap on is a doorway-like page for others anyway; it's not part of an important site.It took the first spammer around 54 hours to send the first spam. Or try to send: all 10 retries with different zombies were rejected by my spam filter. Since then, I've been receiving another round of deliver attempts - around 5-15 per spamtrap address - almost every hour.Of the > 500 spam delivery attempts I've seen since, none made it through my initial spam filters (not to speak of the content filter behind that), but they were rejected at the SMTP level, even before the mail content was sent.I've now disabled some of my spam filters to allow the trap adresses to actually receive mail. After all, I want to use them to train my filter. :-)

25 December 2007

Erich Schubert: Visualizing with XHTML and SVG

My thesis is about data mining, clustering of correlated data in high dimensional vector spaces, to be a bit more precise.In detail, I'm working on methods to improve upon existing clustering algorithms such as 4C (Computing Clusters of Correlation Connected Objects) and ERiC (On Exploring Complex Relationships of Correlation Clusters), where you need to pick some parameters (e.g. k for a k nearest neighbour based approach) appropriately.My approach is twofold. On one hand, I'm improving upon the traditional covariance based correlation (which is quite sensitive to noise), so the parameters become easier to pick, on the other hand I'm working on an approach to automatically fine-tune the parameters to further improve stability.For testing my computations I needed a visualization of this data. I was considering using gnuplot (and in fact I'm using gnuplot a lot), but for some situation I needed animation capabilities, and thats where gnuplot becomes really messy.So I decided to dive into SVG and Javascript. Here's my first SVG project:Visualizing kNN correlation in SVG with Javascript(Internet Exploder is not supported. I don't have Windows, and for all I know it doesn't really support SVG. Use a Gecko-based browser such as Firefox, Opera and Safari (at least on Windows) also seem to work. I didn't get it to work on kHTML/Konqueror/Webkit. I'm just doing this for myself, so I have no need to support other browsers.)It's a 3D dataset, consisting of 300 points. 100 points are noise, 100 points are in a 2D cluster (green) and 100 points are on a 1D cluster embedded into this plane (I'm working on algorithms that support hierarchical clusters, so I needed a dataset with this property!).There are two buttons in the UI, one toggles rotation, the other one toggles the playback of "k". It will cycle k through a range of about 3-200. When offset hits 20 (so k would be 22 or 23), the main correlation vectors - the big blue lines - already point along the 1D cluster. At an offset of around 80 they have already diverged quite a bit from the 1D cluster - at this point, the correlation is seeing the 2D plane quite well already.I could also show you the behaviour for points in the 2D plane (but outside of the 1D cluster) and noise points.We're preparing a paper for SSDBM 2008.[Update: Safari works at least on Windows]

Aigars Mahinovs: AI classification of websites

I see that Erich is also trying to do something with AI classification of web pages. It would be interesting to find out what algorithms he is using and what the validation testing results are - I just did my Masters in a similar direction. But alas, his blog has no comments :) The thing i would suggest is trying out the algorithms using some existing tool sets, such as WEKA from the University of Waikato in New Zealand. I used it in my Master’s thesis and got very nice results. I found that with non-topical categories tree based classifiers and support vector machine classifiers (in the SMO variation) produced acceptable results.

Next.

Previous.