Browsed by
Category: Programming

Google hand tracking now open source

Google hand tracking now open source

Google has made its hand detection and tracking tech open-source, giving developers the opportunity to poke around in the tech’s code and see what makes it tick.

“We hope that providing this hand perception functionality to the wider research and development community will result in an emergence of creative use cases, stimulating new applications and new research avenues,” reads a blog post from the team.

That post over on the Google AI Blog dives into exactly how the tech works, and devs interested in getting a closer look at it can find the project over on Google’s Github repository.

MacOS 10.14 Mojave in VMWare

MacOS 10.14 Mojave in VMWare

Developing a iOS app used to require buying a Macbook or Mac mini. With VMWare, it is no longer necessary. I used VMWare Workstation 15.0 Pro and was able to develop an app and debug it on real iPad/iPhone hardware. Setup instructions are here:

Here’s the latest VMWare Mojave 10.14.4, 18E226 (March 25, 2019) image:

Further tips after the above setup

Eulerian Video Magnification

Eulerian Video Magnification

Back in the ‘early’ days (2012) of video processing, before we had AI algorithms, we often just pursued straight video processing techniques to tease out interesting information.

Enter MIT’s work on Eulerian Video Magnification. The underlying concept is to take small per-pixel differences from frame to frame, then magnify the changes, to detect things not ordinarily visible to the human eye.

One of the most powerful effects is the ability to accurately detect the pulse of someone, or the vibration of objects by sound – with just normal video footage. Check it out in their original demonstration video below:

In 2014 they did a Ted talk that shows some further interesting applications – including re-generating the sound going on in a room from the vibrations of the objects in it.

So, since 2014, you can even recover sound from a discarded bag of chips behind soundproof glass.

Program old standup arcade systems from your browser!

Program old standup arcade systems from your browser!

The folks over at 8-bit workshop have some neat resources. Learn to write 8-bit code for a ton of old standup arcades and tv console systems – right from your browser.

I’m personally a big fan of the 6502 Vector systems, but these are available for you to try out

  • Atari 2600 (6502)
  • VIC Dual (Z80)
  • Midway 8080 (Z80)
  • Galaxian/Scramble (Z80)
  • Atari arcade vector system – (6502)
  • Williams (Motorola 6809)
  • Apple II+

Your first game

Your first game

Time for me to shake my fist and tell you darn kids to get off my lawn. Lets set the wayback machine to the 1980’s…

Ralph Koster shares the first video game he ever wrote as well as a great flashback to what almost everyone that wanted to learn to program did back in the 80’s and 90’s. We typed in long programs by hand from books we got at the library and computer magazines. We taught ourselves BASIC and smatterings of assembly. If you were really cool, you even tried to sell your games: which was done by copying them to a floppy, printing a dot-matrix label for it, and trying to sell it in a ziplock baggie.

I started by fiddling around with the programs I typed in to see if I could change them or make them do different things.

My very first video ‘game’ on my TSR-80 consisted of a bunch of black and white dots that would fall down from the top of the screen, and you moved your dot ‘ship’ back and forth to avoid them as the enemies rained down. They came down one at a time. Ridiculously slowly. But it was probably my very first ‘game’.

My second, more ‘real’ game was a castle adventure game. You were the sole heir of a long-lost uncle and had to search his castle to find the deed within 24 hours. It was a text adventure at its heart, but there was opening graphics. I even wrote my own graphics editor with which I drew those opening screens. I believe I still have the graph paper I used.

Anyway, for anyone who learned to program in the 80’s, Koster’s video will tug some familiar heartstrings. For you younger kids, this is how it was done back in the day…

LD_PRELOAD and stealing function calls

LD_PRELOAD and stealing function calls

There is a clever little trick that one can use for a variety of purposes on Linux. It involves overriding or hijacking function calls. It’s called LD_PRELOAD.

Lets say you create a file called unrandom.c that includes an implementation of the rand() function. It matches the function rand() in standard C.

int rand(){
    return 42; //the most random number in the universe

We’ll compile it into a shared library.

gcc -shared -fPIC unrandom.c -o

Now… just run a program (my_program) that uses random numbers like this, and you’ll find that the rand function only generates 42.

LD_PRELOAD=$PWD/ ./my_program

This trick can be used in a variety of ways. A good write-up can be found here, and is worth a read:

Dynamic linker tricks: Using LD_PRELOAD to cheat, inject features and investigate programs

Vector graphics are back!

Vector graphics are back!

Remember the arcade game Asteroids or the vector-based Star Wars arcade game? How about the vector-graphics based Vectrix game console?

Say hello to LaserOS. It that allows you build really cool, high quality vector graphics dreams – on real laser projectors. You can build visual laser shows, visualizations, control and create musical compositions, and play some great old games.

Here’s a developer that re-created Asteroids with a high-quality laser system (bonus points for talking about the difficulty of the traveling salesman problem):

Here’s one reviewer giving LaserOS a go on his laser projector:

Kernel compiling and the PIC mode error

Kernel compiling and the PIC mode error

If you see this when compiling an Ubuntu or other kernel (my case was a Yocto kernel on an Ubuntu 17.04 distro)

CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
/usr/src/linux-4.4/scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
/* empty file to figure out endianness / word size */


Then the issue is with your gcc installation. In gcc 6+ versions, PIE (position independent executables) is enabled by default. So in order to compile you need to disable it. Even gcc 5 has the issue. This is a known bug for gcc. Bug Link.

So far there is no official patch from gcc side, so the workaround is to patch the Makefile of kernel source.

If you are familiar with patching the source file use the codes from this link to create the patch file then try to compile.Patch File

Here’s the patch to add to your kernel Makefile to disable PIE compiling.

diff –git a/Makefile b/Makefile
index 5c18baa..e342473 100644
— a/Makefile
+++ b/Makefile
@@ -612,6 +612,12 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux

+# force no-pie for distro compilers that enable pie by default
+KBUILD_CFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CFLAGS += $(call cc-option, -no-pie)
+KBUILD_AFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables