Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: bash script for ignoring all .*.cmd files

This command finds all directories with .*.cmd files (like all the .o.cmd files generating when building the kernel) and set the svn ignore command on them

svn status | grep "\.cmd" | cut -b8- | cut -d. -f1 | sort | uniq | xargs svn propset svn:ignore '.*.cmd'

Networking

How Demigod's Networking Problems Were Fixed 65

The launch of Demigod was troubled by piracy and networking difficulties, which publisher Stardock worked quickly to correct. They've now released a documentary that gives a detailed look behind the scenes of diagnosing and fixing those problems. It includes meetings, interviews with the devs, and part of the bug-tracking process during a frenzied 108-hour work week.
Perl

Journal Journal: Perl script for finding patterns

Ok, I reallt needed a bash command that could list the index of every occurance of a pattern in a file. I found this one-liner before:

perl -0777 -ne 'print index $_, "\x5d\x00\x00\x80\x00\x00"' afile.bin

This locates the first LZMA header in a file, but I need to find ALL headers, not just the first... Ok, I'm no perl specialist, but I came up with this:

#!/usr/bin/perl
use strict;
use warnings;

Games

Review: Gears of War 2 193

The original Gears of War was one of the most popular games of 2006, helping to solidify the Xbox 360's place in the console market. Since then, it's sold about 5 million copies. When word leaked out that a sequel was in the works, many wondered if Epic Games could reach the bar set by the first game. As it turns out, they could. Gears of War 2 will feel very familiar to those who have played its predecessor. Games often have a way of reinventing themselves as sequels come and go, but Epic stuck to the basics of what had already worked so well, and simply set about improving, polishing, and fleshing out the Gears world as much as they could. Read on for the rest of the review.

Comment Re:Validating credit card numbers (Score 1) 516

No, regular expressions can not capture the complexity of that formula since it's an algorithm without memory, but with a finite set of numbers the can describe every possible match. You'll end up with a regex that incredibly long though, e.g. for 3 digits:

^0(12|23|31|47|51|69|74|83|92|01)|1(12|23|31|47|51|69|74|83|92|01)... (etc)

(It will be 5 times longer in total and the last digits aren't the correct one, it's only for showing the principle)

So it's possible but impractical.

Slashdot Top Deals

Any circuit design must contain at least one part which is obsolete, two parts which are unobtainable, and three parts which are still under development.

Working...