YouTube team keep it clean.  What is Tyson? Like what's up with Tyson Williams? Especially how did what how did he become available?  So um Tyson Williams a couple years ago. He was an undrafted rookie free agent I believe they said it was injuries that really kept him from being drafted but nonetheless He stuck around on a practice squad his rookie year But then his second year which was last year Y'all know the Ravens had injuries to literally every running back on their roster JK Dobbins out for the season Gus L Was out for the season Justice Hill out for the season So they had a sign guys like leave me on bail for a couple weeks Yikes Devonte Freeman He was there the whole season Latavius Murray He was there the whole season even though he got injured for a big portion of it and missed some time But anyway Tyson Williams was there as well And with Tyson Williams something that we saw from preseason preseason we saw this like this explosive runner He got just great speed. He was a home run runner home run Like you take it to the house He's one of those running backs to where you you're not gonna question like if he's in open field or somebody gonna catch him Is somebody gonna catch up to no, they're not they're not And we saw that in preseason and I was think okay Unfortunately once JK went out at the end of preseason. Oh, man, then Gus again, it was a sad story with running backs But I'm thinking okay. It's Tyson Williams time, but we got this young running back. Yeah, we lost our guys But we got this young running back. All right, let's go but no Week one Against the Raiders. He started off hot He started off hot like he was getting these big chunk games But then he did fumble he had a fumble and then the ball went out of bounds He didn't lose a fumble, but he still fumbled nonetheless And then like after the first half, it's like we I think he only got like two carries in the second half He they just stop using them. They stop using them. And then there was a Missed a missed assignment I think it was an overtime and it led to Lamar getting hit Lamar fumbled and I think the Raiders recovered. I think that was the one in overtime, but I gotta watch the game back But anyway, I know he did miss a big assignment and he missed the pass block assignment that led to Lamar getting popped and Then in week two against the chiefs He again Explosive runner big games on the ground Nice runner good at finding the holes good at cutting and the thing that I like the most about Tyson Williams Is that even when he cuts? He doesn't lose speed. He doesn't lose acceleration. He still keeps the same speed even when he's making a cut so We saw that again in the chiefs game, but then there was a really big run that he got he's running running running running running We like oh go Tyson. Let's go And then he gets to like the five-yard line the chiefs five-yard line And I don't remember who it was, but a chiefs player pop fumble fumble at the goal line a Good thing for the Ravens Devon do when they he recovered it So it was a crazy touchdown, but a touchdown nonetheless But it was two fumbles in two weeks And it was like oof. We know how John Hardball feels about the fumbles and then from that point on We never really saw Tyson Williams again like that We saw him like in in tiny tiny tiny bits and pieces, but Really like hardly ever But the crazy thing is is that he was the Ravens most explosive runner last year Most explosive runner last year with him in a game You had a chance to for him to go to the house of one to take it a distance But the Ravens and for me, I personally think that it was something more than the fumbles I think it was something deeper than that because like they again, they were down to Devontae Freeman Latavius Murray and what made it even weird is that? Latavius Murray had got hurt for a while So it was Devontae Freeman and and Levy on bail like you still didn't use Tyson Williams That's why I think it was deeper than them two fumbles at the early on in the season there was sometimes when um Lamar Jackson and him they just didn't seem to be on the same page There will be some passes where it looked like Lamar was leading him with the pass But Tyson Williams sometimes he would just stop And it ended up messing up some plays and whatnot But I think really the the writing on the wall for the Ravens even though it was kind of weird Why they weren't using him throughout the season, but I think the writing on the on the wall really came in uh in the bingles the first bingles game the first Ravens bingles game where it was I think it was like third down and It looked like I don't know because obviously wasn't in the huddle But it looked like Tyson Williams didn't know what the play was look like he just didn't know what it was and Lamar was trying to communicate it to him and he didn't know what it was and they either Had to use the time out of they got to delay a game one of the two. I forgot what it was but then after that Like the like the very next play on fourth down The game is like it's not over, but it's pretty much over, but it's not all the way over yet Ravens if they would have converted that fourth down then they would have still had a chance to come back But it would have took a lot and anyway with more Jackson those were bought a Tyson Williams and it's this is fourth down and He ends up like it just looked like he wasn't really giving it his all And he ended up running out of bounds on the fourth down. He ended up running out of bounds and it was just like oh, man That was tough man. Yeah, that was tough to watch So I just I just wonder what was going on with the Ravens and Tyson Williams last year It's one of those things that we'll just never know So hopefully for him a change of scenery That'll do him really good because the potential is there. He showed the flashes And I just wonder if it was sort of like a mental thing I wonder if the Ravens they had a lack of confidence in him Which is seen that they did and then that showed because it's one thing and this is just in life period if you Don't have confidence say for instance you as a as a parent And you have your child and your child they they mess up whenever they write in their name They mess up they might put a letter backwards or something like that. They mess up when they write in their name And you like man, what why do you always mess up your name? It's your name You you can't put the letters forward. Come on. What's wrong with you? What's going on? Why why do you keep doing that? What's the problem? Oh? You're never gonna be able to spell your name, right? You can't even write the letters forward you keep writing backwards for what? What's the problem? And if you keep telling them that over and over and over again Children got good memories and they're gonna be like, man. I'm yeah, maybe I am never gonna be able to do that Maybe I am never gonna be able to write my name the right way But if you tell them in a different way like hey, oh Okay, you you messed up on your name. It's okay We're gonna keep working at it and you are gonna get this thing, right? We you're gonna learn how to write your name the correct way. I know you can do it. I know you got it I believe in you. I got faith in you. I got confidence in you that you were gonna get this thing, right? And we are we are actually gonna get this thing right together That's a whole another ball game children remember that too so that you having confidence in somebody that can Completely change their outlook and they can completely change the way that they take on Whatever it is that they take it on So I wonder if that was the case with a Tyson Williams Especially on that fourth down play because he just looked like he just looked like he he was checked out or that guy he just looked like he was like completely checked out and It didn't we really didn't see him like at all after that Like we really didn't So hopefully with Indianapolis Colts He can get a shot. I'm not sure what their running back situation is behind Jonathan Taylor. I'm not sure what's going on there, but it They got an offensive line. Hopefully they'll be happy this year. They got an offensive line As far as quarterback they got Matt Ryan now the Nick foals to right Nick foals and came through But yeah, so we're gonna see we're gonna see but with Tyson Williams you just Excuse me. Oh, you just hope that he's in a good mental space Because the the all the the ability is there the ability is there for him to be a nice running back in the NFL All he got to do is show it That's it. All he got to do is show it now one thing With the Ravens, he did not play special teams That's as far as being a returner being a gunner Kick coverage punkers. He he didn't play special teams so Maybe with the Colts, they may be like alright Tyson. Let's see what you got on offensive course But let's see what you got on special teams So I'm sure if if that is presented to him Then that can be another opportunity another way that he can make the roster not just as a running back But as a special team or two So if that's the case, then hopefully he will accept that responsibility And take it head on and just make it work because I really do want to see Tyson do good I really do want to see him Get an opportunity because I know Jonathan tell I know he gonna run for like 2,500 yards We know that's gonna happen like last year. He was just killing it And there was even talk during the regular season that he could have been he was in MVP conversation But with what ties up so with Tyson Williams if he can be some sort of backup to Jonathan telling again I do not remember. Oh, not not him. Not him. No, I think what is his name now? He minds. Oh, I Forget his name, but I think that yeah, that's the Colts number two and he plays special He's a return man too and all that and I know they move him around on offense and all that too So I guess that's that will be the number two. So maybe Tyson is fighting for that number three spot So hopefully he gets it Hopefully he gets it because I would I just would love to see it So Tyson we rooting for you and I really do hope that in OTAs and training cam and all that stuff and then come preseason I hope he can show that same potential that he showed with the Ravens. I had all those flashes I hope he keeps on flashing for the Colts and He really gets a shot to do his thing appreciate y'all team keep it clean. I love y'all team keep it clean Thank you for watching as always and thank you for subscribing and it just really helping the channel grow still a small channel But it was still a growing channel too. So I appreciate all of y'all And just like Tyson Williams is when it comes to being with the Ravens and that's been official for a couple weeks now He was out and now he's yeah, he's a member of the Indianapolis Colts. So shout out to tie tie we out


