I've been working on a new version of what's going to be the next version of Revenius that lets you do actual concurrency. So this is basically a straight dig at Blake's Talks yesterday about Ruby not being very CPU concurrency.   Okay, so here we go. So this is a script right here. This is what the script looks like to slowly for your edification. It's just going to loop here. It's running this script that is called Gilwind 2. And we'll go look at that script in a second. So right now it's basically just doing a simple numerical algorithm for a large range of numbers, adding them all up and doing some very simple transform on them. And the idea is if you take that large range of numbers and you split it up between threads, do you get any, do you reduce the amount of runtime? So are you able to actually process individual chunks of this range independently? So on MRI right now you can see that it's basically negligible. This is the column we're looking at here folks.  We're not doing, we're not getting anything out of it. It's just a total fail. So we'll just cancel that as you can see where I'm doing up to four threads. So there we did three threads and it didn't get us anything. So we're just going to forget that. So the current version of Rubinius, which is 101, I'm going to go ahead and I'll just let it scroll off the top. Okay. So we're going to run it again right now. And this is the 101 version of Rubinius doing the exact same workload. And this bar over here is the CPU meter. And I've also got this number right here. And you can see that we're for the most part only getting one CPU bar up at a time. And if you glance over here you'll see that we're only getting maybe up to 100% if we're lucky. Otherwise it's like 99 hovering around there. Is that really it? Okay. So while the other person comes up here you can see. All right. You should give them a 30 second warning. So I could have just jumped to the end. Sorry. I gave 10 because you were tight. But yes. Yes. All right. I got a brief moment. I just want to say everybody having a great time today. No, no. Come on. Can I hear you? Everyone having a good time? Everybody say a very special thank you to Josh, to Jim, to Leigh Ann, to all the other organizers. Thank you all very much for doing this. Come on everyone. Give them a hand. So I'm here to talk about Ticketmaster, which is about taking control of your ticket and project management systems, which, you know, they're kind of unruly. First of all, my name is Ron Evans, IKADed program. I'm with the hybrid group, we're a consultancy based out of Los Angeles. But here I'm here to talk about you guys. You're all different and our clients are all different. And they have a lot of different needs. But there's one thing that they all do, which is they somehow manage and control the projects that they're working on. Often they maybe are using your typical agile board, right? Pieces of paper, notepads, whatever. Some of them are using software like this well-known piece of software. Others, this, lighthouse. But the problem with your consultancy that has a lot of different clients is it turns out that a whole bunch of them are using every different system and ones you've never even heard of. What do you do about it? You're trapped. You have to use whatever they are using because they're the client and you're the consultant and they're paying the bill. So what do you do about this? Well, we created something called Ticketmaster, which is basically a universal API to ticket tracking and project management systems, kind of ties into the workflow thing we were talking about. Here's a very brief overlay of it similar to your database connectivity. You've got some providers that talk to the different back end ticketing and project management systems. You can talk to that through your application for our API through the command line interface. All right. Cool. Let's look at some code really fast. All right. So here's a very, very basic, simple one that is designed to open up the lighthouse provider and then iterate through all of the projects that are associated with your account and just dump them out the ID and the name. So pretty simple stuff. Let's look at something a little more different. You can set up a particular API key in a configuration file that's either per project or on your machine. I didn't do it per project because that way I switched to a client project. Everything's already set up for whatever project management or ticketing system they happen to be using. So here's another simple example. This one is using Pivotal and it's just opening up the last project in the list of projects and then iterating through all of the tickets saying the ID and the title. All right. Well, that's cool. Yeah, right. Okay. So now let's talk about something more interesting, which is I would like to take all of my Pivotal tickets and move them to lighthouse. All right. So we're going to open the Ticketmaster Pivotal and Lighthouse Providers, open the Pivotal project, a particular one, open the Lighthouse provider, create a new Lighthouse project. And then for each of the Pivotal tickets, go through and create a new Lighthouse ticket and then copy the comments in. All right. That's very cool. We want to do that migrating from one system to another. In fact, that's such a typical use case that we have made it with a copy, deep copy, which will copy automatically all of the information from one project to another because this kind of migration or synchronization is a very typical scenario. All right. So what can you do with all this? Well, we currently support Pivotal Tracker, Lighthouse, Basecamp, GitHub Issues, Unfuddle. People are working on JIRA, other back-end systems. It's very simple. You only need to derive from four different classes, the provider, the project ticket and comments and voila, you're speaking to your back-end system whenever it happens to be. And so we want you. That's right. You guys, because we need help. It's an open-source project. Try it out. See what happens. What's the worst that can happen? Help us fix it or just tell everyone about it. Come on. Start tweeting. The revolution will be Twittered and it's all about Ticketmaster. Thank you guys very much. For more info, go check out ticketrb.com and thanks. Thank you so much, Ron.  Nice. Next up, we've got Pete Ford in the Impossible Project. Am I on? Yes, I am. Hello. I'm Pete and I'm from Toronto. I'm from Canada and I'm from Unspace. Who's from Canada? Okay. So this is not a talk about Ruby. Who here?   Hold on while I focus on infinity. Let's go there. No megatrons over there. All right. So how was I just able to do that? Because you might have heard that the Polaroid Factory has all got shut down. Of course, there was a lot of dirty politics involved that most people probably didn't hear about. What actually is interesting is that at the closing of the factory in the Netherlands, this guy Florian Kapps, who's a personal hero of mine who similarly to I has been bit by the analog photography bug, he went and got drunk with these guys who were running the factory. They were careerist factory workers who put out Polaroid Film and they all got told to dismantle all their equipment. And this guy basically was able to get them drunk and thinking wildly about what would happen if they were able to maybe get a lease on the factory, reinvent some new film, hire all the dudes and relaunch it as a niche product. This of course speaks to me because if you were around me in Toronto during 2008, this is actually what I was pitching investors on at the time. So I'm a music fan and I always say that there's two types of bands that I love. There's bands that I wish I was in and there's bands that I'm glad they're doing it so that I don't have to. And moving to Netherlands and moving into a factory and restarting Polaroid production was something I was kind of willing to do but I'm really glad someone else did it for me. So basically this is a fascinating open source project. It's not software, it's film. These guys literally could not continue to make Polaroid film. It wasn't just a financial decision. That was a big factor in it but they ran out of the raw materials required to make the stuff. So basically they had to actually sit down and create from scratch an entirely new chemical process. They gave themselves a year. They almost hit the mark. I think they ended up launching in March of this year and the picture that I took just now is from the very first box of the very first batch of their first color film. It's developing in my pocket. Unfortunately it's still very beta. It's light sensitive. So I say that it's an open source project because they are handling it like an open source project. They are appealing to the hearts and minds of people who will pay expensive amounts for the film and test it because it's still very very unstable. So that means that if I don't keep this dry, if I don't put desiccant in a box and dry it out for about two weeks after I take the picture in a month, I won't actually be able to see you find folks that I took a picture of. But the thing is is that they're sort of embracing their faults and actively soliciting feedback and they're saying, listen, we have flaws. We're still working this out. But with your help we can all sort of reinvent this new analog film dynasty together. And I'm really sort of proud to be sort of a part of this. And I'm encouraging you all. You can get these cameras for under a hundred bucks on eBay. It's gorgeous. I mean look at the design of this thing. This is like an Apple design but like before Apple.   But if you've been noticing over the past couple of years there's been a lot of like SLR showing up at conferences. I'm not entirely sure what all of you all are taking pictures of but maybe next time bring one of these because you might actually have a lot of fun learning how to use light and you know catching the totally bizarre random moments and the weird chemical deficiencies of the film that they're pushing on us. It's all a lot of fun. And honestly if you end up hating this process just come back to me and I'll take whatever film you have left and refund you the money out of my pocket. Have a good day everybody. It's fun to say thanks to Leia because honestly Leia walks she's back there. I kind of is it inappropriate to ask for like a standing o? Next up David Stevenson on the fixture builder. Okay I talked last year about Sandbox and Groovy and today I'm here to talk about something actually more useful. I work at Pivotal Labs and we do a huge number of projects and about two or three years ago everybody in the Rails world was using fixtures and I think everyone here is probably familiar with why that was a terrible idea. The biggest problem that we encountered was they're totally unmaintainable and they're a hundred percent wrong almost immediately. The amount of work you have to spend to keep your fixtures up to date is just impossible to maintain in a system that has thousands of tests. But the real good thing about fixtures is that they were fast and they were really repeatable because the data was codified in these files and it didn't change unless you changed it. So then came factories and we have Factory Girl, we have Fix Jor, I'm sure there are others that I don't know about and I thought factories are really amazing until I had about a thousand tests using factories and then my test suite is like an hour long and I'm having to figure out how to paralyze it and I'm having to do things to make it go faster and so I learned that you can make it go faster. All you have to do is maybe not save your file and not save your records as much as possible, keep the number of objects down to a bare minimum but that sort of kept when against the principle that I could just throw together some factories and write tests but it did give me all these advantages, right? It was really easy and it was maintainable and it was flexible and it was always accurate because it used the models that I defined an active record to come up with the data. So it solved all the problems of fixtures but it brought its own problems and that it was too slow. So just to remind everybody, okay here's here's an example of a test written using using Factory. We're factoring up a product and doing some validation against it. It's kind of a naive test because we're creating like 10 objects in this before block here. This is just an example of how you could use factories maybe poorly to generate large amounts of data. This is guaranteed to get slow over time. If I were to write the same thing with fixtures, I would say at the top I'd replace that product with a particular product from my fixture file and this would go much faster. I wouldn't actually be saving any objects throughout my test so good news but I would have to maintain these things myself. So enter a fixture builder. We're going to use factories to generate fixtures. We're going to define a block of code. That block of code is going to generate large numbers of objects any number of objects we want and then at the end of the day that's going to be serialized. So block of code looks something like this. In the middle part of the screen here you can see we're defining a product maybe two products some variations of those products. As soon as that end is hit the state of the database is serialized or actually we run our test first and you can see it says building fixtures and builds products.yaml and variants.yaml. At the end of the day outcome the fixtures and fixture builder does some cool stuff like figuring out how to name your fixtures based on fields that it recognizes but getting back to this it also modifies looks at a particular sets of files for changes and decides when to be smart about rebuilding its fixtures. So we've brought this into several of our customers at Pivotal and we found that it's really easy if you start from the beginning but adding this to an existing project is very expensive you have to go through and normalize all of your tests. So the reason I'm preaching it to you today is if you add it at the beginning of your project you'll be much happier than if you have thousands of tests that are using factories and running extremely slowly and you didn't think of this. See if I have anything else. No thanks here's the GitHub URL. While David's changing over next up we've got Noah Gibbs who is getting rid of Java and who can't get behind that really. That's me. Okay so he's good enough to let me use his laptop since my 1-2-1 is not working. I work at onsite.com. We had about an eight-year-old legacy Java and JSP code base running on Tomcat and we switched over to JRuby for pretty much all of the new stuff for anybody who might want to do something similar or if you've got any friends that really need to kick their Java habit this is a little of how we've done that. So JRuby for those who aren't familiar is really really good for calling methods on Java objects from Ruby and just a very quick summary there. Is that code at all visible to anybody? No it's not the size. Yeah no it's the color. The colors. No that's not. All right. All right so I have like four minutes. You can import things directly you can create new Java objects you can call methods the way the method name conversions there works is visible. So chances are very good your Java code base is already written as if it were you know with models you've got objects that read from the database that do your validations that look an awful lot like active record models in terms of purpose. It would be really nice if you could switch to active record but in general that's going to be a harder sell because you're going to have to rewrite a lot of validation logic. However if you've got JRuby then it's still not at all visible. What you can do is you can write an active record wrapper that uses your existing tables your existing sequences not your existing logic but you can write wrapper functions around that that will call your Java that will do a that will wrap it in Ruby objects and as a result you can write your new views. So in addition to our existing JSPs we've added a whole bunch of new views and all of them what we do is we write them as regular Rails views except that our finders are basically Java. You wrap it in an active record instance like this and all of the validation logic is done in Java. You're writing through to the Java objects you're using finders from the Java objects we do it in a couple of different ways. The advantage doesn't actually end there because once you've done that you can take active record objects either these wrappers or other ones for your tables you can declare a Java interface use them there and you can essentially swap out the entire former Java object you can call through to Ruby from Java. I'm sorry can you speak up? Oh, good viewing. Sorry, do you want to do what? Okay. Sorry. Okay, so as a result you can basically swap out your large Java app piecemeal you can start with the views you can move on to writing supplemental models that exist alongside the Java models or you know new stuff that exists in addition to the Java models including using them where necessary from Java and that lets you go through and you can do the rewrite eventually you may not have to do it all you may want to do it all but for those of you who haven't looked into JRuby this is very much the the expected use case works really well we've had a really good luck with it I'd be happy to talk about the details to anybody. In general Rails is easier to write views in you get much better caching when you start switching to it for an active record and you'll have a much easier time selling it to the business people if you can do it piecemeal like this so look into it it's worth doing if you're trying to get rid of Java. Let's see how long do I have left? 13 seconds. Awesome. Well then you can also use Ruby for testing even if you're testing the Java stuff again look into JRuby it's awesome. Next up I'm on Gupta talking about perftools.rb. Hey guys my name is Amon I go by TMM1 on Twitter I did a talk called debugging Ruby at Lone Star a couple of weeks ago I'm just going to do a five-minute version of that talk. The talk is basically about debugging tools and tools you can use to figure out what's going on in your production systems and I'm going to focus on my favorite tool in the talk which is perftools. perftools is a CPU profiler that Google wrote and uses so there's a bunch of information on here about how to get up and running but the cool thing is basically it gives you a profile both in text format and in a nice visualization like you see on the right and the cool thing about this is you can just take a look and the boxes that are the biggest are the functions that are taking the most amount of time or the most amount of CPU cycles so it shows you what to focus on what to try to improve so I run this on my Ruby processes this is a C level profiler so it gives you information about what C functions are being called a lot which can still be pretty useful so this is something I ran in production on one of my Rails applications and it showed that the function RB store sub bang inside the VM was basically it was spending about 10 percent of its time in that function and I was able to trace that back to the timed out parse function and figured out that all these mysql day times were being parsed in Rubyland and eating up a lot of CPU so this was really useful and what I wanted was instead of seeing C level functions in this output to get Ruby level functions instead so I created a project called perftools.rb which is the Ruby equivalent of perftools again some information on how to use this but say you have this simple scenario application that has two routes one which is compute heavy so it computes the Fibonacci sequence for the first 10,000 numbers and one that's sleep heavy so it spends a lot of time but not necessarily on a CPU it's just called sleep so you can profile this and you'd end up with graphs like this so you can actually run perftools rb in two different modes CPU mode or real time mode so on the right you can see CPU mode and of course the compute action shows up at the top because it's using a lot of CPU cycles but if you run it in real time mode you see on the left sleep shows up at the top because even though it takes longer even though it's not using as much CPU so I've used this on a bunch of open source projects the reddit.rb the first couple versions use system timer and every single read and write that showed right away that there was a lot of overhead associated with that you can run this on ruby gems and see where it's spending a lot of its time it happens to be in file system access trying to figure out what directories and files exist I ran this on bundler recently and found out that a lot of time was being spent in gem version spaceship about 23 percent of time and so with a little a little bit of optimization micro optimization to that function we were able to increase the overall performance of bundle install that patch is going to be the next version of ruby gems I also recently added an object allocation mode and so you can just set this variable and basically instead of cpu cycles each box represents the number of objects that are allocated inside that function and so again this is on a production app and you can see that the date parse function was creating tons and tons of objects about 15 to 16 percent of all the objects created were being created in that function and so recently we're switching over to my skill too since that moves all the date parsing down to c and gets a bunch of objects as well as cpu overhead so I encourage all you guys to use this and the easiest way to do this is with a project called rack perf tools profiler and all you have to do is in your rails application you can pull in this piece of middleware and it just adds a bunch of urls that you can just start visiting to start profiling your application the easiest one is all you do is on any url add profile equals true and times equals some number and it'll run that action that many times produce a profile and in your browser spit out that gift right away so uh that's my talk uh there's a lot of other tools that I covered tools for linux like s trace and l trace tools for c like gdb tools for networks like t-speed dump and ngrab uh cpu usage stuff memory usage stuff and all these slides available on uh squib you can go to bitly slash debugging ruby awesome next up john woody woodell he's gonna talk about dubious okay so you can see that okay guys uh so i'm gonna tell you a little about dubious dubious is something that lets you basically mix in servlets into your rails app without having to get grossed up by writing much java code there's a project here called mira dubious and i tell you go bring down a bunch of stuff and run it right out of there there's no gems or even versions um and if you run it uh you know there's a little drawer here that opens up it's actually using jake where you're not prototype hopefully that's okay and it just tells you the versions that you're actually running there uh and so i have a little trip app here that i created and i you know want to create a little app here i can pick a date i'm gonna say go ruco i'm gonna say it's that date that's wrong date okay so um so i have that little app running locally and because it's running an app engine i can run this little a h thing and i can poke around my data it has a built-in data viewer if i want to modify the app for example i am going to control c out of here we do have a continuous integration thing running but it's a little bit tweaky so instead i'm going to go over to this guy here i'm going to go to here all right so i'm going to jump in here and grab a change you want to make i'm going to go to my model i want to put timestamps on it so i have some timestamps here that's basically what i need to do for my timestamps app models so there's my model you see i'm importing some java classes we're cloning can you see that all right how's that guys all right so i'm uh i'm cloning kind of like the data mapper style and importing any any class that i mentioned and then anywhere down here i can import that paste that piece of code that i copied so you notice i'm also creating something where i take a url from basically from google docs and convert it i also have this little hash that i wanted to put in there and if i want to look at that i can go into my apps views trips show so my urb template looks kind of like that now technically it's not urb because it's mirra but it looks all like urb that's kind of gross looking template but that's that's what you saw now i've just made a couple changes well i've made a change my model i'm gonna actually i'm actually going to compile it so what's happening there well it looks at that model that i had and it takes those properties and expands it out to a bunch of java method calls that i need in order for it to uh talk to java in fact it looks kind of like that it just generates a bunch of gross java now technically i don't have to look at that that's i can generate that if i want to see what's actually going on oh no it's done so if i go back to my script server i can see that it's running and if i go back over here now you might notice there's no timestamps on here i've got some attributes but no timestamps if i go back in to this and i am i running locally yeah i'm gonna go in here i'm going to just oops i need edit it i'm going to save it and then i should see in this other window here that now oops now i have uh entity types i should have this new timestamp created at that got created so i just recompiled it now how much time do i have one minute fifteen one that's enough time to publish it why don't i just go publish it with the heck so i'll go to this browser here i'm going to say go garu kodemo and i'm going to copy that i'm going to create it out and then i'm going to find my terminal again which is somewhere there i'm going to cut out of there i'm going to i'm going to edit my app config oops i'm going to tell it that in fact i want to be something called go god did i type that correctly guys go go garu go did i type that the same way yes fifteen seconds attention and oops oh four three two three go check it out it's published in a second great job woody thanks so very much next up is seth lab with smart browsers okay how's that my name is seth lad i work at google and i love ruby so i'm glad to be here we're going to start this with a little audience participation so the question i have for all of you is if you had to pick you know client approaches you today and you had to pick a mobile platform to develop for what platform would that be just yell it out iphone iphone a little bit android thank you okay good okay moving on uh so and why did why did that come right off the top of your head just yell it out like why why'd you pick that money what market share what it's good it's good okay so yeah great you know rich sdk yeah market share there's an app store people have them uh just a really great user experience right okay that makes that makes perfect sense here is from quarter one 2010 look at the market share 28% fry phone so you just said that i don't want to help 72% of potential users out there and yet you were totally okay with immediately saying iphone and thank you andra so uh i would like to say that i'm not exactly here to say that that's wrong i think that there's a lot of good reasons why we made that choice but you have to understand what you just said all right so i would like to say that that exact reasoning and logic should apply to how you approach web development and i think you should think about browsers as smart browsers just like you think about some phones as smart phones okay and for the reasons that you target smartphones should be the same reasons you should target smart browsers all right now and i think it's perfectly valid i want us to kind of flip the way we approach this why is this possible today of course html 5 tremendous amount of rich apis that are available to you for these smart browsers that give your users a very great rich user experience the type of user experience that you can monetize so some of the functionalities out there audio video obviously webgl for 3d speech to text text to speech file apis web workers desktop notifications canvas svg fonts geolocation device orientation all of this stuff is now becoming available on the rich web and in smart browsers you should target smart browsers this is your delivery platform okay let's look at some demos real quick first year device orientation available today and i just messed that up sorry about that okay this is just javascript listening to the device orientation apis present you know in in macbook this is on webkit so this is css with 3d transformations there is just a smidge of javascript here in this demo this is all css this runs on your ipad no other like complex javascript program anything this is just showing you what is possible with just using the facilities of html 5 and our smart browsers your users are going to love this moving on okay so the point here is target smart browsers first gracefully degrade okay so for example you don't have to like kill yourself trying to get rounded corners on ie6 just not worth it they can see square corners everything's going to be fine just use border radius move on okay so here's a great code that i love what would you have me do spend my time hacking around issues and older technologies like ie6 would you like me spend my time making the site look the best that it can on better desktop browsers as well iphone ipad touch ipad black grey and a host of other mobile devices this is the message we need to take to our clients they will understand it especially if you sell them on these are smart browsers okay so what about ie6 chrome frame is a plugin that you can install into ie678 that is your escape patch this is your this is your ticket out of the problem it essentially embeds chrome rendering engine into ie you just send a header or event attack great turns it on prompt your users to install this they know plugins they understand a plugin this is a plugin that solves your problem okay one more great demo this is indeed a ruby conference 15 this is ruby running in the browser using native clients this is possible today you don't have to use the only javascript although we love javascript check it out okay native client go get it ruby all right thanks so very much staff awesome next up is pat nakajima hello pat nakajima the name how many of you guys use cucumber okay how many of you guys love it and hate it okay cool um so i say screw cucumber nah just playing but not really um my twitter is nakajima my github is nakajima i work for a company called root me we do group text messaging which means that like cucumber kind of breaks down a lot of times um problem with cucumber are step definitions you basically have these you kind of default web rat you ones that work pretty well right um they don't only bother you but if you know about life you know things fall apart and especially we're gonna be working with text messages or just all sorts of things that are not like you know in the browser uh you get kind of things like this let me resize that uh can you see that given a group with the number four eight four blank uh when the group adds pat and the group adds damian with those phone numbers uh uh oh the problem there is basically group is an instance variable and when you use instance variables in your step definitions you're going to feel pain um so you can do something like this uh given a group with the number four eight four one two three then you can parameterize your steps and say you know put the the groups number in there every single time but that's getting so long that you can't even see the rest of that line so you parameterizing steps equals pain so no instance variables and no parameterizing you're tearing me apart cucumber the solution as we found it at ruby is to inline your step definition which basically means ripping out cucumber it looks like this uh given a group with that phone number under that we do that in comments we do all the features in comments and then under each comment we just write a little bit of capybara to or just you know code to you know express that in code um and really that should be readable enough anyway if you're writing your code properly it should just look like group dot ad pat group dot add damian things like this what about web steps you can use stake uh you don't have to use stake it's uh you can find it there on github but uh stake is basically just capybara okay um so then like people are like oh cucumber's still pretty awesome because of my business guys they can read it they can they can write it and what i say is uh you know they can still write the feature files you just turn that into comments then you write the code it's your job and you're good at it thanks a lot any questions two minutes flat oh question comments arguments awesome what up all right all right i'll talk to you later also if you don't get a chance to hear about blake's thing it's way cool round asking about it all right okay coming up next nathan eskenazi and thomas schaefer talking about terminator my name is nathan eskenazi and this is thomas and three days ago we created a gem that we thought solved a very simple problem earlier today you heard a lot of excellent review developers talking about their workflows and and so everyone has a different one but everyone has a workflow and so what this is about is automating a workflow making it a lot easier to start it up safari has to update and bam you have to restart your computer everybody loves the situation uh so after you're all set up you need to save this and somehow be able to get back to it quickly so the three points about the computer programmer are these three and we're here to tackle these two that's right impatient and laziness both very important virtues as a programmer and terminator helps to help you solve those very quickly when it comes to booting up your workflow for every single one of your projects on a per project basis that's right so it's actually really easy to set up it's about as straightforward as you can get you install terminator you type terminator create and you name it you name your workflow and then you can essentially define commands to act on the current directory or on any arbitrary directory essentially this is the exact same thing is just doing it manually except you just define it in a file this is yml but we have a full review version coming later using blocks and tabs yep so then you just terminator start yeah and i want to know right there it only shows tabs but we're actually in the middle of also releasing a feature for windows as well as arbitrary tab names that you can actually set right in the script file so there's actually very few commands here it's extremely straightforward you can create workflows you can start a workflow you can delete your workflows and you can get a list of all your workflows i also really wanted briefly to mention that i actually created this while i was working on i'm the creator of a framework called padrino and it's actually a synatra-based framework that gives you full stack support for a bunch of different rms and essentially creating whatever websites you want in a sort of alternative way to rails so i actually built this while i was working on padrino because i was forced to restart and i was like this is the last time i'm gonna have to set up my terminal like like my set of tabs so i was like all right i'm just gonna script this up and now i just have to terminator and it sets up automatically excellent thanks nathan and thomas next up is jim pulse with what is coffee script quick show of hands how many of you know coffee script is already okay okay what is coffee script answer nothing i wrote or even contributed to but it's something that's cool it's out there that i found that i think you guys will love so um so far this weekend here's what we've heard we've heard this guy say i find it kind of a pain to write javascript i'd rather write ruby heard this guy say most of us have two hammers in our toolbox ruby and javascript we've had this guy say i write almost as much code in shell as i do in ruby and javascript there's a theme here all of us aren't just ruby programmers we're ruby and javascript programmers and then you've heard this guy say rails 3.1 will serve your coffee script as you templates and some of you were probably like wait what is that so coffee script is kind of like scss or css or hamel for your html it's a wrapper language the little language compiles into javascript it wraps javascript in a nice pythonish rubyish syntax it's kind of really cool so let's take a look this is shamelessly lifted from coffee script.org verbatim i'd not write this even myself so to assign things it looks just like javascript you can do string interpolation in double quoted strings just like you can in ruby you can do interpolation in regexes too because you know we love doing interpolation in regexes awesome you can put if statements at the end of the line just like in ruby that's kind of cool functions just have parents are on the arguments and then a little arrow and then the body of the function notice no return statement it just returns the last value just like in ruby arrays look just like in javascript objects look just like in javascript but notice commas at the end of lines are optional notice parenz around function implications are optional you can do splats of arguments you can get all of your arguments slurped up into an array you can do a rick comprehension like in python there's an insistence operator that tells you if a variable exists and just to be clear about this this turns into the javascript that all of you hate to write because you write it so often if type of elvis is not equal equal undefined and and elvis not equal equal null then do that so it's pretty cool um q flame war how many of you like to simulate class based inheritance in javascript awesome um so it's got built in simulation of class based inheritance in javascript uh notice uh there's an at name this is like an instance variable that compiles into this dot name notice also this constructor function uh is has an empty body because constructor functions automatically apply all of their arguments that have at in front of them to the appropriate instance variables with this it's cool destructured assignment you can actually assign the return value from any art any uh expression to a complex data structure just like in ruby notice object literals the curly braces are optional how many of you hate writing dot bind this at the end of all of your inline function declarations so if you notice if you do this with a equals greater than instead of a dash greater than it does it for you that's pretty cool and that's all you can learn more at coffee script dot org again this is nothing i did but it's still really cool and yes there's all the tools you need to integrate into your variables it's awesome excellent thanks so much next up we've got shane becker it's his birthday doing better presentation slides i'm shane becker i got my vegan straight edge that's my user picture you've maybe seen me around i make websites for fun and profit this is uh the man that i work for i made the rubinia site i used to live in seattle and i was part of this thing i made that uh evidently i've recently started seattle or of yourself your slides are bad bad slides crash shuttles space shuttles i'm serious these are 10 things that will make your slides better i'll be pointing some fingers because i've had a little bit evidence the past day and a half use big text really big text as big as you can get away with and what helps you get to big text continuing abhi's idea this morning is no text well maybe not no text of course but less text seriously don't do bulleted lists your readers get ahead of your audience gets ahead of you they're focusing on what i'm not saying high contrast haven't used black on blue and it looked like this it was hard to read assume that that thing that's far away with the lights on is half as bright as this thing use use contrasty colors ruby doesn't scale we all know that so by transitive property slides about ruby don't scale so don't run your text all the way to the edge the two talks ago the really the two minute one was awesome real centered slides but his text went all the way to the edge and got cut off on the left otherwise it was totally red if you're at the movement of your content doesn't mean anything ryan davis don't move your content it's hard for me to follow but all these slides have been black text on white background that gets boring in the audience so mix that shit up a little bit maybe while you're talking about mailers they're all in red and then when you move to test they're all about red whatever you group them together also that was some alliteration humans are good at small tables not at big tables like use charts let's see if i could do this here see this right there we could see a pattern humans are good at visualizing patterns that we could see not in tables like i like helvetica i like it tightly current i like it bold i like it big i like it spaced out yahuda likes museo i love museo it's really great brian used comic seraph yesterday that's also a great typeface don't use these please definitely don't use that this conference has a big stage and a big screen that's the exception usually we have no stage and a little screen and when you're sitting behind evan or over in the corner here and looking through the podium you can't see text on the bottom so don't put text on the bottom rich kilmer and when you're presenting don't look up here at your slides especially if you're wearing a lapel mic because when you turn your head it turns it away from the mic and i can't hear you look at the audience not the screen and finally long live the snowman that was beautiful thanks i'm not the only design guy in here so if you're not a design guy find one of us and we'll help you with your slides maybe we could trade some work next up is uh misaligned mafoni which i've just missed horribly and i'm gonna ask him to say it the right way he's gonna talk about ruby then teaches ruby okay so um suppose you know who's uh why the luck is stiff uh last year on uh the night he disappeared i um decided to salvage the the guide from the internet our house and other people have salvaged his other work and we all republished it on github the same in the 24 hours of his disappearance so people decided to commemorate um the day of why they this year um and i promised to do something uh and i did i just didn't publish it it was um a little bit broken it was alpha it's still alpha but some people had convinced me to to to show it to you right now so my day i was doing this and it's too big okay um i wanted to teach ruby to people i couldn't reach uh this is not for you intermediate or experienced hackers this is for people who are trying to understand code that they're reading and uh i tried to make a parser for code actually i didn't write the parser but i used some existing projects to parse code and try to explain it to people so this is a ruby app written in sinatra that tries to explain some code here i have some code it's uh something that everybody of you understand what's going on except the line wrapping here ignore that um most of newcomers have need a long time to grok this right so what did i do first i hit explain down here this is my local instance so it's gonna take us to something a bit more ugly um i'm using ruby parser to generate um a tree of um you know this program um so i can better analyze its syntax i don't use regular expressions they're pain um and there is a project called ruby to ruby that deconstructs uh that uses this uh tree to reconstruct the ruby code back when i first heard of ruby to ruby project i thought you know like why would anybody parse ruby to generate ruby from that now i'm here using it i think it's very cool uh while i'm reconstructing this project this program i'm searching for specific things um sorry small searching for specific things and uh inserting uh special little comments in there then finally i have a couple of documents in markdown format that i insert into this code and i run it through i run it through um roco which is a documentation tool for a tool for for code so that we end up with something like this in two columns where on the right hand there's a ruby code on the left hand there is a documentation inserted inside the code so we see in the first line we have class definition and class inheritance the next line is method definition but it's also an init method so it's a class initializer it also has default argument values it also has a block block method argument here we see an instance variable then the super call then the setter method and um this is basically everything it's uh up on heroku on explain ruby dot net um i hope it will scale when everyone hits it at the same time it's a basic instance thank you um the reason i didn't publish it on my day because it still also has the same problems when the code is more complex it uh it you know generates some weird things here on the right side so if anybody can help with that this documentation files are just markdown plain text files which are up on github uh under my account explain ruby on github and you can contribute to those even if you don't want to mess up with the parsing of the language and those more experienced helped me mess up with the parsing of the language and you know let's make this something one really really awesome thank you miss law the only person to get a reverse heckle out of ryan davis next up elis chaffee let's go i haven't gone yet okay so um this also is a project like miss love that owes a debt to why and to ryan davis it too uses uh ruby parser and ruby to ruby in a novel way um it and it was also sort of got made made real uh for a whyday project um this is something uh oh and it also owes a debt to flip ph lip who i don't know if he's here because i don't know his real name um and uh okay here's here's the basic idea about wrong by the way everybody laughed at this nice cartoon someone is wrong on the internet um we all love tests right but apparently we hate asserts and the reason i know that is because nobody ever uses assert anymore they use assert equal or assert contains or assert whatever or they use should somebody basically assert was so maligned that some people went and invented an entirely new system of testing that they call bbd so they wouldn't have to use the word assert anymore and steve and i steve conover well raise your hand steve hi um decided to reclaim assert to revive assert because assert is great and we wanted to give to to break down all the walls that keep people from using assert these days right so i'm just going to step through a couple of the weird things the wrong things about the current way of asserting things inside of your tests so here's test unit this is a standard x unit format and by standard i mean it is completely wrong um you say normally when you want to assert that as something is equal to something else you put the equal between the things that you're asserting about and you say the actual thing before the expected thing that's actually one of the reasons people like our spec so much because the should reverses that reversal it puts it back into the natural order um in our spec so that work however there's a whole lot of other problems with this especially for novices the should is the the syntax is very confusing like what is should it's a method but it's a method on something weird actually an object which is totally bizarre if you're trying to teach that to somebody and you'll never have any idea for like the first six months you're using our spec where to put the spaces versus the dots versus the parennes versus the underscores um also this double equal thing it actually is not the equals method it is a weird it's sort of a made up method on this proxy that should returns that you have to call in and it does the matching so this isn't actually code this is some weird thing that's inserted on top of your code that kind of looks like code um mini test is getting closer because it sort of revived assert um however the failure message for assert in this case as it others is not helpful it just says sorry it failed and if you're lucky um you've passed trace to rate so you get to see the line number that it failed at um also if you want to make the message more clear you have to violate don't repeat yourself right if you look at this bottom line by the way I apologize to shame for the bullet points um assert time equals money well there's time should equal money which is useful but you've repeated time money and equals and then the should is obvious because of course you're in an assert so what do we do we turn assert back into something that can introspect the code that you are asserting about and so it actually looks inside of the block of code and makes a useful message out of the code that you already wrote so you don't have to write it again and by write it again I mean not just in a string but write it again by using one of these crazy I'll go over here one of these crazy methods there's dozens probably hundreds of methods in all these various test frameworks and the only reason that we have all these asserts 30 seconds is so the failure message comes out looking nice okay so how do we do it we cheat we use Ruby to Ruby but we open up the file on disk because we got the file in line number from the stack trace or from Ruby everybody grown okay thank you but the point is that this is not production code this is for use in tests okay so everybody I urge you to look at the read me and all the caveats that are out there and plus I just want to point out um that we have console color so you have no excuse not to use it I know that no framework without console color gets anywhere these days awesome thank you so much Alex okay so I have to ask for permission because we're now officially over time but I've got you who the cats and Blake Mizrani lined up to speak to you we think all right so you who don't want to tell you a little bit about client side cashing and I'm desperate to hear all right okay so as I said to Avi earlier your action pack and action controller are actually about HTTP plus responses right so here's a normal controller that you might get oh my god what's going on okay this is a normal controller that you might have in your application and you're rendering a template and you're getting the information from the database so let's say you have this situation and you want to have it be cashed using htp caching based on the last time that this was modified I'm going to walk through how you might do that manually in a rails application we're going to get to not doing it manually soon so the first thing that you have to do is you have to grab out the if modified since headers from the request object and then parse that into a time right that's step number one step number two is you have two branches now right you have the uh what if if there is no last modified at all in which case that's just move on right nobody's asking for any caching otherwise render obviously these are two different branches that's why they look the same but they're going to be different the second the next step is if there isn't a last modified header make one and set it to be the htp date of the last time the post was modified right then in the else statement so now that top part is basically done right in the else statement we want to say if the post modified is bigger than the last time than the last modified from the browser basically do the same thing so i'm intentionally not being dry here but let's get dry so move that render out right and now we can combine those if else so if there isn't a last modified or if the post is modified since the last time the browser said things should be modified set this header up and then of course we need the case where the caching is happy right this is the case this is the case that we wrote the entire thing for so set the status code to 304 and return don't return uh don't render anything okay so this is what you have to do to do htp caching pretty much in every framework except for rails because nobody gives you any help other than this so this is it uh this actually works but let's actually start peeling it back to get to use things some of the rails facilities so first of all we don't actually have to get the header from the headers hash rails gives us if modified since if modified since also gives us back a date so that's good from the request object the next step is instead of setting the response that last modified header and doing that htp date weird thing we have to do we can just set it on the response object and you'll notice here i started from action controller metal which is basically raw rack and i pulled in now the rack delegation module uh the next step is it's kind of annoying to have to do if not not last modified or post modified is bigger than last modified so we can say if not modified post modified right the next thing that we do is that's annoying we don't want to have to now we're like doing some stuff on the response object let's just say pull in conditional get and we can say if this thing is stale and we can say last modified arrow post that updated at render and then the last thing is we'll pull in implicit render and now we can just say fresh when last modified points that post that updated at and now that does all the things that were on the slides before and then finally obviously i just showed that you can pull in some modules in the action controller metal but of course action controller base already has fresh one built in so basically the short version of all that is there's a bunch of stuff you have to do to htp caching right it's a good idea to do it almost nobody does it in the world it's not a very talked about thing because doing it is a big pain in the ass it's actually not that big of a pain in the ass in rails and people should do it more and uh as i said yesterday rails 31 will make give you a better reason to do it so all right thank you precision timing next up lake miss ronnie and i believe that we're going to talk about roundup roundup roundup everybody see that is it okay to the bottom it's a lot of no there you go that better and just make that all right did that work so you guys can see all this this is good okay so uh ryan was talking about is uh shell scripting talk about set dash e and uh i want to give you a quick show of that and uh what it can mean for testing command line interfaces so uh one of the things i do a lot of rogu i spend more time building family interfaces than i do building web interfaces anymore so um i needed a way to be able to test them uh really well so i here is a little shell script that just prints out the hostname but if you look at that it's a little more complex than that there's a set dash e in there what set that she does to tell you that instead of running through every single command it'll stop at the first one that uh exits with a non-zero status so you can see here that it should stop at false right so if i do uh there's also in shell you can do uh set dash x which will give you the trace output this tells you an execution the sub-shells that it's going into you can see what the plus signs the variable expansion and all of that you can see that it stopped at false right so i thought well shell is i think awesome at this so and this is a really really solid feature of shell i want to write a unit testing framework and i wrote it in shell and it's called roundup it looks like this uh when you run it you can see that the test that failed uh it actually prints out what at the line that actually failed and with the set dash x output um and it comes in turn style output the tests simply look like this if we do a roundup uh i'm going to test the five so this here i'm actually testing uh the thing so you can't have before's right you can have afters and you don't have to import anything or do anything you just run this file you just type it uh just all your tests start with it underscore right so we can say it passes here i'm saying true uh it fails so if i do a roundup uh and run the roundup five test you'll see that the failed one failed uh and let's scroll up here and you can see that the it fails failed on false right so uh i use this lot because when i'm testing command line interfaces uh or whenever i'm doing writing a lot of command line interfaces i went i was starting to write tests in ruby and using testing it and i realized that's f-ing stupid because i'm actually writing a command line interface so i should be testing it with the same language that i'm going to be using it with which is shell so i decided i'm and plus i also realized that when i'm doing it this way i wind up building better command line interfaces because it makes it easier to write tests with this thing so uh anyway that's it thanks and it's uh you can find it you can find it here be in this very roundup beautiful


