| Andrew Cooke | Contents | RSS | Twitter | Previous

C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

© 2006-2015 Andrew Cooke (site) / post authors (content).

Apple + Kiwi Jam

From: andrew cooke <andrew@...>

Date: Sun, 17 Jul 2016 16:50:01 -0400

Just made this:

 1.9 kg Fuji apples (2kg before decoring)
 0.7 kg Kiwi (1kg before peeling)
 2 kg Brown sugar
 Juice of 2 lemons
 3 tsp Vanilla flavouring
 200 ml Water

Peel the kiwis as shown on youtube (with a spoon) and quarter.
Quarter the apples, cut out the core, and quarter again.

Everything in a pan.  I added the water only to avoid any burning at
the start.

Boil for ~2.5 hours.

At ~2 hours, the fruit hadn't broken down enough (and was making it
difficult to stir with what I guess is local superheating).  So I took
the pan from the heat and blended the fruit with a hand blender.  This
wasn't as difficult as I expected - just don't turn the blender on
until the blade is under the liquid.

Initial test suggests that it's quite sweet and otherwise rather
bland.  But it's winter...

Produced just over 3kg of (dark) jam.

Andrew

Tasting

From: andrew cooke <andrew@...>

Date: Thu, 21 Jul 2016 19:32:45 -0400

The texture is more jelly-like than I expected (apple jelly I guess).
But with a rough feel - perhaps from the skins or the kiwi.

The taste is fairly subtle, but the kiwi are present.  Not sure what
happened to the vanilla - perhaps better to add at the end?

Next time, I would add at least more cinammon.  Perhaps cumin or
cardamon too?

Quite bland for a jam.  Was surpisingly good with a burger.

Andrew

Permalink | Comment on this post

Previous Entries

For comments, see relevant pages (permalinks).

Sudoku - CSP + Chaos

From: andrew cooke <andrew@...>

Date: Mon, 11 Jul 2016 08:50:49 -0400

Mind-bending paper
http://www.nature.com/articles/srep00725

Andrew

Permalink

Recycling Electronics In Santiago

From: andrew cooke <andrew@...>

Date: Sun, 10 Jul 2016 10:29:18 -0400

http://www.chilenter.com

They organise recycing events in various comunas throughout the year
and accept donarions directly at Quinta Normal.

Andrew

Permalink

Vector Displays in OpenGL

From: andrew cooke <andrew@...>

Date: Fri, 8 Jul 2016 18:01:51 -0400

With Hexpilot I am trying to emulate the old vector displays.  You can
see an example and a brief discussion of the issues at
http://ascii.textfiles.com/archives/3786 but most of that page is
about scan lines.

My initial experiements have just hit a wall because modern OpenGL no
longer supports variable line widths.

That may sound odd - how does a plotting sysetem work without line
widths?  Part of the reason is that OpenGL works at either a higher or
a lower level - you describe a scene in terms of triangles, typically,
which are converted into fragments (something like pixels).  Lines get
lost in the middle.

OpenGL does have lines (as well as triangles), but they have a fixed
width and are hardly used (at least, as things actually displayed).

One alternative to using lines is to replace each line with a pair of
very long, thin triangles (arranged as a long thin rectangle).  That
works just fine until you start to worry about 3D images.

Because with 3D images on a vector display, distant lines are (often)
just as thick as nearby lines.  The line itself is not considered a
physical entity.  In contrast, OpenGL's 3D support is consistent:
distant "lines" (more exactly, distant triangles) are thinner.

THis may sound like something you can work round with a little maths.
Just scale the distant lines appropriately so that they end up all the
same size after perspective correction.  But a little thought suggests
that won't play well with hidden line removal.  In short: it's
difficult to bend the rules for some components of the display while
expecting others to stay working correctly.

So what to do?

My current best idea is to render triangles to a depth texture like
you would with shadow masking (except rendered from the real camera
viewpoint).  And then use that depth mask to do hidden line removal
"by hand" for a line-only rendering.

It will have some artefacts, but they are (I hope) the kind of
artefacts you would also see in old school hidden line removal code.

It's going to be a fair amount of work....

Andrew

Permalink

OpenGL - Render via Intermediate Texture

From: andrew cooke <andrew@...>

