Tips for Integration Testing with GitHub Actions CI pipeline: AWS SAM Backend Integration Testing with GitHub Actions

This article contains some tips and code to help with adding Serverless Backend Integration tests to GitHub Actions. Integrating tests into the CI pipeline improves confidence that existing behavior has not been broken by changes. Typically a production code base will have tests integrated into the CI, and any merge request must pass the tests before being merged and deployed to production. Regarding the local implementation of AWS SAM backend integration tests, have a look at this article. ...

December 31, 2022 · 5 min

Part IV: Testing - Level Up as a Software Engineer by Writing a Chess Engine

Healthy software requires testing. Today, testing is inseparable from the development cycle because it improves reliability and eases refactoring which speeds up features development. This article covers common testing strategies used in chess engine development. These strategies follow tech industry best practices and can be applied to any software project. Component Testing A chess engine requires a move generation function to calculate legal moves. This is a foundational component of the chess engine’s overall quality. ...

February 20, 2022 · 4 min

Part III: Move Generation - Level Up as a Software Engineer by Writing a Chess Engine

How does a computer think? It must know two things: what is possible and what is optimal. A chess move generation function calculates what is possible from a given position. An evaluation function determines what is optimal. Move generation is the marriage of these two capabilities and the focus of this article. A note about the evaluation function No computer can “see” to the end of a chess game but the engine still needs to find advantageous positions. This is why an evaluation function is necessary to score the approximate advantage of a position. ...

February 12, 2022 · 6 min

Part II: Data Structures - Level Up as a Software Engineer by Writing a Chess Engine

Internal board representation is a good place to start if you are building a chess engine. In other words, how will the program represent a chess position? Resolving this question correctly requires thinking through the entire solution before going to the keyboard. Naive Approach The naive approach is to simply look at the board and come up with a structure that can encode the information. For example, you might use an array of length 64, encoding the pieces as single characters. ...

February 4, 2022 · 9 min

Part I: Introduction - Level Up as a Software Engineer by Writing a Chess Engine

I’ve always learned better working on projects rather than reading theory. So, when I started to learn Golang I wanted to find a challenging project requiring a variety of software engineering concepts. I ended up writing a chess engine and it turned out to be more challenging than I had anticipated. It also greatly improved my skill in applying important software engineering concepts. I want to share the challenges that make chess programming such a great way to level up as a software engineer. ...

January 25, 2022 · 4 min

Implementing a Dynamic IP with Domain Hosted on DigitalOcean

In this article, I’ll provide a way to set up a dynamic IP address for your home server with DigitalOcean as the DNS. The article shows you how to monitor the server’s public IP address and dynamically update DigitalOcean records as needed. The article shows how to set up a script to run every hour via crontab and how to cache the previous IP address to avoid unnecessary API calls. ...

December 22, 2021 · 5 min

Part VII: Quick Reference

This guide is part seven of the series, X86–64 Assembly Language Program. This article is more of a reference guide for those learning x86–64 Assembly Language. I hope you find the information and links at the bottom helpful. Registers General-purpose registers — there are 16 general-purpose registers — rax, rbx, rcx, rdx, rbp, rsp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 data- section is used for declaring initialized data or constants bss- section is used for declaring non initialized variables text- section is used for code rdi- first argument rsi- second argument rdx- third argument rcx- fourth argument r8- fifth argument r9- sixth The first six integer or pointer arguments are passed in registers rdi, rsi, rdx, rcx, r8, r9. r10 is used as a static chain pointer in the case of nested functions. ...

December 20, 2021 · 4 min

Tips and Tricks for using Crontab on Linux

Photo by Towfiqu barbhuiya on Unsplash Crontab is really useful but there are some gotchas. The following was all done on an Ubuntu Server. Results may vary on other distros. Setting up a Cron Job Just run crontab -e A file will open in your default editor with the first list commented out. These comments are useful. I’ve copied the first few here: # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task You end up adding a line that has a similar format to this: ...

November 29, 2021 · 3 min

Part VI: How to Determine String Length

This guide is part six of the series, X86–64 Assembly Language Program. How to Calculate String Length In order to calculate the length of a string, we’ll first need to know what determines the end of a given string. Strings in memory are represented as a pointer. The location pointed at is a byte of data representing a character followed by additional characters contiguous in memory. The important point is that this sequence of bytes is terminated by the byte 0x00. This is called the zero-termination character which is one method of terminating a string (C uses this approach, for example). There are methods of encoding strings that we won’t cover here. ...

November 28, 2021 · 3 min

Part V: Conditionals, Jumping, and Looping

This guide is part five of the series, X86–64 Assembly Language Program. Conditionals and Looping Assembly language supports conditionally jumping to a specific line of the code. Looping is actually just a special implementation of jumping. It’s a jump to the beginning of the “loop” until some condition is finally met. Essentially this post is about writing conditional statements to branch one of two ways depending on some condition. The core conditional operator is cmp which is short for ‘compare’. The cmp operator compares two values and then sets some flags indicating the relation of the two values. Flags can be checked using some other operators, namely: ...

November 1, 2021 · 2 min