After pressing the “ON” button on your computer, the BIOS of the computer reads 512 bytes from the boot devices and, if it detects a two-byte “magic number” at the end of those 512 bytes, loads the data from these 512 bytes as code and runs it.

This kind of code is called a “boot loader” (or “boot sector”) and we’re writing a tiny bit of assembly code to make a virtual machine run our code and display “Hello world” for the fun of it.

Boot loaders are also the very first stage of starting any operating system.

What happens when your x86 computer starts

You might…


So, it’s that time of the year again. A year has passed, a new one is around the corner. Time to take a breath and reflect.

What I said about 2017 last year

Last year I looked back to 2016 and forward to 2017, too. So let’s see what I said about 2017 back in the last December:

I don’t know much yet, but I can certainly see the first few conferences lining up and
the continuation of my writing projects will certainly take some time out of this year.

I hope I get to work with my co-workers on more amazing things at Archilogic, for instance…


Picture by WoC In Tech, CC-BY 2.0, https://flic.kr/p/FbS6AN

TL;DR

  • Start with something you don’t know. Research & write down the result
  • Research just enough to identify the major unknown-unknowns, turning them into known-unknowns
  • Break your project down into approachable steps
  • Build small prototypes for each step to validate your understanding of the project’s problem
  • Put together an implementation of your project, based on learnings from the prototypes
  • 🎈 Be proud & share 🎈

Intro

First things first: This is how I approach the silly, little fun projects I do.

It may not work for you and it will most definitely not work for your team when building a product.

Long…


Cross-origin resource sharing

TL;DR

  • The Same-origin policy does not prevent requests being made to other origins, but disables access to the response from JavaScript.
  • CORS headers allow access to cross-origin responses.
  • CORS together with credentials require caution.

I will only show the request handling code here, but the full example is available on Github.

Let’s start with an example. Say we have an amazing website with a login to protect some private data we made available to our users at /private.

app.get('/private', function(req, res) {
if(req.session.loggedIn === true) {
res.send('THIS IS THE SECRET')
} else {
res.send('Please login first')
}
})

We won’t make…


TL;DR

  • when dealing with binary data or communicating with hardware, you may find yourself needing ways to manipulate individual bits
  • JavaScript has operations for this case:
    bit-shift operators push bits to the left or right bit-wise arithmetic operators merge two sets of bits or flip the bits
  • when dealing with bytes, ArrayBuffers allow different ways of handling the data without needing to copy it around

In a previous article on number systems I have explained how numbers can be expressed (or encoded) with any arbitrary number of symbols. We are used to having ten symbols (0…9) to do so, but computers…


Four worker threads running in parallel

TL;DR

  • JavaScript is single-threaded and long-running scripts make the page unresponsive
  • Web Workers allow running JavaScript in separate threads, communicating with the main thread using messages.
  • Messages that transfer large amount of data in TypedArrays or ArrayBuffers cause large memory cost due to data being cloned
  • Using transfers mitigates the memory cost of cloning, but makes the data inaccessible to the sender
  • SharedArrayBuffers are an upcoming feature, allowing data to be shared between threads.
  • SharedArrayBuffer access can (and may need to) be synced using Atomics
  • All code can be found in this repository

Update: isPrime was incorrect

Thankfully a reader pointed out that the isPrime…


Notes from Gottfried Wilhelm Leibniz on the binary system
  • The fact that we use a number system with 10 symbols (0–9),aka “Base 10” or decimal is an arbitrary choice
  • Systems with different bases can help us express numbers in specific contexts more intuitively (e.g. hexadecimal or binary when working with digital systems)
  • Reading numbers in any number system can be done by multiplying each digit value with a power of the base, starting with the zero-th power for the right most digit and increasing the exponent by one for each step to the left, e.g. 123 = 3x10^0 + 2x10^1 + 1x10^2 for decimal numbers (base 10)

Why bother with other number systems?

We are…


The web platform has started out with HTML to allow users to share documents and link them in a user friendly and standardised way.

HTML alone was lacking the possibility to influence the way things looked, so a new standard came about (after other alternatives have been proposed), CSS.

Around the same time (depending on what you consider the beginning of CSS’s existence) JavaScript was created by Brendan Eich and a few years later a way to interact with the HTML document from JavaScript was created, the DOM.

Today, the different technologies may be a little too much to take…


Learning curves, tools and fatigue

Web Development can be pretty strange these days.

On the one hand we tell beginners that they need all the things: build tools, task runners, package managers, frameworks, polyfills, libraries, runtimes and deployment systems.

On the other hand some are airing their concerns about some flavour of “fatigue”, be it a framework, library, JavaScript or even frontend fatigue.

I also noticed a sense of urgency for everything. Mobile-first, Offline-first, Accessibility-first, Content-first and the list goes on. It starts to feel like “everything-first”, which of course really would mean: Nothing first.

Where are the olden days, where all you needed to…


Downtimes, Crashes, Incidents, System Failures - they have many names, but most people involved with technology to some degree have experienced at least one at some point in their career.

I've seen many different teams and many different incarnations of the above-mentioned situations. I've been on the different sides of them: The user, the developer, the system administrator, the site reliability engineer and the consultant.

Some of them I have caused, some of them I helped to resolve and in some of them I was a mere bystander.

This post is the distilled essence on how different teams that I…

Martin Splitt

Bits, Bytes and Rock'n'Roll! Turning challenges into solutions. Pushing the web forward and open source advocate.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store