I’ve been developing and debugging desktop and mobile applications on embedded devices over the last decade or so. The main part of this period I’ve been focused on the multimedia side of the WebKit ports using GStreamer, an area that is a mix of C (glib, GObject and GStreamer) and C++ (WebKit).

# Planet maemo

This depends on Bounce (the N900 .deb) and SDL 1.2 being installed. Google "bounce_1.0.0_armel.deb" for the former, and use n9repomirror for the latter.

This is the second part of my porting odyssey; for the first part, follow this link.

In case you have a sense of *deja-vu* when reading this post, it's because
indeed this is not the first time I try porting a device to Ubuntu Touch. The
previous
attempt,
however, was with another phone model (and manufacturer), and did not have a
happy ending. This time it went better, although the real ending is still far
away; but at least I have something to celebrate.

Qt published its New_Features in Qt 6.0.

Some noteworthy items in their list:

- QPromise allows setting values, progress and exceptions to QFuture
- QFuture supports attaching continuations

I like to think I had my pirate-hook in it at least a little bit with QTBUG-61928.

I need to print this out and put it above my bed:

Thiago Macieira added a comment – 13 Jul ’17 03:51 You’re right Philip Van Hoof added a comment – 13 Jul ’17 07:32 Damn, and I was worried the entire morning that I had been ranting again. Thiago Macieira added a comment – 13 Jul ’17 16:06 oh, you were ranting. Doesn’t mean you’re wrong.Thanks for prioritizing this Thiago.

This question often pops up, when you need a random direction vector to place things in 3D or you want to do a particle simulation.

We recall that a 3D unit-sphere (and hence a direction) is parametrized only by two variables; elevation \theta \in [0; \pi] and azimuth \varphi \in [0; 2\,\pi] which can be converted to Cartesian coordinates as

\begin{aligned} x &= \sin\theta \, \cos\varphi \\ y &= \sin\theta \, \sin\varphi \\ z &= \cos\theta \end{aligned}If one takes the easy way and uniformly samples this parametrization in numpy like

```
phi = np.random.rand() * 2 * np.pi
theta = np.random.rand() * np.pi
```

One (i.e. you as you are reading this) ends with something like this:

While the 2D surface of polar coordinates uniformly sampled (left), we observe a bias of sampling density towards the poles when projecting to the Cartesian coordinates (right).

The issue is that the cos mapping of the elevation has an uneven step size in *Cartesian* space, as you can easily verify: cos^{'}(x) = sin(x).

The solution is to simply sample the elevation in the Cartesian space instead of the spherical space – i.e. sampling z \in [-1; 1]. From that we can get back to our elevation as \theta = \arccos z:

```
z = 1 - np.random.rand() * 2 # convert rand() range 0..1 to -1..1
theta = np.arccos(z)
```

As desired, this compensates the spherical coordinates such that we end up with uniform sampling in the Cartesian space:

## Custom opening angle

If you want to further restrict the opening angle instead of sampling the full sphere you can also easily extend the above. Here, you must re-map the cos values from [1; -1] to [0; 2] as

```
cart_range = -np.cos(angle) + 1 # maximal range in cartesian coords
z = 1 - np.random.rand() * cart_range
theta = np.arccos(z)
```

## Optimized computation

If you do not actually need the parameters \theta, \varphi, you can spare some trigonometric functions by using \sin \theta = \sqrt { 1 - z^2} as

\begin{aligned} x &= \sqrt { 1 - z^2} \, \cos\varphi \\ y &= \sqrt { 1 - z^2} \, \sin\varphi \end{aligned}With Google cutting its unlimited storage and ending the Play Music service, I decided to use my own Nextcloud more seriously.

In part because Google forced all its competitors out of the market, but mostly because I want to be independent of any cloudy services.

Today I released Imaginario 0.10. No bigger changes there, but two important bugfixes.

If you’re developing C/C++ on embedded devices, you might already have stumbled upon a corrupt stacktrace like this when trying to debug with gdb:

Xiaomi has recently released the new Mi Band 5. Since I have owned the each band starting with the Mi Band 2, I think it is time to look back and see where the Mi Band has gone in the recent years.

Having never skateboarded before, I saw the Archos SK8 electric skateboard for about 80€ at a sale and thought why not give it a try. This got me into this whole electric skateboarding thing.

After the latest migration of WebKitGTK test bots to use the new SDK based on Flatpak, the old development environment based on jhbuild became deprecated. It can still be used with `export WEBKIT_JHBUILD=1`

, though, but support for this way of working will gradually fade out.