Error reporting in C++

a headline image with a pipe and boxes saying error on them

In this tutorial, we will be talking about errors that occur during the execution of a program and how to report them in C++. We won’t be talking much about program logic errors, but rather “environmental” errors, such as file not found, out of memory, no network etc. Reporting such errors becomes “trickier” when they take place in a function that normally returns a value. What should it return instead?

read more

cpp-switcheroo: A reimagined switch-case

cpp-switcheroo header image

When teaching C++ to beginners, I often find myself explaining the switch statement. It’s a simple and powerful tool that allows you to execute different code blocks based on the value of integral types. At the same time, it has some drawbacks, like the lack of type safety, forgetting a break statement, and of course, that you are limited to integral types. Drawing some inspiration from other languages and the “Overload” pattern, I created cpp-switcheroo.

read more

ToeTap: A human interface device for your toes

toetap

As you may have noticed, I often make videos about programming and the various projects I’m working on. While recording, I always have a script that I am reading from. The thing is, I often have to either stop recording to scroll the script or move my hand to the mouse. I wanted to find a way to scroll without having to remove one of my hands from the video frame and risk losing my concentration while filming. Here comes ToeTap: A human interface device for your toes.

read more

FREE Udemy course: Error reporting in C++

an ant nest shaped like the C++ logo

Reporting errors in a way that facilitates robust handling and debugging results in more correct and maintainable code. In this free Udemy course, I will teach you how to do that with C++, from the most basic to the most modern techniques.

read more

Tutorial: Let's get comfortable with SFINAE

balloons and confetti for 1000 subscribers

SFINAE is a powerful tool in the C++ toolbox that allows us to select behavior based on “traits” of types. It relies on a peculiar behavior of C++, where errors during template type substitution are not fatal as long as there’s a substitution that succeeds. This is a very confusing concept, so I decided to make a fairly detailed video tutorial about it. In the video, I promised that if I get 1000 subscribers on YouTube, I would write a blog post about it so you may have access to the code snippets. So, here it is!

read more

Udemy course: How to write SOLID C++

a robot transcribing a human

2️⃣0️⃣2️⃣4️⃣ is here and so is my first course on Udemy!

read more

Captivating captions with Phonix

a robot transcribing a human

Remember Phonix? The Python program that uses OpenAI’s API to generate captions for videos? Well, it just got a new feature allowing to create even more captivating captions!

read more

Skonaki: Turn video into cheatsheets

skonaki logo

Study smarter, not harder by creating cheatsheets out of videos with skonaki.

read more

Let's get comfortable with SFINAE

sycophant logo

SFINAE is a powerful tool in the C++ toolbox. It is also a very confusing one. In this video, I try to thoroughly explain what SFINAE is, how it works and how to use it. The goal is that by the end of the video, you will be comfortable with SFINAE.

read more

Sycophant: Opinionated articles based on the latest news

sycophant logo

Have you noticed how many articles on the web are just a rehash of the same news? Few organizations are able to produce original content while most others are mostly aggregating, translating and rephrasing the same news. In many cases, their main contribution is a clickbait title to make the news more sensational. My new project, sycophant, aims to automate this process by utilizing the power of OpenAI and produce, potentially, opinionated articles based on the latest news.

read more

Phonix: AI-powered video captions

a robot transcribing a human

If you create videos for social media (or just consume them), you may have noticed that captions make the content more engaging and increase the audience’s focus and attention. Myself, even though I am a rather advanced English speaker, I still prefer to watch subtitled movies and TV shows. When OpenAI announced Whisper I had to give it a try and incorporate it in some project. My first idea was to create an automatic translator but that was too complicated, so I went for the next best thing I’d have more frequent use for: Captions for my videos.

read more

OpenAI to generate pull request descriptions

a robot typing on a keyboard

Introducing a GitHub Action that can save you time and effort when it comes to writing pull request descriptions. platisd/openai-pr-description uses the power of OpenAI to automatically fill in the description of your pull request, based on the title and contents. It’s like having ChatGPT help you out!

