-
Emulating ZX Spectrum graphics in JavaScript
I'm using EcmaScript 6 Proxy objects to keep track of dirty blocks in emulated ZX Spectrum video RAM in a browser. I describe how the ZX Spectrum video RAM works, and implement an emulator using modern JavaScript.
-
Using Source Maps with CSS
When CSS or JavaScript is minified, there is a mechanism called Source Maps that can help you inspect the original code directly in the browser. Sometimes it requires some extra configuration.
-
FizzBuzz in CSS
Creating a FizzBuzz solution using only CSS is probably impossible, but with just a little HTML added, it's perfectly doable, using a combination of CSS counters and the nth-child() pseudo-class selector.
-
Converting from Type to SqlDbType
The .NET type system and SQL Server types are not very easy to map to each other. In SQL, variables don't just have a type, but can also have precision and maximum length, which is not possible to translate into simple .NET types. Here I show a naïve approach at translating from one type system to another.
-
"Hello, World!" in Pascal
A "Hello, World!" program in Pascal can be written by calling the global WriteLn function to send the "Hello, World!" string to the standard output stream.
-
"Hello, World!" in ZX Spectrum machine code
A "Hello, World!" program in Z80 assembler for the ZX Spectrum can be written by calling the CHAN_OPEN and PRINT subroutines to send the "Hello, World!" string to the screen channel.
-
"Hello, World!" in CSS
A "Hello, World!" program in CSS can be written by setting the "Hello, World!" text as the content of the ::before pseudo-element of the html element.
-
"Hello, World!" in HTML
A "Hello, World!" program in HTML can be written by creating a paragraph element containing the "Hello, World!" text.
-
"Hello, World!" in JavaScript
A "Hello, World!" program in JavaScript can be written by calling the log method of the console object to send the "Hello, World!" string to the standard output stream, or the developer console in a web browser.
-
"Hello, World!" in PHP
A "Hello, World!" program in PHP can be written by using the built-in echo statement to send the "Hello, World!" string to the standard output stream.
-
Overriding console.log in JavaScript
JavaScript is a dynamic language, where even functions are just object variables, pointing to some runnable code. This makes it possible to replace default implementations with your own implementations. However, if you are not careful, it can lead to problems that are hard to debug.
-
"Hello, World!" in Java
A "Hello, World!" program in Java can be written with a static main method of a class, and calling the println method of the System.out PrintStream object to send the "Hello, World!" string to the standard output stream.