This post serves as a summary documentation for all work done over the second half of the semester on a final idea that Chris, Nouf and I worked on.
This is mostly links to documents and decks.
For my final, I decided to build an Adafruit wishlist collation system for ITP.
A lot of us at ITP require electronic components and modules, and the usual go-to place is for us is Adafruit. The unfortunate part is that Adafruit, despite being in New York, charges for shipping, unless the order amount is greater than $200. As a result, a lot of us email the student list to check if anyone else on the floor also needs parts. My hope with this project was to attempt to streamline this process.
This is what I’ve built so far:
If logged into Adafruit, one can create public wishlists. In the system I built, anyone wishing to buy starts by creating a public wishlist, pasting the URL of the wishlist along with their email address and an expiry date for the wishlist.
The service then scrapes the wishlist page for the user’s name, and overall cost of items on the wishlist. As soon as a list is added, an email is sent to the user to confirm the validity of the wishlist. Once the user confirms, the list is highlighted in green to signify that it’s confirmed. Others may also add to this list of wishlists, and once the overall cost of all confirmed wishlists are beyond 200 dollars, it sends an email to all the email addresses associated with that list.
Here’s a link to the code.
I used nedb to store the data since this program will probably have to deal with a relatively small amount of data. I used bootstrap, ejs for templating, cheerio for scraping, and sendmail to send emails for confirmations and notifications.
Here’s a link to the site. I might bring it down soon, and work on it more. The confirmation emails currently look super sketchy and
might will end up in the spam folder (just FYI). I’ll fix this soon.
Research notes for the past week are in this document:
Our current slide deck is accessible via the link below:
A few years ago, I read The Code Book by Simon Singh. At the end of the book, Singh provides a Cipher Challenge – 10 exercises to decode.
For this exercise, I revisit the first challenge – a basic substitution cipher.
It has been years since I looked at this book or the exercise, and I don’t remember how long it took me to decode it by hand back then. So I decided to try it again. It took me around 40 minutes to decipher it.
Now, I’d like to challenge myself to write an algorithm that can decipher this faster. At this stage I don’t know how that would be, but I have a few thoughts.
First, let me briefly explain how I decoded this by hand.
I knew this was a basic substitution cypher that did not purge the spaces between words (the book said so), therefore I began by looking at common patterns of small words. JPX was quite common. I then looked up the most common words in English. So I started with the assumption that J = T, P = H, X = E. I then found a JPXT in the text. It could only mean THEM or THEN. The JPXT was the start of a sentence, and it was followed by JPX. ‘THEN THE’ sounded more probably than ‘THEM THE’, so I also started assuming T = N. Similarly, I went through the other letters until I deciphered it enough to just guess the missing letters.
Now, on to writing an algorithm that does this by itself. Again, I don’t fully know how this would work, but I’m going to experiment with a genetic algorithm that knows a list of common words.
The algorithm will start by producing randomized ciphers, and attempting to decipher any text given to it.
The fitness score of the different deciphered mutations will likely be based on the occurrence of the common words. I don’t know if this will work out, but it’s a fun experiment nevertheless.
So far I’ve written a processing sketch that encodes and decodes phrases. I’ll likely build upon this.
Challenges I foresee:
1. I might need to look up a much larger list of common words.
2. The fitness scoring system should probably be smarter than what I currently have in mind.
So that’s the plan. Anything under this sentence will be updated to show results.