weblog.jamisbuck.org Archives - 28 November 2014, Friday

  • Web services, Rails-style

    weblog.jamisbuck.org 12 Jul '14, 11pm

    Jamis, can this REST support (as well as ActionWebService::Client::XmlRpc as documented http://api.rubyonrails.com/classes/ActionWebService/Client/XmlRpc.html) be used for outbound client apps, such as allowing my Rails app to interact with other web services (like eBay, Amazon, Googl...

    Related:
    1. OndeTrabalharCom ondetrabalhar.com.br 16 Jul '14, 7pm
  • Maze Generation: Wilson's algorithm

    weblog.jamisbuck.org 15 May '14, 10pm

    Then, we pick another unvisited cell at random and do a random walk until we encounter that first cell. Note that this random walk has a few constraints: although it can cross cells it has already walked (as long as they are not already in the maze), we don’t want to allow the final p...

  • RubyConf: Day Two

    weblog.jamisbuck.org 15 Mar '14, 10pm

    RubyConf: Day Two Posted by Jamis on October 02, 2004 @ 01:49 PM This morning started equally bleary-eyed. I just can’t seem to shake this jet lag. At any rate, I managed to shower and stumble downstairs for another exciting continental breakfast, followed by… Morning Panel Patrick Ma...

  • Inside Capistrano: the Gateway implementation

    weblog.jamisbuck.org 14 Jan '14, 6pm

    The gateway code is a bare 100 lines long, including comments. Basically, all it does is establish a connection to the gateway machine, and then for every connection established via the gateway, it forwards a port from the local host to the requested server. Then, it establishes a con...

  • Maze Generation: Prim's Algorithm

    weblog.jamisbuck.org 13 Jan '14, 12am

    The largest bit of implementing Prim’s algorithm (for me) seems to go toward managing the interactions with that frontier set. Maybe your experience will be different. You basically need two operations: mark a cell as “in” (which then marks the “out” neighbors as frontier cells), and ...

  • perils of programming while sick

    weblog.jamisbuck.org 04 Jan '14, 4am

    The perils of programming while sick Posted by Jamis on March 08, 2005 @ 01:29 PM So, I knew my turn was coming. My one-year-old daughter was quite sick about a week and a half ago, running a temperature of 106F. We even took her to the emergency room for that one, though her fever wa...

  • Unit vs. Functional vs. Integration

    weblog.jamisbuck.org 20 Oct '13, 2am

    Unit tests. Functional tests. Integration tests. Rails draws a lot of circles around your tests, and it does a good job (in general) of helping you know what kinds of tests belong in each, but there are still some gray areas (and areas that I think it categorizes incorrectly). For exa...

  • Maze Generation: More weave mazes

    weblog.jamisbuck.org 03 Oct '13, 5pm

    @Jamis Don’t be sorry! I wouldn’t be here if I didn’t like puzzlers. Why do you think the twisty mazes appeal to me? :-) I did wonder about doing something like what you describe, but it seemed likely to get complicated pretty quickly. But there does seem to be a reasonably simple sol...

  • Maze Generation: Aldous-Broder algorithm

    weblog.jamisbuck.org 27 Jul '13, 3pm

    The next maze algorithm I’m going to cover, the Aldous-Broder algorithm, is one of the simplest imaginable. It’s also one of the least efficient. In fact, it is so inefficient that you might wonder why anyone would even bother implementing it, let alone discovering it and having their...

  • Maze Generation: Recursive Backtracking

    weblog.jamisbuck.org 22 May '13, 11am

    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...

  • SwitchTower: Renamed

    weblog.jamisbuck.org 10 Apr '13, 12am

    Ryan, regarding "caving so soon and so fast," it wasn't a casual decision. We consulted an attorney, and their professional opinion was that we not fight it. True, we could have looked for a second opinion, but given that the prospect was not exactly sunny, it would have just been (IM...

  • Maze Generation: Algorithm Recap

    weblog.jamisbuck.org 08 Apr '13, 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 ...

  • 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 ...