Okay, can everybody hear me? Koala Bear is the only one that gave any ideas. I don't like any of them, but I appreciate the ideas. None of them are good gaps, though, so let's hope this sets up and works. Target's 20. And I can't be doing anything long today because I have a webinar, so short day for me, but I think, I mean, this could go past 20. Acor, I'll look at that. What's the reason for the gap here in this? We can look at this if what you're gonna call it doesn't set up. What's the reason for the gap on that? This is not gapping. Well, we can look at Acor, such thick doesn't work, but I think it does. I think it does, so. I think that it does. Me thinks it does. So let's have a good day, strong, solid, easy, quick day. Not a lot to look at. All we need is one. So stop when I call it is going to be 21.25. This is just let this fall. So we'll look for 19 next if this goes to 20. No entry in here yet, though. Okay, stop's gonna be 21.25 if it sets up, which it hasn't yet. It's just gonna go right down to 20. This isn't bad. This looks good. Here, it's just gonna go right down. Okay, if you wanna do this here, you can do it here. I'm gonna wait. Let's wait. Let's even get a tighter entry. I don't know if we're gonna. I don't know if we're going to. Let's see. Let's see if we can get a tighter entry. I don't know if that's possible. You could short it here if you wanna put this top at 21.25. It's a buck 25. I'm gonna hold off, see if I can get a better entry. But I might miss this whole trade. So just letting you know.  But this is valid here if you wanna short it. It stops 21.25 and you can't be tight with it. I may miss the trade. Here, it's just going, yeah. It's just gonna go. Looks like, did anyone do it? I just didn't do it with that stop. I thought we could try to find a better way in. It just wasn't there. It might go right down to 19. Jackie did it. All right. You gotta watch 19.60, 19.50, 19. I'm not saying I'm off of this, but I'm saying that I don't know now that might've been it. So I'm gonna watch here and see if I can find an entry that makes sense. I don't know if we get it. If you're in it, it's working. You gotta be nimble with the move though because of the size of the stop. This might just keep dropping though. I didn't think that that would do that there though. I'm not looking at anything else, Steven. I like this and it's working. So why would I look at anything else? Stitch fix is going. If you're in it, the stop's 21.25. I did not do it because I thought I could find a better way in, but I might not have a way in at all. And if I don't do anything today, then I don't do anything at all. This why I liked this, it worked. I picked the best thing. I'm not looking at anything else, there's no point. And this might still set up. Again, I mean, it did set up. I just didn't wanna do it for buck 25. Let's do 75 by 50, 75 by 50 stitch fix. And if you're ready in it, you're in it. Up, so this is all we got. Here, take it, get in. Get in right now. And don't worry about where you got failed. Put the stop at 20, 50, it's gonna just roll over. And if you did the original one, you did it. Here, here, let's see if it goes. Let's see if we can just get it right down to 19. Here, here, here, here, here. And we have the stop at the right place if it pushes back. Here, we're gonna get a chance to take a little bit more, I think. Anyways, just make sure the stop is in at 20, 50. In fact, let's put it at 20, 60. I don't even think we need that, but put it at 20, 60. And I think this is just gonna roll right on over down and we'll just get whatever we can get out of it. And if you did the original one, that's fine. The stop was a little bit better, but you know, not much. Not much is what it is. If we get a place to take more, we will. I don't know if we will. So we're looking for 19 on Stitch Fix and it could even break that. If it goes to 19 by 949.45, it probably will break that today. For those of you that like Decor, you could do it. I did not rate this, so I didn't wanna do it. Also, this is kind of thin, but it did, if you were aggressive, this fell. There's no play in here now that it looks like it just went. Stitch Fix was the best got. I just don't know if we're gonna get a place to take any more. I think this is just gonna go, so. Or in it, if you're in it, if you did it previously, I wouldn't lower the stop, I'd keep it where you took it because if you sized yourself right, you got it at the place you got it. If this pushes back and resets, we'll do it, but I kind of have a feeling here it's not gonna do that. So here it goes, here's Stitch Fix. We're just kind of scalping this here now because it's just like really just dropping. Here, under 1950 and see where we go. Maybe we'll get out in the 20s of the teens. Here it goes, this is just going here under 50. So did anyone do anything else? This is working, so you either did it here, here.  It was just, I never thought it would set up like this. It's money, just take it, be happy with yourself. Here, under 30, 31. All right, let's wait, let's wait a little, little, little bit more, little bit more here. Stephen didn't do it, did anyone do this Stitch Fix? 30 is the next 31, here, here, here. Oh my gosh, we almost didn't do this at all. Here, wait, under 20. All I had is the only one that's in this, 21. Oh, Jackie's in a two, that's right. Jackie did the first one. Good job, Jackie. Jackie's done more than anyone. If I got rejected, you didn't have it to short, you got to check that in the morning, you have to check that. I request it from the broker, if you don't have it, you got to check that, that's very important, 21. All right, literally my hand is on the button here, if it doesn't break, we're out. Here it goes. Jackie's out, she made $1,000.  We almost didn't even do that. Seriously, did only three people do that with me? Gala had got out too, and Jackie made $1,000, but she did the first one. Oh, my Lanta, this probably breaks 19 though. Oh, wow. I'm glad I even took that one. That was just, let's go over it. I mean, that was just like one of those ones where I just said, screw it, we got to do it. Here, we're going to go over it right now. Jackie's happy, koala bear, didn't have it to short. Shower Singer didn't get it filled, and neither did Steven. Well, I can still see, watch it here, see if anybody else wants to do it. It's gonna back up, but I don't know where.


