 We'll start with lightning talks. I don't know what they are, but they're in a line And so they're just going to talk tell you who they are and what they're talking about all right, I'm David Brady and My timer is now behind his crap. Oh well all right, so last year my New Year's resolution was the ship code every single day and It was pretty awesome actually. I Never wanted for a lightning talk at any of the rugs Started about 30 projects on github. I did a lot of contributing to other stuff and it was it was a really really good experience I didn't go all year. I ended the experiment about 115 days in I didn't give up I just decided I've learned what I've I want from this and I'm done So if sorry with you guys, I'm gonna tell you how to do this I'm gonna recommend that you learn how because it's actually kind of awesome and then I'm gonna suggest when you might want to not so The step one is just to do it once there's no trick to this anytime somebody says there's no trick they always end up saying but it's just hard work and Anybody who knows me knows that if it's hard work, I'm out This is not this is not hard work. Okay. It's really easy. All you have to do is have clear rules Lower your standards and then lower your Epsilon Clear rules means you need an absolutely crystal clear definition because when the alarm clock goes off Or well rather when you wake up at 11 45 p.m. And you realize I haven't shipped code today You've only got 15 minutes to ship code today. You have to have a very clear rule that says okay. I'm done I win I get to go back to bed. All right, so for me a clear rule was a working feature Okay, I'm glad Jim Lyric isn't here because I did not have a rule that said they had to be tested Which gets into the next point which is lower your standards now That's the funny version of lower your standards, but but the serious version of lower your standards is that is If you stop and think the thing that's gonna stop me from shipping code every single day is that well, it's just too hard Right. It's I mean code is big right? Okay. No the reason code is big is because you have too high standards You have decided that I can't ship this until I finish the account manager in the account class and the user class and the login class And the no one feature Get it down just one layer one piece push it in and that's also what I mean by Epsilon Epsilon is just a unit of work a coherent thing that you would consider to be a commit or a check-in something You'd be willing to push as long as the project is coherent and your specs pass your golden Okay, so Epsilon small unit of work. Okay, two years ago Four or five years ago actually it was not uncommon for me to hold work for a week or more before pushing Well committing in subversion two years ago it was oh usually I was daily and Now honestly, it's rare that I go more than an hour or two without pushing So this is kind of a chain that the change that happens to you as you start doing this and it's very useful Step two is just keep doing it. Don't break the chain Go look up streaks time management or calendar about nothing comm which is fantastic if you're doing this on github Just honor your commitment at 1145 get out of bed and go push your stupid code. Don't miss today. Don't break the chain. Okay? Trick three listen to your pain. Okay, if it's 1145 and you haven't got stuff And you don't know how you're gonna get this done because you're freaking out listen to yourself and ask why Okay, how this is what I would end up doing like why am I having not pushed code? I've been I actually coded for six hours one day and then said ask Groot and wrote a 15-minute thing and checked it in Okay, and threw away what I'd worked on for six hours and then I stepped back and I kind of listened to myself What was wrong and that's kind of where I found out you need to lower your Epsilon You need to lower your standards and just do one feature at a time You will oh, I recommend this is just my suggestion Do it outside of work because you're gonna work on some work stuff every single day You want this to be special you want this to be something you have to get done that you're willing to get out of bed and go Do if you just make it a habit every single day that you're gonna get out of bed and do this this way That's a way to do it. You're gonna run out of ideas. So be open to new ones look at project oiler tinker with your development environment There's a bit my I have a project on github called bin And it's just the files that are in my bin directory and it's like just my get my get hacks all that kind of crap Start projects just go for it That's really all there is to it. How long does it take form habit? Two weeks to two to four weeks. Okay, this is gonna take you 90 days because you're not forming a habit You're not you're not remembering to brush your teeth. You're building a mental tool You need to do this This is a fantastic tool to have on ship day when it's 845 and you're still stuck at the office When you need to gear down into a lower gear and running granny gear. It's perfect for it But you should stop Once you have this tool because only perfect practice makes perfect and you're not gonna have perfect practice You're gonna have practice building quick and dirty crap and getting it out the door Which is great at 845 p.m. Not so good at 10 o'clock on Monday morning I recommend anybody take the time to learn this until you have the tool and then I recommend you stop. Thanks All right This presentation is on no sequel and sequels a database tool for kit for ruby and no SQL is non-SQL databases and no SQL is using no SQL databases with sequel and I'm Jeremy Evans the sequel maintainer now MongoDB is a no-SQL document store and sequel Mongo is a MongoDB driver for sequel now How does this work sequel uses a DSL instead of literal SQL strings the DSL produces objects that represent concepts We treat those objects specially in the sequel Mongo driver and we compile filter objects with JavaScript instead of SQL So let's see how this works again. You're just selecting records select star from T DB fine in Mongo same results Inserting records basically the same thing SQL light gives you an integer primary key Mongo gives you an object ID Otherwise pretty much the same thing Updating records again different incantations in the back end same sequel code works on both same results Deleting and delete an SQL remove in Mongo pretty much the same thing except Mongo gives you an integer That doesn't really mean anything All right, let's add some more data and try things like ordering order by be descending again works on SQL light works on Mongo same results how about equals filter with a hash a equals five in the Mongo this dot a equals equals five same results Not equals pretty much the same thing you have not equals this idea not equals five Same results any quality filter with the block a greater than five again pretty much the same thing on both SQL light And Mongo same results how about is null not defined you have a with a nil value in the hash A is null and in a SQL light this dot a equals equals undefined or not equals undefined otherwise same results Limits again limit to limit to work same way in Mongo same results Limit to with an offset limit to skip one in Mongo pretty much same results How about selecting only certain columns? Then SQL this is a select a from T and Mongo This is fields equals a pretty much the same results other than Mongo always gives you the object ID Even if you don't ask for it Okay counting again count star as count in SQL light Mongo just the count function same results Standard math operators a plus one times five minus to be greater than zero again works the same way in both SQL light and Mongo same results Bitwise math operators SQL can do bitwise shifts and bitwise oars if you tell it's a number again same results Let's add some strings to the table and see what we get string operations we can do I'm searching with regular expressions This actually does not work on SQL light because it doesn't support regular expressions It would work on my SQL and Postgresql and you get the same results Mongo gives you But you can you actually can use you use like an SQL light just uses like on Mongo It compiles it to a regular expression which it matches on and you get the same results String concatenations equal handles this basically the same way it handles it on both SQL light and Mongo works the same way gives the same results in not in with an array See in Ali and Alex in Mongo. It's Ali Alex in does index of this dot see not equals negative one or equals equals negative one for Not in same results Complex expressions with ands and oars again simple cases like simple or works fine How about complex expression nested ands and oars again works fine Very very complex expressions as close as you can make it There's no limit in terms of depth other than memory again same results case statements case a one five then zero one one Then nine else one and compiles it to a nested ternary expression in JavaScript giving you the same results Casting cast a as varchar this dot a plus the empty string converts it to a string in Mongo same results again for integers You do use minus zero converts it to an integer in Mongo same results Models and attribute accesses with SQL model again works the same way you get the same results on both even works for associations and That's pretty much it you can't have a no SQL presentation without a completely flawed benchmark So this is the completely flawed benchmark for no SQL and there's a bunch of numbers here, and they don't really mean anything and That's it SQL Mongo is available on GitHub and no sequels at that paste and do I have time for questions? Questions Hello everybody. I'm Chad Woolley work for Pivotal Labs So let's start with a poll who writes tests All right Who thinks it's a good idea to keep your test green? Not the same number. How many of you use continuous integration, which is some machine which runs your tests every time you check in code Okay, how many of you have a prominent visible display of that continuous integration in your work environment? All right pretty good. So that's what this is a Pivotal wrote this for internal use We have all of our internal projects up on a huge TV on multiple places in the office, so everybody knows when somebody's project is broken this is the public one that we have and it just runs several projects that we either wrote or use as You can see it's mostly green. We've open sourced this now It's on GitHub feel free to use it and improve it. It only works with CCRB now and So that brings me to the Rails CI and So for probably a couple years now I've as my contribution to Rails tried to I set up a CI environment for them and tried to run it, but it's a as you can see It's not green and you know, that's a sad thing So we'll look at the sad dog from here on out and just discuss so Why why is that bad? Well is broken windows, you know somebody checks in something that breaks a build and That may be a minor test but the next check-in may be something majorly broken But you don't know because it's just red you could go look at it But you know you should need to know and this notifies them in the campfire room that they have for Rails core But it's hard for them to keep it green that why is it hard because CI ties everything together It's pretty much everything else together. It runs on most of the supported databases it runs on the three interpreters and not everybody tests that when they check in on the core team, so Rails core especially Yehuda and Carl who are great guys by the way want to keep this green But they they need help. They need your help. They need everybody's help If you have an interest in Rails or CI or Ruby or or anything And this is also a great way like if you're looking to get an open source to get some rails commits under your belt And grab that coveted position on the rails committer list, you know, just fix some things All you need to do is watch CI the CI that Ruby on rails If it goes red try to fix it patch it if you can ask for help if you can't if it If it's gone for a while get bisect is your your friend. It seems really hard But it's not it's really easy to sort of target exactly what broke something by using get bisect if you're confused first of all you can email me Chad Woolley or email the rails core list on the you can also get on the Carl Huda IRC list which Bugged them about it. There's also the rails contribute list. I'll go back to the sad dog and That's pretty much it the the environment needs some love especially the Ruby one nine I set it up about a year ago and the It kind of dies sometimes its CCRB is just a single mongrel If a bunch of people hit it with our says which happened it kind of kills it I have some caching in my branch, but I Haven't set it up. My original goal was for this to be completely reproducible so anybody could set this up on a virtual machine or an EC2 instance and it basically eliminate the Excuse all will only breaks on CI So I wanted to have this thing that okay You run this one bash command against some host name that is a bear a one-two or a Debian instance and you'll end up with a working-rail CI and I wrote a like a bootstrap Ruby script and CI in a box and that was really a flawed approach and now there's RVM and chef which you heard about today Which are way more awesome ways to do this But I haven't done it yet. So help with that would also be very welcome and That's pretty much it. Let's uh, you know, especially since If you're working on rails and you're interested in the rails and you have an interest in things We're going to get a patch on your belt help out Thanks So I wanted to show off Something I've been working on for the past couple weeks with a couple guys up there Joe and Jake It's a you can check it out the internet sucks, but it's at memproff.com slash demo. It's basically a web-based Heat visualizer and leak analyzer for 1-8 right now. We're working on 1-9 support But you get you get a bunch of views and I'm just gonna walk through Some interesting things and if anybody has questions or specific things they want to look at we can look at them real quick But there's three basic views. There's namespace subclasses and grouping. You basically this is a this is a dump of a simple script That just requires all of standard lib and then just dumps out the heap and so you can see a lot of interesting things in here Let's go to for instance the subclasses view. We can see the root object is object and There's a bunch of subclasses you can see what the subclasses of ray That are defined in your in your process are We can look at stuff like exception and the entire exception hierarchy in Ruby So you can get a sense of what's on your heap and if you find stuff that's not supposed to be there You can get rid of it and save some memory But the the rule power in here is that you can actually analyze Different objects so for instance here if I click on CGI I can see that CGI has a bunch of constants It has no instances in this case There's a bunch of methods defined on it. It has a meta class. We can look at this meta class meta class You get even more information about there's methods defined on the meta class and Basically anything you can click on so here we can click on CGI dot RB and take a look at all the objects They're defined inside that file. We can group them either by line or by type here We see there's some classes we could click on class and drill down and see the actual classes Defined in that file So this is pretty useful for finding memory leaks or Finding out what's holding on to references here's another example. We could take a look at threads thread class. We see in this case There's two instances The first one happens to be the main thread and the second one happens to have been allocated in timeout rb So you get a lot of power I want to show off one quick example This is actually Bundler Carl asked me a couple weeks ago why if I could help figure out why bundler was taking up so much memory So this is just a heap dump. You can see there's 500,000 objects I group by file and this file has the most number of objects so we can drill down into that file We see there's about 50,000 objects. They all have to be gem version objects So we can click on that get a list of all of them click on one of them and see Click on the references tab and try to get a sense of what's holding a reference to this gem version object And you basically drill down and see that bundler has this thing called remote specification Each of which holds a reference to gem version. Those are held in hashes and arrays in the bundler index And you can basically see anything you want about these objects So in this case The bundler index holds on to a instance variable add specs, which is basically a huge hash in this case 10,000 entries in this hash Basically, it's all the gems on Ruby forage it has to download and pop it's a hash So it can do lookups and figure out what gems to install or download And that's why it's using so much memory in this case because there's this huge hash that's holding on to a lot of references So this is memproff Check it out. It's up. We have a Old survey we just put up that If you have time please fill out just trying to get a sense of what Ruby's people use what sort of problems They've run into and what sort of features they would like to see in this and Finally Joe's gonna have a talk tomorrow that explains in a lot of detail how memproff works and Should be pretty interesting Any questions? cool Hello, my name is jade meskill. I'm the founder and I don't have video. Let's see We'll get it Okay, do over All right, let's try this again. My name is jade meskill. I'm the founder of integral technologies We're a Phoenix based Ruby on Rails and iPhone consulting shop But what I'm here to talk to you guys about is how many guys have had to do user-generated video on a site How many of you hate yourself? Thank you. It's it's hard, right? It's kind of a pain in the butt and one of our clients is Sorenson media who's based here in Salt Lake City and they have a really awesome System for video distribution as well as in browser video capture And what I want to show you guys real quick is we built a little video wall For Mountain West and I built it in a few minutes with a few lines of Ruby And I want to show you guys just how how stupid simple it was to implement There's two gems out there that Sorenson has one is for their products called squish, which is a Java applet that runs in your browser that will capture user-generated video from your webcam or other cameras that you plug in It will compress it client side in the browser and then upload the compressed version to either your own server or they have a System called 360 which is their video distribution network So this little guy here Sets up the new view and the internet is very brutally slow. So you might have to bear with me. I'm on my my fi Sets up this which gets ready to capture some video. So let's let's capture a little video real quick Zing in my time All right, come on Here we go. Here I am Three two one Hello, everybody. I'm in Mountain West RubyConf. Yay All right short little video We capture that I Can preview it and trim it down and do all kinds of fun things. I'm gonna process that video It's going to upload it to Sorenson's 360 service and then it's going to post back to my Rails app that I built And I'll show you that code real quick while we're waiting for that to post I have it going to a secondary step, which is this finish right here Can you guys see that? So this this uses the Sorenson gem to go out using the grid gets all the metadata from 360 pulls it down and Now I have oh great and the internet failed Well, what what should have happened and I've uploaded my handsome face here multiple times Is it will give me thumbnails URLs to the video An embed code that I can easily reuse to just plug it into this view here You know to play the video we can see that and all of that happens from These two lines of code so it's Super stupid simple easy way to get user-generated video for your clients your websites, whatever you need to do just a few lines of ruby and You're up and running and this literally took me about ten minutes the hardest part was stealing the CSS from the Mountain West site and Reimplementing it on my own Any questions, I don't know much time we've got I got a minute All right, thank you very much. Oh There's a question back there. What's that? An example Yeah, oh, that's right. I'm sorry. I forgot if you want to learn more You can go to developer.sorensteinmedia.com to learn more about the API and also This is posted up on Mountain West intergram demo.com I'll put All the stuff up on github Mike's gonna put a link on the Mountain West site It's up now. Okay, and Sorenson is giving away free accounts for developers to test So you can sign up on developer.sorensteinmedia.com and if you email M flathers at sorensonmedia.com He will upgrade your account and give you guys a little bit more access for free Yep Sports flash and mp4 Yeah, so it'll it'll re-encode all kinds of other videos. All right. Thank you Sorry, so I'm gonna talk about HTML5 today, but what I'm actually talking about is offline Specifically when I'm talking about offline, I don't mean only apps that need to run offline I mean apps. I mean reducing downloads in general. So Something that Karl and I noticed when we were we're looking at putting out some mobile thing Some like toolkit library thing. You'll hear more about it. I'm sure eventually One of the things that annoyed us was that a lot of people who make mobile sites like I dot the unofficialapp.weblog.com. They're officially mobile sites But every time you go to a page it actually downloads all the HTML again Even though they're be running on Devices that don't require that and when we started to investigate why that was we talked to a lot of people who were doing mobile device It mobile development what we discovered was that most people don't actually know how to do it So what I'm gonna show you is how to do it and then eventually we will hopefully have something that makes it really easy But the technique is not very hard by itself So first of all here is the HTML that gets downloaded when you go to unofficialapp.weblog. It's like 6k Every single time you go to a site it has to do that not only that but before it can show anything like a loading screen or anything like that It has to go and ask for HTML So it has to open HTTP connection if you have flaky internet like You should you would think oh I already have all the stories Why don't I just want to see a story that I already saw before no you can't do that because it's actually just doing regular Client server model where everything is click on a link go download the whole page every time now They try to make it light 6k is pretty small for a page But that doesn't include the assets and all that so it's basically just like Bad news essentially Even if you just go look at the part of it. That's the list of stories. It's this huge glob of HTML It's a list with allies and ahrefs and spends right so there's a lot more content here than would then you would think would be necessary To just deliver some stories to an iPhone The trick is that instead of having instead of going and having it get the whole page You do a normal request and HP request You accept application JSON I'll show in a second what the JavaScript code looks for that and then in your controller You do something like this this works in Rails 3 and Rails 2 you would say respond to and JSON and whatever But basically you just have your controller like your normal controller and instead of returning HTML you return JSON This is like the normal way that you do APIs right so nothing really amazing here It that returns a blob that looks like this So you end up with just a blob of JSON again if you are done API's with rails This is exactly what happens right so you're just basically having the web application treat your rails application as a server And people are already doing this even in like regular desktop. This is a common technique the jQuery for this is simple Don't worry. I'm gonna get to like the tying it all together in a minute The jQuery is simple basically you just you have some stock HTML you go do get JSON slash articles There's a JSON that comes back and you go in and you update you have a little template HTML that you up you fill in with the slots and then you append it to the page, right? So this is like a normal you've probably done stuff like this in regular desktop applications The thing that makes this cool and work well for mobile is two things first of all There's this thing called the cache manifest the cache manifest is just something you put in HTML You say HTML manifest equals. This is an example from the spec Cache manifest is just a list of it's has to have the word cache manifest in it for some reason And then it's a list of things that you should act that the client should for sure keep So these are things that no matter what the client will not ask for again So if you're if you've seen like the yahoo thing That's like you can only have 25k jQuery is too big and like you're freaking out that it's gonna be downloading all the time The solution is just to tell the client don't do that always download every single time and you put all your assets in here Right, then you have to serve it with text slash cache manifest rails Obviously knows how to do that so just make sure that you have a route that points at cache manifest And you're serving a thing with text slash cache manifest with the valid text So that's step number one that means that when the user comes back to your site in a flaky mode They'll see an actual page that has stuff in it right as opposed to nothing because they have no internet or Nothing because it's taken like 45 seconds to download the HTML the first time the second piece is local storage So local storage is just an API that comes with HTML 5 you basically want to do something like this You want to say hey articles equals local storage that articles and then if I have any articles then update articles And then do a json that parse you display a loader and then in either case you get new articles So right away you already have any articles that you've already downloaded that will show up in your screen and you say go get more Update articles as simple as basically exactly what we had before but it takes json that now you can pull out of local storage Get articles is the same get json we had before right? So basically what you have now is you have the ability to have something that shows up right away You have the ability to pull the actual content out of a local storage That's sitting on your on your phone that isn't gonna actually get wiped away when the user like clicks off the page And you have the ability to display a loader while you're possibly getting more information and I think this technique. I Okay, I'll just finish my sentence This technique is easy enough to demonstrate on a few slides I think there's a lot there's some work that's necessary to put it all together in a Rails plugin That would make it easy, but I think that this is how people should be doing iPhone web apps not always displaying HTML. Okay. Thank you Sweet. All right, so I'm gonna show off some fun stuff I've been doing with e-commerce lately, which is a total lie because I hate dealing with e-commerce all the time So I don't really think it's fun So on my on a couple projects recently I've been playing around with active merchant and most people are familiar with active merchant It's very popular for doing e-commerce in your apps I got sick and tired of doing some of the really The main the mundane tasks that it doesn't take care of like I wanted my apps to be up and running and be able to accept credit cards in a minute or so Sure, maybe the credit card form will look icky I'll add my CSS and things to it later, but I wanted things like that By the way, if I run out of time all my code that I'm gonna do will be up at GitHub Remy presentations There's a Mountain West RubyConf 2010 lightning talk there So and this app we're gonna be looking at is actually a rack middleware for doing e-commerce these stuff It's called rack payment github.com debfu rack payment. So What I've already got is a buy stuff Sinatra application Which just as a hash of products if we go and look at what the app looks like We've got a sombrero for sale and smoked meal Thank you So we'd like people to be able to buy this all we've got so far oops is the home page handle products and a product page that when we go to one all it does is blow up and It should show us some information like the products hash and some prams I'm actually using a little gem called Tracy that Andy Farrah who's sitting over there made like an hour ago And that's where this trace comes from So what we really want to do is based on the product actually get the cost and charge someone that amount of money Here's products. It looks like just a hash So we can use the name of the product And let's trace. Let's just raise at products name And make sure we get something Boop All right, the sombrero cost in 1995 So what we want to do is we want to say that the payment amount that we want to process is equal to that thing that I just deleted so Payment dot amount equals and you're wondering where payment comes from Nowhere because we haven't put it anywhere. So this is when we want to require Rack payment you can install the gem rack dash payment and what we want to do in Sinatra is add some helper methods It's a helpers and include rack payment methods refresh that puppy Now it's pissed off because it's looking for things. We haven't actually included the middleware. So let's reuse rack payment You need to pass some options of some options along so it accepts things like your gateway This might be something like authorize nets or paypal with your username password and API key We're gonna use the built-in bogus gateway that active merchant comes with That just sort of fakes a normal gateway Okay, and now all we're seeing is the amount because that's what we returned So how do we actually process this well with rack payment to help you get up and running really quickly? All you need to do is after setting the amount you want to return a payment required status code There's actually need to be status code for that. It's for oh, too Did ask us if we have enabled some kind of? Session middleware because that's required we haven't so session cookie And then let's try that again And it gives us some pre-formatted thing Which is what we want if we want payment today up and running immediately of course everything's custom You know customizable. Let's see. I'm out in sense. Ta-da-da I'll go back and try this again. We want the sombrero Complete the purchase. Oh Why is it sad? right payment message You and your smartness over there mr. Man. I got 30 seconds left. Whoo. Let's buy something complete purchase Oh We're all so sad. Oh, no, we've got 20 seconds. Let's restart shotgun in case it's mad at us We actually set the amount which should actually be a float return status Sometimes Sinatra wants us to say some kind of text for that response by the sombrero, please Please Okay, oh god. Oh god. Oh god Oh What does the alarm that was a invalid credit card number for the gateway if we give it one? Oh No, that would have worked if you want to check it out. It's kind of alpha, but it's actually being used in production in some sites and Yeah, you usually don't get those kind of errors of production your mom site. Thank you So hi Managing projects with a new screen. What is it? No, no No it's this It's a terminal multiplexer lets you Do cool stuff Why do you want to use a new screen you can split your screen if you drop your connection? If you're working on a server your connection drops it persists. It's cool You can also hack like in the movies now screen manager Screen manager builds on top of a GNU screen. It's just a bunch of config files. Why do you want to use it? If you use different versions of Ruby with your projects, this would be helpful like If you start services MongoDB my SQL D rabbit MQ, etc You might want it or if you're using Mac OS's 10s terminal app. You can't name your tabs and that makes me sad Okay live demo Okay, let's hope it goes well, okay, so I'll get a bigger you got three minutes left. Okay. I'm doing good Okay, so I'm just going to clone the template Gives me a bunch of files Just check out Ruby one night So this will load a screen session that's automatically initialized to use Ruby one night one Right now I'm 186 so rails my project and if I want to make a screen session for My project I'm just going to create the file and the first thing I'm going to do is I'm going to Load Ruby one nine and I need to make the font size bigger again. Can you see it? Okay, load Ruby one nine and then I want to Set my caption That's big and ugly, but the Ruby variable gets environment variable gets set so I can have the Ruby in there and then I want it to start MongoDB and script server and maybe spork and Console and bash So, oh, I also have to set my root environment variable. That just tells us green where to go So look at this command right here. It says stuff. This is stuffing key presses into the screen or the bash session and Backslash 015 that represents a return key so clear on that if I save this and I fire up screen manager with my project I got a screen session. I've got MongoDB running and I have script server running. Well, I would but you see it typed it in I didn't want that to launch right away. So it just typed it for me. I just have to hit enter and Etc. Etc. So that's how you can use it. Thank you. Oh Wait, there's more sorry Can I get one of them? Yep. There's the URL github.com screen manager. There's instructions computers not included and That's me Hi there, I'm Brendan O'Connor. I'm engineer honest to God for dirty tricks at Symbol Geo And I want to talk to you about a small problem. We've been facing over the last couple months So we were working on a variety of different interesting projects and we're like well We want to build all these cool games, right? We want to have games like World of Warcraft except in real life We want to be able to walk around and like I'm an orc and I don't actually play World of Warcraft So you're an elf and I pull up my sword and I kill you except like in real life not just screening around and Because it's way more fun, right? Because admittedly this will get the nerds out of the basement and up under the streets Which may not be a good idea, but we thought it'd be fun And so we tried to start building this and we had this problem Which is that we have these wonderful tools like we have Heroku and we have Rails in the cloud for NGD art and the thing is this is all well and good except if you want to do anything That's geo tagged Because all these tools don't really seem to actually do give us any kind of geo infrastructure We could set it up ourselves, but it turns out to be really difficult if you want to do anything with geo you have to go to somebody like Esri and Do you see the prices up there? Do we have this large enough for you to see that this is kind of a sticker shock issue and for a small start up or just Any random individual developers we have a slight problem that this is more than we have so this isn't really good The other alternative for GIS stuff and any kind of data is post-grad GIS Which is great except that it doesn't scale all these solutions tend to fall over once you get more than one cluster And so we decided we had to build our own solution And then we were going to make it so that it would actually scale and that everybody could build games to get nerds out of basements And so we developed simple geo and so you know and we have lots of great marketing copy But essentially what this is it's Heroku except it's just for geo stuff We have four-dimensional querying so yes That's like x y and altitude and time querying for all sorts of cool geo things and why should you care? Why is this not just astrodurfing? Well for one thing we're using every kind of cool new hotness thing We have an actual restful interface, but much more importantly We have a bajillion open source libraries and this is something you can start hacking on right now Not only is it free for developers within a huge amount of actual data stored in But we have access to a huge amount of data that you can't get like the Twitter fire hose Everything that's geo tagged coming from Twitter. We have you can access it all immediately But in addition we have actual people not just random nerds in our basement Hacking on this thing and launching actual whole companies on this in the middle thing You might have heard about sticky bits which launched on Monday sticky bits is built entirely on our infrastructure And so they turned on an extra a couple thousand queries a minute and we're like it's fine But in addition we have cool iPhone apps and yes when all of this code is free And you can all go play with it but in addition we know that there are some really uncool people who rather than coming to a rail A Ruby conference this weekend decided to go someplace to Austin and do something I don't really understand and so if you really want to track what they're all up to we have this wonderful thing You can check out Austin vicariously And so what you can actually do and we built this in like a day or two as you can see every to every single thing That's geo tagged every bump every go all a check at every flicker every tweet etc. I can bore you with details all day that comes in as it comes in live And so you can see that whoa there are a lot of nerds there and they have too many iPhones And so therefore you're able to do all this this is something you guys can start working on at the hackfest tonight If you were looking for a project and thought well, you know geo would be cool But I want to set up three we spend three weeks setting up post for GIS instead. You can come do this We're going to open beta next week, but if you want to get a beta key just come grab me I'm fairly distinctive. I have you know hugely long hair And so you can get a beta key tonight start hacking on our open source libraries tonight and do awesome stuff with geo questions anybody So, okay, so we had like I think 15,000 developers for the beta ping me after this and I'll get you in right now It's real easy. Yeah, we have lifted open street maps. We're going there. I think next week actually We're just hooked into this just as this is the visualization that I was able to do this I did this by myself in a day or two. I mean Like this is really it really is that easy Do we have something terrible going on? I didn't even It's a tweet. Okay. Well, that's the thing of course you play with the live data. You get what you deserve. I suppose Anybody else? Okay, if you want to play with this team you have to talk. Thank you Hello, my name is Jacques. I'd like to introduce an app that's not yet built but is being built and Hopefully I'd like to get your help at today's hackfest on getting it done. It's called rails gen Basically, what it is is rails boost plus plus It's focused on rails three. It has more more options I try to go a lot further with like integrating designs web servers middle middleware and even kind of initializing deployment and stuff so you can just start a new app and You know get all that stuff really quick It's also more social you can vote up the stuff you like you can comment on stuff And you can start a nice flame war about why one component is better than the other you can also collect stacks cratom and We sort of also track like if you use it from a certain URL We'll track that you used it at that time so you have like a history so you can see okay. I use that I want to use it again And you can fork modify and everything This is basically same same usage as rails boost. You just use it from The command line we use subdomains. That's probably the only difference One cool thing is you don't have to actually go to the website. You can just start using them We the the subdomain we parse so if you just add say AR plus ERB plus prototype We'll find all those things and then generate it on the fly as soon as you request it those are some examples there and Development stack. It's it's all open source. That's you the URL Uses rails 3 sass manga mapper host on heroku and Launching tomorrow with your help I'll be at the hackfest if anybody wants to help out get a sense for you know rails 3 manga mapper and stuff It would be a good project to play around with those stuff and anybody contributes We'll get on the credits page on the site Thanks a lot My name is Chris Smith. I'm a rails developer. I live in Salt Lake I spent about a year and a half with Ruby and rails professionally before that I worked in Java and I guess about seven or eight years and I had a really interesting experience moving from Java to rails or to Ruby and I wanted to talk about it and also present the Small open-source project that I've done to try to address the situation. I came across personally so in Java was pretty Moderately hardcore test first developer and I say moderately because I've always been fascinated with the Sort of the the human factor in programming You know like if you're not doing the right thing the thing that everybody thinks is right And you think you actually believe is right to yourself There might be a reason for it. That's good. There might be reason. It's bad. It could have to do with Not having the right short-term incentives not having the right incentives period or just question self-discipline or habit all that kind of stuff and I've always looked at myself as sort of my own My own case study or guinea pig so The first thing I did with test-driven development years ago was I decided I want to get over the habit question So I just forced myself to do it for a long time And that that gets you pretty far Part of that process I think is also reducing the barriers. So it was a matter of getting Tools in place, you know so that your startup time if you want to start writing tests It should be almost instant, you know if you want to run them It should be in so you should you should try to cut down any barrier that you run into that keeps you from doing this thing You're you're testing has an idea of what the right thing to do us okay, so I was doing really well as a test that TDD person, you know and Always firing up J unit or something like that to write tests to see first of all Classic reason to sort of like design through testing to find an interface from the client's point of view that kind of stuff But secondly also just to explore code, you know, so I'd be sitting with somebody on my team and they would be trying to understand a complicated library like a date library, you know and Testing it out through the application through the web app and I'd say wait wait wait wait come on come on We can do this another way. We can write little tests. It'll tell us right away It's better than even reading the documentation. Sometimes we'll just you know fire up to unit We'll start writing some tests for Java util calendar. We'll see what the thing actually does Let the computer answer the question in fractions of a second so I always had this great motivation with legacy code, you know New projects that came across libraries. I didn't understand lots of things to try to Close the feedback loop as tightly as possible and write tests and then sometimes some of these tests were worth keeping or they Got moved into into the production code, you know You'd puzzle something out and then you move it into a method and you move it into your production code and you keep the test But anyway, a lot of a lot of good testing came out of that Not the majority not as much as if you're designing doing it test first But certainly if you're coming on to a project late and you spend a few weeks getting to know it by writing tests You get a lot of tests out of it and some of them are good to have Thanks. Well So when I came to rails and Ruby I discovered the console and all that motivation evaporated I'm like this is better. I'm swimming in the code. I'm in it and the only thing that was missing was anything afterward Though that five percent of expressions you might write that you actually want to keep or capture in some kind of test Weren't there. So that's what this project which I've been working on for a few weeks is about It's simply a test recorder for IRB and If you look at my SRB it just requires ruby gems and butterfly net IRB Load it like this give a name Start with the variable Maybe expression here and we'll just exit You know I it you can you can tell it when to you just type a m and tell it when to make a new method But in this case it's just one method And you can run it And then work That's it. I need help I Need help this is right now You know like the fact that it doesn't do an assert around that variable assignment that kind of stuff is based on regular expressions It it doesn't have a you know, it doesn't really parse the code. I could use some help Here's my email Again touch with me I'll go to the hackfest. I'll be there. All right. Thanks This is not exactly ruby. It's a it's a project that I personally think is freakin awesome This is a language called coffee script. Okay, it's it's basically just a Syntax that compiles down to JavaScript. Okay, so every statement in coffee script Compiles straight down to JavaScript It gives you a lot of nice things like a lot of nice operators like extends for example You know the fact that it's got a lot of similarities to ruby, which is why I'm talking about it here Like every every method has a return value and you don't even have to say return You know what I'm saying that that kind of stuff that comes from ruby like everything is an expression, right? It's got let me let me just show you kind of some some little code that I wrote here, which was kind of You'll kind of see some similarities to ruby, right? So we've got a class here Called sombrero, which is ridiculous and then it's got a method called dawn, right? Here's how we know it's a method ding What happens when we don the sombrero? Then we've got a person class right here. We've got our little methods We've got our instance variables. These look like ruby, right? We've got method declaration without You know the little the little parenz for the for the you know for the argument list And then you know we've got like if statements here this looks a lot like ruby You know without using your parenz for your for your you know true false testing here We're extending here We've got super capabilities I mean this is this is like phenomenal stuff if you're talking about when you're talking about javascript like javascript I'm sorry, but it I hate it like no, I love it like I do a lot of it But it's kind of like because I'm half due because that's I don't have any choice. But anyway Coffee script so it's like right now. It's just for fun, right? It's just like yeah, this is kind of fun to add this This you know syntax, but then you look it compiles straight down to javascript, right? So the javascript code is kind of nasty you have to do like because you know javascript doesn't really have extends So you kind of have to do this, but I mean it totally runs No, oh lay So You know it shares a lot of similarities with ruby the probably the coolest thing about this project is the Lexar and the grammar are written in Coffee script so it actually compiles itself So it's like yeah, dude like usually when I'm like playing around and I have something for fun Like I don't go to those lengths, you know like to actually write a Lexar for my own for fun language like you know And we're talking about like we're talking about documentation check out the documentation on this project We've got the inline Documentation is pulled out right here, and then you've got like the code right next to it here By the way, this is the grammar file that's written in coffee script So it's an amazing language compiles straight down to javascript You know there are a couple of other people doing like things like this like the objective J project in you know In particular it comes to mind The only drawback with that project is everything is actually Lexed and parsed at runtime, right? This language will compile straight down to javascript because every statement compiles to javascript, right? So you compile it ahead of time and then the client just downloads the javascript, right? So it's it's actually faster. You don't have like the spinning thing that you see when you get cappuccino apps I'm a big fan of cappuccino, but I'm just saying it seems to me like this is a little bit nicer approach Anyway, it uses jison for its compiling which is kind of like a javascript bison But anyways coffee script check it out I'm seriously loving in this language and I think ruby hackers would would really dig it as well, so oh All right. Hey everybody, so we're gonna create a app to nap real quick. What you guys want to call it? I'm gonna call it Mountain West RubyConf demo because I Hey look that's available So I'm logged in as some user that's not really me called j ruby for you so Hope for that will work and it said hey you've got a dashboard great So I've got a dashboard now. I'm going to go over here, and I'm going to Can you guys see this so if you were to install the gem by typing pseudo gem install Google App Engine you could say app config Generate and I'm going to call it Mountain West Ruby Conference demo Oops Okay, so what it's doing here is it's going to Create a folder called Mountain West Ruby Conference demo. It's going to Copy over some jar files that I need out of my MRI gem area, and then it's going to Parse my rack up file that I generated to generate some XML files that I don't look at and now it's going to oh there It is so if I go here Oops, I think we should probably see you in that directory So I've got a config file here. This is hello, and if I run that under the dev app server It's a local Java basically a jetty server running So I get a server without Having to install it there. It's running a local host so There it is it says hello, hopefully yeah, so that's the app that I created now if I want to publish it I would type something else. I'm going to type control C. I'm going to type app config Update and because I haven't done anything is this fake user. It's going to hopefully if I have some bandwidth connect Yeah, there it goes. It's saying I'm using only gem. I'm going to Log in as that user and as long as I'm using Java 1.6 it will not echo my password So if you see your password being echoed you probably want to switch okay, so now it's updating the app and If I were to go back to It's deploying okay, so there it goes now if I go to my dashboard I can see I have a bunch of things in here like versions. I have a version of it running here's the latest version and It's loading now. How much time do I have left? What's that? Okay more than a minute so Okay, so I'm not sure what it's doing there, but you know while it's doing that So there's my app says hello. It's in production. I don't know if you guys can see it's basically showing the latest one But so I have one minute. Maybe should publish a rails app. I don't know. I could probably do that in a minute So if I want to do that I have a little instructions here There's a curl script that you download and if I paste that in here It's going to download my little script that says go grab some files You need to patch in and then also run rails And there it goes. I so I basically just install a bunch of gems You can see I'm using data mapper. It's packaging the gems right now It's basically is taking bundler and saying bundler go grab all the gems stick them in one jar file and throw it in my Web inf directory so the gems are actually installed into the app and as long as I have time here I can publish this now. I could also create a controller with scaffolding and it'll work with with my validations and stuff like that so Now it's actually it's actually firing up j ruby to parse my Configure are you because it's it needs to use Java sometimes to do that because I can put middleware in my configure you Okay, there it goes. I'm going to publish it real quick So I just generated the rails app and now I'm going to update it again. Oops. You know what I need to do this Oops, I'm not really controlled so you get I need to change this to say Mountain West Ruby conference because I blew away the old one I had Okay, all right, so I changed the configure you the configure you and if you guys saw it really quick It basically has some middleware that says my apps called this and it has this version and it also calls the the rails dispatcher We decided to stick everything in the configure you so you do all your configuration configure you We parse that we then generate the XML files you need if you go touch the XML files We'll just blow them away. Anyway, we don't want you in there There's nothing to look at so now it's republishing the app and It's it shouldn't take too long because it is It's going to basically look at all the jars and stuff that I have and do a check some on them and upload ones It's never seen before and since I've published other apps. It's possible that I'm just having to wait for it to configure This pre verification step that we do so we'll wait for it What's that? Okay, so There's actually something that's going on here. That's kind of interesting anytime you have Java code in your application the Files get uploaded and it pre compiles them for you and and sort of validates them And so that doesn't have to happen while they have spinning up Also, it copies anything that's in your public directory off to a set of caching servers So you just deploy your app like you normally would and and don't worry about Pushing it off, you know what I think I may have If you publish sometimes when you publish and you stop it gets messed up. Well, anyway, so are you thinking our network is like hung up? Yeah, so I have no network Okay, well anyway, that's all you have to do. All right guys, that's it. Thank you very much