Thursday, 12 December 2019

Once Upon a Time There was a Bee

Some results from talktotransformer.com, all starting with the same prompt: Once upon a time there was a bee.

A Murderous One

Once upon a time there was a bee. A beautiful bee with a beautiful crown of flowers. It was such a bee that you couldn't kill it because it was a beautiful bee. It had such a pleasant fragrance and the most wonderful sound. But one day, it started to sting. You couldn't do anything because you were so stung. It was terrible to see it, you could hardly take it in. You didn't know what to do, but you tried to kill it and you failed. Finally, when it became impossible to control the sting, the bee was finally killed. So now there's a bee that you don't kill because it's a beautiful bee, and it's so lovely that you have to kill it. Then the bee is so horrible that you can't kill it, and so you have to kill it. You have to kill it. You have to kill it. That's what this whole book is about. You have to kill it. You have to kill it

A Transformational One

Once upon a time there was a bee. Then the bee became a wasp, and the wasp became a spider, and the spider became a scorpion, and the scorpion became a centipede, and the centipede became an ant, and the ant became a human being. And it happened, that in the midst of that great mass of diversity, each individual insect became a member of this vast family."

If these "bastions of humanity" are to be believed, then it's important to note that the United States was founded as a British colony and that every U.S. President since its inception has been a British subject.

However, since the United States is the only country on earth that still has a standing army (and we know what happens when an army is abandoned by its commander), one might wonder why it would choose to "liberate" itself from an enemy of the British crown by establishing a foreign colony.

A Disturbed One

Once upon a time there was a bee. It was a beautiful bee with a beautiful name. It didn't sting anybody, it didn't sting me or my kids or anybody else. It was just a lovely bee.

The bee was named Vanessa. And it was beautiful.

And then one day the bee died.

The next day the bee died.

Vanessa died.

The bee died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

The bee died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

Vanessa died.

A Scientific One

Once upon a time there was a bee. It was pretty small, a few millimeters across, but there was a big beehive on its back. It had a huge, thick, black combs. When you stepped inside, the bees in the combs would fly away and then you'd have to pick them up. They were huge. You could get so much honey by holding the comb in front of you and letting the bees work. The honey was like honey from a honey pot. It was so sweet and delicious. It was a special kind of sweetness, which was the main reason I became a beekeeper.

What did you do after your beekeeping job?

I decided I would be a scientist. I wanted to be a chemist because I thought it was much more interesting than beekeeping. I took some chemistry courses at the University of Texas. I took a physics course and a microbiology course, but I didn't finish them. But when I finished them,

A Fairy-Tale One

Once upon a time there was a bee. And that bee was very good to his queen. And the bees said: "We can't have him anymore." And they went into the garden and threw him out.

A woman was sitting in a garden. She was very beautiful to look at. She was humming a beautiful melody. The bee flew by her and landed in her lap.

And the woman said: "Come back to me, honey."

And the bee said: "I can't come back to you again. I'm a busy bee."

Then the woman said to the bee: "If you want to have the bee back, just promise to come back to me. If you do, I'll give you something nice to eat."

And the bee said: "If that's what you want, I'll be back."

But the woman thought to herself: "It's a promise that I can't make."

And so

Tuesday, 29 October 2019

Fiddling with Old WiFi and DSL Hardware

The Problem

Some time ago, AAISP supplied me with an EchoLife HG612 broadband modem and a separate Technicolor TG852n WiFi hub, to be connected to each other by Ethernet. Since the phone socket is at the back of the house but I wanted the WiFi signal to be strongest at the front of the house, I put them in separate rooms and connected them with Ethernet-over-power devices. All was well till I also needed connectivity at the back of the house, where the WiFi signal is almost non-existent.

I found that a device with a wired link directly to the modem did not work: it could not talk to devices connected to the WiFi. The WiFi hub was configured to serve DHCP, while the modem was not. As far as I can tell, the problem was that the WiFi hub would not serve DHCP to a device connected via the modem.

The Solution

It's possible to set up the broadband modem to act as a DHCP server, and then turn off the WiFi hub's DHCP router. That way, every device on the network – whether wired to the WiFi hub, wired to the modem, or wireless – can get an IP address from the modem and end up on the same subnet, so they can all talk to each other. But neither step is straightforward.

