Tags

Kelly’s 14 Rules are Agile

December 6th, 2009

This is an old one (rooted in the 40ies) Kelly’s 14 Rules

Well in a nutshell, there are The Agilists (and as they are very smart people they already noticed themselves)

Anyway, I came across these rules by some pointless surfing and was struck by the resemblance and the difference to what I know about Agile. So I began dissecting them in my mind and to help myself putting some order into it - and to share it with you - I am writing something down

Read the rest of this entry »

Windows 7 ohne Browser - back to the ’80s

June 14th, 2009

Oh je - ein Betriebssystem ohne Browser.

Es ist nicht Microsofts böser Wille, was hätten sie den tun sollen ALLE Browser mitliefern oder über ein Bootstrap-Menü anbieten - schwer möglich, da sie mit Sicherheit irgendeinen Exoten vergessen würden und die anderen über den Listenplatz prozessieren würden wie Politiker vor einer Wahl.

Ah, ein randomisiertes Menü - natürlich nicht mit gewichteten Wahrscheinlichkeiten (Browser mit hohem Marktanteil werden tendeziell nach vorne gestellt), weil das ja  bestehende Verhältnisse befördern würde.

Ich  mache mir allerdings wirklich Sorgen über den Präzedenzfall, denn dieses Verfahren schafft. Windows 8 dann ohne “Explorer”, damit “Norton Commander” wieder mehr Kunden findet? Keine Firewall mehr, sodass die vage Hoffnung der User kaufe eine andere die Ausbreitung von Trojanern fördert?

Read the rest of this entry »

Great JVM news

April 8th, 2009

 The Google AppEngine opens up for Java. Python is a great language, but still a nice-language (compared to Java). A light-weight alternative to host Jav-applications in the cloud.

What some might have guessed is now official?: Twitter is doing its heavy lifting with Scala We don’t have to feel bad anymore to do write statically typed code:-)

Geld verdienen mit P2P, Dank an IPRED und HADOPI

April 4th, 2009

Wieviel Millionen MP3s und Filme “getauscht” werden ist unerheblich, man kann auch darüber streiten, ob kostenlose Downloads gar den Konsum von Bezahlmedien stimulieren.

Dennoch, Regierungen - wohl auch unter dem Druck der Lobbiesten der Medienindustrie versuchen Gesetze wie IPRED und Hadopi zu installieren, die in ihren Auswirkungen auf die Meinungs- und Informationsfreiheit mehr als fragwürdig sind.

Hadopi geht noch etwas weiter als IPRED: Wer dreimal beim downloaden erwischt wird bekommt eine Internetsperre (Hausarrest). Dabei gilt die Verfolgung der IP-Adresse, also ist jeder für die Sicherung seines WiFi-Routers verantwortlich, oder er akzeptiert eine Schnüffelprogramm der französischen Regierung zu installieren! Das Gesetz heisst übrigens “Gesetz zum Schutz des Internets und der Kreativität” und pikanterweise wird die Überwachung privaten Organisation der Medienindustrie überlassen. Niemand hat das Recht zu erfahren welche Daten an diese Organisationen übermittelt werden und aufgrund welchen “illegalen Aktes” eine Sperre ausgesprochen wird.

Fairerweise muss man sagen, dass das Gesetz auch gewisse Verpflichtungen für die Medienindustrie im Bezug auf digitale Veröffentlichungen beinhaltet (DVD in 4 Monaten nach Filmstart, etc.), allerdings ohne Sanktionen zu definieren…

Nun werden viele nicht davon ab lassen wollen ihre amerikanischen Soaps im Original sehen zu wollen ohne auf die grauslich synchronisierte (ich lebe in Frankreich) Fernsehausstrahlungen zu warten (isch habe gar keine Fernseher, Madame) oder gar 70€ für ein paar DVDs zu bezahlen die ein Jahr später erscheint. Desweiteren mag man sich kaum noch im Internet bewegen, wenn man nicht weiss wer alles mitliest.

Die Macher von PirateBay haben daher IPREDator ersonnen, ein VPN-service der es unmöglich macht einen Download einer realen IP zuzuordnen. Verfolgende Behörden/Organisationen können dann nur noch mit einem blossem Verdacht eine Hausdurchsuchung mit Beschlagnahme der Computer beantragen - was wohl in den meisten Fällen als unverhältnismässig abgelehnt werden wird.

