Archive

Archive for the ‘note to self’ Category

“unbound wildcard type” errors in Scala

February 16th, 2011 No comments

In Scala 2.8.1, I ran into problems while compiling this:

object Test
{
  def log(item: _) : Unit = 
    println("you logged " + item)
 
  def main(args: Array[String]) : Unit =
  {
    log(42)
  }
}

The error message wasn’t not helping that much at the first glance:

/home/niels/tmp/test.scala:3: error: unbound wildcard type
	def log(item: _) : Unit = 
                      ^

To fix it, change the prototype of the log function like this:

	def log(item: Any) : Unit =

There is a pretty good overview of the Scala type hierarchy on the Scala homepage. In short, Scala Objects are subtypes of AnyRef. Primitive types (Int, Boolean, …) are subtypes of “AnyVal”. Both “AnyRef” and “AnyVal” are subtypes of “Any”, and substituting “Any” with “_” in prototypes and templates is not allowed in Scala 2.8.

Tags:

Apples vs. Oranges

August 19th, 2010 No comments

Fighting painfully slow SMB shares

October 5th, 2008 1 comment

If you are running Vista or Mac OS X 10.5 / Leopard, you might have noticed that accessing files on Samba shares over your corporate network is dreadfully slow. Note that I’m not talking about network as in “my 10mbit Ethernet at home”, but as in “those strange fiber optic thingies running to my computer” (even though the problem occurs on slower networks as well).

But why is Samba such a pain suddenly?
Read more…

Tags:

Using WebTest on sites with broken SSL certificates

September 25th, 2008 No comments

I really like Canoo WebTest for testing web user interfaces. And I’m delighted to see that Lee Butts found a way to test web sites with broken SSL certs :)

Learn more about it at his blog.

Tags:
Performance Optimization WordPress Plugins by W3 EDGE