CodeIRL: Filtering Data for My College’s Library

This past week at work, I was tasked with filtering library course guide data as of a bigger project. The filtering involved removing guides named [Deleted] and associating guides to the librarian in charge of maintaining a specific guide.I didn’t feel like combing through 200 odd records so I decided to use Python! I can’t show you the code because of privacy reasons, but I can tell you how I coded up a solution.

The first requirement (deleting the [Deleted] guides) took just three clicks in Excel after which I saved the spreadsheet as a comma-separated values file (.csv) to make it easier to process in Python using the csv module. I could have used something like openpyxl, but the computer I was working on didn’t have pip and I didn’t want to learn how to use another library.

With the .csv file, I started copying the guides each librarian was responsible for into their respective .txt files. It was surprisingly simple as I didn’t have to deal with an paste format issues. The next step was to devise a system to append the librarian responsible for maintaining a given guide. I thought it would be as simple as appending the librarian falling under a given if condition, but there was a big problem- some library guide titles in the comma-separated values file had commas in their title, creating a whole new row in the destination comma-separated values file. I never thought that could happen in a comma-separated values file.

Realizing that, I had to come up with a way of writing the comma into the comma-separated file without creating a new column. At first I tried to escape the comma using regular expressions, but I ended up with a lot of backslashes in the file which were needed to escape the comma so it wouldn’t create a new column in the comma-separated values file. The same thing happened when I tried to write the rows into the csv file pythonically with the module’s csvwriter.

At this point I was stumped and realized that find and replace exists and replaced the backslashes with ‘s. After adding the guide’s of another librarian, the data was all filtered for my supervisor to review. There are still many steps in the data processing, but this was a good start. I’m just wondering if the time I took to make this was much quicker than doing it manually. To be honest, I think it took about the same time. Still, it’s a good way of using Python to make daily tasks much simpler.

Playing E.T- The Worst Game Ever

When I was a kid, I remember going down the rabbit hole of Wikipedia articles. On one visit down the Wikipedia rabbit hole, I read the list of video games notable for negative reception. On that list was E.T. the Extra Terrestrial, a game based on the movie of the same name.

As for why the game failed, it had to do with the high expectations placed on it from all over. Atari’s investors were banking on high sales figures (a minimum of 5 million units) and gamers expected a great complement to the movie which did way better than the game. The commercial failure of E.T. not only killed Atari, it arguably aggravated the gaming crash of 1983. With so many unsold units, they were buried in a desert in New Mexico. I’m sure the environment enjoyed getting millions of non-biodegradable play things being forcibly inserted into it.

During my trip to the United Kingdom, I went to the Centre for Computing History in Cambridge, England. Among all the computers and game consoles was an Atari 2600 running E.T.. Below is me trying to play it. Suffice to say, I couldn’t play it any longer than 1 minute until I realized that it had earned it’s reputation.

Farai Visited…The Royal Observatory Greenwich

The entrance to the Royal Observatory featuring words on a brick wall adjacent to direction signs
Location: Greenwich, London, UK
Website: http://www.rmg.co.uk/royal-observatory


On my second day in the United Kingdom, I went to Greenwich (pronounced gren-itch) to visit The Royal Observatory Greenwich on top of a hill (which has a marvelous view of London by the way). Established in 1675, the Royal Observatory played a vital role in astronomy and navigation as it was the site where the Royal Almanac was created, a document describing the location of celestial bodies that would then be used by navigators at sea to determine their longitude. Today, it’s part of the National Maritime Museum.

As you enter through the gate, the first thing you notice is people piling up on the Prime Meridian to take photos. The Prime Meridian which defines 0° longitude. I joined the pile up and took a photo on the line to see if the photo’s metadata would rest on exactly 0°. Turned out to be -0.0014139° longitude, about 98m west of the meridian.

The Prime Meridian Line running across the ground with my feet either side of the line on the pavement inscribed with the position of cities relative to the meridian.

A few meters from the Prime Meridian was a stump signifying Hailley’s Meridian.He actually came pretty close. Anyway, I didn’t spend £10 to look at a line. I came to learn about the history of time keeping, so I moved onto the Flamsteed House named after the Observatory’s first Astronomer Royal John Flamsteed.