Ironie der Geschichte: IPREDator is kostenpflichting (5€/Monat), schliesslich muss die Infrastruktur und Bandbreite irgendwie bezahlt werden, also wird jemand an diesen Gesetzen verdienen und mit Sicherheit wird ein guter Teil der Kunden Urheberrechtsverletzer sein. Also kreieren IPRED & Co ein Geschäftsmodell auf der Basis von “illegalen Downloads”.

Man schätzt 7-60 Millionen Euro die als Kosten für die frz. Internetprovider entstehen, wieviel die Hadopi-Behörde verschlingen wird, die bis zu 3000 Warnungen und 1000 Sperren täglich aussprechen soll staht noch in den Sternen

Hp Pavilion Vista 64 only 10Mbit?!

March 28th, 2009

Haven’t found anything on the net, and HP support page isn’t helpful…

The situation: The status of the local connection shows 10Mbit/s as does the networl tab of the task-manager.

  1. As always, get the new latest drivers.
  2. Create a restore point unless you like the walk on the wild side
  3. After the install finishes the Task Manager shows 1Gbit/s -disconnected
  4. Deactivate the network card in the device manager
  5. Activate it

Now you should get the full speed (100Mbit in my case)

Windows update Restart Later

December 11th, 2008

After a Windows update it insists on a restart, very annoying if you want to finish something first.

So you click “Restart Later”

But it comes back every few minutes (Vista allows there a more elaborate reaction).

By accident I found a way to get rid of it:

  • Open TaskManager
  • find explorer.exe process
  • click End Process
  • confirm the warning
  • File->New Task
  • enter “explorer”
  • OK

Windows starts a new  explorer and every is as before, but it “forgets” to remind you to restart … nice “bug” in XP SP2 (haven’t tried it with SP3, yet)

Maven, Nexus …

August 15th, 2008

Sorry I have to get loose a rant

Both “tools” are complete crap. If you are just one inch off the line - nothing works and you find yourself working from workaround to workaround (because you discover another bug/limitation)

Nexus is perhaps the worst part - they are now at beta 5.1 or already 5.2  when I finished writing this. They keep adding features instead of making the 1.0 stable.  This is all but professional. La merde bien epaisse qui pue. I have never seen any open source project that uses a M$ tactic before - well, we never stop learning, do we?

Maven itself, yes if all is is standard Maven it might work, but beware to  have something that is not following the Maven “standard” - it becomes an “usine à gaz”.   There are too many caveats, limitations to make it usable for anything that is a bit more complicated - ever had a task that creates more than one artifact? - have fun to  use all of them without intermediate artifacts where dependency mangement is - well nightmare is an euphemism for that.

Sorry, these two are not for me - if you like looking at meaningless logs and masturbate on them, feel free to give it a try.

</rant>

Closure puzzler or enum references considered harmful

February 7th, 2008

SPOILER - don’t read this if you want to figure out the Neapolitan Ice Cream Puzzler by yourself!

Neal Gafter posted a Closure Puzzler that hasn’t too much to do with closures, but shows that Static initializers considered harmful is not limited to the old enum-pattern, but also applies to Java 5 enums. Here the Java 5 version of his code for those who don’t get the closures code or simply are too lazy:

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Compare {
	static <T, U> List<U> map(List<T> list, Transformer<T, U> transform) {
		List<U> result = new ArrayList<U>(list.size());
		for (T t : list) {
			result.add(transform.invoke(t));
		}
		return result;
	}

	public static void main(String[] args) {
	        List<Color> colors = map(Arrays.asList(Flavor.values()), new Transformer<Flavor,Color>(){public Color  invoke( Flavor f ){return f.color; }});
	        System.out.println(colors.equals(Arrays.asList(Color.values())));

	        List<Flavor> flavors = map(Arrays.asList(Color.values()), new Transformer<Color,Flavor>(){public Flavor invoke(Color c){return c.flavor;} });
	        System.out.println(flavors.equals(Arrays.asList(Flavor.values())));
	    }
}

interface Transformer<S, T> {
	T invoke(S s);
}

enum Color {
	BROWN(Flavor.CHOCOLATE), RED(Flavor.STRAWBERRY), WHITE(Flavor.VANILLA);
	final Flavor flavor;

	Color(Flavor flavor) {
		this.flavor = flavor;
	}
}

enum Flavor {
	CHOCOLATE(Color.BROWN), STRAWBERRY(Color.RED), VANILLA(Color.WHITE);
	final Color color;

	Flavor(Color color) {
		this.color = color;
	}
}

I think I have already seen such a backport already, but here it is again…

Automatic Resource Management blocks

