Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hourlist [2009/08/04 15:50]
64.122.198.69
hourlist [2016/06/25 11:25] (current)
Line 1: Line 1:
-3-Aug-2009  +8NqAg1 ​ <href="​http://​fdjbbthnrbij.com/">fdjbbthnrbij</a>, [url=http://pcusohgqqaqu.com/]pcusohgqqaqu[/url], [link=http://​ubrcajtpyimg.com/​]ubrcajtpyimg[/link], http://​yommzurqudpb.com/
- +
-Don Park 2:45pm feeling tricky by listing all hours in day with this ruby +
-<code ruby> +
-irb(main):​001:​0>​ ["​am","​pm"​].map{|m| (["12"​]+1.upto(11).to_a).map{|h| "#{h} #​{m}"​}}.flatten +
-=["12 am", "1 am", "2 am", "3 am", "4 am", "5 am", "6 am", "7 am", "8 am", "9 am", "10 am", "11 am", "12 pm", "1 pm", "2 pm", "3 pm", "4 pm", "5 pm", "6 pm", "7 pm", "8 pm", "9 pm", "10 pm", "11 pm"] +
-</code> +
- +
-RobotAdam 2:53pm @donpdonp That's fun. A Python variation:  +
-<code python>​ +
->>>​ import itertools +
->>>​ list(itertools.chain(*(("​%d %s" % (ht) for h in [12] + range(1, 12)) for t in ('​am',​ '​pm'​)))) +
-['12 pm', '1 pm', '2 pm', '3 pm', '4 pm', '5 pm', '6 pm', '7 pm', '8 pm', '9 pm', '10 pm', '11 pm', '12 pm', '1 pm', '2 pm', '3 pm', '4 pm', '5 pm', '6 pm', '7 pm', '8 pm', '9 pm', '10 pm', '11 pm'] +
-</​code>​ +
- +
-@selenamarie 3:10pm @donpdonp @robotadam hmmm...  +
-<code perl> +
-for my $meridiem (qw/am pm/) { print map { $_ $meridiem . ' '} (12,1..11); } +
-12am 1am 2am 3am 4am 5am 6am 7am 8am 9am 10am 11am 12pm 1pm 2pm 3pm 4pm 5pm 6pm 7pm 8pm 9pm 10pm 11pm +
-</code> +
- +
-@MarkusQ 4:22pm: @donpdonp If you'd like to feel even trickier:  +
-<code ruby> +
-irb(main):​001:​0>​ (0..23).map { |h| "#​{((h-1) % 12)+1} #{%w{A P}[h/12]}M" }   +
-=> ["12 AM", "1 AM", "2 AM", "3 AM", "4 AM", "5 AM", "6 AM", "7 AM", "8 AM", "9 AM", "10 AM", "11 AM", "12 PM", "1 PM", "2 PM", "3 PM", "4 PM", "5 PM", "6 PM", "7 PM", "8 PM", "9 PM", "10 PM", "11 PM"] +
-</code> +
- +
-@kscaldef 4:26pm: @selenamarie @donpdonp @robotadam Haskell:  +
-<code haskell>​ +
-Prelude> [ show h ++ " " ++ m | m<- ["​am",​ "​pm"​], h <- [12++ [1..11]+
-["12 am","1 am","​2 am","​3 am","​4 am","​5 am","​6 am","​7 am","​8 am","​9 am","​10 am","​11 am","​12 pm","​1 pm","​2 pm","​3 pm","​4 pm","​5 pm","​6 pm","​7 pm","​8 pm","​9 pm","​10 pm","​11 pm"] +
- +
-</code> +
hourlist.txt · Last modified: 2016/06/25 11:25 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki