 My name's Sean, Marcia. I'm going to be talking about Save in the World with Ruby and Rails. And that's me on the Twitter at Sean Marcia. And in case you're wondering, I'm an early adopter. That's how I was able to get my own name. So I work at George Mason University as a software developer. And I'd like to thank them for giving me this opportunity to be here and do this kind of cool stuff. Thank all of you. And thanks to my Ruby group for letting me practice this talk in them last week. So today I'm going to be talking about the history of the project, then I'm going to talk about the technology we use, and then I'm going to hopefully tell you how you guys can all get involved. So but really, I'm just going to tell you a story about bees. And my personal story with bees began when I was about six years old. And for reference, that's me at six. Yeah, it's like an orange on a toothpick. But when I was six, my good friend and I, we were out. We were wandering around. And we found a wild beehive. And if you know six-year-old boys, you can probably guess what we did next. We started throwing rocks at it. And my good friend, he just took off running. And I didn't know why. And it wasn't fun to throw rocks at the beehive without him. And it turns out that the bees stung them 20, 30 times. And they didn't sustain me. So I kind of feel I have this karmic debt to the bees for leaving me alone. And so let's jump forward to today. And like I said, I'm a software developer at George Mason University. I was wandering across campus one day. And I saw this guy was giving a talk. This is Hermon Peria. And he was giving a talk about Amazonian stingerless bees and the honey they collect. And as a developer, I'm really in it for the swag. And since he was giving honey samples of these bees, that's why I went. And so I was listening to his talk. And actually he told me what kind of animal that is. And I don't remember right now, but I'll find out. Because it's something interesting. But so I was listening to his talk. And after the talk, I went to talk to Hermon. And it turns out he's doing all this really interesting stuff about bees. And bees are fascinating if you don't know anything about them. There's 4,000 different varieties of bees in North America, if you guys didn't know that. They're responsible for 90% of the wild plants. And they're crazy hard workers. One bee in its lifetime is going to gather one-twelfth of a teaspoon of honey. And that's all it's going to do. But it's going to visit 50,000 flowers to do that. 60% to 70% of all our food is because of bees, like from the pollination they do. Or they pollinate the food that our food eats. But the really crappy thing is the bees are dying. And they're disappearing. And we don't know why. And this is actually starting to become big news. And people are starting to cover it. Just last fall, Time Magazine ran an article about a world without bees and what the consequences are if we don't start doing something. And which directly leads to what Hermon is doing. He's researching this thing called colony collapse disorder. And if you're not familiar with colony collapse disorder, basically what it is is beehives and bee colonies will suddenly just collapse and disappear and for no rhyme or reason. And it's serious. For managed beehives, that's beehives where there's a beekeeper watching them. About 35% of them have just died out and vanished. For wild bees, it's much, much worse. In some areas of the country, 90% of the wild bees are just gone. Like Virginia where I'm from, it's about 2 thirds. And it's not just our problem either. Like it's happening in Europe. They're predicting in England by 2018, all the bees are going to be gone. And that's really serious. Asia, same situation. India, India, it's particularly scary because in India 90% of the pollination and honey comes from a wild bee that they can't domesticate. And as we know, it hits these wild bees harder. So if those bees get hit, India is going to be devastated. And so some of the theories about what's causing colony collapse disorder, maybe it's pesticides, maybe it's these two variety of mites that the bees, for some reason, can't clean from themselves. Could be disease, genetic factors. We just don't know. And it could be a combination of any of these. I have one of my own theories up there that unfortunately isn't gaining any traction in the beekeeping community. But I'll let you guys figure out which one it is. And so hearing all this from Hermon, it's like, hey, what can I do to help? And Hermon doesn't have any technical skills. But he told me, hey, I already have some bee hives at George Mason. And it turns out they're up on top of a parking garage. And so five stories up, you can see the top of another building nearby. And Hermon said he would love insight into these things, like the hive temperature. Because bees keep the temperature in the hive constant year round. It doesn't matter if it's the middle of summer or middle of winter. And actually just in the last couple of years, they found out that when they pull these combs of the bee hive, and there's little holes in them, they always assumed that the bees hadn't got around to filling them with honey. But what they've learned is there's a special drone bee that breaks its wings off and crawls into those holes and just vibrates all day long to generate heat. I guess it's a life. So and he also wanted hive weight, just sort of to see the weight of the hive changing over time. And then he wanted the outside humidity and temperature just kind of as control. Cause like perhaps there'd be a week of really bad weather. And so like that's why the weight wouldn't go up. They'd be eating their stores. And so I was like, okay. So again, looking at the situation, well, you know, immediately, you know, we see there's some issues with this. You know, like it's open to the elements. We don't have any power. Our budget was really small. And we needed something that was really easy to repair and maintain because most of the people aren't very technical. And so the first thing we handled was no power. Like this was the low hanging fruit. And we did that simply by some solar panels, a deep cell battery, and we had some off grid power. And we found that our solar panels and battery could power our system for about seven to nine days when there wasn't any sun. And so as long as we had sun at least once a week, we were good to go. So the next thing was we had a limited budget. And I think we started with less than $200 or about $200. And this is how things broke down. And why, you know, we used Raspberry Pis because we had the first three free. Got a bunch of Raspberry Pi devices, you know, some SD cards, cables. Like who doesn't have a bunch of cables in their closet. And you see the solar setup there at $140. That was like the bulk of our initial costs. And you know, what I brought to the table was this MacGyver-like ability to figure out solutions to problems. And you know, like an example of that is when we built, when we put in our first temperature probe, we needed to protect that probe somehow. And so which led me to quickly come up with a solution. I ran to student health services, asked them if I could get some condoms from them to cover the probe. And they didn't even flinch. They handed over a bunch of condoms. But it really made me realize that these people on campus health services have seen everything. Because when I walked in there, I was kind of dirty because I was outside working and I was carrying duct tape and rope. And they didn't even flinch. They just handed over a handful of condoms. So like this wasn't perfect, but we had to start. And I plugged in Twitter so we could get, you know, social media going and some tweets from the beehive. And so our initial results were, we had a tweeting beehive. Picture you can't really see. And it's tweeting, hey, it's 78 degrees in the hive and a little picture of the bee yard. And we're going. And one of the interesting things is once you're out on social media, people, I guess they assume, you know a lot about bees and they start contacting you. And one of the first people that contact us send us a direct message is like, hey, how do I get my dog to stop eating bees? And so I think eating the bees would probably be enough of a lesson. But I Googled and it turns out lots of dogs like to eat bees. And you know, little dogs, medium sized dogs, and even big dogs. So before I go any further, who's familiar with this acronym? Okay, some of the people here. This is something started by Brian Lyles, maybe five, six years ago. It means test all the fudging time. I always get stuck up on the F. But you know, no offense to Brian, but he's wrong. Really, what it should mean is try awesome things. Forget testing. Because if you forget testing, you can get results like this. It's currently 501 degrees in the hive. And you'd think, oh, why is that valuable? Well, it turns out that people find stuff like this amusing. And suddenly, and you can't read this, but suddenly we're getting retweeted. The city of Fairfax is tweeting us and people are asking us, are we raising fire bees? Is the hive on fire? Are things okay? And it's kind of amazing, like all these tweeting and retweets and people getting in on the joke, suddenly it was our own Gangnam style, just making everyone aware of what we're doing. And it really made things happen fast. And it brought us into the attention of the Sweet Virginia Foundation. And what they are is they're a non-profit that teaches honey bee education to students and adults. And they wanted to help. They didn't know we're raising bees at George Mason. And so they said, well, what can we do? We can offer you space. And Hermann wanted to have a class of researchers. And we didn't have the equipment, but we had the space, which was one of the biggest issues. And so what we did is we started a crowdfunding campaign because it was gonna be about $1,000 per student. And we raised $12,000, which was amazing, so we could have a class of 12. And actually, there was a waiting list of over 100 students trying to take part in this research. But so we had 12. And then this Kickstarter campaign, or sorry, Indiegogo campaign, also was like another big social media raising awareness for us. And so suddenly again, people are becoming aware and bees have just become crazy popular at George Mason University. And so one of the fraternities is starting a bee global campaign. The magazine, the alumni magazine is all about bees. And this is the president of George Mason with Hermann there. And the really amazing thing about the president getting involved is something we have a budget. And so now which leads us into the technology and the interesting stuff. So for anyone working with a Raspberry Pi or is unfamiliar with a Raspberry Pi, that's what this is. It's a credit card sized computer. Like this is an entire computer. And so I invite you to come up after and look at it and play with it. And if you wanna come later in one of the evenings, I'm probably gonna be hacking on it and playing with it. So I invite you to seek me out later. But if you're gonna work with Raspberry Pies, some advice I'd give you is to back up your card often, like take an image of it, and don't go to the traditional dev ops route where you're gonna install everything on there. Because if you ever had to wait for like NokaGurri to compile on your computer, NokaGurri compiling on a Raspberry Pi is about 60 times as long. So it's better just have an image and then copy that image. And buy a couple because they're cheap. They're $30 computers that are full computers. So Raspberry Pies have these GPIO pins on them, which is general purpose input output. And it's the same kind of thing you have if you've ever opened up a desktop computer and looked at how your hard drive plugs into the motherboard. It's the same kind of thing. And there's these pins. And for reference, this is with one of the sensors plugged into one of my Pies. You plug it in. And you may see some tutorials online if you're gonna do some of this stuff that says solder the wires right to your Pi. Don't do that because if your Pi breaks or you don't know, it's easy just to swap it out, take a Pi, throw it away, and plug it into the new one. I guess maybe not throw it away because it might not be broke. And so if you are gonna be working with Pies, these are the three gems I'd recommend checking out. There's the GPIO gem, Pi Piper and wiring Pi Ruby. I'm not gonna suggest which is best out of the three because they're all amazing. I guess it's my own Sophie's choice. But so as to saving the world with Ruby and Rails, I lied. I'm actually using Ruby and Sinatra. So I guess if you wanna get up and leave now, feel free. So I went with the dashing gem. I originally, I was using, for creating a dashboard, I was using the dashing Rails, but I realized I don't need all the complexity that Rails brings to the table, especially because we wanted a solution that was as simple for other beekeepers elsewhere to look at and to use, and we don't wanna have to explain the controllers and spitting out JSON and all this kind of stuff that they just, they don't need. And so using, working with dashing is as simple as gem-style dashing and then dashing new, much like using Rails. And if you are interested in more about dashing, I suggest going to Ruby Nation where Carl, Durante and Chris Mar are giving a talk on it because their talk is phenomenal. But after doing this, you have a dashboard that we can't see too well, but you can see there's, we're using the green and the gold because that's George Mason's colors, but we have our internal temperature, external temperature, internal humidity, and outside humidity. And if the numbers seem low for the temperature, that's because we're using Celsius. We're, I guess, because we're not all in the imperial system, and that's the weight in kilograms. And what this is is it's being wirelessly served so you walk up to the beehive, open up your laptop, connect to the beehive, and then navigate to beehive.local, and then this pops up and you can see the current statistics in the hive. And how did we do this? And we did this simply with a series of cron jobs. And if you're unfamiliar with how cron works, the first one is running at zero and 12 hours, so midnight, noon, second one's running at midnight, 6 a.m., noon, 6 p.m., and so forth. And that's it, like three simple scripts and it's gathering all our information. And this is an example of one of our scripts. So making a little an instance of our sensor, defining a couple of directories. And if you see, directories are in the public folder and the reason again is just to sort of keep it simple if one of the researchers wants to get access to the CSV file, when they're logged on to beehive.local, they just type in inhumid.csv and it downloads to their computer or their tablet or whatever they're using. And it's as simple as just writing the humidity and the temperature into two different CSV files and that's it. And same thing for the outside. And so you're probably thinking, well, it's hard to get it up on the dashboard. But it's not, dashing makes this simple. Every thousand seconds, I'm opening up the CSV file and then sending it to the dashboard and it's as simple as that. It's nothing too complicated. And this is the Python code, but I'm not gonna explain. It came with the scale, so I didn't bother redoing it, Ruby, but now that our scale's having issues, I'm going to work on a new solution with a Ruby gem. And the other thing we used is we used passenger just as for our server. We used a couple of Linux packages for basically creating our wireless access point and the wireless and DHCP server. And that was it and this is simple. And I think it's so simple that anyone here can do it. Anyone who's been doing Ruby and Rails for at least a week, maybe two, there's nothing to it. And I want you all here to go out and do stuff like this. Because I think we're all amazing and we sometimes get this sense in our head that we have all these problems and we're living in this ivory tower that isn't really representative of the rest of the country. We're kind of the Silicon Valley mindset. Oh, I got to get my queuing speed down from 0.6 milliseconds to 0.58 milliseconds or I have to get my tests to run faster. I make DHA chappy. Or we have all these issues, but the vast majority of people, like I work in a university and I see every day people emailing spreadsheets back and forth, they email text files back and forth and all these solutions that are just horrible and really educators, they need our help and they needed us to get involved in projects like this. And it's super easy to get involved in these kind of things. Like I'm involved in three projects right now and all of them I got involved with just by going to see a professor talk and then after his talk, or her talk, I just asked them questions. Because professors have bigger egos than we do as developers, they love to talk about themselves. They do and they love to talk about their research, even more than we love to talk about our code. And so, I know you're thinking, Sean, you dirty Canadian socialist. You know, like, why should I do this? I don't wanna give my time for free. And I guess the simplest reason is, is I run a Ruby Meetup group and one of the first questions I'm generally asked by new people is, how can I get involved in open source? Because open source seems like this goal that you want, but you just don't know how to get to, if you're new. And, you know, doing projects like this, it really is an easy gateway into open source and to getting open source credentials on your resume and on your GitHub. Because like it or not, when we do apply for jobs, they do look at what we do in the open source community. And really see this, but this is one of the extra benefits of doing a project like this, is all the puns. And it's like, you know, you can't really see these, but I gave this talk last week and every one of these are B puns. Like, hey, buzz off, pal. You know, Sean has a tensility to wax on and what's the buzz about? And, ooh, it's gonna be sweet, it's the bee's knees. And so, if this is the kind of thing that interests you and you might wanna go out and get involved in, I'd really like you to check out Ruby for Good. And it's a conference we're gonna be putting on in the Washington, D.C. area, the first to third to August. We're gonna be staying in the dorms at Jordan Mason University. We're gonna hack on open source social good projects. It's gonna be 72 people. We're aiming for $200 or less, and that's all inclusive of your lodging, your food, everything you just have to get there. You're welcome to come and date, Ruby, for North Star Cost, and we're gonna probably do something fun the day before, maybe go do a nighttime tour of the D.C. monuments or something, not quite sure. And also, maybe to make it more appealing for your work, we're gonna have some training sessions on the second day. We have one of the guys from the RSPEC core team coming out, gonna give a workshop on RSPEC. We have a guy giving a workshop on Angular, and another one of the JSON API committers doing a workshop on creating APIs. And that's my talk in a nutshell. Thank you so much for your time, and are there any questions?