Category Archives: Blog


Sometimes I get the opportunity to collaborate on unique projects that don’t necessarily have to do with engineering.

DOOM was a pioneer of PC gaming, and the nostalgia of watching someone play is undeniable to me. To commemorate the release of the new DOOM game, I had the honor of contributing a play through of DOOM episode 2 (The Shores of Hell) for NewRetroWave’s gaming channel. Here’s the full playlist, including Bryan Eddy and StevePlayGaem’s runs as well.

Rainbow String Lights (and other updates)

Rainbow String Lights

Using an Arduino Micro and some low-level port register writing you can drive TM1803-based tri-color LED string lights. The challenge was getting the timing correct on the output pin. An extra CPU instruction or two introduced from refactoring can throw off the timing since there’s only around 200ns tolerance on the RZ line. Fortunately I had my Tektronix Oscilloscope (pictured, BEBOP) to spy on the signal and nail it down. I may someday use what I learned here to write a faster driver for the TFTv2.

I’m taking a break from Arduino stuff for a while, though and focusing on my bigger projects. I’ve written up a great deal of the protocols and specs for the Distributed Neural Network AI project, including the machine vision, voice recognition, and node setup scripts. The purpose of this project is to have a self-hosted neural network AI that can delegate pieces of its service over Multipath TCP; the goal here is Jarvis meets Siri meets IBM Watson, all hosted on your own consumer hardware. I still have some editing to do so the papers will be published sometime around August. I’ve spent a great deal of time and care working on each individual system and unifying them in a useful way is very challenging.


Atomic ListAtomic is still at the top of my project list. Most of the hard grunt work is finished, which really just leaves synchronization and some UI adjustments left before the initial release. I split synchronization tasks off into a separate tool. This may seem like a weird choice, but there are actually multiple command line tools already–and scheduling synchronization in a cron job or Windows Task Scheduler would be a piece of cake if you could call it without arguments.

I just sent out the first newsletter about this app. If you’d like to hear more updates please sign up on the project page.

New series

I’m toying with the idea of making a video/week that showcases my work. I haven’t made the commitment yet, but here’s my first shot, and a glimpse of what that might look like.

Another note on Quadspheres vs QLSC

There is an abundance of posts about Quadrilateralized Spherical Cubes (QLSC) online, but I can’t find any that are sticking to the true nature of Dr. Chan’s original work. It’s a fascinating anomaly that has spread and evolved in the past 6 years, most likely by accident. I contributed to it by making the same exact mistake and had to later publish errata.

Anyway, I love talking about it and the posts seem popular so I would like to share a recent response I made to someone who wrote in. I think it may give just a little bit more detail on what’s going on here. If you want to chime in please feel free to add your comments or write to me too!

Clipped for brevity. Start at the third paragraph for QLSC-only info.

Hello xxxx,


I’m still using the OpenGL2 pipeline for that project. I initially generate my points using the polar coordinate system. Every point has the same distance from the center of the sphere but different angles. If I wanted more points for more detail, I can average the angles of 2
existing points to add a third point directly between them. Once all those points are generated they are converted to Cartesian (x,y,z) and fed into the vertex buffer to be rendered.

(A side note: You could then animate or alter the terrain of the earth by just changing the distance of each point in the polar coordinate system and that would translate all the way into the final earth mesh!)

I couldn’t find a whole lot of information about Ken’s algorithm either, but I did find is the QLSC algorithm was actually for taking points on a virtual spheroid and making it accurately match up with flat hierarchies of data. I.e., unraveling a sphere into a flat surface to map out some data; and the reverse, taking flat data and mapping it accurately to a sphere. He usually stresses that this is an equal-area mapping algorithm. I don’t really know a whole lot about the specifics here, his papers are hard to read and understand.

He sent me an email after writing his comment, saying it was mostly for stuff like the Cosmic Background Explorer at NASA. They had to study where exactly radiation was coming from and they couldn’t tolerate even small distortions when tracking and mapping this data or it would ruin scientific data crunching. I prodded him for more information but he never got back to me. The guy’s probably super busy, so I’m glad he took the time to message me in the first place.

The lesson I learned is that I wasn’t really using his research at all! Sad, but true. Cubespheres were used well before Ken was born, by cartographers making interesting and wonderful world maps. And that’s what I ended up replicating in my work.

If you look online you will find a lot of other people thought they were using the QLSC algorithm too, but in fact they were just making plain-old cubespheres (or sometimes called quadspheres), and they generally store all their terrain height data in a quadtree data structure, which is better suited for graphics stuff.

I made another article to note my corrections but I left the old one intact because I wanted to keep the comments Ken made. 🙂 I think because so many people were calling this a QLSC–the name really does sound cooler–it caught on quickly and became an artifact of errant
reality. I think it’s neat.

Thanks for writing to me,
-Mark H.

In essence, if you’re looking to do planetary rendering, you’ll want Quadspheres/Cubespheres and Quadtrees specifically; QLSC probably won’t help you. In fact, there are a few solutions out there already, for Ogre or Outerra. UE4 has a wonderful landscape rendering engine that can probably be employed to do planetary rendering if that better suits your needs. UE4 is also pretty.

