 All right, let's get started. This is, what, the fifth annual, reject conf. Thank you. So like I said before, what we're going to do is we're going to sort by time, shortest first, so we can get as many people talking to you as possible so we can convey as much information as possible. One thing I will say, lessons learned in the past. If you're too ad-like, I'm going to boot you. And if you play Rush, I'm going to boot you. Those are the lessons we've learned. So stick to those and we should be good. So did you guys search yourselves? Go ahead. You heard it? Here we go. You heard it get off the phone. Are you going to be able to go with? Stand along. Is it OK? OK. Hold on. Hold on that button. OK. Give me your phone. Give me your phone. I'm going to talk about Johnson. Who are you? I'm Yahuda. I work at Engine Yard. I work on Merv and some other internal stuff. Johnson is a JavaScript to Ruby Bridge. So I wrote this terminal, which is what I'm going to use to demo stuff. Actually, this might be tough with the standalone. So Johnson does some obvious stuff that you would expect to do in JavaScript mode like that. But then you can go into Ruby mode and you can see that same variable. You can make an array in Ruby mode. You can go back into JavaScript mode. Look at it. You can index into it. You can do that. We're still in JavaScript. You can actually do this. You want to move the bottom of your terminal window up so it's not colliding with the bottom? Yeah, no problem. You can do that, which is pretty cool. That basically lets you pass a function, a JavaScript function, into a block. Yeah, the function gets converted to a block, which gets rendered using the Ruby side, and you want to pass into that map function. We also have the basic demo as a template or function. So this is what the function looks like. It's crazy. But it does stuff like this. It looks like the RB. Let's give it. And then you can do... This is just standard JavaScript that will work on the client as well. But then you can go into Ruby mode, and you can say context, just call it hello, and you can say name. Just give it something else so you can tell it's different. Go back into JavaScript mode. You can call that on hello, and it works. Yes, sir? Are you interpreting the JavaScript? It's basically eval JavaScript, where it's eval and get inside of the spider monkey context. So what's cool about this is that if you actually look at the function, you see that there's a with statement there, which is doing with of a Ruby object, and then it knows about how to do attributes. If you do... What was that array again? If you do this, it returns back the method, just like you would expect in JavaScript. And basically there's a whole bunch of other stuff like, you know, stuff like that, like does that property exist, or we already kind of showed this, that basically all the kinds of things that you would expect to work correctly in JavaScript actually do with Ruby objects. Oh, you can do like newRuby.array, newRuby.file, stuff like that. Oops. And you can do that. So basically it's sort of like what Rhino is to Java. This is to Ruby. It lets you pull that Ruby stuff into the JavaScript and run it in JavaScript, which, yeah, the most obvious use case is testing, like being able to run what should be browser code on the server rather. So that's it. And who wrote Johnson? So Johnson, it's a weird story. I wrote something called Ruby Spider Monkey, or I modified a thing that Japanese guys wrote called Ruby Spider Monkey. These two guys from SeattleRB, John Barnett and Aaron Patterson wrote this thing called, we used to write R. Kelly and converted it into Johnson, and this other guy, Matthew, is running some, the fork of Ruby Spider Monkey in production for a long time, and he's basically figured out weird garbage collection issues that caused side faults. So one of us noticed that we were doing the same project and now we're working on it together. I wrote the interpreter. They wrote most of the clean C code that exists. And the code is available on GitHub under J Barnett if you want to hack on it. Should we try using the little guy? Can you hear me? Good. I'm presenting a little project I'm working on. I'm Sebastian Delmont. I work for 3dc.com, and I live here in New York City. Working on a project we call AREPA. And as you can see, we're trying to... We picked the name before we decided what we're going to do with it. It's supposed to mean administration of remote equipment can be pretty awesome. And, well, what is AREPA? The idea is we use POPIT to manage our servers, but we hate POPIT. POPIT has a bunch of problems and little annoyances that drive us crazy, so we want to do something new to use it. It's a declarative configuration of servers where you specify what each server needs to do or what is its role, and you specify what you need to perform its role, and it will do it for you doing parallel execution over SSH. The idea is to make it a very simple implementation with a simple Ruby DSL. It might contradict the idea of simple implementation, but compared to POPIT, anything is simple. And in front of Ryan here, I'm afraid of using the word simple. It's not going to be that minimalist, but it's a frame of mind. We're going in that direction. POPIT's in the top 10 for the blog, James. Yes, and I wouldn't be surprised if it's top five or two. And the idea is to have no abstractions, just shortcuts. One of the problems we have with POPIT is that it tries to abstract the complexity of managing multiple servers. They pretend you can write the installation script for a master's late database server into something you can deploy on a Debian machine or on a son server without changing the code, and that's just not possible. What we want to achieve with this is to just let you do automation of the process without trying to abstract the complexity. A little bit of an example of what we want to do is you will be able to define a host, give it a host name, set some variables, like what's the IP address of the host name or any other kind of variables, and you say, you declare that that host is a database server and it's a slave database for a master Dwayne. You also define what the service database server involves. It requires a package MySQL and it requires a file to be placed at the ETC MyConfig, which comes from an ERB template you generate. It is to have something as simple as that and even the package is just a function you define which executes your install unless that package is already in the system. The idea is that arepa might come with a standard library of helper functions like this, but you can write your own depending on your needs. Can you back up once I call? Next slide. The endless part I'm confused about. So this is standard Ruby. Are you preprocessing this into something else? Sorry, the only thing I should have had an exec call in it. I just made that up on the fly before the presentation. We already have some code that can do this, that can have, especially we have an exec question mark and an exec without a question mark. You can do a dry run that will actually call the RPM for the own less if you use the question mark. It will tell you what it will have to run if you really want to do it, but it has to perform some calls on the servers to see what your current environment is to decide what it has to change. If you're interested, contact me at the Gurukha party or email me at sdnet.net or at 3dc.com or check it at github.sdarepa. And that's it. Anyone else? Do we have anyone else who wants to give a talk? I know we got those guys, but come on people, this is pathetic, this is a short line. This should be a lot of people, nice and fast, anything you want to show. Get your asses up in line. This is a drinking line. In New York this would be all over. This is a line to drink. In New York, this would be all over. A little drinking world? Test. There we go. I'm finally getting on. Gay? And you're here? No. We get to gain or we can switch? Yeah, it's on. Can you hear? Nope. Yeah, it's on. Is that better? You just need to talk out. Speak louder. Okay. Anyway, I'm Gregory Brown. Some of you have seen some of my stuff on O'Reilly Ruby, or maybe used Ruby reports. I actually wrote a book with Mike Milner about the report. It was self-published, and self-publishing was a learning experience. I learned that I suck at marketing. I was supposed to bring five copies today to be raffled off. So the first five people that sent me their shipping address, I will send the book to you. But I'm actually... I wanted to talk a bit about the Ruby Mendocan project. How many people heard of that? So basically, a Mendocan is someone who survives off those donations and generosity of others. It's normally used in the context of religion. A Ruby Mendocan is something like that. You can see the details on Google, but here's the reader's digest version. Thanks to 70 people in addition to Ruby Central and in addition to the Mountain West RubyConf, I have funding to take 22 weeks off of work to open first up for Ruby. So the project that I'm going to be working on is called PRON, which is already having naming problems. And it's a PDF library that aims to be fast, kindly nimble, just like the majestic sea creature. It's not yummy. So you may wonder what about PDF Writer, which is more or less our standard PDF writing library and we'll do it right now. Well, it's basically unmaintainable, and the unfortunate truth is I know that because I'm the current maintainer. So there's some big goals for PRON. One of them is Ruby 1.9 report, which as we looked into PDF Writer, that might have been a little bit hard. We'll be doing PRON from the ground up on Ruby 1.9. Internationalization, we're aiming to support the code on both Ruby 1.8 and 1.9 and actually allow people who aren't speaking English to use PDF generation of Ruby, which would be nice. Speed is a big thing. PDF Writer currently generates PDFs about as quickly as your run-of-the-mill laser printer, printer PDF, which is slow. We could do better. An API for Ruby is PDF Writer with mostly a port of a PHP library and I'd rather write Ruby than PHP, and I think a lot of people are here with you. And a complete spec speed. Luckily, there's a PDF reader library now, so we can do things like automated testing, which Austin wasn't able to do while he was developing PDF Writer. So really, I talked about my short-term goals in the next couple of weeks. I'm using geologic time scale for the coding for things. So I'm starting way at the beginning with PDF PRON, somewhere in the not too distant future we will get Jurassic PRON. So in the next couple of weeks, I'm starting with at the beginning and if anyone has any experience at all with implementing PDFs, it's a 1,310-page long spec, so it's painful. But we're starting with the simple stuff. Lines, boxes, polygons. I'm going to work on getting full color support. I'm going to use to color those things in. Page sizes, orientations and pages. Some callbacks and things like that and then Bezier, Kerbs, and serverals. So basically, you'll be able to draw some pretty things in the next couple of weeks. I'm hoping to get that done by May 5th. It looks like it may get done sooner than that, but as soon as I'm done with that, I'll start working on text, which will be painful. The question is what can it do now and the answer is basically nothing, but it can draw lines. So this is the result of a week of swearing at the PDF spec and two days of coding. It's not much to look at yet, but it's going to change fast. And please, because I have really hoping six months from now that this library will no longer be called Prima, it'll be called PDF Writer, please pay attention to it and let me know what you think. How's that coming up in the back? I think it's good. Anybody hear me? Hello? Can anybody hear me? This kid? Hi. Hi, my name is Dan DiMaggio. Here's my picture of me and my robot. I used to be an embedded Linux developer. I've been doing Ruby on Rails for last year, but I need a job, so anybody can do that. I decided to do this talk about a minute and a half ago, so I don't know exactly what I'm going to talk about, but a lot of people have been looking at my laptop and thinking it's pretty cool, so I thought I'd show it off to everybody at once. It's an easier way to do it. It's called the ASOS EEPC, or as they like to abbreviate it, the EPC, with the E kind of, you know, being longer. It's a Linux-based device, or you can get Windows XP, but we won't talk about that. It has a VGA out, which is really cool because that never worked on any of my previous laptops under Linux. It has internal 4GIGs, or 4GIGs, do you buy it? No, I forget. It has internal flash of 4GIGs, so that it has onboard applications that take up about a gig, and you've got about 3GIGs free whenever you want. It comes with some neat things. This is the first time I've ever used the external, so let me see if I can do both external and LCD. Wow. That works. It comes with a whole bunch of applications preloaded, like a web browser, open office, various internet chatting, science, some games and applications, and things like that. It has a built-in webcam, so you can see me. It has some built-in games, so you can be just as productive under Windows. I use it mainly for web browsing. If you are web browsing, you kind of have this problem that the web browser is using up a large fraction of your space. You can hit F11 and install an extra plugin to get rid of all the tabs and everything across the top, and that works pretty well. But on certain websites, like Slashdot, there's too much junk going on. You could probably install a grease monkey extension, but I use a program called ArtVarq. Slashdot is optimized for IE. You can do this, and you hit isolate, and now you can read it like without all the excess stuff like that. There's lots of technologies you can use to make your websites more usable, given the small screen. It's only 800x600. Alright, that's it. Make it show up on the screen. What do you hit on it, man? It just shows up. It's like everything else. That's good resolution. He got sold his shit with every machine. Figure it out. There we go. Okay, it's one show Slashdot. Hi everyone, my name is Phil Matarice. I work for Agile Partners. It's pretty cool. It's better than it looked on this one. Yeah, I'm not much of a singer or a dancer. Slashdot. It's got a letter on it. Oh, it's beautiful. Alright, the work involved in this is actually done by my co-worker, John Berry. There was a designer named Brendan, something or other. I've forgotten his name though, but he came up with a technique called Cinema Regux. And the idea is you take a video, a whole movie, and you dump out one frame per second, get a whole directory of images, put them up as a poster. So, cover these empty walls. And then run real fast. Well then you run real fast. Well, you're going to have to do this. Put it down the side of a skyscraper and then jump. You can try it. It produces some really neat effects though. One of the things that's cool is you can see the style of the director and how they did their cuts. I kind of like to see different color bands. It's sort of neat. You put in a movie that has a lot of thematic lighting or something, and you'll kind of see what this is through. John and I worked on a script that's on our website. I don't have any of the code for it, but I'll have the address at the end so you can take a look. It's all in Ruby. It has nothing to do with websites. It has nothing to do with rails. It does use our magic heavily. One of the... Here's an example of 2001 Space Odyssey. Which is really incredible. I don't know how the lighting is there, but red is when Hal is fighting with them and taking over the ship. Totally cool. One of the problems we had when we came up with this, John Barry came up with this to build as a poster which was 20 inches by 30 inches at 500 dpi, which was a massive, massive image and it basically wrecked everyone's computer who tried to generate one of these. So what we ended up having to do was we found out we had both written our our own methods for doing this. We found out our magic has a montage method built right in. But it's not usable for this. So it was okay. We still got to proceed. The idea was our magic has a thing called an image list. You load up a whole directory of the frames and you hit one button and it will go through and scale them all uniformly and fit them on there. So what we ended up in two passes one pre-processing of the images the other one then going through and using our magic to assemble it into a montage. But I've actually not seen Helvetica but John was telling me there's a lot of scenes where there's just a solid color on the screen and that shows up pretty clearly. Of course I'm such a nerd that I had to sit with my two DVDs of Star Wars the special edition and the other one they were so close it didn't even matter. But in the special edition one you see a lot more like pink spots showing up all over I guess when they were going into hyperspace and Lucas added extra color. Willy Wonka was one of the ones I really wanted to try because I thought the really wacky tunnel scene would be cool. And it's a scene where I don't know if you remember the movie but they go through a river of something lights and crazy videos playing and it's the most psychedelic part of the movie. And then John of course went through playing Super Mario Brothers which added a lot of cool color bending. But I have to say this is very addictive to play around with. I sat there for probably 10 hours yesterday ripping DVDs converting them. Not very long it can take from 20 to 40 minutes once you've got the DVD ripped. I used a program called Handbrake for the ripping and some videos they were taking 3 hours sometimes. I don't know if that's because I was busy doing other things on the computer or not. No, that's just how long it takes. Yeah, okay. This was the website that John used for printing it. He said they had a pretty good deal. I think he had some trouble transferring the large file so if anyone actually wants to try this I think he had to go through and reduce it with Photoshop with some JPEG compression maintaining the same resolution. And that's it. You can find the script on the website. Any questions? How do you have the non-special edition of Star Wars on DVD? It came as the bonus disc on the latest DVD which wasn't packed until after he made everybody else buy the original special edition. But you also get another copy of the messed with version that you can use as a coaster or whatever. Okay? Thanks, guys. Who's got the shortest talk? Quick, quick, quick. And just to be clear, anyone who's getting in line now needs to talk to everyone who is in line and make sure that you're not in the back when you should be in the front. Shorter talks, go first. Oh, yes. Okay, the sizing is going to be all messed up. So, let me shoot text made. As we go, but that's okay. Because this is going to be short. My name is Peter Jaros. I am a senior at Bard College. It's up the river. It's in a tiny little town called Anondale. In fact, it is a tiny little town called Anondale. Yes, and they are never coming back to Anondale. That is my current school and I am in the CS department. There are three professors. Each one of them has a senior project at Bard. My senior project is Robot. Robot is a way to write robots. It is a really simple behavior based robotics DSL in Ruby. Basically, we were doing some robotics work, behavior based robotics. I'll explain briefly how that works in a sec. And it was all in C++. It was for these really cute little robots. Not this big. They roll around on the ground. They're from MOLU Robotics and they have a package called ARIA. ARIA is all in C++ and we were doing work in C++ and I hate C++. And I love Ruby, so I thought this is perfect. I'll make my entire project fixing that problem. So, what is behavior based robotics? Well, behavior based robotics is a way to take some really simple ideas about how you want the robot to act and combine them together into a very complicated idea. Basically... Now everyone knows who I pay attention to on Twitter. Basically, you have a robot object. It's actually a little more complicated in ARIA. There's a whole bunch of things and this is part of what drove me to do this project, but essentially you've got something that connects to a physical robot. And that physical robot object is going to have a bunch of behavior objects. And in this C++ system those behaviors were defined as classes. Each one had to be its own class. And, of course, defining a class in C++ is a whole bunch of code overhead that you'd rather not deal with if you don't have to. Once you've got an instance of this on your robot, then when the robot runs, those behaviors are going to fire over and over and over and over again really quickly. And what the fire code is going to do is look at all the sensors of the robot that it cares about and decide what it wants the robot to do. Does it want it to move forward, move backward, turn, stop, whatever. And it's going to say, this is what I want the robot to do. So that's doing its calculation. But the thing is there's a whole bunch of behaviors and they're all yelling at the robot do this, do that, and the robot has to decide which one of them does it listen to. And actually in this system it's not going to listen to probably any of them in particular. It's going to use an arbitration system ignore the coloring. I just thought the fact was nice. It's going to use some sort of arbitration system to say this behavior has a higher priority than this one. So I'm going to listen to that one because it's telling me to move forward. But this other one with a lower priority is telling me to turn. And no one's telling me not to turn. So I'm going to go forward and I'm going to turn. And in the end the robot is kind of intelligent. It's a nice emergent intelligence thing. Intelligence is really too strong a word here. But it acts nicely. So this is the code that we wrote in our robotics class to have a robot that would give a tour of our new science building. It's sort of the big thing at the beginning of the year. We're going to build a robot and it's going to take the funders around the new building that they funded and they're going to be really proud of it. Now this is C++ so prepare for how much code this is. Here's the code and okay this is the code. Now a bunch of that is comments but not half of that. And this is already 21 lines. So there's a lot to work with there. I looked at it and I said this can't be right. I boiled it down. Go away. And this is what I came up with. This is the translation into robot which I did before I even implemented it. This was just sort of my my reference. And it looks like this. And that's the whole thing. It is 59 lines long with a couple comments and some good line spacing in there. And it's also readable. We've got to behavior go. It's going to take a couple arguments. Again I'm abusing the Ruby syntax much the way Rake does. We're going to take in a max speed stop distance. And then every time we fire we're going to see how far in front of us something is if there's something in front of us. And depending on how close we are to the next object in front of us we're going to slow down. And once we get too close to something within the stop distance we're going to stop completely. And as long as that is on the robot it's going to go until it almost runs into something. And then turn tells us if it's going to compare how close things are on either side and decide which direction it should turn to. And this logic is very readable. It's very easy to see. Down here we say we have a robot. We'll call him Fred because he needs a name for later on when we run him. We could have a bunch of robots set up in this file. And it's going to use the ARIA adapter. This is a completely extensible system. You can write an adapter for any robotic system. You can have one for Lego Mindstorms if you wanted to write a behavior-based system for it. But it is going to have to operate tethered. It's going to be connected to a computer to do this unless you're going to run Ruby on Lego Mindstorms in which case talk to me because that's amazing. And we're going to need a sonar sensor. We're going to have these behaviors with these arguments and we run it. And that's it. The ARIA adapter is an extension that I wrote which is it's using the ARIA library which is doing most of the heavy work. It's basically just translating between this and the style of code that I showed you before. Just to let you know, at the Austin Ruby is that right, Austin? Yeah, Shashay demoed Ruby on Lego Mindstorms. So I think you can find that online. Let me give you a very greedy demo. Let me not give you that demo. Supposed to say I can run it. It works except for one little bug which I'm going to fix. The code is online at GitHub. Pija is the name that I tend to go by online. It's called Rubot and so that's where it is. It is not really packaged so you can use it yet and go away. But you can at least take a look at the code. If you're interested, you'll get cleaned up as time goes on but first by Wednesday I have to write about 25 pages still to go on it to hand in. So I'm going to be a little crazy this weekend and the beginning of this week. I have to take a two hour train ride. Maybe I'll get some work done but thank you. Also, if you like Ruby and you like robots, stay tuned. Let's see what it does. It plays some drum and bass. That's the old style. It's done that. Okay, sorry. I'm getting carried away. So I'm not going to play some drum and bass. Can you see it? I can now reveal that Peter's comments about Mindstorms is actually a setup. This is a Mindstorms robot which is actually running a program which was initially written in Ruby and then translated. It doesn't run on the Mindstorms machine the way it does with the gem that you mentioned because I saw that demoed in Portland too. But this what it does is it generates something called NXC and you can then it also compiles it and you can just transfer the file on there. You'll notice that this robot is kind of dumb that it just goes around in a circle. That's pretty much all the functionality that is actually supported. I'm just going to do a super quick run through of four different things actually. Rubots is one of them and this is the spec for how it works. Here's this is the C or NXC not exactly C which it generates and this is how you write the program in Ruby and you see it's actually longer instead of shorter because it has a lot of flaws with this. Another flaw is that the ultrasonic sensor is the only thing it supports and really weirdly because this was not planned but mine is instead of being called robot it's called robot with a Z. Real quick password this is what I use to store my passwords. You do gem install password and obviously you don't put your bank password in there but for like your Facebook password I don't keep track of that shit I mean there's no point remembering it that's for robots to do that's for computers to do so when I join a new social networking site I just do password-g capital G for generate and the name of the site and my username on there and it just generates a password and stores it in a YAML file so it's got like 50 passwords in there like my bank or something like that okay next up is this thing utility belt and Greg Brown who was talking before helped code the most interesting feature in utility belt utility belt is a set of like nifty what not for IRB so you go inside IRB and you can get history this is something Ben Blathing wrote so you can get all your IRB command history and if you want to go into VI emacs and puts hello world like that and then you quit out of the text editor it executes the code and you can also do it with text made or emacs and in fact you could do it with any command line accessible editor any editor you can run from the command line you can run from utility belt so that's pretty cool and then there's two more things no there's one more thing rock paper scissors I'm not going to load it up but what it does is you've probably heard of naive Bayesian classifiers this is for spam detection well naive Bayes is Bayes without prediction or without inference it just categorizes rock paper scissors uses real Bayes it doesn't do like a network it doesn't do back propagation to basically predict what people are going to click and you can find this it's on ruby forge or my blogger it's somewhere I don't know where but hold on gels it's easier to remember than most of my project names rock paper scissors pretty easy right and what it does is it gives you an app with a it's a rails app where you can log in as a user and then you can click something right and there's a bunch of things in categories when you click one thing it records how often this user clicks that and it'll be able to say if I go here and then I go here you are probably user X and that's it, I'm done I'm going to hit the button no I don't want it that way okay, so again, out of the way I'm Eric Hodel and I'm from Seattle R.B. and I'm a maintainer of RDoC I guess the maintainer yes and one of the things I have finished just now is frameless RDoC except for this giant list of crap at the bottom so if somebody knows CSS can help me make a menu out of that at the hack fest that'd be sweet and as proof here you have some HTML source and look you can see that there's no frames in here and so I've been making changes and improvements to RDoC so if you're interested in helping out with this thing there's the RDoC project on Rubyforge and you can see here we got some actual real activity which is all recent because it was registered three years ago that's it and now we'll go into core hey, my name is Luke Melia I work at WePlay and let's see so this is sort of a mashup of the talk of some talks so I was inspired by Ryan's talk about herding code and I figured I wanted to find out what kind of code we could hurt and then I was inspired by Ryan's talk about FLOG and so I figured I'd use FLOG to figure it out and then I think it was reminded about Socky which I'd sort of forgotten about by Chris's talk and so I made a little Socky task that anybody can use here and we make this a little more accessible so this is pretty simple it basically gets your Git log figures out what files are the most frequently changed in history over the history of the project and then runs FLOG against those so basically you end up with your top 15 files that change the most and just how bad they are and so if you want it you can grab it from lukemelia.com it is the first post, that's my daughter it's the first post here and there's a link to Socky and I figured I'd just real quick show you guys how to install Socky if you've never used it or how to install a task with Socky if you've never used it so the pasty that's linked there has the Socky task it looks just like a rig task so I'm running Socky-i to install it and now install that task and analyze commits most changed files and I'm going to run it and share we have more than I expected actually coming back for some reason but anyway userRB not surprisingly in our project has been changed 28 times and it's also the biggest defender FLOG-wise score of 1185 and so anyway we know what to focus on next time we've got a couple of cycles so that's it there's a mirror button okay I'm Chris Wanzhroff I'm one of the GitHub guys and I wanted to show something real quickly that I alluded to earlier it's called Oil it's kind of something that me and Tom Preston Warner are working on on the side and basically I think at RubyConf there is talk about everyone needs to write a Lisp so here you go this is it basically we wanted it to be prototype and object oriented and we also wanted to have like a more consistent kind of syntax and feel and rules this it looks very similar to RubyCode yes it's not a real Lisp but this is this actually runs in Oil and this is another example of it so basically the way that we had it set up is symbols are kind of consistent in how they're used you don't have to back tick anything every method that you call gets past the tail sort of deal so anyway these are some little examples of things it's kind of prefix notation right now and the cool part of course is that I mean you can see the grammar here it's actually part of the code so you can grab them at run time and do whatever you want with them basic stuff if statements but the neat part is that we did it in TreeTop and the grammar is only like 50 lines and it does so far this part we consider finished it's all in the implementation right now and it's just if you haven't seen it it's treetop.rubyforge.org and it's really simple, really cool ways to get a parse tree of stuff and do stuff with it so I mean just the basic kind of examples I could probably do something like yeah hello world alright that's it what do you mean by prefix right now? because of the way we set up the rules it's let's see if I can get an example maybe we don't have them yet we're working on the implementation right now the inside how we're going to do the stack and stuff but the way that we did it is that so puts is a symbol and hello world is a string the head of any list that gets run, that gets processed it tries to see if the the head has a call method and if so it passes the tail to the call method so basically you could do one space plus space two and pass plus and one to the call method of the first item in the list if you wanted and just kind of change the rules on the fly in actual oil we have an actual, I mean I did that but we're kind of changing things really quickly so the point of it is that we want to write on top of Ruby we want to make it simple it's kind of a fun thing we want to have it to reach into Ruby and we want to be able to kind of like with these really basic consistent rules make it do crazy things and hopefully macros and stuff like that also because TreeTop is written in Ruby eventually we should be able to hook into TreeTop and redefine the grammar while the program is running from the program which I don't really know how to do it yet but if we do it's going to be sick alright I'm Paul hello again I've missed you I just wanted to show up off show okay so I mentioned Bassett here we'll quit that earlier it will at the end of my talk so I just wanted to show that real quick it's just right now it's just for doing feature selection and naive based classification so this is an example I ran it on so classifying something in this case I'm testing like classifying text so I used the newsgroup stuff and like alt.rec.hockey and alt.rec.baseball so classifying whether a document a new document is going to be either about baseball or about hockey so this is just the output of like I mentioned like doing cross validation so the different like pieces that Bassett includes are the actual like the classification evaluator which is for doing cross validation and I had mentioned that I wanted to be generic so it's not intrinsically like tied to just classifying text like you could do other types of things with it and like I said as a feature extractor which is based on chi-squared so let's see oh I guess I'll just show this real quick which is okay let me pump that up okay so basically I just create a new evaluator and for the evaluator I just say compare against Bassett classifiers and I have two classes that I'm feeding in and sorry I'm using just actually just the Bassett and IE base so I'm not really I can also use it other classification algorithms as well and I pass at this block so which tells it to create the new classifier go through the training set and train on it and go through the testing set and test on it and the thing is like the evaluator actually breaks breaks it all up into the different chunks for you so but anyway I'm looking to add like clustering and some other classification algorithms to it so if you're interested hit me up and we can hack on it Wilson so I'm and I work for and I'm going to bore you people with some intricate details of Ruby's constant system and does anyone have an opinion of what this code if you can see it is going to do when I run it bigger okay well if it needs to be that big we're going to be in trouble when we switch files but does anyone have a vote? it's going to warn it's going to warn but it should look it up so the consensus is it's going to warn but it's going to look it up and you guys are root crows because you're right but that's crazy because that is completely not the name that constant has so I'm introducing this as a background as a weird Ruby habit also I have no prepared talk so be forgiving that's too big too small? heck yeah indeed it is okay well this doesn't really fit on the screen but has anyone seen Rails raise this error a copy of whatever has been removed from the module tree but is still active okay so the reason that happens is that Rails is crazy and it runs all of this code that we're looking at that doesn't fit on the screen because of the font every time it can't find a constant and it does all sorts of fun Byzantine things and it has code like substituting object for kernel that does something I'm sure that does so I ran into the whole story here because I was trying to get MIRB running on Obinus and MIRB has this file called autoload.rb where it does the equivalent of what we just saw in Rails and it says in particular whenever something called MIRB colon colon config is referenced then you should go require this MIRB core slash config file it seems reasonable and that didn't work at all and MIRB didn't start but it appears to be used heavily so it seems important as we saw in the crazy WTF file over there you can't really just expect that a constant isn't going to be found just because it isn't in place yet it might just keep looking up so the reason this code didn't work in Obinus is that we have a top level constant for now called config and we happily implement all these MRI rules for looking up constants and we said oh cool there's a config constant in the top level well that wasn't the config MIRB was looking for so the time had come to make autoload actually work the way it is supposed to work so we wrote all these specs and it turns out you can do terrible terrible things in Ruby like asking for an autoload and then going ahead and requiring the file that you said you wanted it to require first so that when it fires it's already been required and it doesn't require it and terrible terrible things happen step two here is how easy this is to fix in Obinus because Obinus is awesome so I had to write for the moment a little bit of C code but I only had to write two lines and I said if this is an autoloady thing then call this Ruby method otherwise do whatever you were doing before I open this file and so here is autoload this is all of it so we make an autoload and the way we saw it over here if I can click is you give it a name you're looking for and a place to go get the code so we initialize it blah blah blah we add it to a list etc etc and then here we are this is what actually gets called by that C code that we were just looking at so it sends this call message to the autoload thing and it requires and it turns out that require because you can require the file by hand and not ever hit the autoload require has to go in and clear out the autoloads so it runs these two lines of code and removes it from the list and then loads the file as you'd expect and then gets itself and we're done and I can't remember if I had anything else to talk about she's presumably an occupational hazard alright anyone have any questions about Constance or Revenius or C when's Revenius gonna be done Thursday Thursday which Thursday is in question I hesitate to make statements that could potentially be recorded but Murrub actually serves up pages now and pretty soon it will be serving up actual apps that have more than hello world in them so that's progress I'm not sure how we define done though that's tricky is Ruby done no anyone else want to talk I think we're pretty much good for time so I got one thing to show that's over actually my initial proposal was rejected I can't talk that wasn't your proposal that was you I gave a talk earlier about asceticism and pairing back and being as simple as possible and I wanted to show you something that I think is awesome I didn't write it Stephen Baker wrote it he's one of the people that gets it and this is beautiful how many people here use RSpec and if you don't keep your hands up and if you don't use RSpec how many people use one of the other mocking frameworks so I think we're talking between half and two thirds so I have something pretty to show because I don't have the mirror button on this laptop I have to do that this should actually that's the last end so that fits that's a mock framework there's no scroll bar that's it that is as small and pretty as you can get and that was written in half an hour on an airplane while going to or from a job interview Stephen Baker contributed this to the I did a little massaging on it but this is it so it is I think 33 lines long and has your little specs and a verify method and does what you think it should do it actually has a fair number of specs to go with it or actually unit tests to go with it and this is one of the things that's contributing to many unit having a test framework that is 100% API compatible user API compatible with test unit a spec engine which is not compatible with anyone else I don't think but is clean and simple to implement and to use and mocks in less than a thousand lines of code including the test form that's it