Hack Cambridge 2018

This weekend I had the opportunity to attend yet another hackathon. This is my second MLH hackathon, with the previous one being Great Uni Hack 2017 in Manchester. Unlike at GUH however, I aimed to build something of value and challenge myself.

I was nervous at first, particularly because I was going alone and had no team. Fortunately, I met two other like-minded students and we immediately got along. Interestingly, we were all coming from different backgrounds and universities. One came from a computer engineering background, the other was more into high performance computing while I was coming from a service oriented/full stack development background. Nonetheless, we managed to work well as a team.

Continue reading “Hack Cambridge 2018”

Advertisement

Great Uni Hack 2017, Manchester

This article won’t be like my previous articles, but rather a few notes about my experience at my first proper Hackathon. I’ve been to (and won) programming competitions before, such as Game of Codes and Google Hash Code, however those were pretty intense and stressful. This time however, we decided to simply have fun and learn something new.

I teamed up with two of my course mates from the University of York, Sophie and Tasman, and attended the Great Uni Hack 2017. Quite possibly, we came up with the wackiest idea in the whole competition.

There were many prizes and competitions to target in the hackathon, each one from a different sponsor. We decided to focus on American Express’s competition, which was to make an innovative travel companion app.  Although we didn’t manage to win that prize, we did win the popularity prize.

Continue reading “Great Uni Hack 2017, Manchester”

Person Identification

There have been many implementations in recent years for identifying the human form within a given photo frame, however one particular method stands out called Histograms of Oriented Gradient (HOG) descriptors. Given a training set, the HOG algorithm is capable of eliminating information irrelevant to human detection. The human form can be shown in many different poses, perspective, ambient lighting and backgrounds, however one of the most important characteristics that is common to all are edges and corners. hoggg The edge and gradient structure information is defined locally in small regions. The HOG technique consists of counting occurrences of gradient directions in localized cells (or pixel matrices). We then normalize these local histograms. It is suggested that the human form can be represented by using the distribution of local intensity gradients.

For my MATLAB implementation, check out my Github.

Implementation

The person identification system can be divided into two main functions which are:

  • TrainHOG – will compute the necessary weights from training data.
  • PredictHOG – will use the previously mentioned weights for predicting whether input images are human or not.

Continue reading “Person Identification”

Testing Techniques for a Betting Website

This assignment was part of the Fundamentals of Software Testing study unit, therefore the main aim of this assignment was to explore and try out different testing techniques and tools which include:

  • Unit Testing
  • Selenium (Automated Web Testing)
  • Cucumber
  • Model-Based Performance Testing

I’ve worked on this assignment with my good friend Jake Dalli. Check out my GitHub for our code!

Overview

The main idea of this website was that we were working for a new online betting company which allows users to place blind bets on sports events without them needing to know what sport or team their money will be bet on.  The company employs expert betting analysts to place bets on behalf of users.  In effect, a user can place a bet of (for example) EUR 5 and a betting analyst might split that into three different bets to spread the risk across different events. We are required to develop an initial version of the website using a 3-tier approach with the following requirements:

Continue reading “Testing Techniques for a Betting Website”

Monte Carlo Optimization: Exam Timetabling

The exam timetabling problem is a classic real life problem faced by all education institutions. When given a period of time, it is required to allocate all exams into specific timeslots without creating any collisions. There are many ways of implementing an exam timetabling algorithm, however one efficient way is to implement a Monte Carlo optimized Hyper-Heuristic algorithm. Hyper heuristics can be considered a type of nearest neighbour (or Greedy) algorithm with the only difference being that it seeks to automate the selecting process through machine learning.

Check out my GitHub for the implementation.

We are first required to define the necessary parameters and present them as a tuple in order to solve this algorithm. These are:

  • E →  The set of events
  • I →  The domain
  • K →  Constraints

E → Set of Events

In this case, the set of events are examinations. In the classic exam timetabling problem, for each exam we are required to define the set of all students which need to sit for the exam. Since this is a simple implementation, it is assumed that students in the same course do not have electives, therefore each student in the same course will sit for the same exam. In the programming implementation, each exam will list which courses are to sit for the exam.
A Course class and Exam class were created. The course class for this implementation contains the course name and number of students. The exam class on the other hand contains a list of courses that are to sit for the exam and the exam code.

Continue reading “Monte Carlo Optimization: Exam Timetabling”

Remote File Memory Mapping

The aim of this assignment was to implement an API which provides a number of calls allowing processes to memory map sections of a file located on a remote machine. Processes can then read and write to this memory area using the provided calls, with changes being propagated to the remote file by the library. Multiple processes from multiple client machines should be able to access and modify the same file on a remote machine. This was implemented in C on Ubuntu. Check out my Github for the full implementation.

REQUIREMENTS

The requirements consisted of a Client-Server model with:

  • The server having the ability to open a number of files (or section of files) on the machine using a file descriptor, and storing them in memory.
  • The client having the ability to demand that the server maps a particular file (or section of file) to memory.
  • The client having the ability to demand that the server unmaps a particular file (or section of a file) from memory.
  • The client having the ability to demand a part of the memory from the server.
  • The client having the ability to alter a part of the memory from the server.

Implementation

Continue reading “Remote File Memory Mapping”

Sudoku Solver

GitHub: https://github.com/PatrickBuhagiar/Sudoku-Solver

Given an initial Sudoku puzzle S0, we explore the state-space until we reach an end state Sn representing the solved puzzle. With the singleton technique, transitions between states will occur by looking up cells which only have one single candidate value.

The class Sudoku will represent the puzzle as a list of rows each containing a list of integers. Unknown cells are represented by the number 0.

class Sudoku(val grid: List[List[Int]]) {
    def row (row: Int): Set[Int] = ... 
    def column(column: Int): Set[Int] = ... 
    def block(block: Int): Set[Int] = ...
}

The row, column and block functions take an index as a parameter and return the content of the row, column or block respectively.

Continue reading “Sudoku Solver”