read more

eely: Markdown-based courses made easy

eely logo

Are you a teacher or instructor tired of juggling multiple copies of your course materials for different audiences? Look no further than eely! This powerful tool helps you organize your Markdown-based content into configurable course deliveries, allowing you to create a single source of truth for your course content.

read more

How to make money with Open Source

stallman oss money

You can study, use, modify, share, and sell an open source project. The latter may sound contradicting or even controversial, however, it is inferred by one of the fundamental rights granted to you by the so-called “four essential freedoms” of free software (i.e. “The freedom to redistribute copies”) as well as by the “Open Source Definition” (i.e. “No Discrimination Against Fields of Endeavor”). In this article, we will explore the different ways to make money with Open Source.

read more

Builder pattern: A pragmatic approach

builder pattern cpp

I have been using the Builder pattern a lot recently but when I came across some articles about it, they confused me, so I got the inspiration write a post about it.

read more

Review: GitHub Copilot and C++

github copilot cpp

GitHub Copilot is a tool that provides real-time suggestions while developers write code. It offers much more than code completion, a feature found in most modern IDEs. Instead, it tries to predict what the developer wants to write from a couple of lines to entire blocks of code. Internally, GitHub Copilot leverages Machine Learning models trained on an unspecified number of open source projects, hosted by GitHub. Recently, it became publicly available at the price of 10$ a month which spawned some controversy. I have been using Copilot to write mostly C++, so let’s see what the fuss is about....

read more

Mob programming for autonomous cars

retrospective outcome

For the past year and a half, my team and I have been practicing mob programming every day, the entire day. It is our default way of working which means that we take “individual” tasks rarely and by exception. Mob programming has been working well for us, decreased the pressure on individual members, increased the team’s effectiveness, and the frequency we deliver our sprint’s commitment to the fullest. In this article, I will dive into the practicalities of how we practice mob programming, the benefits as well as the drawbacks we have observed.

read more

Mock dependencies in C++ without DI

mocks diagram

Do you want to mock your software’s dependencies so that you can unit test it easily? Is refactoring with the Dependency Injection (DI) design pattern not a convenient solution or an option at all? Then keep reading and I will show you a technique, that while it should normally be your last resort, it does allow you to mock most dependencies, without DI and typically, without changes to your code under test.

read more

SMCE: Your Arduino car emulator

SMCE logo

With the pandemic ongoing, hardware isn’t only difficult to source but also hard to collaboratively work with safely. In the case of smart miniature vehicles, the number of available units is inherently limited and so is the “environment” we deploy them in, e.g. a race track or an obstacle course. How do we work around the hardware resource scarcity? We digitalize the resources!

read more

pImpl C++ tutorial

pImpl tutorial

The Pointer to Implementation (pImpl) idiom in C++ is one technique that allows you to hide implementation details from an interface.

read more

Reverse interview questions

break the coupling header

Questions you should ask when interviewed for a Software Engineering position.

read more

Break the coupling in C++

break the coupling header

Implementations tightly coupled to their dependencies are difficult to maintain, reuse and test. In this tutorial, I will show you 5 ways of refactoring with the intent to “break” tight coupling between business logic and dependencies. A good indicator over the effectiveness of a decoupling is testability: If you are able to test your class and your class only without being influenced by the inner works of the various dependencies, then you know you have done a good decoupling. Below you will find some tightly coupled code and several ways to break it away from its dependencies. The focus will...

read more

Top 10 practices I hate in C++

c++ practices I hate

After working with C++ for the past years, I have developed some relatively strong opinions about several things people do, when writing C++. This inspired me to come up with the TOP 10 C++ practices, I hate most.

read more

How to write testable C++ for Arduino

testable c++ for arduino

Learn how to write reusable and testable C++ following the Inversion of Control principle. The new tutorial focuses on writing code for embedded systems (ESP32 MCU) and exercises are included for you to practice.

