Warning: Missing argument 2 for wpdb::prepare(), called in /home/stromber/public_html/kryptoblog/wp-content/plugins/wp-super-edit/wp-super-edit.core.class.php on line 109 and defined in /home/stromber/public_html/kryptoblog/wp-includes/wp-db.php on line 1222
Märklig kod för slumpmässig header » Kryptoblog

Märklig kod för slumpmässig header

June 3rd, 2008 by Joachim Strömbergson Leave a reply »

DailyWTF dök det upp en postning om en märklig kod som försöker åstadkomma slumpmässiga headrar. Koden i fråga ser ut så här:

Dim rNumber As Integer = 0
rNumber = RandomNumber(13, 1)
Select Case rNumber
Case 0

Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 1 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 2 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 3 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 4 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 5 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 6 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 7 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 8 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 9 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 10 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case 11 Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
Case 12 Me.hl_logo.ImageUrl = "~/sysimages/header.jpg"
Case Else
Me.hl_logo.ImageUrl = "~/sysimages/header2.jpg"
End Select

(Que pasa? WTF?! Eller på Dalsländska: Ööööööö...)

Personen som postade koden hade pratat med personen som skrivit koden, och motiveringen till koden var:


It makes it more random because you get more repeats when you select from two random numbers than you do with thirteen.

Nära skjuter ingen hare…

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Advertisement

Leave a Reply

You must be logged in to post a comment.