hgminh's blog

Heat Up Your Laptop Efficiently

1191 words - 6 minute read

NOTE: As many in Reddit point out, majority of energy will be converted to heat anyway, so the idea that some instructions can emit more heat while using less power does not make sense.

The number should still be correct to my knowledge, but the temperature differences should be just be due to different area in the chip heating up.

Have you ever been in a long-haul flight, nestled in your seat with your laptop, only to find that the chilly cabin air is making it impossible to sleep? With no access to a charging outlet, and your laptop’s battery life is limited, you are indeed in a desperate situation. In this article, we will explore an efficient way to heat up your laptop while minimizing power usage, ensuring that you stay cozy throughout the flight.

The final tool can be found here.


Solving Project Euler 820 on different hardwares (part 1)

1609 words - 8 minute read

For those of you who don’t know, Project Euler is a series of challenging mathematical/computer programming problems. Though the problem is more on figuring out the mathematical insight, this post will focus on the engineering side. We are going to look at problem #820, and try to solve it on various kinds of hardwares, ranging from CPU to FPGA, to see how much speed gains we can get from engineering alone.

Also, it is fun to see how different hardware affects on performance of the same codebase.

All the source code is available at Github.

This is part 1 of a 2-part series.


Assembly for C++ developers

1403 words - 7 minute read

A quick post on how to read assembly quickly as C++ developer. Note that this is NOT a guide on how to read assembly code. Rather, this post shows how common C++ constructs/routines are compiled into assembly. From there, it can help you to read asm faster.


Which Loop Is Faster?

1373 words - 7 minute read

The first loop accesses the memory sequentially from the beginning to the end of the array. The second one skips N steps between 2 iterations. Which one is faster?



284 words - 2 minute read