- Podcasts
- Programming Throwdown
- Interface Description Languages (IDLs)
Interface Description Languages (IDLs)
Programming Throwdown
- April 26, 2012
- 1 h 14 min
- Episode 14
About this episodeThis show covers Interface Descrption Languages (IDLs), such as thrift and protocol buffers. News: Sony fighting with PSP hackers, Pebble…
This show covers Interface Descrption Languages (IDLs), such as thrift and protocol buffers. News: Sony fighting with PSP hackers, Pebble smartphone watch, Pacman runs on 0x10C, UF Computer Science cuts. The tools of the biweek are Sublime Text Editor and Luminance HDR.
★ Support this podcast on Patreon ★Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Interface Description Languages (IDLs)
especially now. But yeah, basically, you know, we talked about KeePass, which is an awesome program. Highly recommend, especially now. Highly recommend everyone use it. But I wasn't using KeePass, you know, for a while, especially before the show. And so I had like a default password that I used for things I didn't really care about, like Twitter and Facebook. Yeah, and it was just completely alpha characters. It wasn't numeric or anything. And plus, I used the same password for like basically everything I didn't care about. Like anytime I had to sign up for anything. And so invariably, you know, somebody, you know, didn't store my password securely and, you know, got leaked out and associated my email and everything. And so somebody just went through and systematically logged into everything that they could get into with that password. So it
Yeah, so the way I found out was kind of interesting. I got an email from Facebook saying someone with an IP address they traced to Japan, you know, logged in successfully as me to Facebook. And so that kind of tipped me off. And so then I went and sure enough, there were all these tweets on Twitter and Facebook posts that I didn't make, and I had to clean all that up.
No. So interestingly, this all happened really quickly. So basically, you know, the tweets started, I would say, like eight hours before I found out. So, you know, the person like hadn't had enough time for it really to propagate to any of my friends or anything like that. And the Facebook posts were even more recent than that.
That's true. Yeah, this could have been a disaster. Actually, it's interesting you mentioned that because my co-worker's uncle's Yahoo account got hacked, hijacked. And they actually changed the, you know, forgot password, like the backup email. They changed that to an email that they owned, like the hijackers. And
Yeah. So actually, they do have, so fortunately, my Gmail account was not hacked because it uses a completely different password. But they do have, like a lot of these websites, like Facebook and Google, have what's called two-factor authentication. And the way this works is you have a program running on your phone. And basically, whenever you have to put in your password to log into, let's say, Gmail, you also have to go on your phone and you hit a button. And the button gives you a six-digit number that you type in along with your password. And so the idea is for someone to hijack your account, they not only have to have, you know, your password, but they also have to have your phone. Yeah. So that adds another layer of security.
Yeah. The only hassle is, and I guess this may be a different controversial subject—well, maybe not controversial. I don't know. But if you, like, your wife needs access to your email ever? So it was the case where I think we had been communicating with our bank or with somebody, and they had only been using my email for some reason. And my wife needed, like, I needed her to print off some documents. She was at home and I was at work, and so she needed to get on my email. And she knows my password, but she didn't know my, you know, she couldn't have this code. And so she had to, like, I had to get the phone call, write the number down, and then call her and give her the number.
Just forward it to her. But I guess this is controversial as well. But, you know, it's like you worry about it's OK for me to do two-step authentication and I want to be really safe and have secure passwords. And I, you know, try to educate other people the same way. But, you know, you don't always know. And so there's this hesitancy to, like, you know, I don't know. You don't know what other people's passwords are. You don't know if they're good, you know. So you don't want to forward something to somebody who might have a—that may be very personal to you or have, you know, private information, and then they don't have security like you would want.
Yeah, yeah, totally. So actually this—so the big thing to take away from here, folks at home, is, you know, because I'm pretty sure that what happened was, you know, I put my password in on some forum and somebody wasn't, you know, wasn't hashing the passwords and it just totally got leaked out. And I think even major websites like joystick.com had this whole thing where all of the passwords got leaked out, like in plain text. So if you're going to, you know, have a password which you don't really care about, like if you need throwaway passwords, use KeePass. Just to recap what it does: you have this master password. You put it in and it opens up a program with just a list of passwords. And it can auto-generate passwords. You can type in passwords. You can just, you know, make up passwords on the fly. It's sort of like writing your passwords down on, like, a sheet of paper for the ones you don't care about. But that sheet of paper is now protected, you know. It's better than just having it, you know, taped attached to your monitor or something like that.
You know, although I've actually heard somebody make an argument that it's better to write passwords like that down so at least you guarantee they're different and you aren't encouraged to use the same one over and over again. Better to do that than—than use the same password that's easy or the same. Oh, yeah. And, you know, just because that way you can remember it. Yeah. But then, of course, if somebody breaks into your house, they have all your accounts.
Yeah, that's true. But if you—if someone breaks into your account, into your house, you probably should just change everything. Yeah, that's true. Join the Witness Protection Program. But if—yeah, whether you write them down yourself or whether you use a program like KeePass, use a different password for every website that you don't care about. Because chances are if you don't care about it, you know, it's probably—they're not—probably not doing a good job securing your password. So don't be like me. Don't get all your things you don't care about hijacked. And the bad thing is, you know, since I use the same password for everything I don't care about, then basically, like, all of those things now can be compromised. I mean, like, you know, by their nature, I don't care about any of them. But still, I don't like the idea that someone's going on, like, the MAME arcade forums masquerading as me or whatever, you know.
one in here about—and we talked about this a little bit before—about Next Generation and consoles having this, you know, much more kind of a Valve-type system where things are more downloaded, and you put in unique keys. And that key is tied to your console or your group, like your login. And so you can't, you know, just have normal CDs and stuff. And I just read an article about—this is interesting. So Sony has a storied past with hacker community. Yeah. And their new handheld game system—I think it was a new handheld one, the PSP Vita—has this ability to go online and download games, right? Like, yay, they're a little bit cheaper. And you can go online. You don't have to go to the store. And they sell it as this wonderful thing. Well, so, of course, just like people without a lot of scruples do on many different devices, they essentially wrote a hack to get around this using an exploit in, I think, a combination of the game and the OS. So one of the games that allowed you to kind of undo the DRM, the Digital Rights Management, that prevents you from running games which you don't have the key for. And
But anyway, so what Sony did was because they have this power that it's all online, they, you know, pull those games down and then, you know, try to patch it and put them back up again. And then upgrade the flaw that was exploited in the operating system as well and then force everybody to upgrade immediately. So the thing that's kind of interesting is that had this been normal, you know, whatever generation or two ago, a little less so with the current generation, but still could be done, I guess, is you have CDs made or DVDs made. And you can't, like, remake those DVDs. Somebody will always have that DVD with that exploit on it. And the only thing you can do is force people to upgrade their firmware running on their devices. But this is even faster because they could pull it from the store and change it, force everybody to update both their game and their OS to be able to access anything online and essentially kind of stop it in its tracks.
The issue is that if you have this kind of online connectivity as, like, a base feature, so you're downloading games from the store, you're up, you know, there's all this Digital Rights Management on your stuff as opposed to a disc. You would say, like, oh, yeah, just don't update. Well, the problem is they can force you to, right? Because the game, like, Valve has this. You cannot be connected to the internet and play your Steam games, but only for a set amount of time or a set amount of plays—I don't remember. And then if you haven't connected to the internet, it won't let you play until you do connect to the internet. And then as soon as you connect to the internet, first thing they're going to do is, in order to play your game, you have to update because Steam's out of date. And then once you update, boom, gone. Like, you
So I assume that PlayStation Vita can do the same thing. Like, they can, if you go to play your game, they'll say, oh, you haven't connected online in a month. Like, you need to connect online. Or if you try to go online to play with your friends, you know, then they'll do the same thing because it's all through their system. Oh, I see. It kind
Like, yeah, you'd go to unzip it and be like, oh, nope, sorry, you need some password that's, you know, hashed into the ZIP. Otherwise, you can't get the contents. Like, it's probably something like that, but with a temporal component to it, you know? Like, it's some kind of zip hash thing, but it's based on the current week, let's say. And so once the week expires, like, you don't have the password anymore kind of thing, and you have to go and, you know, get it from Sony. And Sony will only give it to you if, you know, you haven't been compromised or whatever. Yeah, it's just
tied to your account. Yeah, I think you're right. So, like, it requires some piece that exists in the operating system to basically unlock it. And that piece of the operating system would be very hard for a hacker to write. And so without it, the game just says, like, hey, I'm calling this, and it's not coming back. Like, what's going on?
Right, right. Yeah, I mean, if you can make it to where the server has to be involved, it's basically like hacking that would be the same as, like, hacking your bank password or something like that. You know, because you have to send some authentication out, and then it has to get, you know, accepted on the other end and then sent back to you. I mean, it's really the same as logging into a website. So, I mean, that security's been around forever.
Right. Yeah, I mean, we could guess all day, but I guess exactly how it's done. But it's just, to me, it was an interesting fact that this, as everything moves to online, the ability for them to take control out of your hands comes in. It's reminded of the, was it Amazon who pulled a version of 1982? Or 84, wait, which is the one?
No, not mine, but that's okay. Okay, confusion. But they had, somebody had published a version of that book that wasn't authorized. And then people had, I think it was free or people had paid a little. And then Amazon found out, and they actually not just stopped selling it. They went and took it away from everybody's device.
Yeah, yeah. But yeah, basically, like, yeah, I mean, Steam. And, you know, it makes me wonder if the whole, like, piracy hacking thing is going to just go away. Like, for example, you know, now so many things are online. Really, the only thing that's going to be left to hack is, like, your OS or something like that. I mean,
website. What happened to Jason? Yeah. And then there are likely happened to Jason. And then there's hacking, like, we're kind of talking about here, which is more like subversion. Well, that's another thing. But, you know, like, you're doing something that the manufacturer doesn't want you to do, but it's not necessarily illegal or, you know, attacking somebody else. Right?
Yeah. So the problem is there are legitimate reasons why you would want to do some of these things. You bought the hardware; like, at some level you should have the rights to run what you want. So, like, what if you just want to run custom games? So I saw this band the other day that was playing chip tunes, which is, like, you know, retro-style game music. And they used a Game Boy. So somebody had, like, designed a cartridge that you put in that is basically like a—what are those things called? A sequencer? Oh,
That, you know, you could play, you know, these tunes with on this Game Boy. Well, I'm pretty sure that's not an official Game Boy cartridge. So, like, but, you know, Game Boy is how old? And those people owned it. They weren't taking any money from Nintendo that I'm aware of. You know, like, why should they not be allowed to make music on their Game Boys with this special Game Boy cartridge? You know? And at that level, like, I want to support them. But the problem is that's a—in my mind, that's a small percentage of the people. Most people do these kinds of hacking to do piracy. Right, right. So, yeah, it's a hard line to walk.
I'll segue in here to a second story. Not to kind of take over from you and not give you any stories, but this story is really cool. So, there's this website, I don't know if we talked about it before: Kickstarter. So, it's kickstarter.com. And the way this basically works is you pledge money to projects. And then those, if they reach a certain goal level of funding, then your money gets collected. If not, then, you know, you just keep your money. Nothing transpires. And so, people post up ideas they have for projects. They collect funding. And then as part of it, like if they can set levels of funding. And if you pledge that level, they agree to give you, you know, products or, you know, merchandise. Or if they're making a movie, send you a copy of the movie on DVD or maybe just online or whatever. But it's gotten a lot of attention recently with a bunch of video games, you know, going over a million dollars. I think there's like three or four video games now that have gone over a million dollars in funding. For the most part, games that don't have a lot of, nobody knows what they're going to be. It's just going to be, so is it Tim Schafer from
right. So I wanted to talk about this thing that I thought was really cool on here that has now raised five point almost seven million dollars as of the time of this recording. And I say time of this recording because it's going up like a rocket. I think it broke a million dollars in a little over one day of being on here. And it's an e-paper watch for smartphones. So it looks pretty cool. A number of companies, I guess, have tried to do this before. So what is it? So Apple kind of did this with like the iPod Nano watch band thing or I don't know. So what it is, is a watch that you wear on your wrist and its display is e-paper. So it's just black and white, but it's sunlight readable. It's nice. And it gives it, I guess, a longer battery life. And so it normally just displays the time. But you pair it to your iPhone or your Android phone. And if you get a text message, it'll display like a summary of the text on your watch. And it has a little vibrating motor to signify you got an alert. You can sync it. They have another one that shows like using it like a pedometer or showing a distance that you've run, like while you're running. Because I don't know if you've ever tried to run with a GPS tracker on your phone. It's actually kind of nice because it tells you distance and it tells you speed. But it's annoying to look at your phone while you're running, especially if you have it like strapped to your arm or something.
And it can display different watch faces so you can customize it. And they wrote like an SDK that they're going to release for everybody to be able to write again, so people can write apps. And they showed a demo where you kind of just run the program on your phone and then you go to like their App Store. And they don't really talk about it, but I assume you'd be able to buy or hopefully a lot of them will be free. You know, buy new apps for your watch through your phone. That's totally awesome, man. That is really cool. So it's hard because you're laying out the cheapest one you can get right now is for a black one. It's $115. I'm not a big watch person. So to me, that's kind of a lot for a watch. And you don't get it until September. So that's
Yeah. Wow. I mean, it's just insane. I mean, like the amount of power behind Kickstarter is just phenomenal. I mean, I've just never really seen anything like it. Like the news stories, everyone that I see just blows my mind when you think about just the sheer volume of money that they bring in for these projects.
Yeah. There's a couple other websites that have started to spring up, which do that kind of like they'll graph over time how much the project's been funded and things like this. And there are a lot of projects I've seen which get like almost no money. Like they are just kind of like what somebody because I think there are standards like you have to get them vetted. I think like you have, they have to approve your project. But then a lot of them are kind of like that's kind of silly or stupid. And then nobody ever gives any money to it or like they raise $15 or something. Yeah.
it's a way for the project makers to gauge demand before they make something. But as a consumer, I'm kind of worried because you're buying something. You have no idea what it's going to be like. So even if they—let's assume something bad doesn't happen and they don't go under and not deliver you anything, in which case I'm not sure where you're at because your money's gone. They can't like they spent it and then they got hit by a disaster. Like I don't—I don't know what happens in that case.
Oh, but not when they deliver something? Oh, wow. Wow. See, I was under the impression that basically both parties would have to agree. Like so for in other words, for this watch thing, you know, if they say that for $120, you'll get a prototype of a watch, then like you lose the money when you get the watch. You know what I mean?
No, no, no, no. You lose the money when, like on this one, May 18th, I guess they'll take the money from your account. And then in September, this company promises that they'll ship you something that's going to be awesome. Right? But they don't have to. I don't—so I don't know. Legally, they maybe have some obligation like, but I don't know what Kickstarter's involvement would be if that happened. Like on this one, they'd probably want to get involved because it would be very drastic. Right? But like, you know, if you fund something smaller or whatever, I don't like they could deliver to you. But what if it just sucks?
So I have kickstarted one or two things, a board game that was kind of cool. And I think maybe one other thing for like, but it was much less money. I think it was like twenty dollars or something. Yeah. And it was a company that had done a Kickstarter before and delivered well on it. So I had a little bit more confidence.
look it up, right? Like you can just Google the people or I think it tells you how many projects they've done. Oh, gotcha. But you can just Google the company, Google the name and look for news stories. That's how I did it anyways. But I'm hesitant. My philosophy on this one has become like they're saying in here it'll—I think they said it'll retail for $150. So my thing is for my extra thirty-five dollars, I kind of rather wait and just buy it when it actually comes out.
So, this is a pretty fun. It's Pac-Man running on a JavaScript implementation of the or I guess emulator of the Z80 CPU. So, okay, you said a bunch of words. I have no clue what anybody. Yeah. Yeah. So take a step back. Minecraft, the creator of Minecraft, Notch. They're making. He's making a space game. And I think you've done some research on this, but I'll go into a little bit. There's there's a Z80 CPU, which is this virtual hardware that you can control on your spaceship in this new space game that's coming out.
It's a space game. And in the space game, you have a spaceship which has a fixed power supply generator of so many watts. And you like mine something, I guess, from like an asteroid or a moon. The details are kind of scarce right now. But on your ship, while you can use the CPU, which has a fixed number of speed and cycles and all this, you know, you can use it to like guide the ship. But if you're just sitting there waiting for like some processing background tasks to run, you can play games on it. And instead of like making games himself, like little mini games, he released a specification for the processor. This is the D CPU 16. And people are now already starting to write application in games to run on this imaginary—well, real in-game spaceship CPU. Yeah.
Which is totally awesome. You know, this is actually, this is, I think, reaching the apex of something that has sort of really been brewing. I mean, you know, Notch himself has even admitted he's very influenced by Dwarf Fortress, which is a game released by Tarn Adams. You can actually download and play for free. And Dwarf Fortress is like a text-based version of Minecraft, believe it or not. Kind of. Yeah, I mean, it's actually, there's actually even more going on in Dwarf Fortress because you control like many different people instead of like a first person mode. But it's, it's one of these games, it's very abstract, like very hard to visualize because it's literally ASCII art. And you're only looking at one sort of slice of the world. So in other words, like if you, if you have a mountain, you're looking at one slice of the mountain. So you see this like ring of M letters or something, right? And as you use like the brackets to go up and down in the Z levels, basically the circle of M's gets smaller. And like, you just have to sort of in your head visualize yourself as like moving up through these like little slices of this mountain, right? So it's always really abstract games, but, but it had a lot of the fluid dynamics and things that you see in Minecraft. And one of the things that people did early on in Dwarf Fortress is actually make computers. And one person went so far as to make a Turing machine in Dwarf Fortress. And so for people who don't know, a Turing machine is, I'm probably going to butcher this, but it's basically the universal computational machine. So the idea is if you can make a Turing machine, then a Turing machine can compute any problem or any algorithm that's computable. That's computable, right? So anyway, there's a lot of theory stuff that we probably shouldn't get into. Now, but basically, you know, people were really into doing like computation in Dwarf Fortress. And and that really, you know, someone wrote a 10-bit adder and all this stuff. So, and people have done that in Minecraft too. Somebody wrote like an adder with sheep or something like that. It's bizarre.
Yeah, it's totally amazing. Right. So, Notch is just taking it to the next level by saying, all right, you guys, I'm going to just give you straight up a computer with assembly instructions and everything. And just the point of the game is to do fun things with this computer or also really effective things like coming up with a clever AI to mine asteroids and things like that. And it's really, the interesting thing for me is, you know, I have a coworker, a guy who sits a couple rows from me and he's constantly working on like scripting MMOs. So he wrote a bunch of like bots for World of Warcraft and he wrote a bot for what is it? The Star Wars, Star Wars Knights of the Republic or something like that. Oh, okay. Yeah. Yeah. He actually wrote a bot that like looks at the memory and then you know moves around and it can farm gold on its own and stuff like that. Knights
It is totally awesome. So, okay. RoboCode, you were talking about writing the bot to play the game. That is literally what RoboCode was. It was a tanks that were in an arena and you had like a version, like a special set of Java that you could write that would say what the tank should do. Like the tank should scan its radar. And if it sees somebody, it should do this. And if it's this far away, it should behave like this, and it should rotate left and move forward. And you could just kind of program AI or something that just ran around and shoot randomly. Like, you know, you could just program all sorts of things. And then they would put them in giant tournaments. The—sorry, the online system, you could play on your computer tournaments, but you could also submit it online to run your code. And they would run online tournaments where they would put everybody's different ones against each other and see whose was best.
Yeah. You know, this has come up a lot, this kind of thing. And the funny thing is it's always like the really stupid, simple algorithm that wins. Like, they had this—what was it called again? RoboCode. RoboCode. Yeah. They had this RoboCode and they were, you know, you have all these aspirations. Like, oh, someone's going to write some crazy genetic algorithm, neural network thing. And it's just going to like have this crazy AI. It's going to do all this awesome stuff. And no, it's like the guy who writes the code, it says like turn left and shoot like wins. And then they had this with Mario too. Somebody made an open-source clone of Mario and they said, 'Write an AI to play Mario.' And sure enough, the guy had this AI where basically he did a mini-max, which is an algorithm that they use for like playing checkers. It's been around for like 50 years. And he beat everybody with like neural networks and everything. Like this guy who wrote this algorithm that was discovered, you know, 50 years ago, just likes wins. And they had something else where it was like this, like open-ended world where, you know, you had this like population. It was like this cellular automata kind of thing. So there's a bunch of cells with people in them and you could move forward. You could turn, you could mate, and you could kill. Like these are the four things you could do. And so people were always genetic algorithms. They're trying to see if they could get like a group, like a wolf pack kind of thing to evolve. And you know, the person who won, basically it's like turn left, try to have sex and kill like that. Like, and he beat all the neural networks and everything. And it's just one thing after another. It's like, it always seems to be these really simple algorithms take over, which is really sad for AI people like us.
Yeah. Well, that's the game theory thing, right? That basically they did this thing where you could—what is it? I'm going to mess it up. Yeah, Iterative Prisoner's Dilemma. Yeah, that's right. It's like it's a basic one. And everybody wrote all these algorithms to say like, 'Oh, if we play over and over again this game with a choice, like what should you do based on what the other person does?' And people came up with all these complex things. Like, 'If he's doing this two times in a row, then do the opposite constantly.' And it turned out the one that won was just tit for tat. Like, just do whatever the other person did last time, do next time.'
University of Florida. For those of us, we probably shouldn't shorten too much. So Jason and I are both from the state of Florida. Right? But Jason, you didn't go to the University of Florida. You went to Central Florida, University of Central Florida, but I went to the University of Florida. So I guess the story has some sort of importance to me as UF is my alma mater. And the Computer Science department is facing budget cuts and I guess they're going to try to put it under the Electrical and Computer Engineering department. But this is controversial for a number of reasons, including like a bunch of researchers and teachers potentially will lose their job. But we want to take this opportunity to kind of talk a little bit about, so the story to some people we were talking, I was talking to, and this is a little nuanced, right? Like, well, why does it matter? The program's not actually going away. It's just going to be in another department. Like, what does that really matter? And it led to this discussion about just all the different Computer Science degrees there are and how it varies school to school. Right. So,
Yeah. So my undergrad was in Computer Science and it was kind of tough for me because UCF as well as UF, they have computer. Actually, I don't even know. UF probably has more than this, but at UCF there was Computer Science. There was Computer Engineering and there was Electrical Engineering, which had some programming in it. And then there was also Management Information Systems, which had programming like, and a lot of Computer Science prerequisites, but was like a different program.
Yeah. So all of those people take a very similar course load, but they are different. UF has the same, but I, yeah, well, at least we used to have more. So you had, you could do a Digital Arts and Sciences, which is like for people in art, but want to do programming as well. Like programming for 3D renders or, you know, people doing it. So we had that, we had one that was in the Business School that was for people who wanted to be able to do like SQL queries and scripting and also be able to be business people and do more analysis and stuff. Then we had Computer Science, which was a liberal arts degree. We had Computer Science in Engineering, which was a degree I got, which is the same as the liberal arts degree, but you have a little bit extra engineering background as opposed to like a foreign language, you know, more liberal arts type.
Then, so then there was Computer Engineering Software Emphasis, which was also in the Computer Science School. And that was, you have a few more Electrical Engineering classes than Computer Science electives. And then Computer Engineering Hardware Emphasis, which had even more, like you got into kind of semiconductor design and stuff. So even more electrical and hardware, and that was in the Electrical Engineering Department, but they also had to take programming classes. So, and then there was, I guess you could get, oh, even the college isn't the Electrical Engineering College. It was the Electrical and Computer Engineering
college. Oh, wow. So. Yeah. So maybe we'll take turns giving our take on the whole thing because I, you know, I went through this process and it was really difficult for me to decide which to pick. You know, there's a lot of allure in being an engineer. Like, you know, it's sort of like cool. Like if you think you picture engineers as people who like build things, make things happen, like the space shuttles up there cause the engineers, things like that. I thought they were train drivers. Okay. Most people
Oh man. Those are siege engineers. But anyway, so, then there's, you know, so that was kind of cool. So that kind of made me think I should do Computer Engineering, but then I looked at the course load and I saw at least at UCF Computer Science was sort of more math heavy and computer and physics and, yeah, math and theory heavy, and Computer Engineering had more like physics and like dynamics and statics and those kinds of things. So it's sort of more applied, and I was always sort of more interested in the theoretical part. So that's what's, that's what sort of drove me to choose Computer Science. And then for the Master's I did, then, you know, for a master's degree, you have to kind of specialize. So I did Graphics. And then for the Doctorate, I did Machine Learning, but, but basically the takeaway is, what I've learned is that Computer Science, you know, if you really like more of like the math, the number crunching, if you like sort of like what programming languages are made of and, you know, what constitutes a good language, all the different like automata and things like that. Those are the kinds of things that you can only get in Computer Science. Like those are very Computer Science-y things, you know, as opposed to like learning how to program, which you'll learn in either one. You can be proficient in programming. Yeah, totally. Computer Engineering has more of the guts. It's like, I noticed that Patrick is much better than I am at like things like, you know, microprocessors and, you know, like embedded understanding, like actually what's going on under the hood and like how to set up like circuits and things like that. I mean, I'd never learned any of that stuff. So, you know, so it really kind of depends on what you're interested in, but neither one is really better than the other. Yeah.
And I've been asked this question as well, that I'll try to answer here too, but and then we'll kind of move on. So we don't bore the people who are long out of college. But, yeah, so I think is in my experience at, you know, working in companies and talking to other people in the end, it doesn't matter so much what your specific degree was. In fact, some schools don't even offer so many choices. They only offer one Computer Science degree, and it's an engineering or it's not an engineering. Right? And, and the emphasis isn't so much about that, but as to what electives you take, as to what your outside of school interests are, as to what you do on your own time, as to what kind of job you take as your first job, like these kinds of things typically matter more. And when you get to a big, at least a big company, and I'm sure it probably even applies to small companies as well. There's not really a distinction. Like Jason and I, if we worked at the same company, then, you know, we would have the same title for the most part. If we were at the same level, it wouldn't be different because he's more of a high-level applications guy and I'm more of a low-level embedded guy. Like we would still typically be the same job function at most places.
I mean, notice neither of us really mentioned like, oh, you know, I went to Computer Science because it made more money or because I read something on CNN or because, so yeah, I think to Patrick's point, you should really do what you want. And then, you know, you can always, if you do what you want, then the rest sort of comes easy. You know, it's like if you are having fun and you're doing something that you really enjoy, then everything else will sort of fall into place. And then we're moving on, but I'll caveat
it with one last thing, which is I will say that it does make sense to take practical classes. So a certain amount of things you want to be able to go to your first job and know how to do stuff. So if it's not a requirement, Software Engineering as like, you know, the process of doing that. It is important to take some sort of low-level class so you at least halfway know what's going on when you're debugging stuff. It is important to do. You don't want to do just things that are interesting and fun. You want to do stuff that you think will make you easier to hire for a bigger number of potential employers. Yeah, that's fair. On something, you got to weigh those two. You got you can't do too much of one or the other.
Yeah. Oh, that's definitely true. I mean, there's you definitely have to know how to apply what you're doing. I guess, you know, there's always the avenue of being a professor. But even professors nowadays are writing code, or at least like helping out the process. A lot of professors maintain like a source code repository of like the research's work, researchers work and things like that.
sure. So anyways, let's get to tool of the bi-week. All right. You up first. All right. So my tool of the bi-week is Sublime Text Editor. And basically, I've had to write a lot of JavaScript lately, which is something I'm completely unfamiliar with. Actually, we did a show on JavaScript, but I'm completely unfamiliar with writing in like a team, you know, environment. Usually if I do JavaScript, it's by myself. I'm hacking together some crazy like client front end for like I wrote a JavaScript front end for NetHack. But, you know, it's always been just kind of hobby products. I've never had to write JavaScript for a living. And so for the past couple of weeks, I've had to do JavaScript for a living in a production environment. And I had no real idea sort of what was a good IDE for doing JavaScript. And a couple of my coworkers recommended Sublime. And yeah, I think it's pretty great. Might not be the best one out there, but it has like the kind of things you'd really like. The, you know, syntax highlighting, the color coding and all that stuff. One of the cool things, it has a pretty good sense, at least for JavaScript. So you can like click on a function and it'll take you to where you implemented it, that kind of stuff. Also, it has this cool mode where if you haven't edited a file, it has this like the tab on the far left. So it uses tabs like most IDEs where you have like one tab for each file. But they have one tab, which is like all the files that like you haven't really edited yet. And so like if you want to look through all your files, it won't create a bunch of tabs like Eclipse will, you know? Like you can just like left click on all the files in the little Explorer and go through them all without creating a bunch of tabs. And then if you actually want a file to sort of be sticky to be a tab, you double-click on it. Or if you start editing it, then it'll, it'll split it out. But overall the interface is really slick.
Yeah. So basically, yeah. So if you every time you save, there's like a 1% chance you'll get a little nag window that you have to cancel, which like, you know, I used it for a couple of days before buying it. And I got the nag window maybe like three or four times. So it's not too bad. But, you know, I highly recommend buying it. I think it's only like, I think it was like 10 bucks or something. I bought it. I think it's
And this one is a camera application called Luminance HDR, which stands for high dynamic range. Or at least that's what it means in camera. I'm not sure. I hope specifically that's what it means in this app. Looks like it. And we have a link in the show notes. And so this is basically, so the idea of a high dynamic range photo in the photography world is that if you take a picture, your camera does basically, it tries to guess like how bright the picture should be. So it wants the average brightness of the whole image. And this gets a little bit into image processing. But through either mechanical or electrical or electronic programming means, it tries to determine like the average, if you look, think about like a piece of white paper, if that was the only thing on your screen, it kind of tries to make that like the middle of white, like kind of gray, you know, kind of in the middle so that things to the top and bottom don't get washed out. Like that's what it wants to do. So if you think about taking a picture with the bright sky in the background, but like I'm taking a picture of Jason in the foreground and the shade sometimes, like how do you do that? Because the problem is you can only show so many bits, so much range, and your image and the fact that I can't, I can show the dark of Jason in the shade and the bright of the sunlight. That's easy. But I want to both be able to see the details of Jason in the shade and also see that there's clouds in the sky. But
Well, the limitation isn't really that the camera can't do either. It's just that it can't do them at the same time or can't do both. It just can't do them simultaneously. And so what HDR is about is taking the one where the foreground—that's, well, it doesn't matter, but the area that's dark—and looks good when you take an image just for the dark area and combining that with an image that is just of the bright area, but the dark area looks terrible. And you take both of those and kind of smash them together. Right? And so what the computer can do is use more bits of resolution for that range. So it can, instead of using an eight-bit number to represent the amount of blue in the image, it can use a 16-bit number to represent the amount of blue, but your screen can't display that. And your eye can actually do a better job, but if the screen can't display it, it doesn't matter. So what it does is use various algorithms to try to show both at the same time. So kind of like, I don't care about the middle. So squeeze in the bottom and squeeze in the top and kind of ditch the middle, or just other things by combining those two images. But the problem is when you take two images, you don't take them in exactly the same way. If you're handholding it, they move slightly. So you also have to shift the images so that they are exactly the same on top of each other. You get all sorts of bad things happen.
That's right. And when you have things that are misaligned, you get ghosting. So if a person is walking across the scene, you get ghosting. Right? Okay. But long story short, this software does that nicely. And it does it in a way with many different options, all sorts of different algorithms, all sorts of thresholds. The user interface leaves something to be desired. It's not always obvious what you should do. There are paid packages that do a really professional job of this. And once you know what an HDR image looks like, a really famous person is Trey Ratcliffe. He's an online personality and he takes a lot of HDR images using very expensive, very nice software. But if you want to try it out yourself by doing this example thing, there's a great way to do it with the software. And it really teaches you a lot about how it is actually being done as opposed to just doing it all for you, which is bad and good.
Yeah, totally. Okay. So let's go into the programming language. We've sort of ranted for a while, so we'll try to be a little terse. But we're going to talk about IDLs, which is something—Interface Description Languages—which is something I'm really excited about. I've only been using IDLs for like a little over a year now, but it's really helped my productivity tremendously to the point now where I use it no matter even for personal projects, hobbies. I almost start with the IDL programming first and then get into the rest of what I'm doing. So from
A software engineering standpoint, I mean, interfaces—you kind of alluded to starting with it. It's not so much the Interface Description Language. We'll just say IDL from now on. The IDL is the fact that it's the interface. Interface is the thing that glues all the parts of your project together. If you're using a library, how you interface with that library is very key. If you're going to interface to somebody else, that's like if you define those interfaces first, everything else somewhat falls into place. Right.
And if you think about, although it says Interface Description Language, this is sort of more general than that. A lot of these are also sort of data description languages. And many programs that we write nowadays are sort of data-driven. The algorithms and the processes aren't necessarily new or interesting or difficult, but it's just the data. So, you know, for example, like Instagram or something like that—you know, picture taking had been around forever. But the way that they manipulate the data with the social network and sharing with your friends and things like that is well, one of the things that makes that product great. But there's also many other things. So that's kind of a tangent. But you know, starting with the IDL lets you sort of lay out a framework for how your program is going to flow, not only in terms of processes and interfaces, but in terms of the data and what's going to be stored and how.
That's a good point. And we should point out here, people might be saying, 'Well, why do I need a language for that?' And if you're only working on one process on one computer, you might be right. But these days, like Jason alluded to, even simple applications need to talk to another application or need to talk to another process or go over the network. And when you do that, you need a way to tell the person on the other end who may be running on a different kind of computer, a different operating system, a different language. And you need a way to tell them what your data looks like.
Yeah, exactly. Yep. Or even if you're talking to disk—you know, if you want to save data to the hard drive, you don't really want to have... yeah, serialize it or marshal it. You don't want to have to do that by hand. You know, you want something that is going to generate that for you. So, yeah, IDLs—how did they start?
Yeah. So, I mean, there's some classic ones that you hear a lot about: CORBA, Common Object Request Broker Architecture. This is a classic one that's been around for a while. You hear a lot about. Another one that people might be familiar with if you program on Windows is the Component Object Model that Microsoft uses, COM, for a lot of communicating with its APIs and stuff. And it's a way to describe how that data should be and what it looks like.
So, that was the beginning was Korba and ICE, things like that. Then they moved on to sort of the early web era. There was SOAP and JSON-RPC. So, basically, the way these two work is, you know, at the time, there was an XML and a JSON reader and writer in most modern languages. So, they said that this sort of could be an intermediary. So, since, you know, Python can write XML and C++ can read XML, we should create some data format. So, you could think of, like, a simple way to do something like SOAP is let's just have an XML file. And if you have, like, a class, like a C++ class or a Python class, you just have a tag called class and an attribute called name with the class name. And then inside of class, you could have many XML tags for all of the members of the class. And the tag could say, you know, member would be the tag name. And then the type, there would be a type attribute saying whether it's, like, a double or a float or an integer or a character. And then inside of the member tag, you could actually put the data. So, you could actually hold class instances as well as the definitions. So, that's one way to do SOAP. SOAP is one implementation of that. So, for example, a C++ program can write out some classes using this XML format. And then a Python program could read this XML and then reinterpret it as Python classes.
Around. So, like, let's say Jason runs a service that shares pictures with the world or my friends. And I have an application that runs on somebody's computer that wants to upload pictures to Jason. So, an RPC is a remote procedure call. Basically, it's saying, like, I want to be able to initially take a picture that's on my hard drive and send information about, like, who the user is, when the picture was taken, the picture itself. Like, that data I want to send to Jason's web service so that he can then, you know, show it to the rest of the world. So, like, how I call a function on his computer to say, oh, here, I want you to upload picture and here's the data. That's kind of the process that this stuff describes. And then also the reverse. Like, later, I might want to pull down that image. So, I might want to make a call and say, hey, give me image number one. And then have it give it to me or give me a list of all the images.
Yeah, totally. And so, then now more modern IDLs are sophisticated enough to where they'll actually generate the code for you for many different languages. So, one of them is Protocol Buffers. And so, what you can actually do, Protocol Buffers comes with a compiler. So, you write your proto file. And the proto file will say, oh, I have a message, you know, picture, right? And picture has a string called name. And then it also has, you know, a list of bytes called data, right? Now, you can run the C++ proto generator. And it'll generate a bunch of C++ code that can read and write these picture messages.
Right. So, it'll have a get data, set data. It'll have a constructor where you can construct new pictures. And then you can also generate Java code. You can generate JavaScript code. You can generate et cetera, et cetera. In addition to the generator that generates this code, Protocol Buffers also comes with a way to serialize. So, for example, a way to convert it to, like, a binary representation. So, there might be some code for each language, like some C++ code, some Java code, which will say, hey, take this message, which, you know, is a class, as Patrick mentioned, and turn it into a set of bytes that can go into, like, a text file or go across the wire. And then also, it says, here's a set of bytes that I created or that someone else created using Protocol Buffers. Turn it into the class.
Right, right, and also handling, you know, if the protocol definition, if the proto changes, you know, dealing with that is also, like, brings a whole host of problems that you don't want to have to solve on your own. Right. Yeah, I mean, if you've ever, you know, written a class and then written all these getters and setters and thought to yourself, like, there should be a way to do this automatically. Well, you know, that's exactly what, you know, these type of modern IDLs do is if you separate, as long as you can separate the logic from the data, then you can do this and not really have to ever write getters or setters or serialization or any of that. It's all just done for you. And so most modern programming nowadays, you have these sort of container classes that just have a lot of data but can't actually do anything that are just auto-generated from some small proto file or Thrift file, which we'll get into later. And then, you know, you have a set of handler classes that don't have any data or just have, like, a small amount of data but just manipulate these bigger container classes and send them across the wire, write them to a database, etc., etc. Another modern IDL and my personal favorite is Apache Thrift. So actually, this was started from the people who made Protocol Buffers. And you can think of this as sort of like a version 2 of Protocol Buffers. But basically, Thrift adds support for things like lists and sets and maps. The kind of things that, you know, people who have done Java or Python, who are familiar with lists or dictionaries in Python. Apache Thrift has native support for that. So in Thrift, for example, you can say, like, I have this Thrift message and the message is gallery. And my gallery has, let's say, a name, which is, you know, the name of the gallery. Maybe an integer, which is the ID for, you know, looking it up later. And then the third could be a map, which maps strings to picture objects. And so you can map, like, the name of a picture to the actual data. And all this is done in Thrift using just a few lines of this Thrift code. And then you can auto-generate that, you know, class in any language you want. I think there's like 15 languages that are supported. So, oh, go ahead. No, no.
Yeah. So, I mean, yeah, there's a lot of choices here. It's one of those things when you—I don't remember ever really talking about most of these in school. It's kind of something you learn when you get out in the real world and you start running across these recurring problems of, 'Man, I really need to talk to something else.' And I need to come up with a common way to represent it. And I'm going to roll my own. And then you run into a whole bunch of problems. So it's much better to use one of these. Yeah.
I mean, just to put it in perspective. So one thing that I did sort of early on in my career is we wanted to write a bunch of logging data of sort of like what the state of the system was at different points in time. And we actually, we had a bunch of classes in C++ that we wrote just by using what's called a memcopy or fwrite. So we actually just took the class in binary form and just wrote it to the hard drive as ones and zeros. And then on the other end to read the class, we actually, you know, we had this file that had a bunch of classes in it. So you think, 'Oh, well, I'll just write some program that just, you know, goes the other way and does fread.' Oh, but the problem is one machine was big-endian and the other machine was little-endian. And for people who don't know, endian means it's kind of like a pun. It's endian. It's actually spelled E-N-D-I-A-N. And basically what it means is let's say you have a short. So a short is a 16-bit number, right? It's a two-byte number. So the question is, where should the number start? Like if you're writing a number in English, like let's say you're writing the number 1,000. Well, the number—the most significant part of the number is on the left. Like the one in 1,000. The biggest part. Yeah, is in the thousands digit. Or if you have the number like 222, the first two is the most significant. Like that has the 200, the big part of the number. If you lost the first two, that would be a big deal. If you lost the last two, it wouldn't really matter. You'd have 220, let's say. So in the case of computers, there are some computers which are big-endian. And that is where the first byte of a number, say you have a short. That's two bytes. The first byte has the most significant bits in it. And the second byte has the smaller, the least significant bits. Some computers are little-endian, which means it's the other way around. So the first byte has the least significant bits. So the numbers that wouldn't really matter if they weren't there or if they were set to zero. So the computer that was reading the data was little-endian. And the computer that was writing it was big-endian. So all of the numbers were just completely bogus. Like all of them were, like the bits were reversed. So the numbers were, the bytes were reversed. The numbers were just garbage. So we had to write all of this code. It was just thousands of lines of code to like byte swap all of these, you know, classes. And byte swap all of the members in the classes. And it just—it took weeks. And if we had known about, you know, Apache Thrift or Protocol Buffers, we would have saved literally weeks, probably months of work. Yeah.
Yeah. I mean, there are just tons and tons of gotchas when it comes to moving, you know, turning code into data. Or turning, you know, the data that lives inside a code into ones and zeros—serialization and marshalling. And there's just tons and tons that goes into that. And so, you know, it's interesting to learn about. But if you just want to write something to disk, save yourself the trouble and use Apache Thrift.
You know. So IDLs kind of are—this is different, you know, as opposed to talking to one specific language, you're talking kind of about a group of languages. But they do share some common features. And some of this idea of this, this common idea of like the message, the thing that you might want to send or write to disk. And generating these, you know, all this ancillary helper code that needs to be done. And it's really nice that most of these provide utilities or are part of it where they process these message description files and generate code for you.
Yeah, totally. The messages are huge. Another big part of it is most IDLs support many different protocols. So, for example, Apache Thrift supports JSON. So you can send it across over the wire as a JSON object. And that's really useful for web debugging because, you know, a lot of web technology is sort of designed to expect JSON. It can also send data as binary. So if you want to write the data to a file on your hard drive that you don't really care it to be human-readable, you could do binary. Or if you want to store it in a database, you can use binary. Also, many of these have what's called a compact binary. And this is where they do a lot of sort of processor-intensive work to shrink the size down. So this can actually have a dramatic effect. So, for example, you know, you might reduce your database size by two-thirds by using a compact encoding. Which, you know, if you're dealing with gigs and gigs of data, and if you're using something like Amazon Elastic Cloud or something, this could save you a ton of money.
Yeah. The nice thing is also that each library kind of typically has code to handle the details of what it's going out as. So if you're serializing it, like JSON said, in one endian and then reading it back in another, the protocol will actually have defined what that is. And so the readers and writers on both sides all have agreed on what that should be and what to expect. So you don't have to worry about it.
That's right. So just for example, and I don't know if this is actually how it works, but, you know, the Apache Thrift might say, 'Hey, if you're big-endian, then I'll byte swap everything before I send it out.' Like everything will be in little-endian when it's in between computers or on disk. And that way it's sort of everyone has the same expectation, you know, and you don't have any crazy data. Yeah.
So, I mean, moving on to strengths, some of the good things about these are—we talked about the automatic code generation, the ability to use whatever language you want, whatever kind of computer you want, whatever kind of operating system you want, go across the Internet. Those are really the, and the time saving. I mean, these are all really good strengths of the IDLs. But what are some of the weaknesses?
Yeah. So there is a certain amount of engineering work that you have to spend. I mean, for one thing, you have to learn this technology and everyone using it has to be aware of it. The other thing is that, you know, it's just like using compilers, just like using everything. It's not going to be as efficient as if you did it by hand, you know. I mean, this has been the argument since the beginning of time, right? Like, 'Oh, if I wrote assembly by hand, it would be so much better.' But, you know, there are cases, like especially, you know, let's say you want some real-time sensitive, like you're writing some plug-in to do video conferencing. Or something like that. You probably want to write your own serialization that takes advantage of certain nuances of your environment. So let's say you're doing sending video, like compressing video. You probably don't want to use Apache Thrift to compress video because video has certain characteristics. Like the human eye cannot really distinguish shades of blue. And you want to take advantage of that. You want to compress blue more than everything else. These are the kind of things that, like, you don't want to use an IDL for.
Yep. And also, I mean, if you're not careful or, like Jason said, if there are potential things that you know more about than the general solution, it can take longer. If you were going to write a very custom binary format, you might be able to make it smaller than what any of these things are able to do. So there might be overhead there that's associated with that.
Yeah, totally. Yeah, totally. So some good tools for doing IDLs. I use Thrift for Eclipse. So basically it does, like, syntax highlighting and things like that. I think it can actually run the Thrift code generator for you. So when you make changes to the Thrift file, it will auto-generate the code. For me, it's easier just to, you know, to run the command that generates the code. It's not that much work. But I think you can, with some elbow grease, you can set it up to be sort of more streamlined. Another one is for Protocol Buffers is Protoclips. And that's very similar, but for that format.
Yeah. Yeah, definitely. So, I mean, very useful, very flexible. If you want to talk across the web, do remote procedure calling. If you want to serialize data to disk. If you want to just store something. Also, some databases, you know, have this language and are able to do kind of more intelligent things if they know in advance, like what, like the description of what your data is stored as. Yeah, these are really powerful things. Something that not everybody knows about. They're not completely obvious. But when you learn about them, they're a great, great help.
Yeah, I mean, if you've ever seen something that was sort of transformed to the web, like I saw recently, like SSH on the web or something like that. Or you see these like video games, like FreeSib, they ported it to the web. And you figure, like, how is that possible? Like, did they rewrite all of this in JavaScript? You know, like how is this running in my browser? Well, chances are the JavaScript is just some thin client. And it's using something like Thrift or Protocol Buffers to talk to some, you know, bigger program on the server that's running in C++ or Java or whatever. Yeah.
Well, I wanted to point out, well, finishing up with IDLs. We have a lot of great user feedback. We user feedback, listener feedback. So we've had a great amount of reviews on iTunes. Thank you guys for those. We've had some good feedback on our Google Plus page. People have given us a lot of show topic ideas that they want to hear about, things they want to talk about, encouragements. Some helpful things to watch out for in the future, what people like hearing, what they don't like hearing. So we're really appreciative of all that. Glad to know you guys are out there and there's other people on the other end of these microphones.
Yeah, definitely. I mean, we have added like all of the, you know, requests to our list of programming languages to cover. We want to sort of like cover sort of a variety of languages and sort of mix it up between the common ones and some of the more uncommon. But we definitely have taken all the feedback and we're definitely going to keep covering languages until we've gotten every request out the door. So definitely keep, definitely, and beyond. So definitely keep sending us your feedback. We really appreciate it. If you have any particular show topics that you want to cover, like if you're really interested in like, you know, embedded stuff and you want Patrick to give like a little tutorial on how to make like an RC car or something. Or if you're interested in like games or AI or whatever. I mean, if you have any requests or any special topics you want to hear, definitely shoot us a post on the G Plus and we'd be happy to respond to that. All right. Well, that's a wrap. Thank you very much. Cool. See you guys later. The intro music is Axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution Sharealike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix, adapt the work. But you must provide attribution to Patrick and I and share alike in kind.