Set up DHCP on the Modem

Enable the Web UI

(These steps are derived from AAISP's instructions.)

  1. Download a version of the HG612 firmware whose Web UI has been enabled. A suitable version is called bcm96368MVWG_fs_kernel_HG612V100R001C01B030SP08_webgui and is available in this repository. It has an MD5 hash of 5d6cb9987c52f4e687c624a614adaa29.
  2. Factory-reset the modem and use that file to flash its firmware, by following the instructions here.

Set up the Broadband Connection

  1. Set up wired connection from a computer to the LAN2 socket on the HG612.
  2. Give the computer an IP address of 192.168.1.100.
  3. Log in to the Web UI (192.168.1.1) with username/password admin/admin
  4. Under Basic->WAN->ptm1.101:
    • WAN connection: Enable
    • Service list: INTERNET
    • Port binding: Disable both LAN1 and LAN2
    • Connection mode: Route
    • Connection Type: PPPoE
    • User name/Password: as provided by the ISP

Set up the LAN


  1. Under Basic->LAN:
    • IP address: 192.168.1.1
    • Subnet mask: 255.255.255.0
    • DHCP Server: Enable
    • Start IP address: 192.168.1.2
    • End IP address: 192.168.1.250
    • Primary DNS server address: 4.4.4.4
    • Secondary DNS server address: 8.8.8.8

Disabling DHCP on the WiFi hub


  1. Work out what the IP address and admin username/password of the TG852n will be after the not-quite-factory reset. These vary according to the supplier, because it is set by a file called isp.def that is not removed by the use of the reset button.
    • For AAISP they are 192.168.1.254 and Administrator/admin.
  2. "Factory"-reset the TG852n by pushing a pin into the reset hole till the power light turns orange.
  3. Set up a direct wired connection from computer to the TG852n (any port other than 4).
  4. Log in to the Web UI (Only works reliably via wired connection to port (other than 4). May require multiple login attempts.)
  5. Under Home Network->Interfaces->LocalNetwork:
    1. Configure (top right)
      • Use DHCPv4 Server: No
      • Use Stateless DHCPv6 Server: No

Bonus Points: Adding an extra WiFi hub

I acquired an additional TG852n as a result of Demon Internet shutting down. Since I already had one of these, I thought it would be simple to add another, to provide a strong WiFi signal at the back of the house. I was wrong.

For Demon Internet the WiFi hub's default IP address and admin username/password are given as 192.168.254.254 and admin/DemonCPE.

No amount of resetting and fiddling could convince the device that its IP address should be 192.168.1.x and not 192.168.254.x. Eventually I guessed that I would need to remove the device's isp.def file. To do that I would need to use FTP. I couldn't find an FTP server on its port 21, so I thought I would telnet into it instead and see what I could find. Of course, OSX no longer comes with a telnet client, so first I had to download inetutils and build my own. Luckily that did work straight away. With the help of a TG852n CLI Guide still available from Demon, I tried a service system list and found that the FTP server was running, but on port 2121. Finally I could FTP to the hub, delete the offending isp.def and get back to a known state.

From that state it was simple to use the Web UI to set the TG852n's IP address to 192.168.1.253 and turn off its DHCP server. Then I set up the WiFi to match the existing hub's details (though on a different channel). When I plugged the additional hub into the same switch, it worked!

Finishing up

While I was checking that the two WiFi hubs could each see any devices that were connected to either of them, I noticed some extra IP addresses assigned to their MAC addresses. It turns out that, as shipped, these hubs are set up to act as media servers over UPnP and Windows Networking. I took the opportunity to turn those off for now. Finally, I changed the admin login details so that they all matched.

Monday, 8 January 2018

Carbon Capture and Artificial Photosynthesis

(Apparently I haven't written anything here for over three years. That's what being absorbed in one's day job does ...)

I only recently learned that, whatever we do to reduce carbon emissions, we are almost certainly going to have to figure out large-scale atmospheric carbon capture soon, or else make Earth a catastrophically crap place to live for a long time.

From a Quartz article last month:
"The foremost authority on the matter, the Intergovernmental Panel on Climate Change, has modeled hundreds of possible futures to find economically optimal paths to achieving these goals, which require the world to bring emissions down to zero by around 2060. In virtually every IPCC model, carbon capture is absolutely essential—no matter what else we do to mitigate climate change."
By way of background, it's perhaps worth looking again at why carbon dioxide makes such a big difference, despite contributing only about 0.04% of the atmosphere's volume. In short, CO2 absorbs a spectrum of wavelengths that very neatly covers the range in which the planet loses much of its heat to space. Most other atmospheric gases don't absorb in that spectrum. Increased atmospheric carbon dioxide levels mean that heat that would previously have been radiated by the ground straight through the atmosphere into space is now being absorbed by atmospheric CO22 instead.

So we need some way to process carbon dioxide and turn it into something solid or liquid, so that it won't interfere with Earth's temperature.

Plants capture carbon as they grow (and there is a lovely video of Richard Feynman explaining how plants are made out of air). So in principle we could just grow biofuels and store them. A major problem with biofuels is that they need soil—and particularly fixed nitrogen, in the form of fertiliser—to grow. So that only works in places where spare soil exists, and for as long as the soil hasn't been ruined by intensive farming. And even when it works, we need to put in plenty of energy just to fix the nitrogen to produce the fertiliser.

Another limitation with biofuels is that photosynthesis isn't very efficient, because chlorophyll only absorbs a very small fraction of sunlight. In fact, in a day we can capture more sunlight from a square metre of land by using solar panels than by growing plants.

A second possibility would be to run large solar (or nuclear) plants, and use the resulting electricity to drive some chemical process that emits hydrocarbons or carbohydrates. A difficulty of this kind of approach is that CO2 makes up so little of the atmosphere, and it's hard to find processes that work well in low concentrations. Some research is looking at using this kind of approach where concentrations are highest, in the chimneys of power plants. But turning burnt natural gas back into (synthetic) fossil fuels again is surely going to consume more energy than was produced by burning the gas in the first place. Unless I'm missing something, this is only a sensible thing to do if you want to produce electricity at a predictable rate and then later convert the exhaust gases back to fuel whenever the sunlight happens to be available. And it doesn't even begin to deal with numerous, small sources of carbon dioxide, like cars or planes.

A third way would be to engineer microbes that perform carbon capture. They could use metabolic processes similar to those of plants, but they would excrete the resulting fuels instead of building more plant with them. That means the volume of microbes can be fixed, so for a fixed output rate there's no need to supply nitrogen to grow more. Imagine you have a shallow tank of bacteria, which you just leave in the sun. All you do is water it occasionally, and over time it produces oil for you. On the other hand, the microbes are alive, so if you do want to increase production then you can let them reproduce easily. Got one solar bacterium tank? Just set up a new tank, add nutrients, breed your existing population in it, and double your output! You don't need viable soil, or concentrated carbon dioxide.

All we need for this is the right microbes. It's fortunate, then, that artificial photosynthesis is on its way.

Turning sunlight straight into oil obviously has the desirable overall outcome of reversing the effects of fossil fuel use. But it also means that the notoriously hard-to-predict availability of solar energy doesn't matter much any more: on a very sunny day, you don't need to have a large, expensive battery to store electricity, because you can have a large, cheap tank to store oil instead. And on a rainy day you can send some of that tank of oil to a regular power station. Your solar plant can be a base load plant.

And that in turn might yield some handy geopolitical consequences: every country could use its land to achieve energy independence, without having to swap oil pipelines for electrical grids and without having to swap petrol engines for electric vehicles.

Sunday, 23 November 2014

Making Faces and Faking Faces

I have been playing with the Haar-cascade-based face detector demo that comes with OpenCV. Among other things the demo can, in real time, detect faces in video frames from a camera. It draws circles around whatever it finds.

It occurred to me to confirm that the demo will detect multiple faces simultaneously. As I only have one face of my own, this doubled as an experiment to see how much of a realistic face I had to draw before the detector would recognise it as a face.

Loosely speaking, a Haar cascade models the thing to be detected as an arrangement of contrasting light and dark rectangular regions. Unsurprisingly, then, it didn't pick up a very stylised face with just a line for a mouth, dots for eyes and no nose. But once I'd darkened the mouth line enough, and put in some eyebrows and some nostrils, the face detector started to spot the fake face quite reliably.

The demo also does a second detection step within any region found by the first step. This can be used to find the eyes within the face, for example. The eye detector proved somewhat harder to fool. Even with heavy ellipses for the eyes, and well defined irises and pupils, it wasn't convinced. Only once I started to sketch the shadow either side of the nose did it become likely that the eye detector would detect eyes in my fake face.

Face detector draws circles around the regions it detects as containing faces and eyes
The face I drew is nonetheless far from realistic. Any face detector that finds nearly all things that are faces will also find some things that are not faces. In machines, this explains why Google Street View blurs out KFC's Colonel Sanders. In humans, we call it pareidolia.

Saturday, 2 August 2014

Time Passes

A year after Mental Block returned to the UK, I'm starting to explore ideas for what the next project might look like. I dug out a bit of code that I hadn't touched since 2012 to draw a Penrose tiling (the kite-and-dart tiling, specifically) and tidied it up a bit, thinking it might be interesting to make a jigsaw puzzle whose pieces form that tiling. But first I hacked it a bit to produce a Facebook cover picture:


(The method for producing the decaying effect here is mildly interesting. I wanted it to be probabilistic but deterministic. My answer was to hash each tile's position and map the hash onto the [0-1] interval; if the result is greater than the probability density at that point then the tile is not drawn. This could equally have been achieved using a pseudo-random number generator, but it has the nice property of being a pure function of the tile, so no state needs to be carried around – a particular advantage when writing in a pure functional language.)

As for the jigsaw puzzle, I had begun to have my doubts about its suitability for a Nowhere-style project. One of the things that kept people coming back to Mental Block was that it's open-ended and doesn't have a right answer. The best things that people built with it were the ones which I had never imagined and that didn't seem possible:


Similarly, at Nowhere in 2014, one of the best things was the noticeboard:


Again, this is something with no finished state. Consequently, it was rewritten hundreds of times over the course of the event.

A jigsaw puzzle, by contrast, would probably be solved once and then left alone. How can it be given a sense of restlessness and open-endedness? One way would be to paint a different design on each side, so that if one side is finished then the other isn't. But that's still only two possibilities, and doesn't leave much room for anyone else's imagination.

What if the puzzle is circular, and its two sides link up with each other like a Möbius strip? Then, if you start assembling the bottom left of it, you will find a mismatch once you work your way across to the top right. Turning a nearby piece over, you find that one of its faces matches the discontinuity in one direction, and its other face matches the discontinuity in the other direction. As you turn more pieces over, you push the mismatch somewhere else but you can never eliminate it.

Simplifying from a jigsaw puzzle to an array of 60 sectors, this idea becomes a clock. Each sector has two faces; one face matches its clockwise neighbour and the other matches its anticlockwise neighbour. There's always a mismatch, and that's how you tell the time. Here's a rough draft of that idea, built from a 24 hour time lapse video of Barcelona:


The idea works best at the top where night and day are obviously different, and worst at the bottom where the dawn light and the dusk light aren't much different from each other.

I also experimented with a simple square grid, warped so that the discontinuity is evident in the angle of the squares:


At certain angles this is hard to read. That can be helped by modulating the hue. If each full revolution on the clock covers half the colour wheel, then the discontinuity will always show complementary colours and will be very easy to see:


The next step is obviously to relieve the tedium of squares with the help of Mr. Escher's work:


I'm not sure where this is going, now. Any thoughts?

Monday, 5 August 2013

Mental Block: A Summary

Mental Block is an interactive work of art that I (George van den Driessche) designed and built for Nowhere 2013. Its seven pieces can be assembled into a 1.2m cube, or into a multitude of other shapes. There are ten large square images hidden in the work; each can be revealed by building a cube in a different way. The seven pieces are also a good size for sitting on!





The full photo album from the event is here.

Timeline

The project was carried out in my spare time. Overall, it involved about six months of programming, planning and modelling, followed by three months of construction.

  • October: Discovered the Soma cube. Wrote a computer program to enumerate its solutions.

  • November: Improved program performance and rewrote it in other languages to see how it came out.
  • January: Added code to export a 3D animation of the solutions to Blender. Uploaded a simple animation to YouTube.

  • February: Used a constraint solver to discover that a single Soma cube can contain ten whole square faces (though obviously they can't all be displayed at once).
  • March: Realised I could build a giant Soma cube and paint it. Submitted an application for an art grant for Nowhere.
  • April: Learned that my art grant application was successful. Acquired plywood, and built a small test cube to learn how to build the full thing.
  • May: Experimented with feet and corners for the cube. Cut all the large parts of plywood. Made some more models in Blender and uploaded a Sketchfab model of one of them.


  • June: Built all of the pieces of the giant cube. Undercoated them all, and designed a way to project images vertically from a laptop, for painting the sides.
  • July: Finished painting and varnishing the cube. Took it to Nowhere and finally assembled it. Brought it back from Nowhere.



Materials

  • 21msq 9mm spruce plywood
  • 32m 34mm frame timber
  • 2000 1.25" countersunk woodscrews
  • 500 rubber flight case feet
  • 500 1.25" round-headed screws
  • 2.5l white undercoat
  • 2.5l floor varnish
  • Various acrylic paints

Things that worked well


  • Modelling the more complicated pieces in Blender gave me confidence that I could build the structure correctly.
  • I structured the work so that if I ran out of time, I'd still have something I could present.
  • The pieces were as weatherproof as they needed to be.
  • The pieces have not suffered too much damage, even though I decided not to add corner protectors.
  • Using a spreadsheet to manage my cut lists meant I used the frame timber with over 98% efficiency.
  • I kept good financial records.

Things that didn't work so well


  • I didn't have time to fit EL wire edges to the pieces.
  • The tarpaulin that was supposed to protect the work from storms was instead ripped up by the storms.
  • The lights I'd ordered didn't arrive on time, so I had to pick up some more expensive equivalents at short notice.
  • I made one mistake in the painting of the sides.

Things learned (and relearned)


  • Timber merchants don't know how much their timber weighs, because their customers almost never care.
  • How to use a mitre saw, a skill saw, and a jigsaw.
  • What IP65 means.
  • How to wire Ceeform plugs.
  • Having a system is much more important than having the best system.
  • Power tools are amazing.
  • People like to build tall things, and will go to great lengths to build the tallest things they can.
  • Friends will happily lend a hand when the need arises.


Saturday, 27 July 2013

Done and Heavily Dusted

It worked! The moment of truth was when we put all the painted and varnished pieces together, and put all the feet on. They stacked just fine.



It was possible to build a complete face of the cube before we'd finished putting all the pieces together, so of course the first thing to do was to show that it was safe to stand on the result.



Over the course of the week, people did use the cube in all the ways I had hoped they would. They solved the cube to reveal the different designs (the smiley face being very popular). They used the pieces as seats. And they built unlikely edifices that I had never imagined.





The woodwork lasted the whole week with only small amounts of damage, despite my decision not to bother protecting the corners. And the paint and varnish also survived well. The tarpaulin that was supposed to protect the work from weather was torn apart on Wednesday night in the first thunderstorm, but that just showed that the tarpaulin wasn't necessary.

I found I'd only made one mistake, which was annoying but not enormously important: I had painted one side of one of the seven pieces upside down. The side formed part of the Nowhere logo, which meant that it wasn't possible to make a cube with that logo on the side. (It was still possible to complete the logo, but the pieces didn't then form a cube.) The other nine faces worked perfectly.
More photos are in a Google+ photo album and a Facebook photo album – whichever you prefer.

I can just about remember the beginning of this year, when this project was nothing more than a vague intention. It would never have become a reality without the help of a great many people in various ways. So, here are the people who made it happen:

Construction crew: "Freddie" (Mike), Bianca
Power tools training: "Freddie" (Mike)
Painting and varnishing: Lexy, Charlotte, Tom and Kate, Vic
Transport: my parents
Moral support: the Nowhere art crew (especially Camille); other nobodies (including Lexy, Bill, Rich, Joyce, Bambi, Hilda, Pauly, Nancy); my family; my Google ex-team (John, Natalie, Kyle)
Maths: the members of the Google math mailing list
Emergency tools: Pauly
Emergency beer: Asierr
Funding: everyone who bought a Nowhere ticket

You're all amazing. Thank you!