Thorn: Digital Defenders of Children - What They Do and How You Can Help

I was born with a strong desire to do good for others. Over the last three years, the career choices I have made have reflected that. In 2014, I joined the Franklin County Sheriff's Office with the hopes of becoming an investigator in one of two task forces: I.C.A.C. (Internet Crimes Against Children) or the Homeland Security/Ohio Bureau of Criminal Investigation human trafficking task force. I started off working in the Franklin County jails, but after two years of working I came to the realization that I couldn't live off the salary I earned. Luckily I found something that I loved which could be used for the benefit of others: software development.

Everyday after work, I would come home and study for at least three hours instead of watching TV or playing video games. When I left the Sheriff's Office, it was bittersweet. I knew I would miss the work and my coworkers, but I've been pretty happy in my software development job at Nationwide Insurance. Despite the fact that I am earning more money than I ever have before, I find that I am missing one thing. I am intrinsically motivated or more motivated by the effect of the work I do than the money I make. Yesterday, I had no intentions of applying for a job until I watched Ashton Kutcher's powerful testimony and learned about Thorn.

What is Thorn? "The thorn protects the rose." Thorn is an organization that collaborates with government and business to use technology to fight child exploitation. The simple fact of the matter is this: the criminals are technologically superior to those wishing to do good. Criminals have created vast and elaborate enterprises for selling drugs, illegal arms, and human beings. Human beings of all ages and genders are sold for the purposes of entertaining the perverse sexual desires of a very large marketplace. I had no idea how well designed these system were until I spoke with pedophiles while working at Franklin County. What is worse, however, is how widespread and profitable this industry is.

Thorn's work leverages powerful technologies in order to help victims report their abusers, provide software that helps government identify victims, and deterrence. They maintain a central database of abuse images so that large organizations can collaborate effectively with one another. One thing that struck me most on Thorn's website is that they are taking a very intelligent and holistic approach to fighting this problem. Thorn's Deterrence project (read more here) tracks those spreading exploitative material and encourages the perpetrator to find help. While this sounds like it is soft on someone who just conducted an extremely heinous crime, I can say definitively that most people who commit this type of crime cannot help themselves. Remember, the goal is to protect children and prevent these acts from happening.


Thorn's work is important. I have applied for a job there, but you don't have to be employed to do it. Thorn is a partnership of large companies as well as individuals. Anyone can contribute. If you're a developer like me, consider contributing to one of their projects! If you're not a developer, you can still help! Thorn is not just a couple of actor's pet project to make the public feel like they care about the world. Thorn has gotten results and it has been done from the heart. I'm happy to say that even though I am new programmer, I have applied for a job with Thorn. However, I'm even happier to say that I have applied to help with open source projects. I hope to see my friends and coworkers join me, but most of all: I hope I can help.

So it's been a while: what I've been doing

I'm sorry to say that I haven't been blogging like I should be. Between traveling (now that I have the funds) and the holidays, I've honestly let this slip. However, I have been learning like I should be and I've actually learned quite a bit since I blogged last. I've been exploring multiple areas of interest and I've been learning to program in multiple languages. It has been a blast, but one this is for certain: learn one programming language and get good at it. The other languages will follow.

What I've been learning and how I've been learning it.

  • Java
    • How? I've been programming through Graham Mitchell's Learn Java the Hard Way. I really enjoy the program by doing series. I read Zed Shaw's Learn Ruby the Hard Way and I feel it is the most practical way to learn a language. I've also learned what a great language Java is. I personally like how organized it is, though it is quite verbose. Don't let that scare you. It is a invaluable skill and practically lingua franca of software development.
  • Machine Learning
    • How? I've been taking Andrew Ng's class on machine learning out of curiosity as well as gathering credits for the possibility of getting my master's in computer science. The more I learn about machine learning, the more I enjoy it. I may one day make this my niche. However, machine learning is extremely difficult and math heavy. I'll be blogging about machine learning in the future and explaining what I learn using the Feynmann method. For this class I've been making extensive use of Octave. 
  • Python & R for data science
    • How? Through Datacamp! It is a low-cost online program for training people in data science and machine learning. This is a great resource, but it definitely needs work. I've enjoyed learning all the methods of pulling in massive amounts of data and using computers to condense down what data we need. You also learn to make useful predictions with that data. I will also be blogging about this in the future. Machine learning and data science are used heavily together.
  • JavaScript
    • How? Mostly by doing projects from FreeCodeCamp. I've made a Weather App that detects your location and tells you the local weather and displays icons. I've also made a WikiPedia Clone! Both of these sites make heavy use of API's (Weather Underground and Wikimedia respectively). 