So, Covistrip, it's great you have a lot of people here and start off I work as a programmer at MapUnity. So, at MapUnity we'll build products where we solve social issues, for example, MapUnity build. So, a couple of reasons why Covistrip actually piqued my interest is one. I intend to develop a few mobile web applications which means I'll be working on JavaScript frameworks using stuff like Backbone and Node for which, of course, I'll be writing a lot of JavaScript code and after playing with Covistrip for a while, I really felt Covistrip is a better way to use JavaScript. We'll get to how that actually is in a bit and the second thing is I'm a Rails programmer. So, how many are Rails programmers here? Okay, that's not bad. So, for those of you who aren't Ruby on Rails programmers, yeah, Covistrip? So, those of you who aren't Rails programmers, the latest version of Rails which is 3.1 made Covistrip as a default, right? So, that was a pretty big decision by the core team and it got a lot of flame or it's... So that's why I really may have to use Covistrip in the future and this kind of forced me to look into it, right? This before we dive into...can you hear me? Yeah. This before we dive into Covistrip, a very known fact, an open secret, JavaScript is truly ubiquitous. I mean, especially since Node came out, JavaScript moved out of the browser, you can run it on your client, on your server and this happened because there's a trend going on right now that you have to have applications that are more responsive, the interfaces are richer and the only way you could do it is using JavaScript because JavaScript is the only programming language that is supported natively by browsers, right? You shouldn't really use stuff like Flash, right? So, no, because I mean, just before I dive in, so, yeah, so before Node.js, writing a chat client in JavaScript was, I mean, let alone JavaScript, writing a chat client, who's going to contribute as it is in Node.js right now? I mean, you can write a chat client in eight to ten lines of code, but it's not that hard. I remember this thing I read on Twitter a few days ago. So in computing, there are only two things that are really hard, right? One is concurrency, handling concurrency, the other is naming methods and stuff and the other is off by one errors, right? Nobody gets the geek joke, right? So a coffee script, Jeremy Ashkenas is the guy who developed coffee script. He also developed Backbone.js and Jamet, which is a packaging asset library. So he puts it really well, it's a thought experiment.  The value of this doesn't just go underneath your feet sometimes. What if you don't have to, you know, wrangle the whole chain of object-oriented JavaScript? So that brought him to coffee script, right? So what is coffee script, really? Coffee script is a language, a little language as he puts it that compiles one-to-one to JavaScript, right?  Of course, the latest news with this is Mozilla is working on integrating coffee script into the browser. So you can natively use coffee script. You could write, you know, natively use coffee script, you can use text slash coffee script tags, but you'll have to use the coffee script compiler in the browser, which is not that great. Right? How many of you sass? You can just nod your heads, sass, so great. So for those of you who don't know what sass is, sass is synthetically awesome style sheets, right?  For example, you can use color codes and put them in variables and usually you have a color palette in your website and it becomes really easy to manage all that if you have variables, right? It also gives you a mix-ins so you can abstract away common code you usually write in style sheets and use, you know, abstract it away and use it multiple times instead of repeating code. So it keeps your code dry. You can also do stuff like you can, if you have a div, you want to darken it. It gives you some math functions so you can darken it by 20% or lighten it by 20%. So it's a layer of abstraction that has taken, that's been taken by the community really well. Of course, hardcore CSS programmers, I have not met any hardcore CSS guys who really have taken to CSS. Anyone here? No? Oh, here. That's great. So because they feel vanilla CSS does the job and you don't really need that stuff. So coffee script in a conceptual level is similar in that it's an abstraction layer over JavaScript, right? Right. So let's show you some code, have some JavaScript code that I'd like to show you. So you guys can see it? Yeah, it's a very simple adder function. It just takes in two variables and adds them up and gives them back to you. So how would you convert this to coffee script? So let's do that now. So in coffee script, you don't need to use semicolons, right? It saves you that pain so let's remove these semicolons. There are no curly braces, again, saves the finger pain. There is no var keyword in coffee script. So every variable you use, the var is automatically attached by the compiler so you don't have to worry about var. Now of course, in JavaScript, you declare variables with var and sometimes assign variables without using var and that can leak variables to the global namespace. So we'll see how coffee script solves that problem. So you don't need the var. In coffee script, the last statement of a set of instructions, for example, in a scope like there's a function, right? So the last statement is implicitly returned. So you don't have to explicitly say return a plus b. So you can just say a plus b. That's it. That statement is returned. The function keyword, this is pretty funny. The function keyword is actually replaced by, that's it, that's the function keyword. And Nike, who is the inventor of JavaScript, got so psyched about this, he proposed this to ES Harmony, which is the next version of ECMAScript, the official version of official name for JavaScript. And surprisingly, it was shot down. I don't know why. So this is it, really. So how you would read this is input a, b, go into the function and you get the output, right? So that's it. Sorry? Exactly. I'll come to that. So in CoffeeScript, one more very important feature is white space indentation, right? Just like Python, you have to indent your expression. One little improvement you could do here is avoid the next line itself and just put it here. So it's really a one-liner right now. And that's about it. Yeah. One more thing is when you're invoking a function, the parents are optional, right? So you can, you can remove that. And that's it. So let's just compile this in here. So you get five. I don't think you can see that now. But yeah. You get five, really. That's it, really. It does the same thing, but you can't see it. Okay. You get the same thing, but with much less line noise and much concise code. So one more thing that's interesting here is I've heard a lot of arguments saying, okay, great. Another alternate JS. It's going to spit out some JS like a lot of other JavaScript interpreters, right? So let's see what this actually compiles to. So there. So that's the JavaScript that compile to. And this is JavaScript you would actually be proud of writing. I mean, of course, there's a trivial example, but really you're not making it. Can you see this? I just try expanding this. This is JavaScript you would want to write. This function you see here is a wrapper coffee strip provides as a safety to prevent global namespace leaks, right? Of course, what you declare the variable for you actually use it. And that's it. It uses the function literal type of functions, which is the better practice. And of course, it says call this right. So this is good JavaScript. It doesn't spit it out. It sings really JavaScript. Yeah. It sings. So you guys read Hacker News, read it. I'm sure, yeah. So a lot of arguments say, great, I have to switch to this because of the syntax, right? For example, Hamel. You guys have heard of Hamel? Yeah. So Hamel is a markup language that, again, abstraction of a HTML, but the difference between Hamel and SAS coffee script is Hamel does not provide you any functional, added functional value. Really, it is just syntax. Nothing else, whereas SAS and coffee script give you much more added value. So it's not just syntax, really. It's really the icing, and people won't jump from JavaScript to coffee script because of syntax. That will be just an added bonus. So the coffee script homepage, you guys have read it. If you guys have read it, it makes a few nice claims. It says it hides the bad parts of JavaScript. You'll see how it does that and focuses on the good parts. It extracts out, can you see it? It extracts out common patterns from JavaScript so that you don't have to repeat code wherever you use that pattern. It gives you an idiom. I'll show you idioms and how exactly it can reduce your code, a better object-oriented programming model. As I said, if you want to write object-oriented programming programs in JavaScript, you'll have to hack around with the prototype chain and have to say, shape dot prototype this. It doesn't feel right, does it? So this is a great book in case you haven't read it, The Good Parts by Douglas Crawford. I've taken a few, I've taken some inspiration from the bad parts. So there are two chapters in this book at the end, is one on awful parts and one on bad parts. So two chapters dedicated to bad parts and took a few of them to show you how coffee script tries to alleviate the pain. So yeah, global variables, this, according to him, and we all know it, is pure evil, right? You forget the word keyword. Can you notice a subtle difference? It's subtle. Instead of the comma, there is a semicolon and boom, it's in your global namespace and your page crashes, right? So it's pure evil. Let's not go there. It's pure evil. Everyone knows and you really shouldn't use global variables. So what's the solution? The solution is, you don't use global variables at all. That's the ideal solution. But of course, there are cases when you would want to use a global variable. In such a case in JavaScript, the best practice is to attach the JavaScript variable as a property to the window object, right? So like, yeah. So for example, in the browser, the global object is the window object, right? So if you attach that as the property to the window object, one, it is explicit that it is a global variable you're using, two, there are no name flashes. So let's see what CoffeeScript does. And CoffeeScript, there are no global variables, really. So as I said, there is no war in CoffeeScript. So every variable that you declare is attached automatically with war. And the function scopes I showed you, which enclosed the code I showed you, it prevents leaks to the global namespace. So again, if you would want to use the global variable, you would have to attach it to the window object. Or in Node.js, I think it would be the exports object. Equality. This is confused, new programmers a lot, it confused me and I'm sure it confused a lot of you as well. I mean, really, the double equals object is not what you think it is sometimes, right? If you're, for example, if you're coming with C, you wouldn't expect this kind of result when you get it from JavaScript. So what does CoffeeScript do? A pro tip here would be to always use the triple equals, right? So CoffeeScript compiles the double equals when you use it to coffee to triple equals. There is no double equals in CoffeeScript.  The keyword is, is synonymous to double equals. The keyword isn't synonymous to not equals, that is inequality. So if you, so what if you really want to use double equals, you would have to escape that with back ticks and that would be raw JavaScript and CoffeeScript code. Fall Z values. There's one more thing Douglas highlights in his book. There are a few values in JavaScript, zero, NAN, not a number, sorry. This is actually Fall Z. It doesn't to make too much sense because zero is a perfectly valid number. You wouldn't want it to be Fall Z, right? For example, that wouldn't work because name is, what's the value of name, undefined, correct, right? So what does CoffeeScript do? Everything is truthy in CoffeeScript except null or undefined. So except null and undefined, everything is truthy and you can use the question mark symbol like in Ruby to check if it's true or false. So basically it'll return false if your value is undefined or null. So this gives you great amount of relief and it's especially useful when you're using the conditionals, let's say X equals X or Y, right? In such cases, you don't have surprises, you know exactly what your code is doing. Coming to a few features, again, ask and ask, yeah, sure. You can sit, sorry, no, it's a pretty good question. False, I think it's false. Do you know the answer? I think it's false. You want to check it out? I'll get to you later. So language features, right? So Jeremy Ashkenos, as I said, he extracts popular design patterns and gives you an idiom so you have to reuse code in your code base. Let's go through a few wins, right? As I said, the last value statement is explicitly return, right? So you don't have to mention the return statement. But for high-performance JavaScript, sometimes in case it returns a very heavy object, you don't want a lot of memory to be allocated, you can just say return and it returns undefined so you don't have that problem. But of course, there are very few cases you'll find yourself doing that, really. Significant white space, as you saw. Everything is an expression. This especially comes in handy when you have, you can suffix if statements, if statements to your, say, let's say x equals 1 and say alert x if x is 1. You can't do the JavaScript, but you can do it in JavaScript because the suffix works because everything is an expression, it's evaluated in runtime. Like in Ruby, you can use the hash brackets to string interpolation. This is especially useful and it's not, you can also put code here. For example, I can assign name to a variable. I can say name dot to uppercase inside the hash brackets. Loops and comprehensions. So what the Y loop does is after it loops through, it returns an array and splats. So splats is useful. You guys have worked with the arguments object JavaScript gives you with every function. So usually use it to test the length of the number of arguments you get. But JavaScript gives you a nice argument says others, right? So it's not others, I have used others, but you can use others, the syntax is actually wrong. You have to use others dot, dot, dot, and that's a splat, right? I'm sorry about that, but that's a splat. So what happens here is the first argument, which is JS foo, gets into current conf and the other arguments PHP cloud doc type HTML goes into as an array to the others array. Please note the syntax error there. It's actually others dot, dot, dot, it's three dots. The existential operator, as I said, to test truthy and falsely values, very useful. I think Ruby guys will be accustomed to this writing in YAML. So if you want to write an object literal, you use curly braces and you separate with commas, which is okay in JavaScript, it's not that bad, but JavaScript takes that a bit further and you remove the commas, you can use it in the YAML format. As I said, the suffixed if condition works because everything is an expression. So you have, again, much less lying noise. This is a feature actually, which is proposed in ES harmony. So here, as you can see, some difficult, you get the arguments, this is especially useful when you return an array of arguments from a function. So it's useful in capturing multiple arguments from the function, right? So this is an example from Crockford. So anyone know what's going on here? So what does the first console log scope return? What does it print? Sorry? So all of you would say, Outer, you seem to viewer my friend and I'm going to talk to you later. Yes. What is it going to print? Sorry? Undefined. That's correct. So your console.log is going to print undefined. And would you know why? Okay. Tell me why. Exactly. Right? So Ascob is declared. So what exactly you're doing, the technique here, or a bad technique really is shadowing. You're actually shadowing your value. For example, this inner function is actually a closure. And it should have access to the scope variable. But what we've actually done is we've shadowed it and we've removed the access to the scope variable. And this is really bad. You shouldn't use shadowing and the ideal practice is to use different names in your inner function so that you have access to your variables that are in the function's closure. Right? Sorry? Yeah. So the first, you understood why the console.log didn't work. Right? Okay. So here, you've declared RASCOP with Outer. That's good. But it's not in this scope explicitly. Right? This is the function. And you again declare RASCOP as inner. So what happens in JavaScript is a thing called hoisting. Right? So RASCOP actually gets hoisted here, gets initialized, undefined, and then gets assigned. So again, it's a bad idea to use shadowing. So don't do it. So CoffeeScript kind of alleviates this. So this is what, this is the behavior you would expect. So when I asked you the question, everybody said outer. So that is the first instinct that comes to a programmer. Right? And when you write a similar code in CoffeeScript, you get exactly what you guys expected. So when you say console.log scope, it actually refers to the variable in the inner function's closure, which it should. But whereas in our previous function, it was shadowing that variable. Sorry? Okay. Yeah, sure. Okay. Yeah. Right. So as I said, told you hoisting. JavaScript does not have a block scope, right? Like C, it has function scope. So sometimes if you declare or assign a variable at the end of the function, that variable is actually available at the top of the function because the variable is actually, you know, available throughout the functions because it has function scope. So the best practice to avoid confusion is to, you know, use or declare variables right at the top of the function, which is what CoffeeScript does. Actually, if I compile the code and show it to you, the variable is actually, it doesn't really declare the scope variable because scope, the variable scope is already in inner scope, which is why it doesn't declare it again. Okay. I have an example for you, but there's no internet, I believe. So let's say, so I need you guys to do a little imagination. So let's say you have a plain page and you just put a DOM element, right?  And so when I say dot click, it should say, hello, my name. I've written this in CoffeeScript. So usually those things don't work in JavaScript if you write it. The first time, you usually get it wrong. Why? Because the value of this is dynamically scoped. And the time you run that function, the value of this would have changed, and it would be assigned to, let's say, the global object. In such cases, it can cause strange bugs, but CoffeeScript gives you a nicer way to declare that type of function. In such cases, you want to bind the value of this to the value of this when you're actually defining the function. You use the fat arrow instead of the single arrow, instead of the normal arrow. So what the fat arrow does is the time you're writing the function, what is the value of this that is actually bind, that is bound. So this dot name actually works. But in JavaScript, what you would have to do is declare a variable that is self, then initialize that to this, and then use self, and say self, say hello, right? CoffeeScript has class, right? It really does, because let's say you want to write object-oriented programming, as I said, in JavaScript, you have to wrangle with your prototype chain. It's not always nice. Anyone enjoys that? Enjoys writing JavaScript object-oriented style? I mean, it's especially important right now because you have a lot of frameworks like Backbone coming up which include, which encourage you to write object-oriented programming. And it's not great. But CoffeeScript solves that problem. So let's look at it. Okay, first, how does this look? It looks nice, right? You have the class keyword. You have something called the extends keyword and the super. I'll get to that in a bit. So the class keyword is a nicer syntax for JavaScript which allows you to add methods and variables to the animals prototype in this case, right? It gives you a constructor. So at the initial variables are assigned when you create the new object. So for example, cheetah equals new cheetah and dot run. I actually can run this. One meter on this. Okay, monkey patching. So anyone did monkey patching in JavaScript? JavaScript is dynamic. So like Ruby, you can monkey patch it. Of course, one thing you have to keep in mind is the open-closed principle. Ideally, it should be open for extension and close for modification. But that rule can be relaxed if the consumers of the code is you or your team, right? Let's say if you're giving out the code like an API or giving out people the chance to add to the code, it's probably not a good idea. So CoffeeScript gives you the colon colon. What this actually does is it says go to strings prototype and add the function capitalize. So you can use foobar capitalize. So you just added a method to strings prototype and that was how easy it was. So I have a few picks. So js2coffee.org. Anyone use this? No one? So this is a pretty interesting tool. So if you want to try out CoffeeScript or you want to learn how it works, there's a tool called js2coffee.  This is hilarious because you write JavaScript, then you put it to Cockstrip and again you compile it to JavaScript and use it in your code. I know it sounds hilarious, but it's actually useful when you're in your initial stages of learning, right? You get to learn how JavaScript works and puts it in CoffeeScript. Don't use this for a lot of code. Just don't, really. Maybe for trivial functions and for little functions it's fine, but the best way to write CoffeeScript is to write CoffeeScript by hand and not use js2coffee. It's a tool you can use in your initial stages of learning. Tinkerbin. I've heard of it. Okay, jsfriddle? Sure. So Tinkerbin is like the next step from jsfriddle, right? So this gives you to run Hamel, SAS and CoffeeScript code. It's actually available at tinkerbin.com so you can use CoffeeScript right there and compile and it all just works. It's great. It's a nice tool. So you don't have to save files and then run the code. You can just do it on tinkerbin.com. CoffeeScript is not natively supported in your browser, right? Only JavaScript. You can put it into your file. So CoffeeTable actually lets you debug your CoffeeScript. It compiles the CoffeeScript it gives you like an extension. So it compiles the JavaScript and shows you what JavaScript your CoffeeScript generated. The little book on CoffeeScript is a free ebook. It's written by this guy called Alex Mekor. So it's a nice little it's really little actually and it's free. That's the best part. There's another book called Accelerated Development that's a paid book. That's a proud book which is pretty good but I think this should do for initial learning. Right. So as I mentioned Hacker News and I've been reading a lot about CoffeeScript over the past two weeks and trying to get a sense of what people who are actually using CoffeeScript in production feel about it, right? So I've scored through threads and the general consensus seems to be that people are enjoying the experience. They like writing CoffeeScript one because it's not an all JS that spits out JS, right? It's an all JS that writes JavaScript that you can actually it's human readable JavaScript. You can easily read that JavaScript and you can debug it. The biggest problem with CoffeeScript right now is debugging CoffeeScript but CoffeeScript tries to avoid the problem by giving you some really nice human readable JavaScript. It just beat Haskell and ActionScript I believe as of today. So it's getting really popular on GitHub. Any Mac users here? Okay, there's this application called POW P-O-W. So it's a really easy way to deploy your apps. For example, use passenger for Ruby on Rails. It's a really nice thing to use in development that's been written in CoffeeScript. Anyone heard of Trello? Trello.com? Okay, great. So Trello is the guys who made Stack Overflow Jeff Atwood and what's the other guy's name? So those guys made Trello. Trello is a project management system. It's currently free. I think it's in beta and it's got a nice JavaScript UI and it's got a gamification kind of thing going on and I believe their stack uses CoffeeScript, Node.js, MongoDB and Backbone. So they're really happy with their experience. This is, I think, a tribute I read on Stack Overflow. Someone said they're really happy with using proper classes, especially nicer syntax stuff and to close the testimony and the love for CoffeeScript. Douglas Crockford in his, I think he gave a conference in Texas where he was asked about CoffeeScript and how he felt about it and he really warmed to the idea.  It gives you a nicer syntax and you don't worry about the bad parts of JavaScript that you usually find yourself worrying in. It's great and I believe a lot of CoffeeScript features are influencing the current TC39 ECMAScript committee that is working on bringing out the new version of JavaScript. So my guess is even if you don't invariably use features of CoffeeScript maybe later on as pure JavaScript. So thank you, that's it. This was actually meant to be a short presentation but I kind of stretched it to 30 minutes. Do you have any questions? I'd love to answer them. I'll get back to your question. I'm sorry.


