Andrew Cooke | Contents | RSS | Previous


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).

[Programming] React Leaflet

From: andrew cooke <andrew@...>

Date: Wed, 18 Nov 2020 17:29:13 -0300

If you're using Leaflet (the map presenatation library) in React, you will
probably use React Leaflet.  There are a few things you should know:

* It was just rewritten as v3.

* The rewrite is functional React (hooks etc) and works just fine.

* But it breaks all the examples of event handling on the web.

* And it breaks all the JSFiddle examples.

* And you probably forgot to add the leaflet CSS to your website.

But once you have it working, it really does work.


Permalink | Comment on this post

Previous Entries

For comments, see relevant pages (permalinks).

AliExpress Independent Sellers

From: andrew cooke <andrew@...>

Date: Sat, 14 Nov 2020 09:59:36 -0300

Not sure the title makes much sense - these are AliExpress stores that sell
their own branded cycling tops (rather than copies of other people's designs).
This list isn't exhaustive and may contain errors, but it's a useful starting
point for trying to find sellers that are doing more than pushing copies (you
might hope these companies are more invested in making something exceptional -
perhaps better quality materials, a different style, or better service).

There's quite a mix here and no obvious way to group, so ordered
alphabetically by name.  I haven't bought from most of these and make no
guarantees about quality or reliability.


Cheji -

All products are own brand.  Designs vary (perhaps aimed at non-western

Darevie -

All(?) products are own brand, with some shots using own model.  Designs tend
to be geometric patterns.

Frenesi -

Most of the products are copies, but those branded Frenesi appear to be
own-designs.  Generally simple designs.


All(?) products are own brand.  Designs are generally garish novelty items.


All products are own brand.  Designs vary (like Cheji, maybe aimed at
non-western market?).

Pimmer -

A few products are own brand (beware - many appear own brand but contain other
company logos on close inspection).  Minimal designs.  Possibly experimenting
with different fabrics / cuts (see for example).

Racmmer -

All products are own brand.  Designs are, well, mixed.  Well known and high
volume.  A bit more mass-market that Santic or Spexcel (but I Like their pro

Rion -

All(?) products are own brand, with some shots using own model.  Designs are
basic.  Seems to be fairly well known / large volume (like Santic, Spexcel,

Runchita -

Most products are copies, but Runchita in the catgeory menu selects
own-branded.  Designs vary.

Santic -

All products are own brand.  Has an identity outside Aliexpress and tends to
be more expensive.  Shots with own model.  Generally simpler designs.

Spexcel -

All(?) products are own brand, with some shots using own model.  Designs are
simple (Rapha influenced?) with horizontal bands.  Have bought from here -
seem to experiment more with different fabrics and designs.  Fairly well

Swiftofo -

All products are own brand.  Designs are generally simple, but looks like they
may be aiming at a more athletic (triathlon?) market - more athletic cuts and
different materials.  Many shots using own model.


[Politics] Back + US Elections

From: andrew cooke <andrew@...>

Date: Sun, 8 Nov 2020 16:56:34 -0300

Well, this is something of a test post to see if posting here is working

Also, we are just post-US elections, which were really worrying.

There's a lot of euphemisms being thrown around.  On 538 people keep talking
about how 'this kind of politics' is not going to go away.  They mean Fascism.
A huge chunk of the country made clear they thought continuing to support an
openly fascist regime was a good idea.  Call it by it's name.



[Programming,Exercise] Simple Timer Script

From: andrew cooke <andrew@...>

Date: Sun, 29 Mar 2020 17:29:17 -0300

The following may be useful to someone doing exercises at home during
quarantine.  It will only work on Linux since it uses ALSA for sound.

For example

  time 1 -x 3 -d 5

will give 3 beeps, 1 second apart, 5 seconds after you hit return.

If there is a delay the start is indicated by a high-pitched beep.
The last interval is ended with a low-pitched beep.



function beep() {
    ( speaker-test -Dsysdefault -t sine -f $FREQ 1> /dev/null 2> /dev/null)& pid=$! ; sleep $TIME ; kill $pid 2>&1


while (( "$#" )); do
    if [ "$1" == "-h" ]; then
	echo "timer (mainly for timing exercises)"
	echo "usage:"
	echo " $0 TIME [-x N] [-d SECS]"
	echo " -x N     repeat N times"
	echo " -d SECS  wait SECS before starting"
	exit 1
    elif [ "$1" == "-x" ]; then
    elif [ "$1" == "-d" ]; then

if [ -z ${DURATION+x} ]; then
    echo "no duration (see $0 -h)"
    exit 2

echo "duration: ${DURATION}s"
echo "delay: ${DELAY}s"
echo "count: ${COUNT}"

if [ $DELAY -gt 0 ]; then
    sleep $DELAY
    beep 2000 0.5

while [ $LOOP -lt $COUNT ]; do
    LOOP=$(( $LOOP + 1 ));
    echo "$LOOP"
    sleep $DURATION
    if [ $LOOP -eq $COUNT ]; then
	beep 500 0.1
	beep 1000 0.1


[Politics] The world's most-surveilled cities

From: andrew cooke <andrew@...>

Date: Thu, 19 Sep 2019 17:23:23 -0300



[Bike] Hope Freehub

From: andrew cooke <andrew@...>

Date: Sat, 31 Aug 2019 21:54:18 -0400

Some notes on the Hope specific freehub and related cassettes.  In
general, more force is needed than you might expect when manhandling
these things.

 * The two-piece cassette is difficult to separate.  It helps to cool
   the entire cassette (since aluminium has a higher thermal expansion
   coeff than steel) and then lever them apart with something wooden.

 * Putting them back together is similarly fraught.  The spot on the
   aluminium spider aligns with the biggest gap in the internal
   'teeth' of the steel part.  Aligned correctly you can see all teeth
   should be OK (any other alignment and some teeth are 'blocked').
   With that, place the alloy side down on a flat wooden surface and
   then lean on the steel part (I used some stiff gloves to protect my
   hand and a fair amount of weight).

 * Removing end-caps on the front hub is easily done by pushing them
   out with a pencil from the other side.

 * Removing the existing freehub was possibly by clamping it in a
   wooden vice and pulling the hub upwards.

 * The replacement freehub goes on easily enough - you need to push
   the pawls into place - but the green seal again needs a fair amount
   of force from a wooden implement before it clicks inside.

 * The funny looking endcap is QR; the shorter normal endcap is
   12x135; the longer 12x142.

And hope are responsive (if not overly effusive) to enquiries at the
normal email address.



[Restaurant] Mama Chau's (Chinese, Providencia)

From: andrew cooke <andrew@...>

Date: Sat, 31 Aug 2019 21:10:22 -0400

Really excellent food.  A refreshing change.

We went here Friday evening, a belated celebration of Paulina's
birthday.  Fairly early, because they close some time around 8pm.
Paulina ordered a selection of dumplings and a bao (stuffed steamed
bread); I ordered a crepe.  Sharing, so that we sampled as much as
possible, there was more than enough for us both.  Relatively healthy
food with plenty of taste that was still solid enough to leave you
contentedly full.

It has a very small eating area, but also does take-aways.  Everyone
else appeared to be half our age.  It was very popular, perhaps
because of this recent review - - or
perhaps because it's damn good.

Service is minimal - you order and receive a pinger.  When the pinger
pings you go collect your tray of food.  There's a fair amount of
packaging, but it's mainly paper-based.



[Politics] Brexit Podcast

From: andrew cooke <andrew@...>

Date: Sat, 31 Aug 2019 21:01:55 -0400

Not dumb.



[Diary] Pneumonia

From: andrew cooke <andrew@...>

Date: Fri, 30 Aug 2019 11:25:00 -0400

I want to make some notes (similar to those on the bike accident) to
help remember the sequence of recent events related to me being
hospitalized for pneumonia.

On Thu Aug 1 we flew to Edinburgh.  The day before (or two days
before?)  Paulina's brother had stayed in our flat, apparently quite
ill, coughing and vomiting.

In Edinburgh we were in good condition, walking a fair amount (I was /
am still recovering from the broken leg and ensuing problems).

On Tue Aug 6 my sister drove me down to my parents (Paulina stayed in
Edinburgh at a conference).  In the car I was coughing a lot.

On Fri Aug 9 I went to meet Paulina at the local train station and
wasn't feeling so good.

The plan was to take the family (including sister) to dinner on Sunday
evening.  I spent most of Sunday in bed, hoping I would be well enough
for the meal to go ahead; in the later afternoon I had a temperature
and we cancelled.

The next few days I thought I had the flu - intermittent temperature,
shivers, coughing, etc.  At one point I noticed that I was coughing up
phlegm that contained some blood.

On Tue Aug 13 the rest of the family insisted I go see a local doctor.
The doctor sent me directly to the local hospital, where I stayed for
two nights.  Initially there was concern I had TB (so I had a
'private' room), but test showed pneumonia (strep).  I was on a drip
for hydration (maybe 24 hours) antibiotics (48 hours).

I had been taking Ibuprofen-based flu medication to help with MS
symptoms, but apparently this raised the chance of Kidney problems so
I was switched to Paracetamol.

On Thu Aug 15 I was released with oral antibiotics (2 kinds, 6 days).

On Fri Aug 16 Paulina flew to Chile.  On the main flight (LHR - GRU)
she had a fever and was placed on a drip in the airport clinic at Sao
Paulo, but later flew on to Santiago.  She saw a local doctor on
Sunday, was diagnosed with pneumonia, and was prescribed antibiotics.

One motivation for Paulina returning (apart from work which was the
original reason for the early flight) was that her brother had
disappeared.  He was later found in a hospital in the South of Chile.
I do not know what his diagnosis was.

Meantime (sorry, don't have exact dates) my parents were also
diagnosed with bronchitis and given antibiotics.  My sister was OK.

I was intending to fly back on Mon Aug 19, but the local doctor felt
this was unadvisable.  Unforunately I only had Betaferon (MS meds)
until that date.  After some discussion with my doctors in Chile we
decided to delay the flight a week and skip the Betaferon (the risk of
an MS outbreak was low and the drug is not commonly available in the

I increased the spacing of my final two injections, so the final
injection history was:

		       August 2019    
		  Mo Tu We Th Fr Sa Su
			    -  2  -  4
		   -  6  -  8  - 10  -
		  12  - 14  -  - 17  -
		   - 20  -  -  -  -  -
		   - 27  - 29  - 31 

I flew back on the 26th, arriving 27th (injection on arrival).

Currently we are all easily tired, with coughs, but otherwise OK.



[Politics] Britain's Reichstag Fire moment

From: andrew cooke <andrew@...>

Date: Fri, 30 Aug 2019 11:21:39 -0400



[Programming] GCC Sanitizer Flags

From: andrew cooke <andrew@...>

Date: Thu, 16 May 2019 15:35:19 -0400