In the Flamsteed House are artifacts commemorating the housed astronomers. After the tribute there was a room dedicated to the effort behind solving the longitude problem (finding a way to accurately calculate longitude). Most of it was dedicated to John Harrison’s effort. After all, he spent 31 years developing clocks to solve. His final attempt culminated into the H4 which was accurate within a few hours, however the Board of Longitude refused to award him the prize for his efforts, so he had to fight for it in Parliament.

After the exhibition on the longitude problem, I moved where I found more clocks along with how time was shared among citizens and a tribute to the Greenwich Lady who sold clocks and synced them to the time at the observatory. I then stepped into the courtyard to take a lot of selfies next to a dolphin sundial which didn’t work because it was cloudy. Ah well, on to the next one that being another building. In it were some really big telescopes, a book store, a room full of timepieces from around the world and a picture of Flavor Flav.

A Picture of Flavor Flav holding a quartz powered clock.

In all, the Royal Observatory Greenwich is a wonderful place to visit. With a large collection of time pieces as well as it’s efforts to show how the astronomers worked, the Royal Observatory actually makes clocks fun. My favorite part was on John Harrison’s efforts to solve the longitude problem. If you’re in London and you have some hours to spare, the Royal Observatory is worth a visit.

May 2017 Update

So, I’m back from my three week long trip to the United Kingdom to study the history of mathematics and how it links to culture. While I was gone, I showed you what my room looks like, what’s on my phone, what’s on my laptop as well as what tech gadgets I own.

The content under my blog and YouTube channel (unless I say otherwise) is now licensed under the CC 4.0 BY-NC-SA license. Basically, you can share my work as well as make adaptions of it provided a) you credit me and link to the original (BY) b) it’s for non-commercial use and c) the derived work is licensed under similar terms. If you don’t like those terms, email me and we can with something out. Fair use/fair dealing is still a thing however.
It’s summer time and I’ve got a lot of stuff planned personally and blog wise. Ideally, I would have had an internship, but that didn’t work out so I’ll be working at my college campus as an RA (free housing!), library assistant as well as cafeteria assistant (it pays well). To be honest, I really feel like I’m lagging behind big time and I think I’m screwed in terms of job prospects. I might as well make the most of my summer jobs.

I’m hoping to lose weight as well as learn how to cook as well. Being fat sucks, and it’s time to grow up and be a responsible adult. I also hope to try out bullet journaling and I’m planning a trip to Southern California as a trial run for my trip to Shenzhen. Blog wise, I’m planning a major redesign where I’ll give this blog a whole new look in addition to refining my work, better marketing and a bunch of other cool stuff. I hope to finish in late August so stay tuned for more info for that.

Content wise, I honestly done have much planned for June. I wanna make a video on my trip to the U.K., a travel film if you may. I’ll also post pics of my trip on Instagram, which you should follow, @thisisfarai. I’m also gonna post some posts on the museums I went to in addition to leaving some reviews. I’m also gonna finish the Human Resource let’s play and maybe make a review/essay on the game. Then to mark the six months of YouTube, I’ll post a personal critique of all my content, my website etc.

Before I sign out, I just wanna apologize for being so vicarious on twitter. I don’t know why I’m so heavily invested in the politics of a country I’m not a citizen of , but it’s so hard to watch idly. Well, I’m still idle since I haven’t done anything tangible so this whole political investment needs to be dialed down a bit, or at the very more productive.

So that’s what’s up! Stay tuned for amazing things during the summer. Plus, send me gift card. It was my birthday. Ktnxbai.

My Stuff Spring 2017 Edition

I was traveling around the UK for the month of May so I thought it would be cool if I show you guys the stuff I use(d) as of April 2017. So enjoy!

Here’s the room I stayed in

This is what’s on my phone

And here’s the tech I used

 

A list of my tech stuff

KMASHI 10000mAh Portable Power Bank with Dual USB Ports 3.1A Output and 2A Input – Black
by KMASHI
Link: http://a.co/8YKPNF2

iPhone SE: https://www.apple.com/iphone-se/

Dell Professional P2017H 19.5″ Screen LED-Lit Monitor
by Dell
Link: http://a.co/aohR8u4

Blue Microphones Yeti USB Microphone
by Blue Microphones
Link: http://a.co/55ubhZ0

