Skip to Content

Blogs

Sorting arrays in Perl 6

#!/usr/bin/perl

my @array = (1..4, 20, 6, 14);

say "The array is @array.sort().reverse()";

Playing with Junctions in Perl6

Junctions in Perl6 are supercool. I can see myself using these a lot :-)

Here's my first test program.


#!/usr/bin/perl

# Test Perl6 Junctions

my $even = ( 2 | 4 | 6 | 8 | 10);
my $odd = ( 1 | 3 | 5 | 7 | 9);
my $prime = ( 2 | 3 | 5 | 7 );

my @nums = (1..10);
for @nums {
my $num = $_;
print $num;
print " prime" if ($num == $prime);
print " even" if ($num == $even);
print " odd " if ($num == $odd);
say;
}

Track of the week: Numbers Don't Lie ~ The Mynabirds

This week's track is Number's Don't Lie by The Mynabirds who hail from Omaha, Nebraska.

Track of the week: Phone booth ~ Robert Cray

Thanks to Neil Harris for putting me on to Robert Cray. Here is Phone booth a song published on his 1986 release Strong Persuader

Windows command: list history

Display a full command prompt history for Windows XP:
doskey /history

and a list of most popular command (with a little help from Perl):
C:\>doskey /history | perl -ne "END { map {print ++$i.qq|: $_\n|;} splice(@{[sort {$h{$b}<=>$h{$a}} (keys %h)]},0,5); } m/(.*)/; $h{$1}++;"

Inspired by:
One liner history command counter
and

Google Reader API -- list 100 starred items

This little Google Reader API call gives you a feed of your 100 most recent starred items. Substitute [userid] for your Google User ID.

http://www.google.co.uk/reader/atom/user/[userid]/state/com.google/starred?n=100

Magic!

Track of the week: Alleyway ~ Life in Film

This week's track of the week is by the London dark-pop outfit Life in Film. Enjoy.

KONICA MINOLTA magicolor 2490MF default admin password

The default administrator password for KONICA MINOLTA magicolor 2490MF printers is MagiMFP.

First Excel UDF written in C# using .NET

Eric Carter's article Writing user defined functions for Excel in .NET offers a fantastic introduction to developing UDFs in C# for Microsoft Excel using Automation Add-ins.

C# and .NET 3.5 notes

This blog entry is a collection of notes from my experience of reading C# 2008 Programmers Reference by Wei-Meng Lee, published by Wrox.

System.Linq is defined in the System.Core.dll in .NET 3.5

Link to Microsoft article:
How to determine which versions of the .NET Framework are installed and whether service packs have been applied

Location of ildasm tool:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

Typecasting value to enumerated type:
Console.WriteLine("Day: {0}", (Days)4);

Syndicate content