Okay I hope you can hear me. Yes. Okay so thank you very much for the invitation and yes today I would like to talk about random constraint satisfaction problems and the effect of introducing a bias in the measure that describes the set of solutions. So this is the outline now I start by giving some definition and introducing the phase transition some of the phase transition that arrives in this random constraint satisfaction problems then I define the the bias measure that we have studied and its effect on the clustering transition and then I look at the particular case of the large k limit where k is the number of variables involved in one clause. Okay so for the definition so a constraint satisfaction problems so it can be seen as a set of n discrete variables that are subjected to a set of m constraints and the solution is an assignment of the variable so that all the constraints are satisfied and in this talk I will focus on one particular problem which is the bi-coloring on k-hypergraph and in instance it's defined as follows so it's an hypergraph of n vertices and m hyperranges where an hyperrage links a subset of k variables and on the vertices lives the the spin variables so there are boolean or here I take the notation of spin variables and okay solution is an assignment of all the spin variables so that all the constraints are satisfied where a constraint is that the k variable involved in one hyperrache shouldn't be all equal so there is at least one variable that is plus one and one variable that is minus one okay and it's so in order to study the typical properties of this problem it's interesting to study to introduce random ensemble of instances and so here it's a random ensemble of k hypergraphs so here I will talk about the two main ensemble common ensemble which are the regular ensemble and with the vertices of the the degree of the vertices are fixed and they are just any ensemble and okay and see so it's very interesting to look at the thermodynamic limit where you send the number of variable and the number of constraints to infinity but at a fixed ratio alpha which is so the density of constraints and so when you increase the value of alpha in this thermodynamic limit you will see that the set of solutions will undergo several phase transitions that I've okay tried to describe here so the squares represent the space of configuration and the black region corresponds to the set of solutions so the most prominent phase transition is the satisfiability transition above which typical instances in the larger thermodynamic limit doesn't admit solution and below there is solution and in this talk I will focus on the clustering transition which can be defined in several ways so the first one it's from you can see it from this sketch so below the clustering transition the set of solution is rather well connected and you can reach any solution from the other one by making a small rearrangement of a small number of variables and above the solution sets fit into an exponential number of clusters and these clusters are separated by a free energy barriers okay it can also be defined as follows so when you run a Monte Carlo Markov chain to sample the the set of solutions above the clustering transition it will have an exponential roll abstention time while below it will be able to equilibrate in a polynomial time in N and finally it's also related to the apparition of long range co-elections which are called the point to set correlation that measures the correlation between one point and the set of variable that are a distance d from it and this is related to a an information theoretic problem called the reconstruction on the on k-r-i patterns in this problem okay so the what is interesting to look at is to look at the typical properties of the algorithm that try to find a solution on the typical instances so can we relate their typical performances to one of the first position that I have mentioned and is there a barrier above which a value of the density of constraint above which it's not possible to design an algorithm that would find a solution in a polynomial time so in order to understand this okay we have to look at different regimes so in the regime of small k actually there is some algorithm that are very efficient and that can find a solution in polynomial time up to density of constraint that are very very close to the satisfiability threshold but in the large k limits so the situation is quite different and up to now the best algorithm can find the efficiently solution up to density of constraint that are at the reading order for the same as the clustering transition so here I give the scaling for the clustering transition it's two to the k minus one log k over k and this has to be compared with the satisfiability transition which scales as two to the k minus one log two so between these two values there is a wide range of alpha in which typical instances do admit a solution but up to now we don't know any algorithms that are probably efficient in this range okay so now here's the approach that we have adopted so all the many of the phase relations that I have mentioned and in particular the clustering transition they are obtained for the uniform measure that over the set of solutions so this is its expression but give us the weight when the configuration is not a solution and it gives the same weight for all the configuration that are solutions and if you instead you introduce a non-uniform measure that still gives zero weight to so configuration that are not solution that weight differently the solutions then you will be able to move the value of the clustering threshold but not the value of the satisfiability threshold and so the goal is to design a bias measure so that we can increase the value of the clustering threshold and we have seen that at least for the performance so for the simulated annealing algorithm it will increase its performances so there is some work that I've used this idea of binding the measure so in the first example it's on the problem of packing hard spheres which can be seen as a constraint satisfaction problem on the second item is okay the solution are weighted according to their number of frozen variables and on the third item so the solution are weighted according to their local entropy which was introduced in the in the previous talk by by Carlo Rucci-Bello and so here I I define the the bias that that we have studied so the first one introduces a interaction inside the that factorize on the clause so this is the expression of the measure that we have used and so it's a product over the constraints and it's defined through this function omega that takes as argument the set of k variables involving one constraint so it gives still a zero weight to the configuration that violates the constraints so when all the spins are equal to either plus one or minus one otherwise it gives a non-zero weight but through this parameter epsilon it will give a different weight according to the number of almost violating clauses so this equality means that there is only one spin that take the opposite value compared to the other variable involved in this clause and okay this is a second example so there we introduce some interaction at distance one so this is an example of a small k-i paragraph with k equal three so the vertices are represented by black dots and the hyper edge are represented by white square squares and so k equal three in this and okay so the bias that we study it will introduce interaction between one variable and its neighbors at the distance one okay and we have chosen this bias to count the number of forcing clauses we are forcing clause so let's say that a is forcing clause this means that the variable that are surrounding it except i are all equal and this will force the variable i to take the opposite value so that the constraint is well satisfied and so this take this following form where p is the number of forcing clauses okay so now this is the result that we obtained for our finite k so this is the clustering threshold for a random regular graph so where the w is fixed and is rated to alpha through relation and so we have computed the clustering threshold for k equal five and six and so this is the value of the clustering threshold in the second column for the uniform case and you can see that when you optimize on the parameter that describe the bias of the first and the second bias you are able to increase indeed the value of the clustering threshold and we check that this has a positive effect on the simulated annealing algorithm and okay so now i move to the last part that look at the large k limit of the clustering transition so in the large k limit the clustering transition is this following asymptotic expansion so what is known rigorously about this asymptotic expansion so the dominant term has been proven for so by coloring of k-up hypergraphs as well as other constraint satisfaction problems for so such that for instance the q-coloring problem in which the variable can take this time q value and also there is some result about the third term so the by this two paper by Alan Slay and Zhang about so some inequalities on the third term the constant term gamut and so we with my advisor games in our genre we have estimated the value of this constant and we have shown that it was the same for both for the problem of by coloring on k-up hypergraphs and for the problem of q-coloring and so now what is interesting is to look at the effect of the bias that we have introduced on this asymptotic expansion of the clustering threshold so for this we need to choose a scaling for the parameter that described the bias so for the intra-closed bias we took this scaling at epsilon scale that constant over a square root of k log k and so till the epsilon is now our rescaled bias parameter and for the interaction at distance one we have taken a specific choice where we distinguish between the case where there is p equals zero so there is no forcing closes on the case where there is at least one forcing closes and b is our bias parameter that we take constant as a case growing so with this choice of scaling we showed that the clustering transition arise at the same the same scale as the uniform case but now the okay we can make some improvement on the third term of the expansion so gamma d depends now on the the bias parameter epsilon and till the epsilon and b so okay this is the result for the intra-closed bias so this is a plot of the rescaled parameter till the epsilon square against gamma d and the dots represent the clustering transition so the uniform case corresponds to till the epsilon equal to zero and so you can see from this plot that as long as you turn on the the bias you decrease actually the value of the clustering threshold so this is not what we expect we would like to have a bias that increase the clustering threshold so this bias is not it's not doable but instead with the bias that introduced interaction at distance one it is possible so this is the plot of okay b is the bias parameter so we recover the uniform measure when b is equal to one and okay now the the clustering transition is represented by the crosses so you see that when you move b from the value one you are able to increase the value of the clustering threshold and the optimal value is found around the b equal to 0.4 and for this we can obtain an increase of the the third term of the asymptotic expansion so we obtain gamma d is equal to 0.98 which has to be compared to the value for the uniform case where gamma d is equal to approximately 0 0.87 okay so now I can conclude so with this this um bias measure we were able to increase the value of the clustering threshold both at small k and at large k so at small k we also check that this has indeed a positive impact on the performances of simulated annealing and at large k we we could improve on the third term of the asymptotic expansion so of course the perspective now is to so it would be better to be able to improve on the more leading term of this asymptotic expansion and to do that we could try to use more generic bias so our first direction could be to try to increase the range of interaction because here we have a look only at interaction at distance one but we could try to increase it also we have only looked at the bias that only take the number of forcing clauses surrounding one one variable but it could be more general and carry more information um okay so thank you okay


