Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Encryption

Submission + - Decryption Keys for HD-DVD found, confirmed

kad77 writes: It appears 'muslix64' was the real deal, despite skepticism. Through a riddle posted here: http://pastebin.com/853659 members on the doom9 forum identified the Title key for the HD-DVD release 'Serenity'. Volume Unique Keys and Title keys for other discs followed within hours, confirming that software HD-DVD players, like any common program, store important run-time data in memory. Round One has been won for the Fair Use crowd, how will the industry respond? Links to decryption utility and sleuthing info in original doom9 forum thread: http://forum.doom9.org/showthread.php?t=119871
Java

Submission + - Java Generics and Collections

andrew cooke writes: "Java Generics and Collections

Java 6 was recently released, but many programmers are still exploring the features introduced in Java 5 — probably the most significant changes in the language's twelve year history. Amongst those changes (enumerations, auto-boxing, foreach, varargs) generics was the most far-reaching, introducing generic programming in a simpler, safer way than C++ templates and, unlike generics in C#, maintaining backwards (and forwards) compatibility with existing Java code.

Given the history of Generic Java, Naftalin and Wadler's Java Generics and Collections has a distinguished pedigree. In this review I'll argue that this is a new classic. Background to Generics

If you're a Java programmer you've probably heard of generics, an extension to the type system that was introduced in Java 5. They give you, as a programmer, a way to write code even when you don't know exactly what classes will be used.

The obvious example is collections — the author of a List class has no idea what type of objects will be stored when the code is used.

Before generics, if you wanted to write code that handled unknown classes you had to use make use of inheritance: write the code as if it would get Objects, and then let the caller cast the result as necessary. Since casts happen at runtime any mistakes may cause a runtime error (a ClassCastException).

Generics fix this. They let you write code in which the classes are named (parameters) and the compiler can then check that the use of these class parameters is consistent in your program. So if you have a List of Foo instances you write List<Foo> and the compiler knows that when you read that list you will receive a Foo, not an Object. History

I'll get to the book in a moment, but first a little history. If you know any type theory — particularly as used in functional languages like ML and Haskell — then you'll recognise my quick description above as parametric polymorphism. You'll also know that it is incredibly useful, and wonder how Java programmers could ever have managed without it.

Which explains why Philip Wadler, one of the people responsible for Haskell, was part of a team that wrote GJ (Generic Java), one of the experimental Java mutations (others included PolyJ and Pizza) that, back in the day (late 90s) helped explore how parametric polymorphism could be added to Java, and which formed the basis for the generics introduced in Java 5.

So if you want to understand generics, Wadler is your man. Which, in turn, explains why I jumped at the chance to review O'Reilly's Java Generics and Collections, by Maurice Naftalin and Philip Wadler. The Book

This is a moderately slim book (just under 300 pages). It looks like any other O'Reilly work — the animal is an Alligator this time. It's well organised, easy to read, and has a decent index.

There's an odd discrepancy, though: Wadler is the generics Guru; this is going to be `the generics reference'; generics are sexy (in relative terms — we're talking Java here) and collections are not; the title has "Java Generics" in great big letters with "and Collections" in little tiny ones down in a corner. Yet very nearly half this book is dedicated to collections.

So in the next section I'll justify the `reference' comment above, and in the one after I'll take a look at the collections half of the book and ask to what extent it's padding. Part I — Generics

This is a great, practical read. It starts simply, introducing a range of new features in Java 5, and then builds rapidly.

If you are completely new to generics, you'll want to read slowly. Everything is here, and it's very clear and friendly, but there are not the chapters of simple, repeated examples you might find in a fatter book. Within just 30 pages you meet pretty much all of generics, including wildcards and constraints.

If that makes your head spin, don't worry. Read on. The next hundred or so pages don't introduce any new syntax, but instead discuss a wide range of related issues. The chapters on Comparisons and Bounds and Declarations contain more examples that will help clarify what generics do. And the following chapters on Evolution, Reification, and Reflection will explain exactly why.

So the first seven chapters introduce generics and then justify the implementation — any programmer that takes the time to understand this will have a very solid base in generics.

There are even some interesting ideas on how Java could have evolved differently — section 6.9 Arrays as a Deprecated Type presents a strong case for removing arrays from the language. It's a tribute to the clarity and depth of this book that the reader is able to follow detailed arguments about language design. Fascinating stuff.

The next two chapters, however, were my favourites. Effective Generics and Design Patterns give sensible, practical advice on using generics in your work, including the best explanation of <X extends Foo<X>> I've seen yet (so if you don't know what I am talking about here, read the book).

(A practical word of advice — if at all possible, use Java 6 with generics. Java 5 has a sneaky bug). Part II — Collections

