Latest Articles

Happy AI Valentine's Day

Valentine’s Day is upon us and this year that heartfelt card you get from your significant other this year might be written using AI. Specifically, ChatGPT which has taken the internet by storm. In fact, I asked ChatGPT to write a really heartfelt card message and this is what it produced. My dearest [Wife’s Name], On this Valentine’s Day, I want to take a moment to express how grateful I am to have you in my life. You are my rock, my support, and my best friend. You have brought so much joy and happiness into my life and I am forever grateful for your love.

A real threat has emerged to challenge Google and it might be Microsoft

The term “googling” is synonymous with searching for things online. For years, Google has enjoyed a monopoly on search, advertising, and other facets of internet life. As Yahoo! fades into the ether and Microsoft’s Bing exists but isn’t used much (who says “binging” or “bing it”?), we are starting to see competition heat up in the search space are decades of Google dominance. The threat to Google is ironically coming from Microsoft.

Why Don't You Hear Much About GraphQL These Days?

You might have noticed that you don’t hear about GraphQL as much as you used to. Some people might have you believe that developers have lost interest in this technology, but that couldn’t be further from the truth. This blog post will explore why GraphQL isn’t as talked about as it used to be and why it’s still a relevant and valuable technology for developers. Maturity and stability GraphQL has come a long way since its introduction a few years ago. As more and more companies adopt GraphQL, the technology has become more mature and stable. The growing number of real-world applications built with GraphQL has resulted in fewer bugs and compatibility issues, making GraphQL a reliable and predictable technology for developers. With its growing popularity, GraphQL has become a well-established technology widely accepted and used in the industry, reducing the need for developers to talk about and evangelize GraphQL.

Sentiment Analysis Using TypeScript Without Dependencies

Sentiment analysis is usually a task that requires a specialised dataset and machine-learning techniques to implement properly. However, I thought it might be a nice exercise to try and implement sentiment analysis with TypeScript without training models. // Define a type for the sentiment result type Sentiment = 'positive' | 'neutral' | 'negative'; // Class to perform sentiment analysis on a given text class SentimentAnalysis { // Arrays of positive and negative words to use in the analysis private positiveWords = ["love", "like", "great", "good", "happy", "awesome"]; private negativeWords = ["hate", "dislike", "bad", "angry", "sad", "terrible"]; // Method to perform sentiment analysis on a given text public getSentiment(text: string): { sentiment: Sentiment, positiveWords: number, negativeWords: number, neutralWords: number } { // Convert the text to lowercase to make the analysis case-insensitive const lowerText = text.toLowerCase(); // Sum up the number of times each positive word appears in the text let positiveScore = this.positiveWords.reduce((acc, word) => { // Use a regular expression to match the word in the text return acc + (lowerText.match(new RegExp(word, 'g')) || []).length; }, 0); // Sum up the number of times each negative word appears in the text let negativeScore = this.negativeWords.reduce((acc, word) => { // Use a regular expression to match the word in the text return acc + (lowerText.match(new RegExp(word, 'g')) || []).length; }, 0); // Calculate the number of neutral words by subtracting the positive and negative words from the total number of words let neutralScore = lowerText.split(' ').length - positiveScore - negativeScore; // Compare the number of positive and negative words and return the sentiment result if (positiveScore > negativeScore) { return { sentiment: "positive", positiveWords: positiveScore, negativeWords: negativeScore, neutralWords: neutralScore }; } else if (positiveScore < negativeScore) { return { sentiment: "negative", positiveWords: positiveScore, negativeWords: negativeScore, neutralWords: neutralScore }; } else { return { sentiment: "neutral", positiveWords: positiveScore, negativeWords: negativeScore, neutralWords: neutralScore }; } } } // Create an instance of the SentimentAnalysis class const sentimentAnalysis = new SentimentAnalysis(); // Analyze some sample text const result = sentimentAnalysis.getSentiment("I love this code and think it is great!"); // Log the result console.log(result); This code uses a class called SentimentAnalysis to perform sentiment analysis on a given text. The class has two arrays of positive and negative words and a method called getSentiment that performs the analysis.

Handling Errors with the Fetch API

The Fetch API is a modern and efficient way to retrieve resources from a server. It is an interface that provides a unified way to fetch resources from different sources. Fetch makes sending HTTP requests, including GET and POST, easy and handles responses asynchronously. However, handling errors properly is important when working with the Fetch API. Errors can occur for various reasons, such as a network error, a server-side error, or an invalid URL. Failing to handle these errors can result in unexpected behaviour and break your application.

The PlayStation VR 2 (PSVR 2) Headset Needs PC Modders to Survive

I tend to get excited about virtual reality and have wanted to see it succeed for over a decade. While VR has undoubtedly grown, it’s not mainstream due to the barrier to entry. Most notably, requiring beefy PC setups or locked down (like the original PSVR headset). Adding to my growing collection of VR headsets, I preordered the PSVR 2 headset for the PlayStation 5. There has been work done on untethered VR headsets, failed beginnings with Samsung creating phone VR headsets before Meta struck gold with the Meta Quest. Not only does it support using it by itself, but it can also be connected to a computer. Then you have the heavy, expensive hitters like the HTC Vive Pro 2 for powerful computer VR experiences.

Hogwarts Legacy: PlayStation 5 Review

Harry Potter fans have waited for an open-world Harry Potter game for almost two decades, and it’s crazy to think that we may have finally got what we have been asking for. After a lengthy wait and fear of delays, it’s finally here. So, the question is: does Hogwarts Legacy live up to the expectations, or do we have another No Man’s Sky and Cyberpunk 2077 situation on our hands?

Is Asking Developers How to Write FizzBuzz Outdated?

I have never understood why FizzBuzz was deemed a means of screening developers. The idea is for multiples of 3; you print Fizz. For multiples of 5, you print Buzz, and for multiples of 3 and 5 (15), you print FizzBuzz. While this kind of prescreening question might have worked 15 years ago when information wasn’t as accessible as it is now (smartphones, smartwatches. etc.), it seems strange that some companies still ask developers how to write FizzBuzz.

Will ChatGPT Replace Programmers?

ChatGPT is an AI-powered conversational API by Open AI that generates a lot of hype and fear amongst consumers, professionals and experts alike. Depending on who you talk to, ChatGPT will either revolutionise how we work, or it’s coming for our jobs and will taint academia. You might have seen some news stories, including the impressive feats of ChatGPT passing prestigious law and business exams. And while these stories are understandably concerning, AI is based on learning and is no different from people reading books and learning materials available online to do the same thing.

Why I Quit Social Media (Almost) – A Journey to Better Mental Health

Have you ever stopped to think about the impact social media has on your peace of mind? It was a realisation that came too late towards the end of 2022. The constant arguing, negativity, and drama on platforms like Facebook and LinkedIn took a toll on my mental health and well-being. I realised I needed to step back and break free from the negative echo chamber. You might not realise it, but even seemingly harmless platforms like LinkedIn can have a negative impact on your life. What started as a professional networking platform has fallen prey to the negativity that plagues other social media platforms like Facebook. The constant barrage of conflicts and drama was too much for me to handle.