world update

Mittwoch, 5. Mai 2010

Immer wieder schön, wie Software nerven kann. Bei emerge gibt es (noch) keine ignore-Option und so konnte Opera 10.10 nicht gegen das vorhandene Qt3 gebaut bleiben, nein es musste unbedingt Qt4 sein. Da ich diesen Bloat nicht auf dem Rechner haben will, blieb nur¹ das Demaskieren des instabilen Opera 10.53-pre6330 mit wunderschöner defekter Menüleiste, die man erst einschalten muss, nachdem man vorher den überflüssigen Quatsch (Unite etc.) abgestellt hat:

Opera 10.53-pre6330 menu

Was gab es sonst noch? mrxvt malt per default grüne Cursor (wtf?!), natürlich musste xorg-driver nochmal übersetzt werden um die Eingabegeräte nutzen zu können und ghc 6.12.2 wollte gar nicht erst kompilieren. Wenigstens ist Qt jetzt ganz vom Rechner verschwunden.

Aktualisierung:
Im ghc-Ebuild gehen sie von /usr/bin/gcc aus, beim Einsatz von ccache kann das nicht klappen:

# Relocate from /usr to ${WORKDIR}/usr
sed -i -e "s|${WORKDIR}$(type -P gcc)|$(type -P gcc)|g" \
 


¹ oder diverse Overlays

EU-Fahndungssystem vor dem Aus

Sonntag, 18. April 2010

EU-Fahndungssystem vor dem Aus
Die Entwicklung des Fahndungssystems SIS II erweist sich als teures Debakel zur Verbrecherjagd. Die Bundesregierung will die Planungen jetzt beenden und setzt auf das bestehende System.

Übliches Schema:
Die Aufgabe von SIS II wäre allerdings ein teurer Fehlschlag. Ursprünglich waren laut Bundesregierung für SIS II 14,6 Millionen Euro vorgesehen. Inzwischen wurden aus dem EU-Haushalt aber bereits 76 Millionen Euro ausgegeben - ohne brauchbare Gegenleistung.

Wer ist schuld?
Angesprochen ist damit ein Konsortium um den Server-Hersteller Hewlett-Packard und die Software-Consultants von Steria Mummert.

Terrorisieren - verunglimpfen - mobben

Samstag, 13. Februar 2010

Ich weiß schon, wieso ich vor vielen Jahren aufgehört habe, die c't zu lesen: Völlig anonym: Terrorisieren - verunglimpfen - mobben
Unter falschem Namen lassen sich SIM-Karten von Mediamarkt, Saturn, Aldi, Netto Marken-Discount, Penny, Lidl und REWE per Internet oder telefonisch freischalten. Die Discounter leisten damit Straftaten wie dem Identitätsdiebstahl Vorschub.

Skandal! Bürger können telefonieren, ohne dass der Staat es weiß. Sind natürlich alles Terroristen, Stalker, Kinderpornographiekonsumenten usw.. Und am Ende noch scheinheilig über den "gläsernen Bürger" aufregen, weil man selbst zu doof war, seine Daten nicht wegzugeben und diese Regierung abzuwählen.
Falls das Verhalten der Prepaid-Anbieter folgenlos bleibt, ist das Wasser auf die Mühlen der Kritiker an der gängigen Speicherpraxis: Wenn ein derartiges Loch im Deich klafft, ist das Aufschichten von zusätzlichen Sandsäcken andernorts sinnlos. Und selbst wenn dieses Schlupfloch geschlossen wird, bleibt für Kriminelle, Terroristen und gesetzestreue Bürger, die Wert auf anonyme Kommunikation legen, immer noch der Kartenhandel über die Trödelmärkte, der Einsatz ausländischer Karten, der Besuch im Internetcafé, die Nutzung eines ungesicherten WLAN, ein Hotspot mit anonymer Guthabenkarte oder die gute alte Telefonzelle.

*würg

log escape sequence injection

Samstag, 30. Januar 2010

log escape sequence injection
Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa

Manchmal verliert man wirklich das Vertrauen. Haben die die letzten 25 Jahre geschlafen? Ein-/Ausgabevalidierung anyone?

