The following is a problem given as a lab assignment for my Graph Algorithms course that I’m currently taking. It’s a pretty interesting problem and I enjoyed coming up with the solution. Problem Fatima commutes from KTH to home by subway every day. Today Robert decided to surprise Fatima by baking cookies and bringing them…

# Category: School

## Multi-threaded client-server application for ticket purchasing

The third lab for my Operating Systems programming course this quarter was to design a client-server application to simulate purchasing airplane tickets. The program was written in C++ and the client and server communicate via sockets. The server class has a main thread that listens for incoming connections and then creates a new thread to…

## Find the middle element in an int list (SML/NJ)

The following is a function that I wrote as an assignment for my Language Design class that returns the middle element of an integer list. fun middle lst = let fun reduceByTwo ([],onelst) = hd(onelst) (*When our twolst is empty we are at the middle*) | reduceByTwo (twolst,[]) = 0 (*This should never happen*) |…

## End-of-Quarter Update

Spring quarter is wrapping up this week and, believe it or not, classes have either finished or just cooled down for the most part. It was a pretty good quarter overall; I had good group partners for both classes in which I had groups, and my Discrete Math teacher’s seemingly odd grading system ended up…

## Crude JavaScript Filter for ‘select’ HTML list

This function was written for my group project in my User Interface Design course. I needed a way to live search through a group of <option> elements and this is what I came up with. Keep in mind, I have never formally learned JS, so some or most of this may not be best practice,…

## Project Euler | Problem 7 (10001st prime) Solution

Problem: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10 001st prime number? Explanation and Thinking My teacher gave us the hint that we should only be searching up to the √n where n is the number…

## Update on School Projects and Upcoming Tests

Discrete Math – Counting Test I’m writing this on my break from studying for my upcoming Discrete Math test on counting basics, which I’m currently feeling pretty good about. Counting isn’t hard, and I understand why each bijection is being used in most scenarios, so that’s good. The only thing I am worried about is…

## Project Euler | Problem 4 (Palindrome Product) Solution

As a part of my Discrete math class this quarter, my teacher has assigned us a few of the problems from Project Euler. If you are unfamiliar with this project, it is a “series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve.” Being a much bigger fan of…

## First Lab for User Interface Design Class

So apparently this class was not designed with the assumption that everyone knew HTML and CSS, because our first project was basic to the point of boredom. We just had to design a little informational page about our pet. At one point in the development process I accidentally deleted all my HTML, or more specifically,…