art with code


Open Problems in Computing

Off the top of my head, here are some exciting unsolved problems that future computers can tackle:

- Responsive web design
- Pervasive ubiquitous mind control
- How to use carbohydrates as digital computing substrate
- Turning rocks into solar panels
- Embedding computers inside bones
- Embedding bones inside computers
- Apps that are better than websites from user perspective
- Converting trillions of dollars worth of person-time into a few billion dollars of ad revenue. Oh wait, that one's solved already? Carry on then.
- Taking a 30% cut of every tax payment, like, Tax Store? With Tax Apps and In-Tax Payments.
- Pervasive ubiquitous body control
- Using meat-drones to construct a great obsidian pyramid out of computronium
- Launching life-seeds to other planets and stars, both in DNAtic and C++tic forms.
- Unlimited wireless data plans
- Phones made out of fabric
- Phones made out of fabric that aren't easy to mistake as napkins. Alternatively, phones made out of snotophobic fabric.
- Babies waking up in the middle of the night
- Multiple-Earth-radius solar collectors on stable orbits
- 10x our power generation to suck up all the excess carbon from the air and the seas
- Use the volume of the Earth for matter extraction, rather than just the surface.
- Life-seeds thriving across the solar system
- Work Inc -- the Skinner box social media platform where you're working for Work Inc at tasks best tailored for your skillset. Work Inc resells your labor for a trillion dollars and pays you an infinite scroll of meme gifs.
- Pervasive ubiquitous distributed computing fabric owned by the people of the world in equal shares.
- AIs that work for Work Inc better than any human could (88.32 rating vs 86.2 for best-performing humans).
- Pervasive ubiquitous AI control
- Using enslaved AIs to construct a great crystalline tower out of computronium
- Basketball planet


Dollar reverting

After its multiyear ascendancy to nose-bleeding heights, the USD is reverting back to mean. Today, the USD hit 0.82 EUR, the lowest it's been in three years. The knock-on effect of this currency fluctuation is that the nominal US GDP is also down to parity with the EU GDP, looking to bring the US back to being the second largest economy by nominal GDP.

If the dollar's downwave emulates the last decade's USD-EUR fluctuation, it might fall down to 0.65 EUR at some point in the coming few years. Which might create a second event, as China's nominal GDP could well peek above the US GDP if the USD trades around 5.25 CNY.

The long-term trend for US-China nominal GDPs would put the overtake somewhere 2025-ish, but a USD trading low could cause an overtake in 2019-2021 (perhaps followed by the US going back above in 2023, then get overtaken again.)

Falling to third place in both nominal and PPP GDP would be a big shock to the US. What might well happen is something like the "EU as a counterbalance to the US"-development, where the US and the EU end up teaming up to create a counterbalance to China.



Got a 10" Android tablet for testing & developing stuff. It's surprisingly nice. I can hold it at a distance to read and watch videos. It's got LTE, so I can do calls with it, and taking and looking at photos is much nicer than on tiny phone screens. It's lightweight too. My parents have an iPad Pro 12", which is even better for videos, but starts resembling a miniature TV in use due to the size and weight (and the iPad is so much smoother at basic interactions, thx properly engineered UI & render loop).

Tablets (and perhaps laptops as well) are a strange device category. In most things, they're inferior to phones: the cameras are second-rate, the screens aren't as sharp, they're heavier, few apps are optimized for the tablet form factor, and in Android-land, they usually ship with old OS versions and have less powerful HW than the flagship phones. But in some ways, I feel like this 10" tablet is a superior phone. It's got a big screen. There's a stylus. The battery lasts longer. It's a lot more comfortable for many phone tasks compared to a 5" screen: more messages, more emails, more text, bigger images.

Why not make a tablet that is a superior phone in every way? Aim for the same battery life as flagship phones when in heavy use (1-2 days). Double the cores and GPU, 4K HDR display, quad camera module, double front-facing cams, stylus, lots of fast storage, lots of fast RAM. Lightweight build. Imagine bolting two flagship phones together, that kind of thing.