I'm Raquel Lopez with the Denver Police Department. I'm going to be interviewing Commander Lanzaunier in relation to the murder or suicide that occurred in the 4900 block of Pearl Street. Commander Saunier, if you can let us run us through the incident that occurred yesterday. Yeah, yesterday morning shortly before seven o'clock in the morning, Denver Police Department responded to a call of multiple parties down in the 4900 block of Pearl Street. Upon arrival, they located a deceased female, adult female in the house. There was two small children that were also pronounced at the scene. An additional child was transported to a local hospital, whereas currently still in critical condition. We began investigating this crime and looking into it throughout the investigation. We continued into the late hours last night processing the scene. We continued this morning with the autopsies at the office of the medical examiner. Throughout our investigation, it appears at this time that this is a homicide suicide. That the female that was involved in the situation wound up taking the lives of two of her child and seriously injured another child and then committed suicide or took her own life. It's a very unfortunate event. It's been very tragic for the family, the friends, the community that's out there, my heart and the hearts of the Denver Police Department investigators and police officers that have been involved in this go out to the family and community. And you discussed yesterday how we cannot give information as far as evidence. Can you tell the community why we are not able to discuss evidence? I guess the first the biggest thing that we have is it's right in our policy manual that we don't discuss or release information about evidence but to that effect we hold on to a lot of evidence a lot of times so that we don't jeopardize an investigation. There are things at a crime scene that only the person that committed that crime are going to know and if we put out all that information we could be handing it to you know the media could cause someone to come forward with a false statement with information. So a lot of times we're withholding that evidence to it helps us to clarify to verify information that we're receiving from people. If we put out what evidence we have then that's not a safety valve that we have in place. Thank you.