read more

How to write SOLID C++

SOLID principles

We all know, or should know, about SOLID. The question is, do we write C++ according to the SOLID principles?

read more

Worse is better!

Keep things simple

If you are working on a product that involves software, you may realize a considerable number of the features you build are never utilized by your users. And while some of those may be there due to legal reasons, the fact that you spent resources with little to no return of your investment does not change. To make matters worse, these features increase the system’s complexity and make the remaining ones less discoverable. Combined with the understanding that the majority of the work which goes into a product is not in functionality that sets it apart from the competition, I...

read more

Corona Lamp: Monitor the pandemic

Corona lamp

Paranoid, or “just concerned”, with the ongoing pandemic and want to keep tabs on the situation? This ESP8266 and WS2812B enabled lamp has got you covered.

read more

Are you agile when plagued by technical debt?

Man carrying boxes

Almost everyone claims to be agile. Some “in their way”, others more formally as part of a framework. From small startups to big automotive vendors and from development teams to HR, suggesting you are not agile is the equivalent of admitting you hate puppies or something equally shocking.

read more

Smartcar gets an ESP32 upgrade

ESP32 Smartcar

Remember Smartcar, the versatile and easy to use vehicle platform for your hobby-grade projects? It just received a powerful upgrade with an ESP32 as its “brain”, allowing it seamless connectivity via WiFi or Bluetooth. To sweeten the deal, it got new motors and fancy, custom-made chassis!

read more

IoTink: Your portable e-paper dashboard

IoTink

In our previous apartment, the gadget I was using daily was the VästtraPi which is a Raspberry Pi device with a 7” LCD screen connected to the internet indicating the next public transport departures. Since we moved, the new layout did not make it easy to have the screen mounted and continuously powered. Since the need to know when buses and trams leave remained, so it was time to use the E-paper display I bought last summer, to create… IoTink! (IoT + E-Ink 😂)

read more

Develop faster with Code Review Lamp

Code review lamp

At work, we are a fast-paced team that likes to commit small and often. Every commit does not only have to pass the various tests run by our Continuous Integration machinery, but also gets extensively code reviewed before allowed to be merged. Since we are six and our internal code of conduct dictates two positive approvals for each new submission, the lack of responsiveness when it comes to reviewing, can impede the development process and speed.

read more

Custom Actions for Google Assistant

Google Actions bus stop

A Google Home Mini  recently made it into the collection of gadgets I use on a daily basis for casting music, setting count down timers, reminders, recipes etc. However the capabilities the software behind it, Google Assistant, expand way beyond that. We saw how it, one day soon, could be making calls and booking appointments for you during the Google IO 18 keynote. Additionally, it is expected to be the catalyst for driver experience, as brilliantly demonstrated by Volvo Cars in the promotional video of their next generation infotainment system. It runs native Android just like your smartphone! There is so...

read more

Crowdfunding open source products

Paper abstract

When developing something that solves a big, small or silly problem I ask myself, usually as a mental exercise: How can I make money out of this? Sometimes, this thought experiment is concluded by a crowdfunding campaign where my cool gadget receives support by like-minded enthusiasts who pitch in and help bring it to mass production. Additionally, as an open source proponent I enjoy publishing my work, however this is ultimately a business move. Unfortunately, the lack of insights on the matter deems such decisions difficult and, as the devil is in the detail, surrounds the initiative’s feasibility with uncertainty....

read more

Debug your code with Dialectic Ball

Dialectic Ball

Always fascinated by portable, low power devices and new ways to interact with them, I was very happy to discover these LCD displays that used to be on old Nokia phones and their consumption is in the micro-Amperes range. As it often happens, I had a solution and was looking for a problem. And that is how Dialectic Ball was conceived!

read more

PCB trophies for your Hackathon

PCB trophies

During the past couple of years I have been involved in a couple of Hackathons, mainly as a member of the jury as well as the overall organization. One of the most fun tasks was creating the trophies for the winning team.