Okay so we talked about Sada a little bit already but let me know like how did y'all get tapped in cuz like y'all bond it really gives like big brother little brother like I really like what y'all got going on how did y'all I grew up with his little brothers Quill and DM my big brother Wheeze like that's like my big brother that's one of Sada friends growing up so he knew I was doing music and he just brought me to Sada one day and that like I really didn't want to just be like I'm around this nigga I'm just do music with this thing I had to see what type of person he was so we just started hanging and then we got closer and grew closer I start going to shows with him he was taking me out of town and shit to his shows and shit he had to do and then we just grew close like that's bro for show yeah people call you his protege of sorts how do you feel about that I mean something a part of me be like I ain't no nigga protege but I technically am like sure he showed me how to do this shit for real like I go around or he took me around the world like you feel me like show me how to really do this shit I learned how to perform from that nigga like all that shit like a lot of my versatility like I get that from anything like I think for show when one of the greatest entertainers I ever seen for real like part of the I've been a brown and so are you signed to him I'm starting to get you're signed to get him okay we gonna get into that so what's this so there's no type of like situation between you and Sada outside of him kind of being like a big brother my big brother okay um so you said that you're signed to get him it's like inner scope get him okay that's tea that's one thing that I actually didn't know so how did you get into that that deal I just like my music just had a like a spurt where it just start going crazy like around the summer last year and then like everybody just started tapping in with I just had a crazy ass crazy ass run like from like July to like now for real for real but around my birthday I got signed like October but I had like all the labels is calling me and see that I knew I knew that you had interest I didn't know that you had actually landed on one so what was it about them that made you want to go with them as opposed to the other people that pull off his on the table I know people around like I know people in the building like in the building so I just knew like I had more push in the building with a label if I knew somebody in the building was more family oriented and then they just had the best offer when I was talking to my lawyer like they had the best offer like the deal was the best one okay so now a lot of this is making sense because Iki Vicky was a re-release right was that because of okay but on the topic of Iki Vicky one million two weeks shout out to you for that so our visuals is fire how did you come up with those I really wanted to be chipped Skylark because it was like Iki Vicky you feel but DNA like you should go you should be Timmy Turner so they came over with the treatment under and I liked the video so I'm like because I really wanted to be chased around by girls for real for real it was the skill in me just wanted to be chased around by girls for real be chipped Skylark but yeah next song no no you wouldn't do that another song you wouldn't do okay I'm done with Timmy Turner see all right can I just tell you maybe it's the New York in me because we got a lot of sample music going around like I was really thinking like a a Vicky you're so like a sample of that would have been fire so the fact you said no more so hard to clear Tim fairly odd parents sample yeah I want to clear none of my sample just in case they don't want to clear none of my samples so how do you feel about like music that is like released that's not cleared because a lot of people are doing that now like they not they're not under labels though under labor got clear everything that's true business side really like the side you really need to pay attention to the music side be easy like if you doing music you got to know the business because they that should have fucked you up any of course like people ain't clearing shit for free right sometimes and for real these won't take money mm-hmm so are you learning the business as you're going through it or is there somebody that's like putting you on I know you got soda but are there people that you turn to for like business advice and entry my cousin shoot my manager one putty my lawyer like I talked to everybody my label the president my label caught me every day like so it just be like my A&R talk to me so I really got a good supporting cast I talked to other people other artists learn from them so like T grizzly I just like start being around him but he helped me a lot he showed me to be business so I just try to take I try to have my ears open learning through everybody for real and I'm glad you brought up T because I was wondering also how y'all became connected he just tapped in one day like I know like we are from Detroit so of course I know somebody he knows so we just like we just did some music one time when I was I really seen it when I was in London one time and then after that we did some music in LA and then we just like I ain't gonna lie T when I work with T the energy be good like I be going on vibes and energy like the energy was there we made some good music so like we gonna come out with it little tape or something okay yeah I saw the tent in a bio and then he did like the car freestyle and he nominated you to do yours and you did yours you set that back real fast too it was like under an hour I think yeah you did that and it was good so but even with the good not saying that this is bad but like you did that very quick fire in the booth you body but you said that you was nervous why would you so nervous because this is a camera like I seen Drake on that I seen Drake on fire in the booth like if like that shit different like when you be like damn I was just watching this shit a few years back Drake was out here now I'm all here you be like damn all these cameras looking at me my cameras make me nervous oh I'm lifting this camera now that's you we here cuz I don't really be like so you was there but I think I think that you did well with that but I thought it was just interesting to see like when you were like handling it on your own in front of your own camera like you sent it back real fast and then like on that platform you was like oh I'm so nervous so how do you get over like your nerves and how do you build your confidence in situations like that do it I try not to think about it okay I try to close my eyes then when I open it it's like I'm doing it now so when I open my eyes I got to keep doing it or I'm gonna be embarrassed I really be shot in embarrassed though like mm-hmm I want to embarrass myself on camera so if I'm already on camera doing something I gotta keep doing it so is that like a one-take situation it was like it is what it is no like sometimes I it'd be one take but a lot of times I ain't gonna lie like that shit's not easy okay I'm nervous okay well that's normal um so how do you feel about when people compare you to other artists because that's something that's been happening a lot lately especially on Twitter and I feel like you handle it very well because you respond with the opposite artist answer I mean the opposite artist name yes like I don't really care like opinion opinion don't pay me so it'd be like if I could be it somebody else I'd be it somebody else I don't gotta have like I ain't got to be walking around like I'm the best I don't even care as long as I get paid for real for real you don't care as long as you get all this shit a competition though like don't get me wrong um because I feel like that feeds into you saying that you will work with your opposite amazing show um how would you feel though if you were working with somebody who had beef with somebody that she was cool with and then they went on the song and this the person that you was cool with not doing that how do you handle that situation not gonna get on the song tell you don't say that that's disrespectful is disrespect when you disrespect somebody you know I'm cool like I tell everybody like like some my homeboy is cool not cool like don't get along with other other people that I'm cool with so it'd be like bro y'all could disrespect each other but don't do that shit around me like say you and her had a problem if I'm with her and you see us out don't do nothing to her don't even try that that's disrespecting me so and I I'm glad you kind of cleared that up because that's also that also kind of feeds into the narrative that people have when it comes to you working with Sada and T we don't gotta get into the politics of all of that but I know that some people are like curious as to like what that situation looks like when you are close to two people who aren't really seeing out in a moment I mean Sada and T knew each other before me that's that's not my business for real for I'm I'm here for the business like Sada my real big brother I love that thing me and T getting cool but like it ain't nothing like that like to wear like ain't nobody died them niggas ain't fought none of this shit so I really like I'm here for the business like I don't be going in the business thinking personally if I could work with my ops I don't even care about nobody like ain't nobody died I don't give I really don't care for real but do you even have a like you seem so unproblematic like I feel like if you have ops there will be ops by association they open show up in oh boy open for show but it's like I don't broadcast but that's good yeah I'm unproblematic for sure like you know when you're unproblematic sometimes problems come your way because people think like you won't but you really will and I think that that goes back to what I was saying about like in your music it's like more like at this point if you know you know not you gotta like you don't got a point to prove as it's Taylor make sure you follow us for more exclusives at www.talkofthetownshow.com like comment and subscribe