Thank you very much, Ms. Karan. Distinguished guests, it is a pleasure and a true honor to be welcoming you all here for the 17th Urban Age Conference. My name is Anna Herrhausen. I am the Executive Director of the Alfred Herrhausen Gesellschaft. From the beginning in New York in the year 2005, the Urban Age has been a collaboration between the Alfred Herrhausen Gesellschaft and Ricky Baudette, Philipp Rode and their team at LSE Cities. In the last 18 months or so, we've been particularly fortunate to have found additional important collaborators. Without the following institutions and the people behind them, we would all not be here today. The United Nations Economic Commission for Africa, the mayor and city government of Addis Abiba, the Ethiopian Ministry for Urban Development and Construction, the Ethiopian Institute for Architecture, Building Construction and City Development at the University of Addis Abiba, the Forum for Social Sciences, and the Ethiopian Civil Service University. Thank you so much for your input, for your support over these past months. For some of you in this room, this is the 17th Urban Age Conference. At this point, I would like to particularly welcome Ute Vailand, my predecessor. The Urban Age is in large part also her baby. Actually, it's not a baby anymore. I would say it is a confident and able young adult. Thank you very much, Ute, for coming. For some, like me, this is the fourth or maybe the fifth Urban Age Conference. And I believe for many of you, it is the first. So I hope that all the veterans in the room allow me this brief introduction. All of you in this room are here because professionally, you connect to the phenomenon of urbanization. You come from city or national governments, from academia, from businesses, from the media, from civil society organizations or from the arts. You govern cities. You research cities. You write about cities. You advocate for certain stakeholder groups. You conduct performances in and about cities. You build cities. Most of you have the words urban, city, or metropolitan in your professional title. So you all have something in common. And as I've seen this morning and yesterday, during the course of the day, I think the connecting is already very well underway. But who exactly is Alfred Herrhausen Gesellschaft and what do we have to do with it all? We are a nonprofit organization dedicated to the legacy of Alfred Herrhausen. From the Wikipedia entry, you will learn that Alfred Herrhausen was a manager. He was speaker of the board of management or nowadays we would say CEO of Deutsche Bank until his assassination in the year 1989. What you will realize when getting further into his biographies that on another level, this manager was also an activist, a politician, and a philosopher. He was always interested in and working for the creation and maintenance of a free and open society. He would have fitted very well into this crowd and he would have truly enjoyed being here. Why? Because he would have understood that the world's urban age is upon us and that this final leap towards the urban age needs urgent exploration. The big questions for mankind come out in cities. Questions of welfare, of social cohesion, of sustainability, of security. Questions of values, questions of governance. You will rightfully ask, if this is the 17th Urban Age Conference, don't you have some answers as well? And all I can say is yes and no. Our experience of the last 18 months has been humbling at times, motivating at others. We have all learned a lot and I would like to thank our four mentioned collaborators again for welcoming us with patience and with an open mind. The dynamics of urbanization in sub-Saharan Africa, the drivers behind this trend and the rationale by which it plays out are in many ways different from what we've seen in other parts of the globe. The current challenges however, and I'm aware that this is a strong statement but I wouldn't be here today if I didn't believe it, the current challenges are arguably not so different in Addis Abiba than they are or perhaps have been in Medellin or in Singapore or in Leipzig for that matter. We have tried to reflect this asymmetry in the program of the next two days. In terms of how to deal with rapidly urbanizing regions in sub-Saharan Africa, I hope you will support us in teasing out where the commonalities and where the differences lie, where we can transfer practices and where we should develop something indigenously. Where we should plan and coordinate or where we should allow for trial and error. I hope you will all contribute to the discussions and I hope you will all take something valued away from them. Please enjoy the conference.


You can create multiple libraries that are separate from your personal library that you can share with other people. This is really handy when you have a group project and you need to collectively find sources and annotate them. To create a new library, select the icon that looks like a box. New Library. Then choose New Group. You'll be prompted to log in to Zotero.org. And here you can choose a name for your group, and then choose the group type below. Public or Open Membership. Public Closed Membership. Or Private Membership. I'm going to choose Private Membership. And then select Create Group. Now we're brought to our new Groups Settings menu. Where we can change the group type and permissions. I'm going to make sure that any group member can edit and read. And if you make any changes, be sure to hit Save at the bottom. Now if I go to my Groups tab, I can see the shared libraries that I'm a part of. And for my big project, I'm going to choose Manage Members so I can invite other people. I'll choose Send More Invitations. And in the Invite Members Group, I'll add my group member's email addresses. And then I'll click Invite Members. It's important to remember that you should encourage all of your group members to get their own separate Zotero accounts. Not to share just yours. This way, everyone can keep track of their own information, their sources, and not have to worry about people changing things. And it's easy enough to invite people to a group library. Now I'm back in my Zotero application and I'm going to hit Refresh. And as you can see, my new Group Library, Big Project, is in the left-hand menu. And once my two group members accept the invitation, they'll be able to access this as well. Two other things to note. One, whoever creates the group library owns that data. So if you're getting close to your data limit on Zotero.org, you might ask a different group member to create the library on their account. Secondly, you have the option to transfer ownership. For example, perhaps you are finished with your group project and you don't really need the information anymore. However, someone in your group really wants to continue the research. And they want to keep all of the sources you all already collected. To transfer ownership, go to Zotero.org. Go to your Groups tab. Go to Manage Members. You should see the current members of your group. And as you can see, my role is owner. You'll be able to change the role of other group members so that you're a member and they're an owner. After you do that, you just select Update Roles and ownership will be transferred.