Googles "Lokales Branchenregister"

Donnerstag, 28. Januar 2010

"Geben Sie unten Ihre Geschäftsinformationen ein." - würde ich ja gern, aber unter Firefox fehlt das Feld "Firma/Organisation" und es erscheint beim Senden eine Fehlerinformation und unter Opera ist der "Nächste"-Schalter kaputt. Wie kann man ein simples Formular derartig verkacken und mit JavaScript überladen?

Aktualisierung 29.01.2010: Der IE zählt die verbleibenden Zeichen falsch. Testen die nur noch mit Chrom(e|ium)?

Firefox suckt

Mittwoch, 13. Januar 2010

Natürlich will man bei cloneNode() die Inhalte von textarea und select verlieren...

Test
Bug - offen seit 07.01.2004, alles Gute zum 6. Geburtstag nachträglich

Opera macht's richtig.

Verweissalat 0

Freitag, 1. Januar 2010

A regular expression to check for prime numbers
Aktion Uberwach
Brewer's CAP Theorem
Conway's Game of Life in one line of APL
IMDB DB
iPhone-Fans leiden unter dem Stockholm-Syndrom
JSNES: A Javascript NES emulator
Man or Boy Test
NOSQL Patterns
Quality-oriented teaching of programming
Sorting Algorithm Shootout
Spatial indexing with Quadtrees and Hilbert Curves
XOR Swap Algorithm

C++ and the compile time faculty

Freitag, 1. Januar 2010

I hate C++ fanboys. "Look C++ is the most p0werful and shiny language ev4r. You can't do that with any other language." followed by a copy of the faculty example from FQA or Wikipedia:

#include <iostream>

using namespace std;

template<int n> struct fac {
        static const int value = n*fac<n-1>::value;
};

template<> struct fac<1> {
        static const int value = 1;
};

int main() {
        cout << fac<5>::value << endl;
        return 0;
}


C++ dissolves the template to a simple multiplication (if -ftemplate-depth >= 4) and *woohoo replaces the multiplication with the result at compile time. There are many languages (and language features) out there with this capability, p.ex. Lisp Macros, Scheme, MetaOcaml or Template Haskell:

Fac.hs:
module Fac where

fac n = product [1..n]


Main.hs:
{-# LANGUAGE TemplateHaskell #-}

module Main where

import Fac
import Language.Haskell.TH.Syntax

main = print $(lift $ fac (5 :: Int))


120 at compile time:
>ghc -ddump-simpl Main.hs | grep print | grep 120
Main.main = print_rSB (GHC.Integer.smallInteger 120)

Bringing back the J to Bifid Cipher

Donnerstag, 22. Oktober 2009

As a programming language enthusiast I often examine new (to me) languages, paradigms and concepts. Recently I played with J - sth. like APL with keyboard friendly syntax. If you are familiar with point-free functional programming, J isn't that complicated. More tedious is the used vocabulary (verbs, nouns, frets, agenda, gerunds...) for trivial things and the fact, that you can't use search engines - neither for "J" (-> "site:jsoftware.com"), nor for a function symbol (combination).

Mind bending are the many one-liners and examples in the documentation. And believe me, there isn't much more satisfaction as in unraveling the first lines of J code. ;)

As practical example on "hello world" level I used the Bifid Cipher:

pre=:(]->&9)@-&65@(a.&i.@toupper)
enc=:|:@((%&2@#,2:)$[)@(<.@%&5,5&|)
dec=:((2:,%&2@#)$[)@(<.@%&5,@,.5&|)
pst=:{&a.@(]-<&75)@(5&*@[/+66&+@]/)

encode=:pst\@enc\@pre
decode=:pst\@dec\@pre


Keep in mind, this is of course not the shortest or fastest or nicest implementation. It's just my first J program.

A short explanation for the curious

Read from right to left, @ is function composition and & binds a parameter.

pre - prepare our string

1. take a list of characters (the string), convert every character to uppercase (toupper) and look up (&i.) the characters in the ascii table (a.)
   a.&i.@toupper 'hello'

72 69 76 76 79

2. subtract 65 (ascii value of 'A') from every list item (-&65) (a 0..4 indexed cipher table to save some inc- (>:) and decrements (<:))
   -&65@(a.&i.@toupper) 'hello'

7 4 11 11 14

3. and decrement every item greater than 9 (]->&9) for the missing 'J'(!)
   (]->&9)@-&65@(a.&i.@toupper) 'hello'

7 4 10 10 13

The last part needs some explanation. (]->&9) is a so called "monadic fork". We have three functions f (] "identity"), h (- "minus") and g (>&9 "greater than 9") and the constellation as monadic fork (f h g) x executes as h(f(x),g(x)). The comparison gives a list of 0s and 1s, "NB." is line comment:
   NB. the identity (f):
   ] 7 4 11 11 14
