weblog.jamisbuck.org Archives - 17 December 2012, Monday

  • Nesting resources

    weblog.jamisbuck.org 03 Aug '12, 8pm

    I believe you are getting into why DHH said this will help you make better controllers. I am working on a e-book for modelling REST and resources in Rails. Right off the bat, you should be thinking about your use cases and the flow of your application. Jamis, didn’t you blog something...

  • Mining ActiveSupport: Object#returning

    weblog.jamisbuck.org 31 Jul '12, 9am

    If you’re into functional programming at all, you probably know right away what the K combinator is. For the rest of us, this article is helpful (if a bit on the academic side, but that’s about par for the course for most reading about functional topics). Basically, the K combinator i...

  • Skinny Controller, Fat Model

    weblog.jamisbuck.org 21 Jun '12, 3am

    Excellent write-up in helping beginners understand the principles of Rails. Keep’m coming! As Christoffer said, pseudo_id could be a helper, I think it fits fine in the model. I’m sometimes unsure whether to put little functions like that as part of the model or as a helper. Personall...

  • Maze Generation: Recursive Backtracking

    weblog.jamisbuck.org 02 Jun '12, 5pm

    Actually, once you understand this algorithm, I think the best place to go next would be to change it to a breadth-first traversal. The intuition here is that a maze is an undirected graph, and this algorithm constructs the maze by traversing that graph in depth-first order. This is d...

  • Maze Generation: Weave mazes

    weblog.jamisbuck.org 01 Jun '12, 11am

    @Robin, very nice, I love how it’s actually simpler to allow adjacent crossings. I’ll bet it could even be simpler: we probably don’t even need to check the connected status of east/west and north/south pairs during the crossing phase, since they can only be connected if the center ce...

  • LEGOs, Play-Doh, and Programming

    weblog.jamisbuck.org 24 May '12, 12am

    Nice blog post. :) But I don’t think I agree with your points about Java collections vs Ruby collections. The different collections interfaces/implementations do have different purposes. For example, take HashMap and TreeMap. HashMap is – tadaa – implemented with a hash table and has ...

  • the { buckblogs :here

    weblog.jamisbuck.org 17 May '12, 5pm

    Pat Eyler is looking into designing a certification program, in conjunction with a university course. This really got me thinking. As a general rule, I believe certifications are a joke. Plain and simple. When I was at BYU , and the mandate came from the suits that we had to drop ever...

  • the { buckblogs :here }: Maze Generation: Eller's Algorithm

    weblog.jamisbuck.org 25 Apr '12, 9am

    @chaered, it actually does not matter how you define “placed in the maze.” By definition, every cell in the maze must be reachable by every other cell, so regardless of where you are placed, there will be a shortest path to any other cell you designate. And since a shortest path will ...

  • the { buckblogs :here }: Watching ActiveRecord Do Its Thing

    weblog.jamisbuck.org 28 Mar '12, 6am

    ActiveRecord is cool and all, and it goes without saying that we all trust its judgment, but sometimes you just want to watch while it does its thing. For instance, just today, I wanted to verify that, in edge Rails, ActiveRecord no longer loads the entire collection when doing a scop...

  • the { buckblogs :here }: Method visibility in Ruby

    weblog.jamisbuck.org 03 Mar '12, 5pm

    The difference between protected and private is very subtle, as you can see, which explains why protected is rarely used by most Rubyists. If it is used at all, it is generally as a convention, to document methods that are internal to the class, but which lie closer to the public inte...

  • the { buckblogs :here }: Maze Generation: Algorithm Recap

    weblog.jamisbuck.org 20 Feb '12, 11pm

    (Hello Minecrafters! If you’re looking for random mazes you can build in Minecraft, you might be better served by this page I wrote . It’ll give you block-wise schematics for the maze, and will require less mental translation than the demos here. Just don’t use IE—it won’t work right ...