4 ms·
A bit of back-story; during my second year of university I picked up C# after a summer internship at a local company. I was purely taught Java at university, bu
by EnderMB 12y ago
A bit of back-story; during my second year of university I picked up C# after a summer internship at a local company. I was purely taught Java at university, but was keen to learn other languages as I wanted to expand my knowledge past what Java would offer me. Sure, Java to C# isn't a huge paradigm shift, but after playing with LINQ I was sold on .NET.
For my final-year project, I built a search engine from scratch using C# that would rank websites based on "how they looked". This involved looking at the various data structures required to store and retrieve this information, alongside figuring out how to rank pages on both content and their looks. To handle the looks, I took a screenshot of each page, reduced the size to around 100x100 and scanned the colours of each pixel to see if text would contrast. Alongside this I scanned the CSS of the page to check text colour and see if it matched the pixels; if it did, do a comparison against this. I can't remember the exact algorithms I used, but if you used dark text on a dark background you'd get ranked down, and vice versa, alongside some other metrics.
The result was very crude, and looking back on it now the code was terrible. I had implemented the data structures myself, had a semi-decent crawler set up, and could sit all the tools alongside each other to crawl the Internet. Most importantly, it worked so I ended up getting decent marks! While the code makes me cringe, my write-up was fairly impressive, and I felt that writing 40k words over a year helped my writing ability considerably.