Bose SoundSport in-ear headphones – Apple devices Charcoal
by Bose
Link: http://a.co/2jj36hY

Sennheiser Urbanite XL Over-Ear Headphones
by Sennheiser
Link: http://a.co/4k8uOUB

Bluetooth Headphones TT-BH07
by TaoTronics
Link: http://a.co/ck5KdwH

Kyocera Hydro Air 4G LTE Unlocked GSM 8GB Waterproof Lcd 5.0 5mp Flash Camera
by KYOCERA
Link: http://a.co/20tFEOh

HP Pavilion 15.6-Inch Notebook, Intel Core i5-5200U Processor (2.2 GHz), 1TB HDD, 6GB DDR3L SDRAM, HD BrightView WLED-backlit di
by HP
Link: http://a.co/6PIL2UO

Samsung 850 EVO Parent
by Samsung
Link: http://a.co/83orKYE

I’ll see you all in June!

April 2017 Monthly Update

This monthly update comes to you live just minutes after my flight took off for the United Kingdom. In this update, I discuss this very busy month, my random musings on Twitter, my trip to the UK and content planned for May.

So far, April has been my busiest month year in terms of content published.  A book review, a post on the 2037 bug, the production of a let’s play series, a video on two factor authentication, the launch of a microblog, filler content as well as preparing a video. Still, the views are barely coming. I guess I’m in for a year of zero views, unless I become a commentary channel.

The aforementioned microblog is called Why I Like This Thing hosted on Tumblr. The purpose of this blog is to log the reasons why I like something whether its an app, a website, a YouTube channel etc. So far, I made a post about CSS Tricks and Awesome Screenshot.

This month, I got into some happy musings on Twitter. For one, Sydney Padua, author of the Thrilling Adventures of Babbage and Lovelace replied to me…twice! I saw someone showing off their copy of the book which had a cooler red cover and Sydney told me that it was the UK edition. I gave her props to which she thanked me. Man I’m special.

Learning about Sydney Padua's alternate book cover
Link to tweet

 

The other musing had to do with a tweet polling job opportunities. One reply was from Alex Mole, chief technical director of Criterion Games, the studio responsible behind Burnout. I wondered where what they’ve been up to all these years and it turns out that they were working on the VR level for Star Wars Battlefront and something in Battlefront II. I guess that’s why they need 90 developers.

Learning about Criterion Games's Projects
Link to thread

For the next three weeks, I’ll be travelling all over United Kingdom uncovering the historical roots of mathematics for my May Term class. I will be visiting lots of parks, museums, hostels, rain (more like the rain visits me)- the lot within that time. I don’t know what content I’ll make relating to the trip but I’ll tell you guys about it. If you guys want to follow along, make sure to follow me on Twitter @fgandiya and on Instagram @thisisfarai. Besides those random musings I mentioned earlier, I’m pretty boring, but I’ll try to be fun during May.

Since I’ll be out all of May, I won’t be making any new content so you’ll be seeing scheduled stuff, unless I also decide to post a random video in the UK. The posts you will get are will just be a continuation of my Human Resource Machine Let’s Play. My time will be mainly focused on the class,but I’ll be taking time to think about the future of the blog in terms of design and direction. I can’t live off of *.wordpress.com forever.

So there you have it! The things I did this month as well as what’s in store for May. April was by far the busiest month this year given all the content I made. I got into some fun musings on Twitter and I’ll be out for May, so enjoy the filler content I have planned until then.


Wanna see what I’ve got lined up? Watch the Trello Board here.
Have an opinion about me? Let me know what you think here.

How You Can Help AGCKB

I forgot to post this when I made the video, so here’s a tl;dr/w

You can help AGCKB by:

  1. Providing Feedback via likes, (repectful) comments and suggestions.
  2. Share my stuff
  3. Transcriptions

You Should Enable Two Factor Authentication by Yesterday

For example, if I want to log into my GitHub account which uses two factor authentication, I need to provide both a password and a six digit code to access my GitHub account. Using two factor authentications makes it a bit harder for hackers to gain access to your account even if they were able to get your password since the second factor is needed to verify the login request.
Now we know what two factor authentication is and how it helps, let’s explore the options.

Option 1: One Time Passwords via SMS

