by simon baird
Sunday, October 31, 2010
Saturday, October 30, 2010
Thursday, October 28, 2010
Tuesday, October 26, 2010
nooooo...! #minecraft
(warning, boring story follows).
so i have a little single player world. i haven't been there there
long. i found an amazing cave a few minutes walk away from my base. i
explored it for a while and loaded up on iron and coal, carefully
marking my path so i could find my way back up. (there was some gold
there too but i hadn't made an iron pick yet).
it was getting late (irl) so I decided to go back home. got almost
to the surface when i was ambushed by a skeleton! i noobishly
had no bacon or other means to restore health and i ended up full of
arrows and dead. when i respawned it was daylight (thankfully) so i
bolted as quick as i could back to the spot to get my loot before it
disappeared.
but i couldn't find the entrance! it was kind of hard to see; just a
flat hole in grass and i hadn't had the sense to mark it. eventually i
found it but it was too late and all my stuff was gone. this includes
a heap of glass that i had made and all my torches, my tools, my wood,
some flint. everything. :(
(the end)
so i have a little single player world. i haven't been there there
long. i found an amazing cave a few minutes walk away from my base. i
explored it for a while and loaded up on iron and coal, carefully
marking my path so i could find my way back up. (there was some gold
there too but i hadn't made an iron pick yet).
it was getting late (irl) so I decided to go back home. got almost
to the surface when i was ambushed by a skeleton! i noobishly
had no bacon or other means to restore health and i ended up full of
arrows and dead. when i respawned it was daylight (thankfully) so i
bolted as quick as i could back to the spot to get my loot before it
disappeared.
but i couldn't find the entrance! it was kind of hard to see; just a
flat hole in grass and i hadn't had the sense to mark it. eventually i
found it but it was too late and all my stuff was gone. this includes
a heap of glass that i had made and all my torches, my tools, my wood,
some flint. everything. :(
(the end)
Monday, October 25, 2010
this could be an amazing new band: kyü
listen to pixiphony on their myspace. kind of
bat-for-lashes-vs-animal-collective-y:
http://www.myspace.com/kyusounds
friday show in brisbane:
http://tickets.oztix.com.au/?Event=17821
itunes:
http://itunes.apple.com/au/album/kyu/id391988362
(i will let you know if the hype is justified)
bat-for-lashes-vs-animal-collective-y:
http://www.myspace.com/kyusounds
friday show in brisbane:
http://tickets.oztix.com.au/?Event=17821
itunes:
http://itunes.apple.com/au/album/kyu/id391988362
(i will let you know if the hype is justified)
Sunday, October 24, 2010
Saturday, October 23, 2010
Tuesday, October 19, 2010
Sunday, October 17, 2010
Benoît Mandelbrot (1924 - 2010)
ob mandelbrot video:
http://www.youtube.com/watch?v=JGxbhdr3w2I
the photo parts are a little tacky LAME but i like the way there is zooming, panning and rotation (instead of just the traditional endless zoom)
Wednesday, October 13, 2010
minecraft
i might try to explain to you how amazing this game is. but not now. now it's just these links, (which don't really explain it either):
a fan's attempt at a trailer:
crafting guide
Thursday, October 07, 2010
Wednesday, October 06, 2010
beginning_of_fortnight method for Ruby on Rails
You might know that Rails provides a bunch of useful extensions to the Time class with methods like beginning_of_week, beginning_of_month, etc.
For my application (a thing with fortnightly billing periods) I wanted to define a beginning of fortnight method to consistently calculate the beginning (and end) of a fortnight. Here's how it ended up (both short and sweet):
(Note that there's no special reason to use epoch. Any other day would work just as well probably).
Does it work?
Put beginning_of_fortnight.rb in config/initializers.
Note that there is already a Numeric#fortnights method in ActiveSupport so we can use things like 2.fortnights without needing any extentions.
For my application (a thing with fortnightly billing periods) I wanted to define a beginning of fortnight method to consistently calculate the beginning (and end) of a fortnight. Here's how it ended up (both short and sweet):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Extend ActiveSupport to provide a beginning_of_fortnight and an | |
# end_of_fortnight method for the Time class | |
# | |
module ActiveSupport::CoreExtensions::Time::Calculations | |
# | |
# How many weeks since the beginning_of_week before unix time zero | |
# | |
def weeks_after_epoch | |
((self - ::Time.at(0).beginning_of_week) / 1.week).to_i | |
end | |
# | |
# The beginning of the current fortnight | |
# | |
# The choice of which week should begin a fortnight is arbitrary | |
# If you want to flip it then change even? to odd? below | |
# | |
def beginning_of_fortnight | |
# If there's been an even number of weeks since epoch use beginning of this week | |
# If there's been an odd number of weeks since epoch use the beginning of last week | |
(weeks_after_epoch.even? ? self : self - 1.week).beginning_of_week | |
end | |
# | |
# The end of the current fortnight | |
# | |
def end_of_fortnight | |
(beginning_of_fortnight + 13.days).end_of_day | |
end | |
end |
(Note that there's no special reason to use epoch. Any other day would work just as well probably).
Does it work?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Development]>> puts Time.now; (-5..5).each { |w| t = Time.now + w.weeks; puts "now and #{'%2d'%w} weeks: #{t.beginning_of_fortnight} - #{t.end_of_fortnight}" }; nil | |
Wed Oct 06 16:29:52 +1000 2010 | |
now and -5 weeks: Mon Aug 30 00:00:00 +1000 2010 - Sun Sep 12 23:59:59 +1000 2010 | |
now and -4 weeks: Mon Aug 30 00:00:00 +1000 2010 - Sun Sep 12 23:59:59 +1000 2010 | |
now and -3 weeks: Mon Sep 13 00:00:00 +1000 2010 - Sun Sep 26 23:59:59 +1000 2010 | |
now and -2 weeks: Mon Sep 13 00:00:00 +1000 2010 - Sun Sep 26 23:59:59 +1000 2010 | |
now and -1 weeks: Mon Sep 27 00:00:00 +1000 2010 - Sun Oct 10 23:59:59 +1000 2010 | |
now and 0 weeks: Mon Sep 27 00:00:00 +1000 2010 - Sun Oct 10 23:59:59 +1000 2010 | |
now and 1 weeks: Mon Oct 11 00:00:00 +1000 2010 - Sun Oct 24 23:59:59 +1000 2010 | |
now and 2 weeks: Mon Oct 11 00:00:00 +1000 2010 - Sun Oct 24 23:59:59 +1000 2010 | |
now and 3 weeks: Mon Oct 25 00:00:00 +1000 2010 - Sun Nov 07 23:59:59 +1000 2010 | |
now and 4 weeks: Mon Oct 25 00:00:00 +1000 2010 - Sun Nov 07 23:59:59 +1000 2010 | |
now and 5 weeks: Mon Nov 08 00:00:00 +1000 2010 - Sun Nov 21 23:59:59 +1000 2010 | |
=> nil |
Put beginning_of_fortnight.rb in config/initializers.
Note that there is already a Numeric#fortnights method in ActiveSupport so we can use things like 2.fortnights without needing any extentions.
sleigh bells!
tell 'em (track 1)
never has a song intro more effectively communicated the message "WAKE THE EFF UP AND LISTEN TO THIS! :)"
riot rhythm (track 3)
mad chromatic gee-tar riff ftw
rill rill (track 7)
delicious summery chill-out without even trying
and the rest of it is as good
check it out
Sleigh Bells
Treats (2010)
(Content owner: Liberation Music)
Monday, October 04, 2010
Saturday, October 02, 2010
Friday, October 01, 2010
night 4 (minecraft)
My cave hideout has a top storey lookout and a walled courtyard.
Pic 1: "everything under control here. stupid exploder below me isn't going anywhere. stupid zombie at the back is just roaming up and down outside my wall.
Pic 2: HOLY WHAT THE.. ZOMBIE CLIMBING UP TO GET ME..?! AIIEEEE..
Then I think it started shooting me with arrows.
Subscribe to:
Posts (Atom)