One last note, NASA also has some really cool work-in-progress for planetary rendering, and a friend has been actively deriving from that work, while another is responsible for the physics simulation behind it. I’m not sure if I can provide any details, but I’m excited about these new advancements in space simulation. I will update this post if I get permission to post snapshots or links and such.

As always, hope this helps.

Switching Back to Evernote

I considered DokuWiki these past few weeks. However after transcribing each of my notes to DW, it was apparent how slow this would be to work with on a regular basis. The biggest pain point was not being able to easily clip articles anymore. Also, hosting a local webserver for it takes up a lot of memory and battery life

If you’re concerned with security, organization, or platform-specific issues on Evernote and considering switching to a wiki, you may want to reconsider it; using a personal web-based Wiki for anything feels disruptive.

I now have all my notes back into Evernote and used a new Stack/Notebook/Note structure to handle Evernote’s arbitrary hierarchical limitations. I keep all of my interests, dev, platform, and projects neatly in their own stacks. Nearly every child notebook has an index, general reference and TODO list. It’s a workflow that I developed in the process of moving everything back and forth.

Ultimately, refactoring all my notes helped me prune old data and refine my ideas and personal projects.

Updates all across the board

  1. The response to Atomic is amazing. I am nervous to send my first update to all the people who have signed up. Some of you left very wonderful notes and I starred each of those in gmail of these as a reminder of why I am doing this project. Thank you.I would like to announce that the software is stable and running on Windows, Linux, and even Mac! So I will be releasing a Mac version as well, which you may prefer over the existing Jive client.My absolute highest priority with Atomic is reliability: no crashes, no loss of tasks, no annoying bugs, bullet-proof business logic. Secondly is feature set. Unsurprisingly, visuals come in last place for the pre-release and it looks hideous right now. I’m waiting to finish both the auto-update and some of the skinning before I announce a pre-release version to the wonderful people who signed up already.This will be a free product, but if you are interested in accelerating development I would graciously accept donations (Verified PayPal: And just like any crowdfunded project there are rewards: over $1 gets a credit in the about section on the site and app, anything over $10 gets a link to your site, and $250 gets your organization a special sponsorship link with logo and all. You can contact me for details. If I can offset just $8,000 of dev costs in donations I will even open the Github repository and make this Task Manager a fully Open Source project!
  2. I’m about to reorganize the site to make it more obvious which projects are in development and which were released.
  3. I have a copy of Christian Grobmeier’s book now, the Zen Programmer (a big congrats and thank you to the author!), so I plan on taking a deeper look on the philosophy behind his original blog post. I’ve skimmed through it briefly and the effort and polished editing is very obvious. His book is based on the post I previously responded to the other day.

This next point cannot fit in a list item but I am running into relentless dependency issues on my open source Flight Simulator project. Such a time sink. I have spent so much time writing build scripts and refactoring chunks of C++ code in order to make flexible cross-platform builds. And guess what—these builds don’t even work on Windows or Mac! They actually never did, but I didn’t notice because I was only working in Linux at the time.

Just to give you the scale of the project, it took me more time to write out a long post on the Cubespheres than it did to actually implement them in Irrlicht. But it took over 26 times the number of commits, plus more hours to learn the intricacies of various graphical engines, write dynamic build scripts to accommodate and statically link them (using premake) just to find that gcc would fail to compile them on different machines. This undermines the whole point of what I was trying to do. So I’m not including external libs in my FOSS projects anymore, with the exception of External Vessel Dynamics Simulator (EVDS) as this is integral for the physics simulations and has never given me any problems on any build.

The former problems are probably related to the large number of dependencies and platform-dependent code from statically linking everything, so given the new direction I will likely I will switch back to OGRE since it has better shader and other baked-in features that I would have to arduously recreate in Irrlicht.


I took a look at Open Morrowind years ago and it seems like the project has come a quite a far way. If you’re a big fan of The Elder Scrolls 3: Morrowind, this is pretty neat: a group of coders recreated the entire game engine. Their goal is to make it work on Windows, Mac and Linux, and to make it better looking than the original. If you still have your Morrowind data files you might want to check it out.

The big change since I last looked at it, though? They changed from D to C++. All the dependencies (listed on the FAQ page) are also platform-independent and are very tolerant to unusual and low-end hardware. I would love to see if this compiles and runs well for the Beagleboard or Raspberry Pi. Maybe something even smaller, like my Nokia N900 phone which runs Maemo (a full Linux-based operating system.)

Re: The 10 rules of a Zen programmer

My response is to the original post found here: The 10 rules of a Zen programmer.

Some preface. I’m a big fan of reading. On  slow days I can get through around 250 news articles, scientific journals, white papers and blog posts. Some of them deal with space, AI, technology, and algorithms, surrealist fantasy or humor, or pieces about lifestyle and workflow. I’m very careful to first cultivate articles that grab my interests. Today for instance, I read about positive results in the quantum superposition of very large particles that are subjected to the dual-slit experiment. I also read an extremely down-to-earth article that solidified what I knew about Fourier transforms. I try to keep the signal-to-noise ratio as high as I can. But even so, a lot of signal eventually turns to noise, and I get particularly excited when my jaded eyes come across one piece that sticks out above the rest.

I am not going to comment on each rule the author Christian Grobmeier touches on, who already does a great job expressing in the article. You should read his article first. Just like the title suggests it is tailored loosely towards programming and Zen Buddhism (of which Grobmeier practices,) however the author does not mandate or imply you have to be a programmer or spiritual for these rules to apply to your life. I would recommend the reading regardless of your beliefs, occupation or skill set.

Just as a disclaimer: I know next to nothing about Zen outside of what was mentioned in this article, so forgive me if I make improper assertions. I am also using bullets because these points do not actually correlate with the enumerated rules that Grobmeier lists in the article; I am just collecting and commenting on themes I have noticed throughout. Here goes:

  • If it’s worth doing, it’s worth doing right. Christian didn’t use these words, but he expounds upon this dad-like maxim with several additional concepts. Firstly, he explains that if your job detracts from your life—and that is to say if you have a job that you dread and gives you no opportunity to grow, and you are also one of privilege that can find a new job that has more positive qualities—you may just want to consider finding a new job. At the same time, when you are tasked with something you hate, try not make a scene over it. “[Zen monks] have stuff to do like cleaning the toilets. Or working in the garden. Or as a Tenzo, they cook.” The key part is in the next sentence: “They do it with all the care they can get. Whatever they do, they do it without suffering and they are (or should be) happy, because every second, even the second where they are cleaning toilets, is a second of their life.” Even the simplest of jobs done with great care. That is a great theme.
  • Focus, intent. If you need to work, work. If you need to sleep, sleep. Both are important, and you should never mix the two. Don’t work 12 hours and then go back to work 6 hours later on little sleep. If you are falling asleep at your job you might want to go home and rest. When you are working, though: focus. Working for you may entail constant interruptions from phones, chat messages, notifications. This is not focus. Focus with a deep passion like it’s your first day of your new job. Focus on one task as if what you are doing is your magnum opus. Focus like what you’re doing is more important than checking your Instagram feed.
  • Death of the ego. This is a common theme in some theological and meditative practices. By meditating you increase your awareness of the direct interconnectedness of everything. You become more empathetic, and less selfish. This isn’t just some new-age trend. Meditation is healthy for you. We’re finding it might even make you less of an asshole. Western culture can be very competitive rather than collaborative, so maybe try to work meditation into your routine. Fierce competition in society is very poignant and evocative of some of the culture today. It is important to note that peaceful cooperation usually tends to lead to a higher rate of success and lower stress all around. (Aside: I know I have another article supporting this but cannot find it at the moment, sorry.)
  • Awareness. Every word you say and action you take has a consequence. Someone who is especially aware can carefully craft their work in a way that is artful and strikingly beautiful. Act on this awareness by doing everything with care, as I mentioned earlier.
  • Flow. Situations change. People lose their jobs, people are born, people die. You are not excluded. Accept it as part of the flow, and be less concerned and caught up about the transient. Especially things that you cannot control. This does not mean “do not mourn” or “do not be sad”, but be more accepting of the highs and lows (and the possibilities of future highs and lows) of day-to-day, year-to-year life.

One last point that I’ve extrapolated from this article: be aware of the beauty and sacredness around you. Grobmeier expresses this in a charming way, first briefly flirting with Nihilism and then bringing you right back to the serenity of Zen:

“You live alone and you’ll die alone. World goes on, even without you.”

“A flower is beauty. But it’s just a beauty (sic) flower – nothing more. There is nothing special around it. You are a human who can program. Maybe you are good. There is nothing special around you. You are of the same kind as I am or all the others on this planet.”

“After (hopefully) a long time you will die and everything you have created will be lost. Even pyramids get lost, after a long time. Do you know the names of the people who build up a pyramid? And if you do, is it important that you know? It’s not. Pyramids are there, or not. Nothing special.”

“Don’t be too sad when the winter comes and don’t be too happy when spring comes back. It is just a flow.”

The exact opposite of the rat race. The antithesis of leaving a legacy, of being the top person in your field or being famous. Grobmeier accepts the flow, the inevitability of life and death. But Grobmeier is ok with it. That sounds pretty Zen.

Edit: Moments after posting this I found several other comments debating the use of the word Zen and some of the concepts discussed within the article. So take this post as a derivative of the original and understand that I am not interested in arguing the semantics. As with anything your encounter take it all with a grain of salt.

Also, drastically and absolutely adhering to any life philosophy comes with its own set of exceptions and caveats (no one actually does that, do they?)  So I found the original article both positive and inspiring and that is why I wanted to share it—even if others will continue to debate the accuracy of details on the internet it does not discredit the original work at all, in my mind. Cull the good from it. Cheers.