.

A Use for class << self

A while ago I posted

class << self
  def find_all
    code_goes_here
  end  def destroy_all
    code_goes_here
  end
end

or you can write

def self.find_all
    code_goes_here
end
def self.destroy_all
    code_goes_here
end

I said that these two versions are functionally the same and that I ended up preferring the second form because it was easier to tell you are working on a class method. Turns out there is a difference.

Jay Fields answered this a while ago – but I just found it here

Basically if you use the first form – Ruby will honor your private/protected tags but in the second you would have to resort to something like this

class<<self;self;end.send :protected, :find_all :destroy_all

or


class << self
protected :find_all,:destroy_all
end

This isn’t the end of the world since I end up putting my private/protected stuff at the bottom of the file (Since that makes it easier to find out what is protected/private than sprinkling it into the code) but could be a gotcha if you didn’t know about the need for the extra code.


Things to do when your wife is out of town….

Trial by Fryer – Food – Hombre – FHM Online – FHMonline.com

White Castle Burgers

Start with frozen White Castle burgers. When you deep-fry them, they cook—the cheese melts, and everything. What can you say about White Castle? It’s always good when you have the munchies, and deep-fried, it’s twice the satisfaction.


Don’t Play This Game

Ok I didn’t listen and it cost me hours of my life.

I read this (Desktop Tower Defense Considered Harmful) over on Jeremy Zawodny’s blog.

At then end he says:

Whatever you do, please DO NOT click the link and start playing that game. You may find yourself in the very same time warp that I did…

The bad news – is that he is right. I’ve spent a lot of time the last few nights trying to beat normal level – so far level 40 is where I max out. This game is some kind of skinner box. It is perfectly tuned to my persuasion. Meaning it has action – and resource management and strategy all in one small package.

So assuming you are going to ignore me – just like I ignored Jeremy – you can play the game at

http://www.handdrawngames.com/DesktopTD/

(If you want you can keep your scores in the economysizegeek.com group and we can compare notes).

You have been warned…


The Coming Wave

Let’s peer back into my past :

I laughed at Oak when I was a C programmer – why would we want it. And why would Sun create a language – don’t we have enough of them already? (That language became Java.)

A while ago (measured in years) I had the opportunity to rewrite an app that was in PHP. In the process of making the choice – I made fun of Ruby – asking if someone had decided pick the most obscure language they could find and gotten it on the list. (If you follow the blog you know how I feel about Ruby now)

I once gave a presentation about how Web services would change the face of hosting and eliminate the need for mid market hosting. (I don’t know if you follow the hosting market but I can assure you – there is a lot of need for hosting of all flavors – that’s what I get for spending 2 days in Microsoft’s booth learning about Hailstorm.).

About four years ago, I was using a feature of Mozilla called XMLHttpRequest – it seemed really really useful. I didn’t get very far convincing anyone that it was going to be awesome. (That function is the basis of everything you know as AJAX)

My point with all of this is not that I can predict the future – quiet the opposite. I end up being a bit of Cassandra. Actually, I suppose it is more like I make predictions on opposite day. I have mocked a lot of technology that turned out to be useful ( eventually) .

So here’s my prediction ( I actually made this about 6 months ago but I forgot to put it up in the blog) – Erlang is going to be the next big thing.

It has some stuff going for it – terrible name, horrible syntax…. Oh wait – I’m supposed to be talking about the good right – well it is designed to handle concurrency and distribution. It can be fully fault tolerant. This means a lot in the future of always up. It will also end up being a big deal when everyone has to write apps that actually use 4 cores without just forking processes.

I saw my first proof that this is going to be the path – behold

Programming Erlang from the Pragmatic Programmers.

Lean how to write truly concurrent programs—programs that run on dozens or even hundreds of local and remote processors. See how to write high reliability applications—even in the face of network and hardware failure—using the Erlang programming language.

I originally started all this as a tongue in cheek joke – mostly to poke fun at the rise of Ruby and the special place Erlang/OCaml/Haskell have on programming.reddit.com. Now I’m making my prediction – so that one of two things can happen.

1) I break the curse – by predicting something that comes true I harness my power for good.
2) I stop the rise of Erlang by predicting that it will be successful. Since my predictions don’t come true, maybe I can stop this thing….


Signs of a Code-pocolypse

Code Craft » In software no good deed goes unpunished

All of this confirms a theory I have about some companies. If the culture is broken, the fastest way to make enemies is to do more than everyone around you.


Making the P capital

1221.jpg

Don’s Guns

This is for real. I grew up watching his ads back in Indiana

Of course – his tag line then was – “I don’t want to make money folks I just love to sell guns.”


Live From The Field

Got tickets to meet Sam Calagione next month. Maybe he’ll sign a copy of his book.

DirkPhoto054.jpg

Matzoball On TV

Proving that Bulldogs are the coolest!

DevilDucky – Letterman: Adam Sandler Interviews Matzoball


Vision Thing vs. Status Quo

Total apropos of what I’m working on currently:

Network Performance Daily – Network Performance Blog : Editorial: Dungeons & Dragons & Networks

If people performed preventative maintenance and worked to improve their network, they’d have fewer problems to address in the first place. But because individual problems provide intellectual boundaries and present obstacles to overcome, it is simply a much, much easier task than trying to look at the vast possibilities inherent in the network and try to come up with a vision rather than a solution.

It’s funny because that provides a nice parallel to another idea I ran into in college. I went to a lecture from a noted Russian writer. He was bemoaning the decline the quality of writing in his homeland. He believed that democracy was to blame. He felt that although the censorship of the past had been bad for the people in general, it forced artists to be more creative in what they were trying to express. With few constraints, artists have to push farther out to get try and find a boundary. (c.f Piss Christ). The boundary is where the real art occurs and with censorship from the state you hit the boundary early and can focus on the art instead of wandering aimlessly looking for it.

Not to say what I work on is art (I prefer to think of it as practical solutions with aspirations to be considered elegant), but the point is the same. Coming up with a broad vision is difficult to do well. I feel like I’ve mostly cheated when I’ve been on the hook for them. My secret – describe things in broad terms and don’t mess with the details until they are close enough to matter. This doesn’t make it trivial – because sometimes you don’t realize that certain details are important until after the fact – but it will at least allow you to keep forward momentum – which for me is key.


    Stuff I want to read

    Shelfari: Book reviews on your book blog

    Stuff I've Read

    Shelfari: Book reviews on your book blog
    You are currently browsing the Economy Size Geek weblog archives for March, 2007.
    Categories
    Archives

    .