Date: Wed, 6 Jul 2016 14:49:07 -0400

I just got this working in hexpilot
https://github.com/andrewcooke/hexpilot

The display, instead of being rendered directly to the screen, is
rendered to an intermediate buffer (backed by a texture).  This
texture is then written to the output buffer.

Which is pointless, of course, but opens up a whole world of
possibilities.  The plan is to have a texture that accumulates several
display updates so that the screen blurs and smears like an old CRT
(the idea is to duplicate the old vector screens of asteroids, etc).

This would have been impossible without this excellent guide
http://learnopengl.com/#!Advanced-OpenGL/Framebuffers
which described exactly what I needed.

Even so, I can't believe that the code worked "first time" without me
having a blank screen for hours and hours as I searched for mistakes.
Yay!

Andrew

Permalink

Using Garmin Forerunner 230 With Linux

From: andrew cooke <andrew@...>

Date: Sun, 3 Jul 2016 21:56:24 -0400

I recently bought a Forerunner 230 and have been trying to work out
how best to integrate it with other software.

For uploading data to Strava you can simply connect the watch to a
Linux machine, open the thing as a USB drive, grab the relevant file,
and manually upload to the web.

If you want to use the watch as a "smart watch" then you need an
Android (or I guess Apple) device.  That must include bluetooth 4.0,
so my ancient Nexus tablet doesn't cut it (but that would be silly
anyway, because you need to carry this around with the watch).

If you want to update the OS then you need a Windows or Apple
computer, on which you run a program called Garmin Express.  This
works together with the Garmin Connect (which also connects to the
app).  It's all rather clunky, but lets you upload software to the
watch over USB.

Using Express also messes up your settings (settings in the website
seem to overwrite settings made using the watch).  But since the whole
thing isn't that wonderful anyway the best approach seems to be to use
it once to update to the latest OS and then ignore.


So, in summary: you need a non-Linux computer to upgrade the OS.  But
for day-to-day use you can do things with Linux alone.  Unless you
want the "smart watch" features in which case you will presumably have
the appropriate phone.

And WIndows 7 in VirtualBox worked fine for running Express (you need
to insteall the proprietary extras package for VB to get USB working
and you need to add yourself to the vboxusers group for device
permissions to work OK).

Andrew

Permalink

(Beating Dead Horse) StackOverflow

From: andrew cooke <andrew@...>

Date: Sat, 25 Jun 2016 10:12:08 -0400

Useful question / answer (actually uses fseek) deleted.  How is "C
Programming: How to read the whole file contents into a buffer"
unclear?  What a pile of shit.

Andrew

Permalink

Current State of Justice in China

From: andrew cooke <andrew@...>

Date: Sat, 18 Jun 2016 12:03:17 -0400

https://chinachange.org/2016/06/18/china-is-the-biggest-mad-house-in-the-world-and-ccp-the-worst-lunatic/

Read past the first few paras, which are a bit name-calling.

Andrew

Permalink

Axiom of Determinacy

From: andrew cooke <andrew@...>

Date: Fri, 17 Jun 2016 08:54:22 -0400

https://en.wikipedia.org/wiki/Axiom_of_determinacy

From https://www.reddit.com/r/math/comments/4ofh79/the_axiom_of_choice_is_wrong/

Andrew

Permalink

Fee Chaos Book

From: andrew cooke <andrew@...>

Date: Thu, 16 Jun 2016 12:24:49 -0400

http://www.logicmatters.net/2016/06/15/explaining-chaos/

Andrew

Permalink

Sparse Matrices, Deep Learning

From: andrew cooke <andrew@...>

Date: Wed, 8 Jun 2016 10:44:19 -0400

This article on sparse matrix specific hardware
http://www.nextplatform.com/2016/06/06/former-nasa-exec-brings-stealth-machine-learning-chip-light/
got me to wondering what it was used for.

I think this paper explains things in the intro:
http://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Liu_Sparse_Convolutional_Neural_2015_CVPR_paper.pdf

Basically, deep learning means thrpwing a lot of data at very deep
networks.  Those networks must have alot of redundnacy.  So if you can
find the sparse equivalent you can save time.

But still, I don't think that would have been obvious 10 years ago.
Maybe the hardware company got a lucky break?

Andrew

Permalink