This part of the book was more along O'Reilly's `Nutshell' lines: the different chapters explore different collection types in detail. I must admit that at first I skipped this — it looked like API docs re-hashed to extend the size of the book.

But then I felt bad, because I was supposed to be reviewing this book (full disclosure: if you review a book for Slashdot you get to keep it). And you know what? It turned out to be pretty interesting. I've programmed in Java for (too many) years, and I guess I've not been quite as dedicated to tracking how the library has changed as I should have been — I learnt a lot.

Again, a wide range of readers are welcome. This is more than a summary of the Javadocs, ranging from thumbnail sketches of trees and hashtables to a discussion of containers intended for multi-threaded programming.

The way I see it now, this part is a bonus: the first half, on generics, makes this book one of the standards; the second half is an extra treat I'm glad I stumbled across (I guess if you're some kind of weird collection-fetishist maybe it's even worth buying the book for). Conclusions

I've used generics since the first beta release of Java 5 and had experience with parametric polymorphism in functional languages before that (in other words, I can tell my co- from my contra-variance). So I guess I'm heading towards the more expert end of the spectrum and I was worried I'd find the book boring. It wasn't. After claiming to be expert I don't want to spoil things with evidence that I'm actually stupid, but reading this book cleared up a few `misunderstandings' I'd had. I wish I had read it earlier.

If you're new to generics, and you don't mind thinking, I recommend this book. If you're a Java programmer who's a bit confused by <? super Foo> then this is the book for you.

The only people who shouldn't read this are people new to Java. You need to go elsewhere first. This is not a book for complete beginners.

A great book in the classic — practical, concise and intelligent — O'Reilly mould."
Quickies

Submission + - Beryl Project hacked

Thos writes: On January 2nd, 2007 Beryl was the victim of an online attack directed at our MySQL server. This attack removed most entries for the past several weeks and will cost countless hours in repair and recovery. Logs of the attack have been salvaged and analyzed, and the likely origin of the attack identified. More info here.
Power

Submission + - Doomsday Clock to move forward

Dik Zak writes: Several news sites report that the Bulletin of Atomic Scientists intend to move the hands of the Doomsday Clock on Wednesday 17 January. The clock was started at seven minutes to midnight during the Cold War and has been moved forwards or backwards at intervals, depending on the state of the world and the prospects for nuclear war. Midnight represents destruction by nuclear war. It is not said in which direction the hands of the clock will be moved, but it should be safe to assume that it will be closer to midnight. The Bulletin of Atomic Scientists cite "worsening nuclear, climate threats" as the reason for the move. The clock was at two minutes to midnight, when both the United States and the Soviet Union tested nuclear weapons in 1953. The farthest away from midnight it ever was is seventeen minutes to midnight, in 1991 when both superpowers signed the Strategic Arms Reduction Treaty. It is currently at seven minutes to midnight.
Portables

Submission + - Dell accused of selling defective notebooks-again

crowbarsarefornerdyg writes: Dell's in the courts again, except this time Sony isn't to blame. The lawsuit stems from overheating Inspiron laptops. I own one (I inherited it, ok!) and it has overheated since we got it. Dell's answer? Keep it cleaned out. From TFA:

'A lawsuit filed in Ontario Superior Court alleges that Dell notebooks suffer from design defects that cause premature failure of the motherboard due to overheating.

The suit, which seeks class-action status, was filed on behalf of an Ontario owner of an Inspiron PC, according to articles by the Canadian Press and the Associated Press. It claims that Dell knew or should have known of the defects but sold the notebooks anyway.'

http://www.theregister.co.uk/2007/01/12/inspiron_d efect_lawsuit/
PlayStation (Games)

Submission + - PS3 piling up in retail stores

An anonymous reader writes: Seems like Playstation are piling up at retail stores around the US. I just called a few Best Buys around the Bay Area and sure enough, they are available, which is shocking given that it is Silicon Valley, plus the Bay Area is richer than most and could probably afford the $600 price tag. Meanwhile Wiis are sold out everywhere. Is Sony's strategy completely failing? Will they have to drop the price soon in order to remain competitive?

Feed CES: Winners and Losers (wired.com)

What was the show's best gadget and the best game? Did you know that some of the 100-inch TVs are glued together from smaller screens? Wired News blows the lid off the show's best and worst. The Wired News staff reports from Las Vegas.


Hardware Hacking

Submission + - uClinux Ported to PSP

FJ60 writes: "Someone has finally ported Linux to the PSP! Specifically, uClinux 2.4.19. So far it boots, mounts the root filesystem, and runs an interactive shell. The only device driver that currently works is the TTY driver, which allows terminal sessions to run over the serial port built into the headphone jack. Pretty impressive considering that MIPS core used in the PSP is highly proprietary and this guy had no documentation! I can't wait to see X running on that screen.... Check it out at: http://df38.dot5hosting.com/~remember/chris/"

Slashdot Top Deals

Gee, Toto, I don't think we're in Kansas anymore.

Working...