7 4 11 11 14
   NB. greater than 9 (g):
   (>&9) 7 4 11 11 14
0 0 1 1 1
   NB. together with minus h(f(x),g(x)):
   (]->&9) 7 4 11 11 14
7 4 10 10 13


enc - encode

1. Now you are familiar with forks, you can interpret (<.@%&5,5&|) also, didn't you? On the left side we divide every element by 5 (%&5) and round (<. "floor") to the next smallest integer. On the other side we compute the remainder of the division with 5 (| "mod") and append (,) that list to our left result.
   (<.@%&5,5&|) 7 4 10 10 13
1 0 2 2 2 2 4 0 0 3

2. with ((%&2@#,2:)$[) we reshape ($) our list to nx2, n is the length (#) of the list divided by 2 (%&2), (2:) is the constant function, giving back 2
   ((%&2@#,2:)$]) 1 0 2 2 2 2 4 0 0 3
1 0
2 2
2 2
4 0
0 3

3. and transpose (|:) it for our final conversion in pst
   |:((%&2@#,2:)$]) 1 0 2 2 2 2 4 0 0 3
1 2 2 4 0
0 2 2 0 3


dec - decode

Decode is similar to encode.
1. div (<.@%&5) and mod (%&|) our list but merge (,@,.) the result
   NB. append from enc
   (<.@%&5,5&|) 5 12 12 20 3
1 2 2 4 0 0 2 2 0 3
   NB. merge from dec
   (<.@%&5,@,.5&|) 5 12 12 20 3
1 0 2 2 2 2 4 0 0 3

2. and again reshape the result to 2xn with n as half list length
   ((2:,%&2@#)$[) 1 0 2 2 2 2 4 0 0 3
1 0 2 2 2
2 4 0 0 3


pst - result to string

1. we have to rebuild our string, so we take the first row ([/) and multiply with 5 (5&*) and add (+) the result to our second (]/) row, to which we added 66 (66&+)
   NB. our table
   t=:((2:,%&2@#)$[)@(<.@%&5,@,.5&|) 5 12 12 20 3
   t
1 0 2 2 2
2 4 0 0 3
   NB. first row
   [/ t
1 0 2 2 2
   NB. second row
   ]/ t
2 4 0 0 3
   NB. multiply and add twice
   (5&*@[/ + 66&+@]/) t
73 70 76 76 79

2. we have to decrement the values below 75 ('K') (]-<&75)
   (]-<&75)(5&*@[/ + 66&+@]/) t
72 69 76 76 79

3. and lookup our values in the ascii table ({&a.)
   NB. decoding result
   ({&a.) 72 69 76 76 79
HELLO
   NB. encoding result
   ({&a.) 70 78 78 86 68
FNNVD


Now we can compose and use our encode and decode functions:
   encode=:pst\@enc\@pre
   decode=:pst\@dec\@pre
   encode 'PROGRAMMINGPRAXISWITHJ'
OMQNHHQWUIGWRFGSKFOMTP
   encode 'PROGRAMMINGPRAXIS'
OMQNHHQWUIGBIMWCS
   decode 'OMQNHHQWUIGWRFGSKFOMTP'
PROGRAMMINGPRAXISWITHK
   decode 'OMQNHHQWUIGBIMWCS'
PROGRAMMINGPRAXIS


Another example

Not enough? I see you are as fascinated as I am. The next example ist from j602/system/main/convert.ijs
av=: 3 : '({&a.)`(a.&i.) @. (2&=@(3!:0)) y'

3 : '... y' defines a verb, imagine it as a function with one argument y. (()`()@.()) is:
m@.n is a verb defined by the gerund m with an agenda specified by n ; that is, the verb represented by the train selected from m by the indices n . If n is boxed, the train is parenthesized accordingly. The case m@.v uses the result of the verb v to perform the selection.

Pure beauty! Here (2&=@(3!:0)) acts as a case or if expression. It returns a value which becomes the index of the left "list of functions" (take it with salt). 3!:0 returns the "type" (more salt!) of a parameter. If it is a character it returns 2, the following comparison (2&=) returns 1 and (a.&i) evaluates to the index of this character in the ascii table. Otherwise we assume it is a number and return the corresponding character.
   (2&=@(3!:0)) 'A'
1
   (2&=@(3!:0)) 97
0
   ({&a.) 99
a
   (a.&i.) 'a'
97
   ({&a.)`(a.&i.) @. (2&=@(3!:0)) 'abc'
97 98 99
   ({&a.)`(a.&i.) @. (2&=@(3!:0)) 97 98 99
abc

Aktualisierung auf xorg-server 1.6

Sonntag, 11. Oktober 2009

Ging erstaunlich problemlos. Maus und Tastatur waren tot:
sudo emerge -1 $(qlist -IC x11-drivers)

Strg+Alt+Rückschritt funktionierte nicht mehr (/etx/X11/xorg.conf)
Option      "XkbOptions"  "terminate:ctrl_alt_bksp"

und >x11-base/xorg-x11-7.4 enthält zuviel Bloat und mußte gehen. xorg-server reicht vollkommen.

Hinweise für die Sachen, die man eh nicht installiert, gibt es wie immer mit:
eselect news read new


PS.: qlist ist in portage-utils

ghc unter Gentoo

Mittwoch, 30. September 2009

Das Haskell-Overlay ist schon etwas Feines. Um es zu benutzen benötigt man Darcs, natürlich aus dem Portage-Tree und das wiederum benötigt ghc, den es nur zum stundenlangen Selberbauen gibt, um danach dann die vorkompilierte Variante aus dem Overlay zu installieren, die man eigentlich haben wollte. Ein Traum:

Total: 10 packages (10 new), Size of downloads: 40,432 kB
Calculating dependencies... done!
[ebuild  N    ] dev-util/darcs-2.0.2  USE="-doc" 1,759 kB
[ebuild  N    ]  dev-haskell/regex-compat-0.71.0.1  USE="-doc -profile" 4 kB
[ebuild  N    ]   dev-haskell/regex-posix-0.72.0.2  USE="-doc -profile" 42 kB
[ebuild  N    ]  dev-haskell/mtl-1.1.0.0  USE="-doc -profile" 0 kB
[ebuild  N    ]  dev-haskell/html-1.0.1.1  USE="-doc -profile" 11 kB
[ebuild  N    ]  dev-haskell/parsec-2.1.0.0  USE="-doc -profile" 15 kB
[ebuild  N    ]  dev-haskell/quickcheck-1.1.0.0  USE="-doc -profile" 9 kB
[nomerge      ] dev-haskell/regex-posix-0.72.0.2  USE="-doc -profile"
[ebuild  N    ]  dev-haskell/regex-base-0.72.0.1  USE="-doc -profile" 7 kB
[ebuild  N    ]   dev-haskell/cabal-1.2.3.0  USE="-doc -profile" 613 kB
[ebuild  N    ]    dev-lang/ghc-6.8.2-r1  USE="-bash-completion -doc -ghcbootstrap" 37,975 kB

Total: 10 packages (10 new), Size of downloads: 40,432 kB

Deshalb hier die Kurzvariante (sudo weggelassen, layman bereits installiert, ghci nicht enthalten):

Das darcs-Binary runterladen und installieren
cp darcs-2.2.0-ghc6.10-libwww-static.bin /usr/bin/darcs
chmod +x /usr/bin/darcs

überprüfen, ob in der /etc/make.conf die make.conf für Layman eingetragen ist
source /usr/local/portage/layman/make.conf

Layman aktualisieren, das Haskell-Overlay hinzufügen und Portage aktualisieren
layman --fetch
layman --add haskell
eix-sync

ghc in der /etc/portage/package.keywords demaskieren
dev-lang/ghc ~x86

in der /etc/portage/package.use dafür sorgen, daß nicht stundenlang rumkompiliert wird - und ghc braucht wirklich lange
dev-lang/ghc binary

und dann nur noch ghc installieren
emerge ghc

Fertig.

Wer eher Komplettpakete mag, könnte gleich die Haskell Platform installieren. Darcs kann jetzt gelöscht oder über das Overlay installiert¹ werden.

¹ Ich mag ja die verteilten Versionsverwaltungen, aber die Vielfalt nervt. Früher reichte svn, heute muß man zusätzlich Git, Mercurial, Darcs und am besten noch Bazaar auf der Platte haben, bloß um an die aktuellen Quelltexte zu kommen.

CUFP 2009, ICFP 2009, ML09, WGP09...

Montag, 28. September 2009

Inzwischen stehen viele Beiträge der alljährlichen Konferenzen im Netz, ua.:

Commercial Users of Functional Programming 2009
Erlang Workshop 2009
Haskell Implementors Workshop 2009
Haskell Symposium 2009
International Conference on Functional Programming 2009
JAOO 2009
JVM Language Summit 2009
Workshop on ML 2009
NOSQL meetup
Workshop on Generic Programming 2009

Netterweise hat Malcolm Wallace einige Vortragsmitschnitte sortiert.

Mein Lieblingszitat (bis jetzt) fiel beim JVM language summit:
Mock objects and dependency injection are just for people who don't know math.

(E. Meijer: The .NET Reactive Framework)

Linux is "bloated and huge"

Dienstag, 22. September 2009

Torvalds: Linux is "bloated and huge"
"I'd love to say we have a plan [to make it slimmer]. I mean, sometimes it's a bit sad and we're definitely not the streamlined hyper-efficient kernel that I had envisioned 15 years ago. The kernel is huge and bloated."

Gewinnt doch Minix? ;)

XSS-Lücke bei SFM

Dienstag, 26. Mai 2009

Da hat der Sachs-Admin nicht aufgepaßt, was er ins Netz stellt:

XSS sfm-bikes

Bildinformationen auslesen

Sonntag, 24. Mai 2009

Ob ich mir das nochmal merken kann?

Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".
Ich meine nicht "imginfo".

Sondern:

>identify -verbose <Datei>
Image: <Datei>
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: PseudoClass
  Geometry: 800x667+0+0
  Resolution: 150x150
  Print size: 5.33333x4.44667
  Units: PixelsPerInch
  Type: Grayscale
  Base type: Grayscale
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    gray: 8-bit
  Channel statistics:
    gray:
      min: 34 (0.133333)
      max: 255 (1)
      mean: 241.423 (0.946756)
      standard deviation: 40.1489 (0.157446)
  Histogram:
    433106: (253,253,253) #FDFDFD rgb(253,253,253)
     16332: (255,255,255) #FFFFFF white
[...]
       254: (254,254,254) #FEFEFE rgb(254,254,254)
       255: (255,255,255) #FFFFFF white
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Page geometry: 800x667+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 92
  Orientation: Undefined
  Properties:
    create-date: 2009-05-15T21:17:40+00:00
    jpeg:colorspace: 1
    jpeg:sampling-factor: 1x1
    modify-date: 2009-05-15T21:17:40+00:00
    signature: ...
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 60.6kb
  Number pixels: 521kb
  Version: ImageMagick 6.4.8 2009-03-08 Q16 http://www.imagemagick.org
« vorherige Seite   (Seite 2 von 6, insgesamt 80 Einträge) » nächste Seite