read more

Moltoduino: Extra cores & HIL testing

Moltoduino

If you are like me and enjoy working on microcontroller projects it is more than likely that, at some point, you wished you had additional processing power, extra pins, parallel threads and so on. One way to tackle this is to get stronger hardware and another to optimize your code. A third is to… stack another microcontroller on top and thus Moltoduino was born!

read more

Nevma: Gesture control for the masses

Nevma

Working at Delphi (soon Aptiv) allows me the luxury of being immersed in a high-tech and innovative environment that provides constant inspiration for creating new and exciting gadgets. One day, some colleagues mentioned gesture control being one of the recent trends in automotive. This got me thinking of ways to bring gesture control to the broader audience in an affordable and easy to use package. And thus, Nevma was born.

read more

Cryptopuck: Encrypt on the fly

Cryptopuck

After finishing a project, I torment myself on what to make next. While riding the bus home one day, an idea struck. How cool would it be if there was a small handheld gadget, able to encrypt USB sticks and SD cards just by plugging them into it. And thus the Cryptopuck was born!

read more

SonicDisc: A 360° ultrasonic scanner

SonicDisc

For some years now, I have been on a never-ending quest to discover the cheapest way for a miniature vehicle to position itself. One that performs decently that is. My latest idea involved the, less-than-a-dollar, HC-SR04 ultrasonic sensors to acquire a holistic view of the surroundings. But let’s take it from the beginning…

read more

My personalized Västtrafik bus stop

VasttraPi

In Gothenburg we are fortunate enough to have the local public transportation company, Västtrafik, maintaining its live schedule online and providing a public API for whoever needs to query it for their own applications. Consequently, there are plenty mobile solutions that provide access to the schedule, allow you to plan your trip etc. I have a problem though. In order to figure out when the next bus is arriving, I have to take my phone out, open the application, tap on my bus stop and finally check how many minutes I have left until I miss the bus.

read more

Scrumtato: Make daily stand-ups agile again

Scrumtato

At Delphi in Gothenburg, where I am currently employed, we create all kinds of cool products for the automotive industry. To organize our development process, we use SCRUM and abide by the Agile principles. Every morning, we have a short meeting where we discuss what our progress has been since the previous meeting, what we intend to work on until the next one, as well as mention any obstacles that we face. This meeting, the “daily stand-up”, is supposed to be short and should not last more than 10-15 minutes.

read more

Young Makers make the headlines in Greece

Students featured

During the last one year and a half I have been part of a voluntary initiative between the University of Gothenburg and the 1st Gymnasium of Rhodes which aims to introduce secondary school students to STEM through Maker and T-shaped education. As the first cycle of this project comes to a conclusion, it is time to write a short retrospective experience report. Let’s take it from the beginning.

read more

A Christmas tree PCB ornament

Christmas tree PCB

It is soon Christmas and I am facing the very same, yearly recurring problem: What gifts to buy! I generally prefer gifts to have a personal touch and was always fascinated by some personalized keychains I would receive from my uncle who has a milling machine. This Christmas, I did some timely planning and created a bunch of interactive electronic ornaments, shaped like Christmas trees!

read more

An autonomous wheelchair meets Li Keqiang

Autonomous wheelchair

When AVR meets AR, an autonomous wheelchair is born that gets to be introduced to the Chinese Premier of the State Council, Li Keqiang, during the 2016 Mass Innovation and Entrepreneurship week in Shenzhen!

read more

Turning software engineers into Makers

SEM demo

For the last few months, I was employed part time at the University of Gothenburg and helped to introduce the maker culture into an undergraduate Software Engineering course. But, let’s take it from the beginning…

read more

Phishing WiFi hotspots with captive portals

Onion omega captive portal