December 30th, 2007

In his (perhaps successful) attempt to sink the BGGA proposal, Captain Bloch send the closuralists packing to Scala island in the Swiss Sea and promised milk(CICE) and honey(ARM) for the rest.

Besides some remaining choices of freedom a ARM block will look somehow like this:

do (InputStream in   = new FileInputStream(src);
    OutputStream out = new FileOutputStream(dest)) {
  byte[] buf = new byte[1024];
  int n;
  while ((n = in.read(buf)) >= 0)
    out.write(buf, 0, n);
}

I thought this should be pretty easy to imitate in Scala as well. Ideally I’d like to have

with (fi<-  new FileInputStream(src);
      fo<- new FileOutputStream(dest)) {
  val buf = new Array[byte](1024);
  def cp() {
    val n = fi.read(buf)
    if (n>0) {
      fo.write(buf,0,n)
      cp
   }
  }
  cp
}

But writing a “with” is not possible - the 2nd idea was to have a with where the resource is “this”:

with (new DbConnection) {
  executeUpdate("delete from scratch")
  commit()
}

As Jamie Webb pointed out a simple wrapper is easy to write and might do the job:

class ManagedResource[T<:{def close()}] (resource:T) {
  def foreach(f : T => Unit) : Unit =
    try {
      f(resource)
    } finally {
      resource.close()
    }
  }
}

and so it is easy to write:

for(pi<-new ManagedResource(new PipedInputStream);
    po<-new ManagedResource(new PipedOutputStream(pi))) {
  po.write('A');
  Console.println((pi.read).asInstanceOf[Char]);
}

So interesting part it: How does this magic work. On Scala island everybody knows swiss-army knives. We usually use “for”. The code above is equivalent to

for(pi<-new ManagedResource(new PipedInputStream)){
    for(po<-new ManagedResource(new PipedOutputStream(pi))) {
  po.write('A');
  Console.println((pi.read).asInstanceOf[Char]);
    }
}

and each block (or closure) is passed to foreach:

new ManagedResource(new PipedInputStream).foreach(pi=>
  new  ManagedResource(new PipedOutputStream(pi)).foreach(po=>{
     po.write('A'); //where is po defined?
     Console.println((pi.read).asInstanceOf[Char]);
   }
  )
)

Here you see the for-magic in action. For defines some nice symbols pi and po for us that make writeing the function much easier than wrapping it all up in nested anonymous functions.

As the expansion of for shows we are getting the nest of resources as we would get if we would write everything by hand. Less visible is the cleanup. Note that the argument to each foreach is a closure. This means th code is excecute where it is writen and not evaluated and then passed to foreach. By this the finally block in foreach executes two times:

  1. After the print
  2. After po had been closed

So far so simple, but why some might ask can I refer to pi and po as PipedInput/Outputstreams instead of ManagedResource[T]s?

The reason is that “for” is just some compiler magic, what eventually gets executed is the foreach which takes a function T=>Unit (i.e. a funtion with a single argument of type T and return value void). T here is either PipedInputStream or PipedOutputstream and the pi and po are type to accommondate for that.

In practice it is a bit more complicated to define ManagedResource because there are three different possible expansions (via map and flatMap). We investigated as well lazy resource acquisition, but this might open some other wholes, but it is possible to write ManagedResources that aquire the underlying resource iff it is accessed. You opening a ctor to the application developer is too dangerours as inadvertedly an open resource might get passed to the ManagedResource without that it can tell that it got already opened.

Resources with explicit open methods as Josh mentioned in his text would solve this problem easily with no overhead for the application developer. An alternative are Linear Types, but that doesn’t go well together with a language like Scala.

Not only open source

December 27th, 2007

I pulled out an old issue of brand eins which remained still unread in the pile of magazines. If you don’t now this magazine yet and you have some interest in off-beat economics and you can read german - get it.

An article with interview with Don Tapscott on his Wikinomics I found quite interesting. The point -in short - is that openess will make you advance quicker and be more successful. I don’t buy everything he says, but he is right in many aspects.

Take the simple example of open source and closed source. Where do you think hides the worst coding and design? It cannot be generalized of course, but closed source has better to get away bad coding. There are exceptions in any domain, Axis for example (at least the 1.4) is a kludge and some closed source stuff I worked on had been beautifully engineered. Anything has to stand the test of time, thus in an active open source problems will be addressed - if not god-like committers reject these changes.

And here I lost interest in continuing until I found Why giving away your code is not dangerous.

Read the rest of this entry »