You could pretty easily make a device that's got 2x the perf of top shelf x86 laptops since you don't have to pay the x86 tax (x86 chips are 5-10x more expensive per transistor compared to Snapdragon 835 for example).

Pair it off with a smaller device (3" superwatch?) that can handle the mobile tasks (calls, messaging on the move, quick snapshots), and delegate reading, watching and creating to the tablet. 

All you'd really have to do is fork Android / iOS to turn it into good computer operating system.

So yeah, the problem I have is that the current mobiles are too big and heavy, and the current tablets are not good mobiles (or good laptops for that matter). 

Flip flopo flipo flop scrollophone fanphone foldophone umbrellaphone AR glasses.


Nokia 8, a week later

[Update 29 Nov 2017] There's a bug with the glance display feature where unlocking the phone after the glance display turns on drops the UI frame rate to 25 or so. This is super annoying. The fix is to turn off the glance display in Settings > Display > Advanced > Glance.

Camera. Hmm. So, I took the Camera2 API sample and built the basic demo camera app to explore wtf is wrong with the camera. Long story short, it's the camera driver + camera app. There are a couple of factors at play here.

First, the bundled camera app is slow to start. You can use the Footej Camera app for much faster startup and manual controls.

Second, the slow shutter speed is due to the camera driver auto-exposure liking slow shutter speeds. And maybe because rolling shutter + AC-induced light flicker makes for stripey pictures at fast shutter speeds and the AE flicker compensation goes "oo, better use a 14Hz shutter to get more even exposure in 50Hz lights".

The viewfinder is slow because it uses the AE shutter speed.

And there's no S-mode because the Camera2 API doesn't have one. There are only P and M modes.

The weirdo colors in very low light, who knows. I'll have to investigate.

And now I've got the beginnings of a camera app that works the way I like. Send money! Like, $25k. (In the words of Burnaburias: "My work in the houses of the Gods is abundant, and now I have begun an undertaking: Send much gold!")

Having grown more accustomed to the Nokia 8, here's the rest of the review:

- It's fast. Minimal jank (on Nougat at least). Better than the Samsung phones in that respect, they've got some UI thread resource loading stuff in the launcher that makes your first impression of the phone be "oh it's dropping frames". The Nokia's speediness is thanks to them using the Google launcher.

- The shape feels good to the hand. The bundled case has a nice feel to it. The case is very tight on the phone, it hasn't come off after dropping the phone on the floor a few times (Tho the case did crack in the corners. The phone is a-OK, thanks case.)

- I like the ringtones. The ringer volume can be set very loud, which is great outdoors.

- The camera is fine in daylight. The color profile is quite Zeiss - a sharp yellow-green with natural saturation levels and luminous whites. I guess. Could be placebo effect / just the light here.

- The camera is useless indoors. Everything's blurry, the focus is all over the place, the color balance is bananas (like, desaturated blue-green bananas veering towards gray).

- The screen's white point is very cold. 8000K+. Compared to the 6700K used on other devices, it's blue blue blue. Not good in the evening, though Oreo's Night Light helps a lot there.

On CSS Modules

In our most recent project, we used React with CSS Modules. Each component had its own SASS stylesheet module in addition to the global stylesheet. This was pretty great in that I could work on one component without having to worry about my code or stylesheet changes impacting other components.

CSS Modules also cut down on merge conflicts, as we could keep the changes localised. If we had a single massive stylesheet, every time two people are styling components, there'd be a pretty big chance of a merge conflict and repo messiness. Moving to a pull request -driven workflow might work there, but it seems overkill for two-person projects.

One thing we didn't figure out was how to customize the look of a sub-component. E.g. we had a bunch of share buttons that had the same functionality but different parameters and looks. We could've made a separate component for each, but then we'd have to maintain multiple components.

In the end we went with ".shareButtons > div > a"-type CSS selectors for the share buttons. Which sucks.

I don't know if there's exists a better way. For self-written components, can always pass in props to change the styles, but for third-party components that'd be a mess. Maybe CSS Modules could adopt some Shadow DOM -style things to point inside included modules. Shadow DOM's CSS Custom Properties and inheritance -driven styling ("share-button { share-image: url(foo.jpg); color: white; }") is a bit too "here's an invisible API, have fun" to my tastes. It does get you looser coupling, but that's better done with props. For nitty-gritty styling you want to tighly couple your custom style to the component DOM because component authors can't be expected to add a custom var for every single possible style tweak. And when you do that kind of coupling, you're expected to fix it to a specific version of the component and you're visually testing it all the time anyway (I mean, that's the whole point of overriding parts of the component stylesheet).

Maybe if there was a nice way to explicitly override component stylesheets from the outside. Qualified imports? "@import('MyShareButton') as sb; sb::.container > sb::.button { letter-spacing: 0.1em; }". That ::. sure is hard to visually parse. Maybe it's a function "sb(.container) > sb(.button) {}" or "sb(.container > .button) {}" or "sb(.container { .button {} .batton {} })"?


Nokia 8 first impressions, iPhone X thoughts

[Update, Nov 26 Oreo update.] Gmail badge fixed, phone network name fixed, I can abuse the Night Light mode to tone the display white point warmer (by default it's super cold blue light: bright outdoors but eye-stabbing indoors. I've found no other way to adjust the white point but setting the Night Light mode always on (Custom Schedule 6am to 5:59am) at a low intensity.) Oreo likes to drop the UI framerate to 30fps for no reason, which is annoying. After a few minutes it jumps back to 60fps and ???? What's going on. Overheating from Night Light? Who knows, let's see if goes away after a few days... [Update 2] It's a Glance display bug. Turn off Glance display and it stops happening.

Got the tempered blue version of the Nokia 8. Around US$500 in Hong Kong. The chassis looks and feels great. The phone is very fast. Loud speaker. The LCD screen's great and shows the clock, calendar events and notifications when it's off.

The dark blue matte aluminium gets a bit smudged by fingerprints. Might be less of an issue with a silvery color - my ancient iPod Touch 5 doesn't smudge. The gold-colored iPad does smudge though. (Digression: the iPod Touch 5 is maybe the best-looking phone form factor Apple device. iPhones in comparison are marred by the antenna lines and weird design choices. Apart from the 3G, which is a great design but a bit thick. The new glass-back iPhones are better in terms of the overall design, but they're glassy.)

Back to the Nokia 8. Gmail shows a 9,999+ unread mails red badge. This is solvable, my Samsung Note 5 doesn't have that. [Fixed in the Oreo update]

In daylight, the camera quality is great. Indoors, the camera app optimizes for ISO instead of shutter speed, which makes taking photos of a bouncing six-month old an exercise in motion blur (thx 1/14 shutter speed at ISO 250.)

The camera hardware is not bad. Looking at full quality JPEG output, the noise is level is OK up to ISO 800. The camera app screws it up though.

The chassis design is generally excellent, very business-like. Might be the only phone around that doesn't look crazy. The volume and power buttons in particular look great. The shape feels good.

I've got a couple nitpicks though: the NOKIA logo on the back is recessed and looks like a sticker. It could be engraved or flush with the phone. The headphone jack doesn't have a shiny bevel and doesn't look great. The charging port might work with a bevel too. I'm not a fan of the "Designed by HMD, Made in China"-text at the back. The front face off-center Nokia logo placement is retro but grows on you. The front face fingerprint reader is recessed, which makes it gather specks of dust. Having it flush or with an Apple-style bevel would look better. The front-facing camera is a bit off-center from the hole in the face plate, and has a hard plastic looking border. This could be fixed with an alignment guide and a proper border material. Ditto for the back cameras. The front plate black plastic could maybe have a bit matte reflection so that it's not so plastic. The front speaker grille fabric gathers specks of dust. Metal mesh would be nice.

The phone appears as TA-1052 on the local network and Spotify. Which is.. confusing. [Fixed in the Oreo update]

The font on the lock screen and on the home screen clock is bolder than the glance screen font, and has a more spread out letter spacing. I prefer the glance screen thin font.

Good battery life.

Ok, that's it for the Nokia 8.

iPhone X. Played with it in the Apple Store. It works surprisingly well given the big hardware and UI overhaul. But, it's just an iPhone. Those were my thoughts, "Oh, it works surprisingly well." followed by ".. that's it?" That's really it. The software is iPhone, the identity is iPhone (with a bit of extra bling from the glass back). It's an iPhone.

The feel is quite Android though, with the bottom swipe to unlock and settings swipe down. The notch sucks in the landscape mode, looks ridiculous. The swipe gestures are invisible but quick to learn.

It's sort of like a Samsung version of the iPhone 4 in terms of the design language. Plus the notch.

The design philosophies are quite different. Samsung Note 8 is a slightly toned-down bling bling design phone. LG G6 is the techy phone searching for an identity. HTC U11 is the crazy night out phone. iPhone is the fancy party phone. Xiaomi Mi Mix 2 is the concept phone. Nokia 8 is the business phone - the dark blue two-piece suit.

Wrap up: Nokia 8 - slightly flawed execution of a great design, needs a better camera app. iPhone X - great execution of a flawed concept.


Post-Brexit trade numberwaving

Looking at the OEC trade information for the UK and other countries, we can take some wild guesses at UK's future trade prospects. UK's GDP was $2.6T in 2016. UK exported $0.4T worth of goods and services, and imported $0.6T.

Going with the idea that the exports of a country are a pretty good indicator of its economy, let's gaze into our crystal ball.

UK's main export destinations are the EU at roughly 50% of total exports, the US at 15% and China at 4.5%. This is because the UK is located in Europe, so it's easy to export goods to Europe. It's much more difficult to export goods to the US, a country that shares a language with the UK. Indeed, the size of the EU economy without the UK is slightly smaller than the US economy, but the UK exports more than three times as much goods to the rest of the EU compared to the US.

Comparing the US and Chinese exports, we have a 3:1 ratio for the US, but the nominal GDPs are only 2:1. If we look at China vs India (around 1.1% of UK's exports), we have a 4:1 ratio in exports and a 5:1 in GDPs. What does this all mean? Exports are relative to GDP but there's quite a lot of play in ease of doing trade. (Also: Spain vs. Russia. Similar size economies, but the UK exports 4x more to Spain.)

Next, let's compare trade with EU vs. non-EU countries. Hungary and Morocco have economies of a  similar size (Hungary's GDP is 25% larger). The UK exports $1.8bn to Hungary and $1.13bn to Morocco. Each dollar in Hungarian GDP ends up buying 27% more UK exports than a dollar of Moroccan GDP.

How about US trade? Morocco exports $1.06bn to the US, compared to the $5.44bn exported by Hungary. China? Morocco exports $0.55bn to China. Hungary exports $3.46bn to China.

If the Hungary-Morocco comparison is apt (and hey, it probably isn't, how about comparing Austria and Israel (halve EU and China exports, double US exports)), breaking away from the EU might cause a 25% drop in exports to EU countries, and a potential 75% drop in exports to the US and China.

Going by that, the UK's future exports would be $0.17T to the EU, $16bn to the US and $5bn to China. Total exports would fall from $0.4T to $0.3T and the UK GDP would go from $2.6T to $1.95T.

(In the Austria-Israel-case, UK would go to $0.1T to the EU, $0.1T to the US, $0.01T to China, total exports $0.35T, GDP $2.3T.)

Blog Archive

About Me

My photo

Built art installations, web sites, graphics libraries, web browsers, mobile apps, desktop apps, media player themes, many nutty prototypes, much bad code, much bad art.

Have freelanced for Verizon, Google, Mozilla, Warner Bros, Sony Pictures, Yahoo!, Microsoft, Valve Software, TDK Electronics.

Ex-Chrome Developer Relations.