How do I have time to learn all these things? Truth is, once you get your first coding job, you'll have plenty of time to learn while doing or do self-paced learning. If you're looking to get into this field, just get good enough to get your first job and learn from there. Learning is my hobby and I'm looking forward to restarting my blog and showing you what I'm learning!

FCC's Weather App Project Part Two: Bittersweet Callbacks

Upon gathering my data from Weather Underground, I had written a simple script calling each piece of data thinking that is all I would need. I was wrong, however, and the reason is due to JavaScript's advantage as well as its disadvantage as a programming language.

JavaScript executes programs in an asynchronous fashion, which is unusual to a Ruby programmer like me. What's the difference? A synchronous program is executed line by line and whenever a defined function is called, the computer waits until the function has completed its work to move execute the remaining code. Asynchronous languages execute code whether or not a function has completed its work or not. This is a little confusing, but it is one the main reasons JavaScript is so popular: its quick. So why would this cause programming problems?

If I were to simply assign the "$.getJSON" call to a variable and log it to the console, it would return the JSON history, but not be accessible. Due to the asynchronous nature of JavaScript, the function executes after the JSON data is no longer available. However, JavaScript has a unique property that is both unusual, but also extremely useful: passing functions into functions. In order to retain the data from the API call we have to assign the data to a function and app it into other functions that use the data for our purposes. Imagine if you will that you have predefined functions and you’re essentially calling back to them throughout your script. This is called a callback and it is quite confusing but also quick. Here’s an idea of what a callback looks like in my script:

function testIdea(value){
console.log(value);
var apiCall = "https://api.wunderground.com/api/f946ee8192f9f7ca/conditions/q/" + value.location.state + "/" + value.location.city + ".json";
callData(apiCall);
}


var geoLocate = $.getJSON("https://api.wunderground.com/api/f946ee8192f9f7ca/geolookup/q/autoip.json", function(api) {

testIdea(api);

})

This tends to be very confusing, but not too bad once you get the hang of it. However, this outlines one of the disadvantages JavaScript has for large scale apps versus another backend language like Java. Imagine having different sets of callbacks for multiple types of information. The script will get quite confusing. However, now my scripts are set up and all I have to do it make my site pretty and add some minor functionality. The hard work is over and its nothing but sunny skies ahead!

FCC's JavaScript Weather App: Introduction to API's

The Goal: To create an app that takes weather data from a weather information site and display it to a site so that any user can get their local weather data (in Celsius and Fahrenheit) from my app. Here's an example of my end goal.

As part of my goal to become really good at JavaScript and Java, I've started to take on projects on Free Code Camp again. This project required me to find a good API or Application Programming Interface. What is an Application Programming Interface? Interface is just a fancy word for a meeting ground of two organizations or systems. So an Application Programming Interface is a sort of meeting ground for one application to retrieve data from another application. This is important because, generally speaking, there are two ways to obtain data. One way landed me in trouble with a web admin and is incredibly slow and tedious and generally not allowed. That is to scrape the data off a website with a web crawler. The other is to use an API. Use API's. Its a skills employers need and its what developers have set up (with certain conditions such as a payment or providing credit to the data they have obtained) so that you can safely and securely obtain valuable information.

With JavaScript, an API returns an object in JSON form. Here is an example from my project's api call that was printed to the console.


 This is a pretty sweet deal and I must provide credit to the best weather API that is both simple and easy to use: Weather Underground. So how can we make this object useful to our application? The default language of data transmission on the web is JSON (which is why JavaScript is popular). This means that with an API call with jQuery (outlined next post) that I can simply pull data from this object with a command such as (object name).current_observation.UV. Any guess what data this would return? It would return the integer value of 3, where (object name) is the name of a local variable. This might be a little cloudy now, but I plan on outlining how this works exactly in my next post. Get it? Cloudy?! Weather??? Alright, till next time...

Aspirations

One of the key success factors with me landing my first software job, was blogging. This allowed me to do two things:

  1. Maintain accountability in my coding journey
  2. Write a blog as if I were teaching the code I was learning. (You remember more of what you teach)
As such, I think it is important to write out what I want to learn for the first two reasons as well as show my intended path. When I started my journey, my goal was to: "become fluent in Ruby and conversant in JavaScript." Now that I'm employed, my goals serve to first master my current role (automated tester) and secondly to explore what ultimate career path I want to take. I enjoy testing, but I am also very curious about becoming a developer. Luckily, the next two languages I'm delving into: JavaScript and Java are both useful in testing. However, I will be learning some web development skills and begin demonstrating that here.  I will say that any developer should be an excellent tester first. And anyone wishing to become a tester should also learn to become a great developer for the sake of proficiency in their career (imagine being able to point out code bugs upon finding errors).

