| 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 ... |
![]() |
![]() |
|
LinkBack | Thread Tools | Display Modes | ![]() |
|
#1
|
||||
|
||||
|
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! |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT. The time now is 06:51 AM.








Linear Mode