Welcome to module number six, in which we will discuss software design and implementation. And design is often as a term used to describe also what we discussed in the previous module, namely the architecture of a system. So as a start, the question arises, what is the difference really between software design and software architecture? And at least in this course, we use the distinction that architecture is more the high level structure. It's the overall system quality trade-offs, for example, performance versus security. Whereas design is more on the lower level. How do we decide what classes we have and what they should be doing, functions and relationships between them? So in a way, architecture is the macro structure, design is the micro structure of a system. And we'll discuss a number of things, but in general design and implementation as sort of the least abstract part of software engineering is probably what you are most familiar with already. If you know programming, there are already some things that you might be doing or you're familiar with and we'll explain some of them. But in general, I focus on a number of things in this module. And that is the concept of reuse of software, parts of the software. It's the configuration management. And finally, it is the so-called host target development. And these are three things that are very important. Reuse, of course, you can reuse software parts at a very different level and different artifacts. So you can, of course, if you have an entire system that suits your requirements, you could be reusing the entire system. You can reuse individual components. So maybe you have a backend that fits your application, you reuse it somewhere else and it might do the trick as well. You have, of course, all of you have already reused libraries, for example, a testing tool or a library for accessing a database. So that's a very common way of reusing functionality at a very low level of the design. And then finally, what you have seen last time in the architecture lecture is to reuse abstractions. So we have seen the architectural styles, which are a way of reusing knowledge about how to design a system, how to architect the system, and reuse that in a way in an architectural style. We have a similar thing in the design. We have so-called design patterns, which we'll go into that basically focus on smaller parts of the system. How do you design a number of classes so that they fulfill a certain purpose in a good practice kind of way? But if we talk about reuse, we have to discuss that reuse sounds nice, but there is always a cost associated with reusing software parts. And that is due to different reasons. But for example, if you take a library, it might not be fitting you exactly. So you might have to adapt certain things, adaptation cost, which is also very common, for example, for components, for larger system parts. They might not fit everything. You might have license costs. So a library or a component might be costing money because there's a supplier that develops that and would like to make a living of it. So you might have to purchase it or to license it in a certain kind of way. You always, even if you don't have to have adaptations, you somehow need to integrate it into your system to get it to run. That can take time. And finally, the time for actually searching for it, for browsing the internet or maybe in terms of larger systems and components for having a process of scoring different suppliers takes time. And that is, of course, costly in itself. So reuse is a good aim, is a goal, and it can help you tremendously, both in the amount of the quality you get, but also the time you save. But only if the cost to actually reuse is justified. And this is, of course, a business decision where companies regularly have to decide, do we really take something from someone else or do we rather implement it ourselves? So that's the reuse part. Then another part which is really important in software design and implementation is configuration management. And that is really a number of issues. It's, first of all, having access to the right versions of your software. So many of you have so far only ever implemented one product and slowly evolved it. But in many cases, in the real life, you have different versions of your software that are in use. And this doesn't matter whether you're developing a small library or it's some embedded system like an airplane where things are really built physically in. But you might have to keep track of what are the different versions that we are being using. For example, in this airplane, we're using version one in this airplane's version two or in our library's version one. And you need to have support for these. And then having the right tools to actually access the right version at the right time is tremendously important. And here we are talking about tools such as Git, which you are probably familiar with. So version control tools that are in use today. Then we are also talking about things like compilation support or compilation and linking support. So having access to the right versions of the libraries you need, the right compiler, very important and embedded systems. There are often very small differences between the compilers, but you need a specific compiler for this hardware or for that hardware. And having a tool that allows you to quickly access those things is really important. And in practice what this means is that there are lots and lots of tools and scripts and smaller programs in place that make sure that you can at any time access these things in a good way. Finally, what we also often consider under configuration management is the ability to track changes. So you, for example, discover a bug in your system. Do you have some kind of way of reporting this? So it is actually connected to the right version, to the right compiler and so on. So many of the tools like Jira that are in practice allow you to be able to actually link that to Git. So you have a right commit. But it's also about smaller things. So issue tracking and change management is one way of addressing this, but it's also about, for example, using commit messages. So actually having a version control system and people commit something and they describe it so that when you go through the version history, you try to find out why there is a bug. You can understand what has been changed. So it's both having the right tools, having the possibilities, but also having the right practices in place, having the developers actually writing proper commit messages.  But for configuration management for tracking what's going on, this is highly important. Okay. And as a last aspect for now, there is the issue of host target development, which again many of you might not yet be familiar with. Host target development essentially describes that you are developing on a certain environment, on a certain host, on your computer, but you are developing for a specific target. So for instance, you might be developing on a Windows computer with a certain hardware like an Intel CPU, but you are developing for an Android phone with different operating system, different hardware. So the question is how do you do this in a good way? And of course, mobile apps are a good example, but it's very much the same if you do a web application, for example. You have different browsers, different versions, different operating systems. Embedded systems are a very extreme case of that where there's really small differences depending on the CPU or the kind of hardware boards you use. And all of this is under the term of host target development. So we are kind of concerned with things like what is the hardware, what is the operating system? What are maybe the databases or other dependencies that we might have? Do we get them to run? As already mentioned here, compilation support in host target development. Similarly, it's very important that we have the right compilers, we have the right linkers, we have debuggers. We might have things like simulators that can actually simulate the real thing, even if we don't have it. For example, if you don't have an Android phone, you might still want to use the Android emulator or simulator to see how this would look like. And then if you go more advanced, we have so-called in-the-loop testing. So if you develop a larger system like an airplane, you cannot always just put the software on the real airplane and test it because you might not be able to actually fly that. The airplane might not yet exist. You're just developing a part of the system that is ongoing in development. So you have so-called in-the-loop testing, which means you often start with just running it on your computer, on your hardware, and then slowly you add pieces to it. If you have a so-called hardware in-the-loop test, it means you're testing your software together with the real hardware. There is something that is called a model in-the-loop. That means that you are running your software, and there is some kind of simulator, a model that runs behind it that tries to, for example, behave like the real aerodynamics. It gives you the real sensor values depending on the simulator. So these kind of technologies come into play there. All of this is our concerns that we look at when we develop software, when we want to do the right design and implementation. And of course the target in the end is we want to have an executable system that is of high quality, that is maintainable, that is reusable maybe. And this is what we'll dive into more now in the remainder of this module. So we'll look at best practices, good practices in implementation. We will look at design patterns in particular.