Four short links: 8 May 2013

http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html -- This is quite a useful class; } /* matchstar: search for c*regexp at beginning of text */ int matchstar(int c, char *regexp, char *text) { do { /* a * matches zero or more instances */ if (matchhere(regexp, text)) return 1; If the first character of the regular expression is ^ (an anchored match), any possible match must occur at the beginning of the string. This is tested by matching the rest of the regular expression against the text starting at the beginning, and nowhere else. But the test is correct here: since the * operator permits zero-length matches, we first have to check whether a null match is possible. The function matchhere operates by attempting to match the first character of the regular expression with the first character of the text. If the match fails, there can be no match at this text position and matchhere returns 0. If the match succeeds, however, it's possible to advance to the next character of the regular expression and the next character of the text. The easiest case is that if the regular expression is at its end (regexp[0] == '\0'), then all previous tests have succeeded, and thus the regular expression matches the text. The function matchstar(c, regexp, text) tries to match repetitions of the text character c, beginning with zero repetitions and counting up, until it either finds a match of the rest of the text, or it fails and thus concludes that there is no match. This identifies a "shortest match", which is fine for simple pattern matching as in grep, where all that matters is to find a match as quickly as possible. A "longest match" is more intuitive and almost certain to be better for a text editor where the matched text will be replaced. we go on to test whether the next character of the regular expression matches the next character of the text by making a recursive call to matchhere. At each stage of the recursion, if something matches, the recursive call that follows uses pointer arithmetic (e.g., regexp+1 and text+1) so that the next function is called with the next character of the regular expression and of the text. Generally, the success of a match is determined by whether the regular expression runs out at the same time as the text does. t++)

'Reinvented' Nine Inch Nails to return this summer after four-year hiatus | The ... -- After a four-year hiatus, Trent Reznor is returning to his roots the pioneering musician who played a huge role in bringing industrial music to the mainstream just announced that a revamped Nine Inch Nails will return to the stage this summer. It's not yet clear how exactly the band will be re-invented there's no word on when NIN might release new music or whether the new shows will be in a style notably different than the band's previous incarnations.

Why Don't We See White Holes in Space? : Discovery News -- Science fiction fans love the possibility of other universes, even more so contemplating the possibility of being able to travel between them through exotic configurations of spacetime, notably wormholes, which are pretty much just black holes with an opening poking through the singularity. Matter could actually fall into a black hole and re-emerge elsewhere in space or even in a completely different universe, a notion proposed by British physicist Roger Penrose a few years earlier via a white hole. In the 1970s, Stephen Hawking demonstrated that when a white hole and a black hole are in thermal equilibrium with their surroundings, they absorb and emit the same amount of radiation and thus it's impossible to tell them apart.