General Computing and Internet This is a discussion on, Random Dilbert comic strip within the Community channel forum; For the geeks on here (and I know I'm not the only one, lol) you'll be aware of the Dilbert ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 26-05-10, 10:47 AM
Tony1044's Avatar
O2User Member
Exchange:
Broadband ISP:
Broadband Package:Business package + free static IP
Router:
 
Join Date: Nov 2008
Posts: 357
Thanks: 3
Thanked 20 Times in 19 Posts
Random Dilbert comic strip

For the geeks on here (and I know I'm not the only one, lol) you'll be aware of the Dilbert comic strip.

Not sure if you are also aware, but there's a website with each day's strip on it plus an archive going back several years (not certain how far off the top of my head).

So I wrote a script to open up todays strip (simply because I'm lazy like that...) and then thought it'd be a larf to have it open up a random one...so here it is.

It's in PowerShell.

Utterly pointless, but I was working on a project that required me to generated random dates and this developed from it.

[DateTime]$theMin = "1/1/2006"
[DateTime]$theMax = [DateTime]::Now

$theRandomGen = new-object random
$theRandomTicks = [Convert]::ToInt64( ($theMax.ticks * 1.0 - $theMin.Ticks * 1.0 ) * $theRandomGen.NextDouble() + $theMin.Ticks * 1.0 )
$newdate = new-object DateTime($theRandomTicks)
$date = date $newdate -format yyyy-MM-dd
$url = 'http://www.dilbert.com/strips/comic/'
$url2 = $url+$date
(new-object -com shell.application).ShellExecute($url2)
__________________
I don't actually know much about xDSL, but I do know quite a bit about Microsoft technologies, particularly things like Exchange and Active Directory.
I'm happy to try and help where I can, so drop me a line.
www.o2user.co.uk forums rock!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:51 AM.