In this blog post I will explain how you can make an Angular app work with WebAssembly code. This combination of technologies can bring interesting advantages to web development and it is fairly simple to implement. As I write this post, Angular is currently at version 5.1 and WebAssembly is still in its initial version, but it is Continue reading How to make Angular and WebAssembly work together
I have been testing java optimizations lately and I have found a bug in the Java compiler by accident. The JDK version I use is 8 update 112, which is the latest production release available at this point (Dec 28, 2016). I have just reported the bug to Oracle, hopefully they will fix it soon. I will Continue reading How to crash the java compiler (JDK 8 update 112)
The volatile keyword exists in some programming languages, including Java, C and C++. I want to discuss in this blog post the differences, similarities and some details that every programmer should know about this keyword and help you understand how it affects your code. My focus will be only on Java, C and C++ because those are Continue reading Comparing the volatile keyword in Java, C and C++
The return statement in Javascript looks innocent and intuitive, but it hides a caveat that can break the logic of your code and lead to undefined behavior. The best way to illustrate this is to use a simple example, so let s consider this function: function greeter(name) { return 'Hello ' + name; } greeter('Hugo'); // works Continue reading Beware the return statement in Javascript
This week I implemented a simple 3D experiment with Typescript, ThreeJS and Ammo.js. It works like an FPS game where you can navigate with the mouse pointer and W-A-S-D keys, and you can also shoot cannon balls with the mouse button. Online Demo: http://static.componenthouse.com/webgl-shooter/main.html Source Code: https://github.com/hvidal/WebGL-Shooter Using Typescript Typescript is a great…
The volatile keyword in C++ is poorly misunderstood. Lots of developers believe that it makes the declared variable an atomic variable, but that s wrong. The truth is that you should use std::atomic or related code (e.g., mutex) on a variable if you want to guarantee atomic operations in a multithreaded context. What I want to discuss in this Continue reading A note about the volatile keyword in…
I wanted to compare how Java, C++ and C perform when reading a text file line by line and printing the output. I ve implemented some possibilities and, at the end, we can compare the speed of each execution. Java 7 version (BufferedReader) import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; public class Main7 { private static final Continue…
I have been wondering about version control systems (VCS) recently and I wanted to build a list with clear advantages of Mercurial over Subversion. First of all, Mercurial is a distributed VCS, Subversion is not. This brings advantages like: 1) You have a full copy of the repository on your computer, so you don’t have to rely Continue reading Advantages of Mercurial over Subversion
This is the second part of my UI lessons from the real world article. It has more funny examples of what (not) to do with your UIs. You guessed it, folks. After the huge success of my first article Ten UI Lessons from the Real World, I decided to write the second part with more Continue reading More UI Lessons from the Real World (Second Part)
Learn UI concepts from real world pictures. Signs can teach valuable lessons in this regard and you should pay attention to them. User interface isn’t a subject specific to computers. Every object in the real world has an interface and understanding it is crucial for a correct usage. Some objects are well designed and can Continue reading Ten UI Lessons from the Real World