My goals (in this order too) are as follows:
  1. Master my current field: automated testing
  2. Learn Node.js and complete a simple project with it
    • I am currently working through Manuel Kiessling's Node Beginner Book
    • I hope this will also serve my learn JavaScript goal
  3. Master the MVC framework
  4. Become proficient in Java (and possibly Java implementations of Ruby like JRuby and Groovy)
My interest, should I become any sort of developer, is to become a backend developer rather than a front end. I find this far more fascinating than the frontend and Node and Java are excellent skills to have for this reason. 

However, I will say the most important skills to learn to succeed in this field are the soft skills. Learn to speak in front of a group, learn to communicate and ask for help, and learn to be aggressive: give talks and network hard. This is a topic for next blog. See you then!

My Plan to Automate Myself Out of a Job

Ever see a cop on the side of the road directing traffic at a construction site? Or see a cop just standing around providing security at a football game? That must be a pretty cushy job right? That guy or gal probably went to roll call that day, crossing their fingers, hoping they would get to work the football game that shift. That would be cool, but who's out doing the routine patrols? Are we, the taxpayers, paying the cops overtime for this?

A lot of people don't know this, but things like directing traffic at construction sites, providing security at events and graduation parties are all duties that fall outside an officer's regular duty hours and the cost of the officer is paid for by the individuals and organizations requesting them. For instance, a construction company needing traffic control actually pays the officer and rents a police cruiser (if one is requested). This is called special duty and I'm temporarily administrating all of this while the regular coordinator is on maternity leave. With her absence, I've begun to appreciate her mental organization skills and memory. This job involves taking requests from multiple groups of people, checking inventories and staffing, getting command approval to work the job, posting the job, recording those who bid on the job, reviewing their personnel file to see if they've done anything bad to warrant not being allowed to work special duty, and then assigning the job and notifying the person who made the request. That's not all, you've also got to generate invoices, process and verify checks from the vendors, and distribute checks for the officers who work.

That might all sound difficult and I often get praised for simply taking on the job, but theoretically it's not. Its all a matter of being detailed-oriented and doing the same thing over and over and over without making a mistake. Wait a second...

Doing the same thing over and over and over and over and over again = routine work
routine work = an opportunity to enhance a human being's function or eliminate them completely through automation!

I've been teaching myself automated testing tools and developing the skill set necessary to land a job in that arena, but I understand Ruby well enough to know that everything I've done at this job can be replaced with a few scripts. In fact, they are scripts I've used before. However, remember I'm really not automating myself out of a job, I'm automating the well-organized young lady who just had a baby... Don't hate me just yet because there are two important facts we must remember:

  1. We work for a law enforcement agency, which is a government agency and so we'll always have a job unless we really screw up or leave. 
  2. There are certain human aspects to this that you simply cannot program. I will likely make her job 100,000 times easier rather than put her out of work. In fact, my goal is the purest of the two: make her job easier!
While, I believe I have all the tools to make this work there's one big problem that I'm not sure how to solve yet: making it look pretty. When she comes back to work, I want to make her program pretty and I'll need something that I believe can handle the task: rails. I'm going to work through the tutorial and learn rails as best I can with the end goal of automating us out of work. And really by automating us out of work, I really mean doing away with a large part of the workload.

This excites me because I don't have to wait to solve real problems, I'm working on solving a real problems  now that will make the lives of people I know easier now and create a cost savings down the line. This is what programming is all about. Let the fun begin!

Uploading files and testing popups with Capybara

So, I took on the task of testing my friend's file upload site. You can find that site here. It's a tool that allows you to upload a file and you will get a popup alerting you the file size in bytes.

When you go to a website and click something that allows you to upload a file, typically you'll get a GUI interface that interacts with your system to retrieve a file for you. However, requires a different set of tools because this means you now have to interact with your system rather than the browser. Luckily, Capybara has a wonderful method: attach_file. This method is simply amazing because it takes two arguments: the button style identifier you want to press that opens the system to attach a file and the file's path. Amazing. The method while in action would look like this:
attach_file("the-file" , 'file path')

So I ran this through cucumber and the test is well-designed, except I didn't know how switch Capybara from testing the browser to a popup window. Its really simple! Give your driver variable the method the "switch_to_alert" and Capybara will look at popups (officially know as alerts).

This shows how powerful a tool Capybara is. I feel like I'm practically speaking English to the computer and getting the computer to do amazing stuff for me.