Hello. Yeah. Hi, everyone. I'm Garima from ThoughtWorks. And I'm an application developer over there. I worked on Android for a couple of months. We have built an internal ThoughtWorks app. Apart from that, I am a DevOps person, service management, et cetera. So quickly coming on to today's discussion. First, let me cover what I'm going to talk about is performance bottlenecks and why that is the other side of usability. The sections that I'm going to cover are, I'll talk a bit upon usability and performance, why they both overlap each other in case of Android. Then I'll talk more about performance bottlenecks that we have faced in our previous apps and how did we go about solving them. And then at the end, I'll talk about how you can gather more and more feedbacks from user about performance bottlenecks. So to start with, before I start, I want to tell you guys that this session is going to be pretty interactive. I would like to have as much inputs from your side as possible. So let's start. I would ask you the question, what is usability? What do you think by usability? Come on, if anyone can answer that. Exactly. How easy it is to use. How swift the navigation is. When we come to Android apps, how swift the navigation is. How intuitive is the app? How beautifully the app launches. As a user, how good I feel when I open the app. Now tell me, after usability, what do you feel about performance? What is performance in Android? Exactly. And why is that that important? Because the way in which you use mobile is only for some seconds. If the app is not working, you exactly come out, even though it has so great usability, great UI and all. Exactly. At the end, that is adding towards the user experience. So in case of Android, especially when we talk about performance, concurrency, scalability, and those things get eliminated. So in case of Android, we can clearly say that usability and performance overlaps each other. When we talk about usability and performance, we come up with these buzzwords. User experience, user-friendly, stylish, designed, heavily featured, swift navigations, everything. Now let's talk about a few broader points. The app should be quick, as you said. That is the basic need that I require from my app. The app should be quick. Let's take an example of Gmail. You launch the app, there is something. There is no loader coming up, and there is something which is already present in your app, which Gmail has already downloaded, and that has shown. Next comes engaging. The best example of engaging app is Angry Birds. When I start using it, I want to go on and on. I want to clear as many stages as I want. Next comes intuitive. These all words are very tightly coupled with each other. When we talk about intuitive, if I want to add some data, if I want to add something else to my app, there should be a plus button.  These things adds to intuitiveness. Error handling, yes. If there is no internet working, your app may crash saying, oh, something happened. Please, do you want to reopen the app? Next comes easy to learn, as the name suggested. WhatsApp, I installed it, and I just went on using it. It was really very easy. Next comes effective. Now, by the term effective, what I mean is user gets all those features that he's expecting from your app in that app. For example, let's take the case of Instagram. It gives you all the functionalities that you can do with your image. Gives you built-in templates to redesigning to your image. It will give you focus and everything. So that is the best example of effectiveness. And last comes well-styled. With well-styled, I mean two things. First is good-looking. Yes, obviously, we want a good-looking app. Second thing which comes is how consistent is your app? Consistency in terms of different apps as well as a single app. Your single app should be consistent with the successive layouts. Your first layout say orange color, and second layout is a purple color. Would you like it? No, there should be a consistency. So we have talked about these things. Now, let's talk about the performance bottlenecks and what is the key focus of this session. Now, think of an app which is very beautiful. You open it and you feel, wow, what an app. And as soon as you click on the second button, it hangs. Nothing is happening. As a user, how will you feel? In the next step, for the second step, you went to another button, and again, the app crashes. After some time, you will uninstall it. We don't want those things in our app. So as a developer, what we should do? What things we should keep in our mind while developing the app? Not as a UI person, not as a UX person, that this should be the design, this should be the buttons. Here it should be in that. No, before that, you need to think as a developer that what changes, what tricks that I should keep in my mind will add to the performance. So that's what I'm going to talk about today. I'll share my experiences that we have faced. These were the problems that we have faced and how did we go about solving them. So what are we going to do is these couple of steps that we are going to follow for some basic version of app. So I have this shopping application app, very basic version of it. It has a couple of performance bottlenecks. As an audience, as a user, you will have to tell me what are the problems that you see in those apps. In the next version of it, we'll remove those apps. We'll touch a technical bit of it that how did we go about solving it. And then we'll see the next version. And again, in the next version, we all will come up with the problems that we are facing. We'll remove it. And that's how we'll go take our basic application to a pretty nice looking application which you can actually take to Play Store. So this is what we are going to do. So before I start off with the first demo, this is what our basic application is doing. As soon as user launches the app, there is this great view. The app makes a server call for the list of watches. In case of shopping application, I have used watches. Now that list of watches is stored in DB. As a next step, the watch comes with these four things to it. First one is name, description, thumbnail URL and image URL. It's not actually the image, it's URL. So whenever user clicks on the app, it fetches these things, stores in DB and gives a name and the thumbnail URL on the grid view. When I click on one of the watches, I am taken to the next layout which has name, description and the image. Image actually gets downloaded. So let's see the first version of our app. This is the shopping application app. I launched it. I launched it. Hopefully the internet is working fine. What are you thinking as a user? What do you think? What is the problem with this? I'm using main thread to load the application. Exactly. As a developer. Yeah, the internet is working actually very slow. Do something. Yeah, we are working. The app is not loading. As per my expectation, it should have get loaded by this time. It is taking a lot more than expected. But yeah, this was my main intention. That app, as soon as you open your app, this is the first feedback that you get. The waiting period was too much. As a user, I was confused that even the app is working fine or not, whether there was no immediate feedback. And at that point itself, you lose your first user. You, the user don't know whether it's working fine. Should I go back? What should I do? Have I done something wrong? Is my phone itself got hanged? And you know, user can say, oh, this application actually hangs my phone. So these are the aspects that you should think about when the user launches the app itself. So now let's try to locate it with what is actually happening in the background. What is happening is I make a server call for list. I store that in DB, the second image. I make a server call for images. And then I combine those images with a list. Until that point, I get this black screen. And at the end, I get the products with images. The problem is over here, right? Now, as a developer, you tell me, what can we do? Separate threads, show a notification, saying that it is loading. Don't load everything at one time. Exactly. So let's take his first thing that he said that instead of this blank screen, at least give a loader to user that something is happening, right? So let's see the solution to it. What did we do? Yeah, instead of calling your server call directly in the main thread, use async task.  And then async task comes with a callback functionality. You can use this callback to dismiss this dialog. Technically, how can we go about it, right? Now, let's see the second version of our app. Yeah, see, it worked in the background at least. Before that, I will quickly remove one of the dev settings that have done. So I'll remove the first version and install the second version of our app. And user gets a loader. Now, what are you thinking? What is wrong with this part? User gets a feedback, right? Still, there is some problem. Sorry. So the user can't do anything till the loading is not finished. Yes, exactly. Couple of feedbacks. This loader is going like infinity. So as we saw in the timeline that we download the list and then we download the images. Images are actually the thumbnails, right? So instead of, yeah, this is the version two. The problem that we are facing is the loader is going on and on and on. The waiting period is too much. Now, trying to relate it with what is actually happening. User makes a call for list, stores and DB. Server call for images. This is the point where we can change it. This part can be actually replaced with the actual content without images, right? But how do we do that? Any idea? Lazy loading placeholder. Now let's see what I have done, what we did, was to having two different async tasks. First one was a download images task without a callback. So as soon as you get your images in the background, they'll start getting populated. And this resource downloader, this callback doesn't wait for the downloading images to come. So that's it. Your problem gets solved. Let's see the third version of app. Anyone having any issues with any idea that what we did? Okay, so let's see the third version of our app. The internet is not working. So third version of our app. Hopefully this time it doesn't take that much of time to load. Yeah, I'm sorry. Yeah, the solution for the third version. Yeah, but we don't know the problem of third version yet. Yeah, sure. I'll go back to the previous slide, this one. You want me to explain? Point here. Yeah, cool. Let's see whether the app worked or not and it is not working. So let me change the internet setting for one. Give me just one minute. So till the time this internet start working, I'll take you through how, yeah, this page is at least there. So in this next case, yeah, this is the version in which the images are downloaded at the background and we'll see that the page, the layout first gets populated with just the list and then we get the images. This is also not working well. Internet. Okay, so till the time it comes over here, I'll tell you what the next problems that we face. Every time, even if the, when we scroll up and down, if you might have noticed, the images get downloaded in the background, right? If you scroll up, what happens is, Android's layout, the way Android's grid view and the list view works is, as you scroll up, the layout goes up and the fields are reused and with the populated with the next content, right? So every time you scroll up and down, the images, the thumbnails are downloaded, right? So the scrolling bit becomes little laggy. It takes time to scroll up and down and the images takes times to come out. So what can be the solution that you think of? Caching. Exactly, we can enable caching, but how can we do that is by, let's see, shared preferences, most of us might have used it. So this was the problem with the third version.  So this is what is happening in the background. When you scroll, images products comes without images. The solution is we enable caching. So I have used shared preferences. I'm sure you might know that there are some other ways also in which we can get images for our app, any idea. Downloading the images actually and storing it in internal device, internal memory, external memory, maybe use your database. Now the question is why did we go with shared preferences? Anybody having any idea why we should use shared preferences and in which scenarios we should use shared preferences? Yeah, as a bitmap, right? Yeah. So the user tickets, right, you know, whenever the application, JVM closes, all the incidents will be closed. So when the new JVM is created, I have to get the user tickets. So these kind of information will be stored that shared preference. Exactly, so the idea behind using shared preferences is when your size of data is small. So in this case, thumbnails images were really very small. I would not suggest anyone to use shared preferences, especially for images, but in this case it was thumbnail. So we went ahead with using it. The second point which added to this was the frequency of those images getting downloaded, right? You are scrolling up and down. So in that case, images will be required frequently. As a user, I'll just scroll up and the scroll should go on and on and on and if images are not coming, I would feel what is happening. Also, not to use internal devices, internal device memory was because every time you scroll up and down, at least there will be time required to get images from your internal memory. If it isn't shared preferences, it is there very closely with your app content. So the next version was actually without using our app with shared preferences and having caching. Let's see if the internet is working now, which I'm not sure. It's not working. This time I actually wanted the app to be present so that I can get more feedbacks from you. Let's see in how much time it loads. Till the time we can discuss about, what else? Async tasks, how did we go about using them? Maybe callbacks, when to use callbacks, when not to use callbacks. In our first version, we used just one async task. In the first version, the basic one, we made the server call directly from the main thread. The main thread was blocked. In the second version, what we did was, we called the async task for both of them to get the list as well as the images and then get back to the main thread. It's not working. And at the end, yeah, with caching and with downloading images in the background, we used shared preferences. Till this point, as a developer, we are satisfied. Now something is there which comes as a user experience. So as a backer of it, I have a screenshot taken of my app. So let me quickly get it for you. So this is the recording that I'm playing. And this is the version that I wanted to show you for the caching part of it that whenever user scrolls up, these three, this grid view will be reused to display the next images, next content, hence it will go up. And the content for these, this one which went up will get deleted. So in order to keep it with us, we used caching. Now there is some problem with this version also. Can anybody tell me? Something from user point of view, user experience point of view. Yeah, so we used caching for that. So now it is getting really easily fetched. Now don't think of as a developer. Now think of as a user. First time you open this app, you see a loader, you see content like this, but still there is something missing. Do you? Yeah, I actually didn't like the looks. And here comes a very basic requirement from an app. It's looks. We pay a lot of attention for looks, but still we forget that it should be consistent, right? If I go to go inside one of them, there is a red color which gets displayed. Yeah, this one and I go to one of them. And this is the content that I see. There is a very high problem of consistency. Previously in the first page I get to see purple color. And then in the next I see a red color and you know images are looking ugly. To solve this problem we can, you know, we can every time go and change our, change our layouts, the color that we are using. But for how many times are you going to do? You create one more layout. Are you going to design its layout from the scratch? That you know, if the text box is this, text box is this way, you change the color to purple, you change the action by or to something. Are you going to do every time? No, let's make it little agile. Let's introduce themes. Android itself gives you an option of using themes. But what if I don't like to use the normal pattern? Then we'll extend our themes. We'll, you know, we'll make tweaks in our themes so that the problem of inconsistency goes away and there is a fresh look given to my app. Now let's see how I have used inconsistency. So here is the way you can use themes in your manifest. You just introduce a style app theme and in style.xml you gave, so this is the reference that I have given and parent is Android Holo.  So now let's see the next version of our app. Let me go and uninstall it. Now, this is the version which has a new theme and, you know, I have tweaked the Android themes for it. Let's launch it and you can see a... So if you have noticed, I just changed that Android manifest and the style.xml, but the appearance is completely different. Is there anyone who has used themes previously in their apps? Yeah, couple of you, but it's a really nice thing to use. It gives a drastic difference in the user experience. Just tweak it a little bit. It will give you really nice performance, not performance, but the user experience. Yeah, I'll take you to the code then. This is how we did it for our action bar. Just for the action bar, I said use this color as the background, which is orange. So as you can see over here, this orange color, it comes from the tweak that I have done to my theme and rest of them is all Android theme, which gets populated. Yeah, coming back to the presentation. Now we saw we are about to see the fifth version of our app, which is not coming that easily because of internet, but what else do you think, what else can be problem with the next version of our app? We removed the loader problem. Let me take you to test. This is how the app looks. This is the backup that I'm using from the screenshot. I'm sorry that the internet is not working properly, but this is the current state of our app. Now as a user, you are not able to identify what the problem is, right? So let's use some developer options. What I'm going to do next is, I'll go to developer options. This you can do in your phone right now itself that go to developer options. Enable GPU rendering. How many of you knows just want to check? Yeah, couple of us, but let's go over here. So I went to developer options and will enable GPU rendering. What it does it, it will display the content in a different color. Blue, green, light red, and red. What it means is on your layout, now let's, this is the screen that you see. Now let's break it into layers. You see different layers over it. Every time there is a layer on the pixel that overdraw is done, right? Every time there is a new layer, the pixel gets drawn. For one X and two X, that means for one time or two time, it's okay. Three time is fine. But when it comes to four or five, it's not desirable. Why? Because Android itself will take time to render, to draw it on the layout. And that time is not noticeable by normalize. Then why to not have layers? It's because you'll feel it when you go back and forth in your app. You can feel that there is a rendering time which is required. Every time you go, you go immediately back and forth. As a user, I'll go, oh, I need like this watch. I'll go, come back. I'll scroll, I'll go to the next. And that rendering time will irritate the user, right? So what is actually happening in background is this, I'll go to presentation now. We use the developer options more properly and we see this. The rendering time is more. Now Android provides you a very nice option of hierarchy viewer. You use GPU rendering, enable GPU rendering to know that on layout, how many times, how many times the drawing is done, red, green and everything. But you don't know which layer is actually doing that, which is the redundant layer that I can remove for that. Android provides you a developer tool in your DDMS. If you go and click, I'll quickly take you to that tool also, this one. On your DDMS, you can select your application.  But generally it looks like this. It will give you the layers which are present and there are three dots connected to it at every layer. So consider that your layout had a basic linear layout inside which it had a image view and a linear layout. In that linear layout, we had two text views. This is something that is shown, right? But what do I get out of it? How do I know what is the problem, where actually the machine, the device is taking time to render is these three dots. Green means relatively, the time taken relatively was less, it was okay, okay. Yellow shows the relative time was 50% more and red is the sign that okay. On this layout, while rendering this layout, drawing it on the screen, Android took time. Now there are three dots. These three dots means, first one is the layout, second one is, I don't remember it well, yeah, draw and the third one is the actual, I'm sorry, I got confused, the first one is rendering, second one is layout and third one is draw. The third one is the one which is more, you know, which I focus more upon is because the time, the draw, actual draw time is over there. If that is red, which means that on that layout, on that specific layout, I want to make some changes, I would like to remove some content out of it. So this solves our problem and in the next version, your rendering will be much faster if you go back and forth. If the internet might have worked properly, I would have shown it on the actual APK that I have used, that yeah, the ongoing back and forth, it works fine. So let's see the app progress that we saw from version one to six is this. This was the first one, ugly looking app and the second one. This is actually you can take to Play Store, right? It's pretty decent, not a high five, but there are some couple of things that you can do next to it, you know, provide offline support, you can, you know, provide, every time user launches, they have no need to show the loader, the way Gmail works, right? The previously loaded content is shown and Gmail does the downloading in the background. All such functionalities you can do step by step, but this is the basic version with which you can actually launch your app. So our apps need to be agile enough so that the new functionalities, new features comes, we can involve them as easily as possible. Now let's see what is the summary, what we actually did. The problems that we faced were a black screen as soon as we launched the app, we added a progress dialogue. The waiting period was too much, we did the downloading in the background. Now the images were getting downloaded every time, then we used caching. In consistency, we used themes, we tweaked those themes according to our requirement and at the end there was a layout overdraw. This was not visible by the user, but what we did was to use developer tools properly, using hierarchy viewer, we could identify that there is some problem and then we removed this. I think optimizing layout was covered by Sriram in the morning session, so I'm not covering that. And at the end, other ways to get the user feedback. And why am I focusing on that is because at the end of the day when you launch your app, it's the user who's going to give you feedback. But before launching, before that, what you can do is couple of testings, like hallway usability testing. As the name suggested, go in your office, whosoever comes next in your hallway, catch hold of him, show him your app and deeply analyze his behavior, his spatial expressions, how he is feeling when he navigates from one layout to other, when he's trying to search for something. If you deeply analyze his expressions, you'll come to know that, oh, there is some problem over here. Next comes competitor analysis.  Is there something really good which I cannot compete with? Try to do similar. Try to come up with new idea around it. Next comes dog-fooding. How many of you know what does this word mean? Yeah, exactly. Eating the food that you're going to give to your dog, which means use your app first. Be the first user of your app. For example, for this shopping application app, be the first one to go and purchase a watch from there. Not an expensive one, at least. But yeah, be the first user of your app. And at the end, yes, user comments when you go after you launch your app, go through the user comments and you'll come to know. Before I end up this session, I want to tell a few more things. While developing the app, we don't know what problems are going to come. What bottlenecks are we going to face? It's our responsibility that we design. We architect our app in such a way that even if some bottlenecks are there, we are able to remove them. And there comes the idea of using object-oriented programming, modeling your data models, using MVP or model view controller. Many of us know about these things, but how are we using them? Using single responsibility principle, keeping our app agile enough to, if in the future, even if a new functionality or a performance bottleneck comes, we can solve them in a quick way. That's it. Thank you. Questions, anyone? So why are you storing each and every thumbnail in the shared preference? Basically, when your app launches, all the shared preferences get loaded in the map, right? So let's say there are 100 thumbnails. So in that case, your app performance will be even worse. Yeah, yeah. So there is when your decision comes in that what you want to use, what is your use case? If you have 10 images which are going to come up, if you have 20, it's okay. And it's the thumbnail. If it is actually an image, a big size, it has a bigger size, then you should think of other options. At the end, you have to decide that if I can use a shared preferences, how it is going to perform. And if it is not, if you said 100 of them, then obviously go ahead with the internal memory, store it beforehand. Okay. Actually, if it's not a thumbnail image, it told that we can go for some other option. But taking internal memory, it again makes the app, makes use of the memory a lot. Is there any other option other than internal memory, external? External storage, right? As WhatsApp does, right? Sorry? If you have got chance to go through WhatsApp folders, it actually stores the images of every person that we get the contact image in a direct read directly. It doesn't store it in shared preferences. Okay. Okay. Hi. Hi. I think you talked about the performance with the EOS Red and the images, caching images and all of the good presentation. I would point one thing actually, a question, by using the Android in-built SQL like database, right? Can we have, what kind of performance issues can I have or any difficulties to, because I have used SQL like database, but I have used a small, small query. Yeah, same. So I'm aware of it when you talk about it. So I'm totally aware of it actually. What kind of performance issue I have? Yeah, so in case of, so my, if I need to decide that should I use a database or directly the internal device memory or whatever, it will come from the use case that, what is my use case? There is no key that I want to store that. For this particular thing, I want to store image this, then this. In this case, we just wanted the list of images, not the actually images, that's it. Apart from that, we didn't want to store the whole content. As in case of this, we can actually extend it to next phase, storing the images and downloading them and storing it in DB. That's the next step to it, but for the basic version, for the, you know, the cutoff where I can think of, you know, you can always enhance your app. You can always, you know, add new features, new functionality, new performance to your app. But you need to decide that, oh, this is going to work, you know, slightly for me. This is not going to affect the performance drastically, and that's it.  Thank you. Hi, here. Yeah. So I want to focus on the problem which we saw right now. Internet connectivity, we did not handle that. So in caching, say for example, I cached six images and then while scrolling, I lost internet connectivity. So how do you deal that? I cached six images and when I scroll down, I do not see any images. How do you handle the situation and... Yeah, you don't have internet then. Yeah, but I cached six images. As a user, I will not know that they came from cache, right? Oh, yeah. So in case of shared preferences, when you launch the app, your shared preferences start acting by that time.  It depends then when I clicked, when I actually launched the app and when the actual server calls were made for images, that time it got loaded and stored. So as a user, I will know that, okay, during this, you know, when images were coming. I mean, when I'm scrolling, say for example, I did not scroll. For the first time I saw six images. Then I scrolled and I lost internet connectivity. So there are six images on the top. There are no images now. So when I scroll down, I mean, when I scroll up, I'll see images. So as a user, I'll not know that they came from cache. I think I got six images and now I'm seeing blank in the bottom. Yeah. So, but you don't have internet connection at that point. Maybe you can have a placeholder. I mean, how, how will we show this to the user that there's no internet connectivity, but I got these from cache or how to handle this situation?  How will we tell the user that it's because of cache? We'll not tell the user that we are storing it in the cache, right? So maybe as a placeholder, you can say that no internet connectivity or something. For every grid or how? It depends upon how you want the interaction to be. For me, I am okay with, if personally, I will be okay with, you know, only six images and if there is no internet connection, then maybe user will have to go back and check your internet connection. That again affects user experience. So he'll be thinking, I got only a few images and I'm not getting others. At least that will be a feedback that at least I got some images. That will be more better than nothing. Your intention was to, you know, if you get all of them, then only start populating. Otherwise, don't show the images. What's your point, Brianna? I'm asking how to deal in this situation. That's it. Yeah, that's it. Cool, thanks. Hi, here. Hello. Yeah. So my question is, have you dealt with out-of-memory errors, which that is very pretty common when you're dealing with images and means especially in low budget phones. So that comes up very often because they have very less memory, very less RAM. Yeah, so I never got through that, but if I start getting that error, maybe I'll switch my shared preference using caching to internal memory or maybe external storing the content in external. If you're asking me that, what should we do in case of, sorry, what should we do? If you're saying that you will change it from this shared preference to external memory, that won't do any good because here out-of-memory error comes from heap, right? And your shared preference, it's not in the heap, right? Maybe for temporary, it's in the heap, but it's stored in the internal memory of the application folder. At the end, right, yes. So the out-of-memory error can come if your thumb, means it's because when, if somebody else, the heap is something that is shared by all the apps, right? It's occupied by some other apps. Yeah, so if some app is very buggy and it takes up a lot of images, it stores it. So the heap may be very less for me to use. And sometimes inflating us even a simple thumbnail itself from the shared preference can cause an out-of-memory error. But don't you think that will be a problem with that buggy app, which is there? No, but how? Do I need to handle it? Yeah, that is certainly, but from a developer perspective, how, I mean, this question totally depends on if you have handled out-of-memory errors. I never got a chance to handle out-of-memory errors. Sorry. Hi. Hi. Yeah. I have this problem, but I didn't expand it thoroughly. Which one is applicable? I mean, advisable. Okay. Writing data that is received from the server as JSON or objects, apply object civilization and then write it. Personally, I would go with JSON, maybe. It has performance issues I've experienced. Yeah, so. Because you're reading it from a file? I don't know.  Maybe that's how. Because I'm not sure how to handle those kind of problems. Maybe, yeah, we can actually take this case offline going through the content that you have for objects as JSON. Okay, then how does Google+, Facebook does this sync and then store it locally so that we can view the, view things, even when we're offline? Can I answer this question? Yeah. So, basically, there are some libraries like Picasso and there was a talk in like 4 o'clock on Wally. Okay. So, Wally has a networked image view. So, they do cache for me. So, basically, there are many image caching strategies that they use. There are basically two, the best way to do image cache is two levels. One in the memory itself and another in the SD card. So, in the memory you'll be using something called a bitmap LRU cache. Okay. LRU cache is something that keeps track of which bitmap was used, the decent. So, old bitmaps will be quickly recycled. Okay. So, there will be two levels. One will be in the memory itself and one will be in the SD card. There are many libraries. If you just search and there are libraries like Universal Image Loader, Droid View, Ignition. I mean, forget about images, just JSON. No, JSON won't do. Basically, better is that you keep it as a byte array. That's the best way you can do. Okay. Thanks. Thank you. Okay, thank you.