The most common is getting a one time password (OPT) sent via SMS whenever a login is requested. The good thing about this option is that the password is unique each time it’s generated, meaning that once it’s used, it becomes invalid. While the OPT via SMS option is simple to get going and it’s better than not having TFA, it has many downsides. A practical downside is that you won’t be able to get the OPT when there’s no phone reception (like when you’re travelling) and you have to give away your phone number which could bring about spam. Also, it’s possible for your phone number to get “stolen” through social engineering, such as an attacker tricking the cell provider into terminating your SIM and giving it to the hacker. This happened to some prominent YouTubers last year such as h3h3, LinusTechTips and boogie2988 last year where poodlecorp was able to access their channels and deface them, with help from “Forgot Password” and overwhelmed customer support.

Option 2: Time-based One Time Password (TOTP)

Given the limitations of OTP via SMS, a step up would be to use a Time-based One Time Password, or TOTP. TOTP combines time and a secret key to form a temporary code needed to access an account. TOTP codes are typically managed in an authenticator application, such as Authy or Google Authenticator. Since they work of of time rather than an SMS, they’re much more convinient. Also, authenticator applications are much harder to spoof. There aren’t perfect however. Given how TOTP is time based and time doesn’t always line up perfectly, TOTP codes usually last longer than their supposed expiry date to ensure things work. Also, if the secret key used to form the code was to get leaked, the TOTP code can be calculated.

Option 3: Login Verification

Another TFA option is login verification where a notification is sent to your device asking you to verify a login request. It uses public key cryptography which sets things up such that only you will be able to authorize login request to which only they can validate. Public key cryptography is a bit complex, but login verification is the simplest option out there. With login verification, All you need to do is click a notification and you’re done! The main issue is the device which gets the notification needs internet access, and if the private key is stolen, you’re screwed.

Option 4: Security Tokens

The most secure of the TFA options are security tokens such a YubiKeys and smartcards. Security tokens are considered true two factor authentication (better yet two separate values) since they work completley independent of the server. I haven’t had much experience with security tokens but from what I’ve read their purpose built to authenticate accounts. The codes (or “codes”) generated by these tokens can be in a random loop, cued on demand or not even require your input whatsoever. Since their purpose built, they’re a very solid options. The isses with security tokens are that they can be lost and stolen, you might need a lot of keys for your different accounts, the private key can extracted from the device (with lots of effort) and they tend to be more expensive than using a phone you already have.
The TFA option you choose comes down to a nubmer of factors such as whether the service supports two factor authentication (let alone two factor authentication), how much the account means to you, what you can afford, and what you’re willing to tolerate for the sake of security.
I’ll use myself as an example. For me, given how careless I am, security tokens aren’t an option. Since I’m glued my phone and I travel quite a bit, I prefer to use the TOTP option via Authy since it doesn’t need internet. If the option is availible, I tend to activate login verification feature because it’s just a matter of clicking yes or no. If the above options aren’t supported, I just use the SMS based TFA since it’s better than nothing.
If you want to see if your online accounts support two factor authentication, head of to twofactorauth.org, home to the Two Factor Auth List. There, you can look up a service and see which TFA options they support, potential issues, and if the service doesn’t support TFA, it let’s you send a message to the service’s Twitter or Facebook asking them to add the option.
Like password managers, two factor authentication should be another thing to keep in your security. TFA usually makes breaching into an account a whole lot harder, there are some drawbacks such as getting the secret keys used for verification stolen as well as the fact that given how none of these options are perfect, they sometimes supply you with backup codes, which are much easier to steal. Oh, and the rubber hose is still a thing.
There you have it! A guide to two factor authentication! Check out the Two Auth List to see if your services support two factor authentication. For a TOTP option, check out Authy, my chosen TOTP method. If you’re more inclined to using security tokens, Yubico have some great options and if you don’t like it, you can make your own.
That’s all for now. Share this post if you found it useful and until next time, seize the means of computation.

Wanna see what I’ve got lined up? Watch the Trello Board here.
Have an opinion about me? Let me know what you think here.

The 2037 Bug