Are you using a paid Wifi hotspot service, which allows you to have Internet on various spots around the country? This convenience could come at a cost! If you are not careful enough, you might fall victim to - an easy to implement - phishing attack, therefore revealing your username and password to perpetrators. What is worse, is that the essential components cost around 30$ and can be hidden in one’s pocket! Want to learn how this can be done so you can tackle such attacks? Read on….

read more

Enhance your marketing campaign with IoT

Iot marketing robot

This post will cover the creation of Inno, a wooden robot-looking idol, that serves as an IoT marketing medium, for a new educational initiative at the Software Engineering and Management program, in the University of Gothenburg. In the beginning of the year, I was approached by the program’s administration to discuss the creation of an organization that would engage in extra curricular activities and enrich the students’ education. After months of negotiations, proposals and surveys, we are finally almost ready to begin with the “Innovation Space” and this is one of the ways we will hype it up!

read more

Simple LED driver board

LED driver

This article is about a simple PCB that I designed and enables the user to drive four separate LEDs (or other circuits) using one signal line. It is based on the ATtiny85 microcontroller by Atmel, which drives four NPN transistors. The aim is to document this board thoroughly, as it will be (hopefully) used by future teams attending the Carolo Cup competition, from Chalmers and the University of Gothenburg.

read more

Build the Android autonomous vehicle

Makezine instructions

After Makezine published an article on Team Pegasus’ Android autonomous vehicle, the person who wrote the report on it, David Scheltema, approached me in order to write a set of building instructions for their readers. And with the help of Donald Bell we got it published! So, if you are interested in building your own autonomous vehicle, check this article out: Build Your Own Android-Powered Self Driving R/C Car

read more

A path following vehicle called Alice

Path following vehicle

During the last term, my team and I were not the only ones creating a vehicle, controlled by Android. A group of first year students, at the Software Engineering and Management program, of the University of Gothenburg, were also developing one of their own. They created an Android application, which enables them to draw a path on the screen with their finger. This, is interpreted as a set of driving instructions to be sent via Bluetooth to an Arduino based vehicle, that executes them and therefore follows the drawn path. Let’s see how they describe their product.

read more

A multipurpose business card

PCB business card

First impressions matter, but what about… the second ones? Say you have met a potential employer or business partner, awed them with your skills, personality, knowledge (or your interactive name tag) and it’s time to give them your contact information. You hand out a business card. So why not make that one stand out as well?

read more

The world's first Android autonomous vehicle

Android Autonomous Vehicle

Team Pegasus created an autonomous vehicle that utilizes machine vision algorithms and techniques as well as data from the on-board sensors, in order to follow street lanes, perform parking maneuvers and overtake obstacles blocking its path. The innovational aspect of this project, is first and foremost the use of an Android phone as the unit which realizes the image processing and decision making. It is responsible for wirelessly transmitting instructions to an Arduino, that controls the physical aspects of the vehicle. Secondly, the various hardware components (i.e. sensors, motors etc) are programmatically handled in an object oriented way, using a custom...

read more

Breakout for the HM-11 BLE module

HM-11 breakout

A month ago, I was researching ways to increase the connectability and compatibility of devices that I make. More particularly, that of a vehicular platform, I have been working on for the past couple of months and will write soon about. I considered the Bluetooth Low Energy (BLE) as the way to go, since it’s the technology that is becoming the new standard, with the latest Android and iOS devices supporting it. I stumbled upon, some relatively cheap and small BLE modules, called HM-11, based on CC2541 by Texas Instruments.

read more

DIY, easy & cheap wireless presenter!

DIY wireless presenter

During presentations, I avoid being stationary and generally like to walk around in order to increase the interaction between me and the audience. However, I was constantly being faced with the burden of having to go back to the laptop, in order to change a slide or tell a person sitting by the laptop to do that. Not cool!

read more

ATtiny85 workshop in Gothenburg

ATtiny85 workshop

Last Friday, I organized a workshop on the ATtiny85 microcontroller. It was a great experience and I believe everyone had a lot of fun and learned a few things.

read more

ATtiny85 line following truck

Line following truck