I'm on. There we go. Susanna, thank you so much for doing this. We're thrilled that you could be with us. Your film is absolutely astonishing. I can't remember the last time I learned so much from a single viewing on a single topic. Oh, thank you. It's it's quite a remarkable piece of work. I'm wondering what you learned while making it. Well, I kind of learned everything while making it. I mean, I learned a lot before I well, I learned. I learned the beginning of it, you know, when I went to get treatment for my daughter. So I learned a little bit then. But what motivated it was that once I knew what was happening to her and I started talking to people about it, I discovered that so many people I knew had migraine and didn't talk about it. I didn't know they had this, you know, condition. And I realized how closeted it was and how nobody was talking about it and how there was a need to talk about it.  I also the biggest surprise, I guess, which is in the film was learning that I had had abdominal migraine. Once I discovered there was such a thing and putting those pieces together and going, oh my God, that happened to me. Why do you think the stigma is so powerful? Why do you think it's been such a well kept secret? I think probably the biggest reason is because it's seen as a disease of women. It is, you know, 75 percent of people who suffer from migraine are women. I think because you can't see it. It has a lot of the same associations as, you know, hysteria and the sort of, you know, melodrama that is attributed to women when they are not believed.  Yeah. Yeah. Yeah. So I'm going to ask you some questions now that came from the audience the night that we showed the film. Great. Why don't doctors tell parents and patients straight away what migraine symptoms are? Believe it or not, I think a lot of doctors don't know what they are. That's still a big problem. You know, I think there's a doctor in the film that says that he teaches one hour on headache in medical school. So unless you're going into the specialization of headache medicine as a medical student, you're really not going to learn very much. Plus, there are a lot of symptoms that are still being discovered as being associated with migraine, you know, because it's a neurological disease. And I think it's been so hard to break out of the sort of paradigm of headache, which is obviously only one part of it. If if if them, you know, and there's some people who don't even have headaches from it. So it's a very steep learning curve for doctors. Wow, it's so amazing. How did you choose your subjects? Well, I chose my main subject because she's my daughter, Emma, who was I had easy access to, you know, I was just I thought, you know, we were sort of testing it out. Is this can we make a film like this? Is this what's this going to be like? She brought to my attention Joan Didion's essay in bed. And that gave me the idea to try to contact Joan Didion and choose her. And she said yes, which was amazing. What made you shoot Joan Didion so extremely close up? Well, her extreme close up was just reading the material if she was kind of in a normal frame for the interview. I just wanted to be in her experience. I just wanted nothing else to exist for the moment.  And and you can see her pain. She was actually having a migraine while she was. We that was actually in the film at one point. Yes, it was. Is it in it still? I can't, you know, you edit a film for so many years. Yeah, yeah, yeah, no, it's in a one time. She says I'm having one now, right? Anyway, she's just such a vivid sort of experience of what she's talking about. Mm hmm. So how long did it take you? I'm still reading these from the audience. How long did it take you to make this film? I hate to say this, but from beginning to end, eight years. And that was because we had so much trouble raising money because nobody was interested in a film about migraine. I mean, the film, the film community didn't get migraine and the migraine community didn't get film. So it was like, where do you go? We we got sort of our biggest kick at the beginning was a grant from the Migraine Research Foundation. We met, you know, we would go to conferences and we would meet all these people. And we would talk about what we were doing. And actually one of the doctors, you know, we got, I can't remember where we got the first little bit of seed money from, but we had a little bit of money that we started out with. And we went to a conference and we met some doctors. And then they, you know, they knew where the money was and who was in that world of funding for research. And it was one of the doctors in the film who suggested the head of the foundation. And then we got to her and then there was another foundation. I mean, we got a lot from foundations and actually also family foundations, private families who had children who suffered from it and recognized the incredible value of film in order to, you know, some people think, well, if it's not medical treatment, then what good is it? But, you know, particularly mothers, there was, you know, there was one couple where the father was like, why, what, how's the movie going to help my daughter? And the mother's feeling was it's going to help her not feel so alone and isolated and devastated. And it's going to help, it's going to get attention to the subject. Another audience question. How did you cast your film with such a great geographical variety? That was very deliberate. And that's kind of back to how did you pick who you were casting? Yeah, I mean, you know, actually the geographical variety wasn't as deliberate as the gender, race, age spectrum. Right. That was very deliberate. We were, I mean, a couple of our subjects were in the south. The couple were in the northeast, trying to even remember where we went. You know, we had doctors, you know, we have a doctor from UCLA. We have to, you know, we do the doctors were from wherever the great headache doctors are, the great neurologists who would convene at whatever conferences and then we just, you know, go wherever they were. And why is there such a paucity of funding from migraine research when over a billion people suffer from this disease? One, it's invisible to its women, primarily. Three, the that I think the term headache is really does a disservice. The association with headache does a disservice to the to the disease because it's so much more. And it's and it and and and it is not except in instances which do exist of suicide. It's not life threatening.   But that's, you know, that's rare. And so it's not considered life threatening. So how can the migraine myth be broken so people can realize the condition is so much more than having a bad headache? By watching this film, by, I mean, you know, people, people have to want to know or have to be exposed to it without knowing that's what's going to happen. You know, people sometimes people like get dragged to this film and then they go, oh, my God, I had no idea and it was so fascinating and it was so great to watch. And, you know, it's really hard to break the stigma and to break through and get the information out. And so, you know, we're we're placing this in medical schools. We have a grant to place it in medical schools all over the country that we're working on now. So at least there will be access to it. And we're, you know, trying to distribute it as well as we can. But, you know, you get the word when you discovered that you had suffered as a child from abdominal migraines. How did that affect you in terms of your thinking about your daughter? And how does a person cope with abdominal migraines today? I didn't really change anything in my thinking about my daughter.  It was just sort of another interesting piece. It made me feel a bit of a kinship, maybe. Yeah, a connection. Yeah, yeah, even though mine are very different from hers. Is it genetic? Well, yeah, I mean, it is hereditary that migraine is hereditary. And I and I think in the film, I say that I was asked by the neurologist, you know, who in your family has it for that reason.  Did either of your parents suffer from any form of this? No, not that we know of. OK, so no other family member. I mean, probably, but not that I know of.  She has to say, did your mother go into a dark room and close the door? You know, because people don't talk about it. So I don't know who's I mean, sure, I'm sure many people in my family and maybe even in Emma's father's family. Yeah, but right. How would we know? Right. So Emma's a social worker now. Yeah. How did her illness lead her there or did it? It did, actually. And she said this on camera and we just couldn't fit it in the film. It made her want to help people who are suffering in silence. So in fact, it inspired her so that she could be an example in a way to others. Yeah, it inspired her to help people who couldn't necessarily understand their own suffering or express it and help them do that. That's amazing. Yeah. When you say in the very beginning of the film, this was one of my favorite parts, you say, I had to make this film. That's a really extraordinary thing because a lot of people wouldn't say that. They know that their child is suffering from an illness, but they don't necessarily have the motivation or really the drive to turn it into something like a film or a book. So what propelled you? Well, I mean, I am a filmmaker, so I am someone who when I see a subject that I feel needs to be explored and is interesting to explore and that I have something to say about it, then that sets me off. It's not like I wanted to do it. It happens to me a lot in documentaries. Is it like a subject comes to me and it's like, oh, my God, this has to be a film. Right. I understand that completely. Yeah. So knowing all that you know now, how would you advise a parent, any person really, who is suffering from migraines or who has somebody that they love to suffer from migraines? Well, what would I say to them or how would I advise them? Yeah. Get to a headache specialist, get to a neurologist who is actually a headache specialist. I mean, there are some extraordinary doctors who aren't special headache specialists who are able to treat this. But I think if people are really suffering and not finding relief through normal medical channels, they need to see headache, a headache specialist. So tell us about the difference between a headache specialist and a migraine specialist. Who should go there? They're the same migraine and headache specialist. So what's the difference between a regular neurology? Well, neurology has many different areas and headache is one area of neurology. Headache and migraine is one area of neurology. But I have a really interesting story, which is that. We had, I mean, one of the great things about this film is how many people come up to us afterwards by us.   I don't feel so alone. I had a guy say, oh, my God, my wife dragged me here. And now for the first time in my life, I understand what my daughter is going through. But we had a headache specialist, a doctor, a neurologist, headache specialist who came up to us after screening and she said, I'm a headache specialist. I don't suffer from migraine myself. This is the first time in my life. I have really understood what my patients are going through. Wow. Well, that's that's everything. I mean, how amazing. That's fantastic. Yeah, so not only are you able to allow the audience to empathize who may have migraines or know someone who has the migraine condition. You also gave a doctor the gift for the first time to really understand what it's like to wear those shoes. Yeah, I mean, most honestly, most doctors who go into headache medicine actually do suffer from migraine really dry leads them there, but some don't. And so, you know, it's something that's that's, you know, really hard to understand unless you put your mind to it. How is Emma doing now with her migraine? She's doing great. She's doing great. She's really managed. She's one of the lucky ones. I mean, she's had a few flare ups, but she basically. Well, well, it's actually really interesting. They they kind of transformed as they do. They change over time or they can change over time. They can get worse. They can get better. They can turn into sort of something else. And when she stopped getting headaches and aura. She started. She got IBS irritable balsam drug, which is a very it's it's it's not an adequate name for what it is. It's not an irritation. It's it's it's it's an agony. Yeah, no, I know. And so Bob Shapiro, who's the doctor in the film in Vermont, who does the gut brain connection research, he said, you know, his feeling is this is her the current manifestation of her migraine. So she was she had that for several years and her diet was really, really restricted. It was really very thin. Oh, it was it's really hard to know that on the camera. She was thin because of the drug that is not named.  Right. But then, you know, she got off of that. And she got, you know, her. So this didn't change her weight, but it was just really a pain to. I mean, it was like impossible to go for her or go out to dinner. I mean, she wasn't living with me anymore. But she, you know, she had a very restrictive diet and she hated it, too. She finally did a self hypnosis course. Mm hmm. And she actually cured, not going wood, the IBS. Wow. With self hypnosis.  It's it, but it was like there's something called gut directed self hypnotherapy. She was desperate. She would have tried anything. That's fascinating. Yeah. And just further affirms the gut mind connection. Yeah. That is so cool. Yeah. Tell me about the epilogue and how that came to be. What's the epilogue? I can't remember. I haven't seen it in a few years, a couple of years. The of Emma. Yeah. How that came to. Oh, OK. So, you know, we did the film. We started the film. She was the first interview we did. And it was like really good. So we kept it in the film. Then then the other thing that's interesting about the filmmaking process is that for years, I was not a part of the film. I was not. And when I did the interview with her, I said, just don't talk to me like I'm your mother. Talk to me like I'm, you know, just a film interviewer. So I kept I kept struggling to find the narrative arc of the film. And. At one point. I realized that I had to be in it. And I had to admit that I was Emma's mother and I had to bring the personal thread in. I didn't want to film myself. I didn't want to be on camera. That's when we thought of the animation to make the that to make that Emma's and my story, the spine of it, and to do it to make me an animated character and to do our story through animation. So that gave shape to the film. That was kind of the solution to the film. That was the arc. So then we got through that and it was like, OK. Here's Emma. You know, eight years later. Right. Let's revisit this. Now, this is the this is the, you know, the final step of the arc. And I had access to her. So we did. And she actually said some really interesting things in. In the final interview, some of which I was able to use just the audio, but I couldn't I didn't want to bring the picture in until the very end. I didn't want you to see Emma now until right. We got to the very end. Right. And go ahead. I just I just have one more interesting film making point is when I put myself in it, she had already we already had had structured it around her starting the story of being in Paris and having your boyfriend come and having her migraine start again. What I realized the way in to bring me into the story. Was a line that I. That was true, but that I wrote and had her record, which is that's when I called you right and told you I had to come home. So it went from this objective story to subjective and it was directed at me and then I was in film and it didn't happen that way.  But yeah, I got her to say that line. That's great. So what are you working on now? I'm working on a couple of things that I I'm a little reluctant to talk about one is the documentary, a short documentary. That's a very kind of it's like a little memoir piece of this woman who something happened to that I I'm not I can't I'm not really ready to talk about, but it's this story. It's it's it's learning something. Kind of awful, some learning something about her father after he died and reckoning that that she wish hadn't been true and not. And how do you reckon with that after the person's gone? Right. And then I actually am working on the other main thing is TV series, you know, a fictional TV series comedy. Great. And that is in kind of in I mean, I don't know if it will how far it will go, but it's very well positioned right now to possibly, you know, move forward. Right. But it's a it's a really it's kind of my it's it's my great relief from these dark and painful documentaries is to write comedy, which I do. Comic relief. Yeah. So is there anything else that you want us to know about migraines or being the parent of somebody who has this condition or a loved one or a friend? I mean, I would say that we did when the film came out, we did a lot of interviews. We did an interview in Marie Claire magazine. I think was where Emma said somebody asked her that. What's the one person you would say it was the opposite? What would you say to people to the family and friends of people with migraine? And she said, believe them. That was her answer. Believe them. God. And so I would say believe them. I would say, you know, to people who who might be watching this and not have gotten this not have been at the screening or not have gotten this information to go to our website, which is out of my head film.com. And aside from being able to rent and buy the film there and share it with friends and, you know, tell people, there's also a list of resources of, you know, headache and migraine resources and organizations to, you know, help people. So the website is actually more than just like a commercial site. It's full of information. Excellent. OK, Susanna, thank you so much for this. We really thank you. This is great. Thanks a lot. Bye.