Editor’s Note: This would have been a video, but I got lazy… Sorry :(.


On January 19 2038 at exactly 03:14:07, many computer will probably fail. The reason has to do with the 2038 bug which I shall explain in the post below.

To start off with, let’s talk about how computers track time. Most computers track time through a counter hooked onto a hardware element that causes the counter to increment at certain intervals, usually seconds. The time is inferred from the time elapsed from a certain reference time or epoch. In the case of *nix systems, like Linux and macOS and some programming languages, this epoch started on January 1, 1970.
2^31-1
231-1=2,147,483,647
The issue with *nix systems is that they store the time difference from the epoch in a 32-bit signed integer. The biggest number a signed 32-bit integer can store is 2^31-1, or 2 147 483 647. Why not 2^32? The integer is signed, so the leading bit is reserved for the sign. Now, two odd billion sounds like a big number but you are mistaken. Being the Zimbabwean that I am having experience with numbers in the trillions, I can tell you that 2 billion isn’t enough.
100 Trillion Banknote from Zimbabwe
Like, serious!
I mean, it’s all fine and dandy until that two odd billion runs out. That time will be exactly 03:14:07 on the 19th of January 2038. Once that date is reached, the next second will bring things back all the way to 13 December 1901 at 20:45:45. Why does this happen? When the number is incremented after having all True 31 bits, the next value will cause the signed bit to increment, turning the number from a positive to a negative.Year_2038_problem.gifHandy GIF thanks to Wikipedia
This sounds awful…Scratch that – this *is* awful! This bug has the potential to affect millions of systems. Desktop computers, phones, electronic assists in cars, avionics systems, industrial systems – anything using a signed 32-bit integer to store time. It’s not confined to hardware either. This bug could impact databases, file systems, medical software, military software among others.
Besides that incident with Paul Ryan’s economic forecasts, people have encountered some issues. AOL screwed up and some people couldn’t play video games. Also, some people have one more year (2018) to fix this bug lest their future calculations stop working. To be honest, I’m being a bit melodramatic. Knowing that this bug exists doesn’t necessarily predict that computers will catastrophically fail.
The last time we had this big of a scared based on time was during the Y2K bug craze where the issue had to do with storing only the last two digits of the year (so 2000 would actually be 1000). While they were warned about it 50 years in advance, they only started working on it in the last decade of the 1000’s, a bit like my essays and Paul Ryan’s healthcare bill. Thanks to programmers providing $300 billion in effort, they were able to mitigate disaster, although things did fail and they subsequently got fixed.
age of universe comparison.png
Now we know the problem and what it could do, how can we fix it? Well, the answer is surprisingly simple, but not easy. A good fix would be to move from 32-bits to 64-bit, giving us 293 billion years (about 22 universes) to think of something better. But, like I said, it’s simple, not easy. Any change is bound to break something. time_t is afunction in the C programming language responsible for storing time as a 32-bit signed integer on some computers. If time_twas changed to an unsigned number, we would work with numbers into 2106, but dates before 1970 won’t work.
64-bit computers already use the 64-bit integer, although they can’t calculate past 32-bit for legacy issues. Some Linux kernel maintainers have spent years finding a fix. Bergman has a proposal, but only one fix has been committed. Clearly, this will take a while to sort out, but I trust that programmers will be able to think of something.

Farai Read…The Thrilling Adventures of Lovelace and Babbage: The (Mostly) True Story of the First Computer by Sydney Padua

Book Info
ISBN:  9780307908278
Author: Sydney Padua
Publisher: Pantheon (US)Penguin (UK)
Published: April 21, 2015
Length: 320 Pages
Genre: Steampunk
Price As Purchased: $13.69 (with $5 discount) on Amazon

I did a book review on this book. Again, I wrote the post, but my text editor messed up the format, so you can watch the video on my thoughts below.

Where to get it:
Buy it at Barnes and Nobles – http://www.barnesandnoble.com/w/the-thrilling-adventures-of-lovelace-and-babbage-sydney-padua/1120420212?ean=9780307908278
Buy it on Amazon – http://a.co/aW3XufU
Find it on Worldcat to borrow in a library near you http://www.worldcat.org/oclc/869881357Fun Stuff
Sydney Padua’s Talk at Google – https://youtu.be/5fVlGAY6m8o
The Thrilling Adventures of Babbage and Lovelace Webcomic – http://sydneypadua.com/2dgoggles/