I am organizing a workshop on ATtiny85 programming this week, so I built a model truck that can either be remotely controlled or tasked to follow a line! Read on for the story behind it, schematics, photos and videos.

read more

DIY interactive name tag

DIY Nametag

Exams are over, so there was some time to make this peculiar interactive name tag. It consists of an I2C LCD screen, an ATtiny85 microcontroller and a microphone. If you are attending a conference, a workshop or something similar and you want to make an impression, keep reading!

read more

8$ RC kill switch!

Killswitch

In this article I will cover the basics of a remote controlled kill switch that you can deploy in your house, your embedded project, your autonomous vehicle or anywhere else you see fit! After some months of absence from this blog, during which I was engaged in some very interesting projects [1] [2] I should write about at a point, I am back for this new little gadget I made.

read more

Make your own 10$ trackable keychain

Trackable keychain

Have you seen advertisements of small, usually Bluetooth powered, tracking devices such as the TrackR bravo? Well, now it’s time to make your own… cheaper! This tutorial is a sequel of a previous article, the GSM bug hack, where by modifying an inexpensive GSM surveillance bug from China, you can end up with a simple on/off switch, controlled remotely by your phone. Various applications of this simple hack where presented as a Use Case diagram, one of which was to “Locate belongings by emitting sound or light”. My mother frequently forgets where she placed her keys, so time to make her life a little easier. Also, this...

read more

DIY Bluetooth enhanced, spider robot

Spider robot

Lurking around AliExpress listings looking for cheap polypod, spider-like chassis to make something interesting out of, I stumbled upon this, for about 10$. The problem: it was “dumb”. All it does is to walk towards one direction, as you can see in the following video from 0:27.

read more

GSM bug hack - get a cheap phone controlled switch

GSM bug hack

For more than a couple of years, I have been growing a great interest in the Chinese gadgets scene. It all started with some key chain spy cameras and evolved into mini PCs, tablets, smartphones and electronics. Now, I decided to revive the old times and tangle myself again with ingenious spy gadgets. For quite a while, I have been aware of GSM surveillance bugs (they come under many different names and shapes, I’ve got this one) which essentially are some tiny boxes with a SIM card socket, also equipped with a microphone. You call them, they answer automatically and...

read more

Gamebuino: An über-cool open source gaming console

Some months ago, I contributed in a crowd funding campaign, to build the “Gamebuino” a gaming console based on Arduino. The guy behind Gamebuino, Aurélien Rodot had initially built it for himself while also publishing out schematics and code. When he noticed a growing interest in it, he started a crowd funding campaign to see if he can mass-produce it. And indeed he did, by collecting 1000% more funds, than his minimum goal!

read more

Tenvis JPT3815W camera gets firmware update to 1.1.0.8, still a threat to your privacy

It has been more than two weeks since my findings regarding the vulnerabilities of the Tenvis JPT3815W network camera. Since then, these findings were re-posted and verified by other individuals like Craig Russel and thus far it was discovered that this vulnerability exists only in the 1.1.0.5. firmware. Thankfully, Tenvis took this more seriously, especially after Craig twitted them about this issue and they promised a fix. And indeed they did issue a fix, or at least they tried to. On 4th of July, I emailed them again, inquiring about a firmware update. Here’s their answer:

read more

Tenvis JPT3815W: A cheap network camera, if you can afford the huge security issues

Tenvis camera

I recently purchased a cheap, Chinese network PTZ camera which comes under the branding “Tenvis”. It set my wallet back by 50€, including shipping from the UK. I decided to get this one, after reading some positive reviews which labeled it as a great value for money option. Additionally, I saw that “Tenvis” had a real website and an English forum, so I thought “why not”.

read more

Serial.println("Hello World");

Panoramic GBG

Hi everyone! This is my new blog that I’ll be writing on from now. It will be mainly focused in technology news and reviews, as well other topics that could be inspiring and interesting. Tutorials, how-to’s are also on the way!

read more