Important Question of the Day
/Why has no-one made a “Death Star Hamster Ball”?
Rob Miles on the web. Also available in Real Life (tm)
Why has no-one made a “Death Star Hamster Ball”?
this is really what the cameras looks like
This little camera is like no other. Except perhaps the other Lytro camera (of which more later). It takes photographs as “light fields”. Rather than focusing an mage on a sensor, the Lytro uses tiny “micro lenses” in front of the sensor to create a pattern describing the light rays arriving at each point in the picture. Pictures are created by processing the light field pattern, which means that you can do funky things like focus a picture after you have taken it. You can even make videos of the focus changing…
The video above was created from a single Lytro picture. You make these using the Lytro application which you can download from here. You can even get this to run on Windows 11.
You can pick up Lytro cameras for not much money. I got one and the pictures and performance were rubbish. But then I upgraded the software to the most recent version and things got significantly better. If you get one and want to upgrade it you need to use the Lytro application which tries to fetch the upgrade firmware from a long dead Lytro site. But you can get round this by patching a code file to redirect update requests to a site that does have the required files. I did this and felt very “hackery”. You can find out more details here.
Look Ma! I’m patching a binary!
Light Field Photography was a fantastic idea which didn’t survive the collision with reality. The focus party trick is achieved at the expense of a huge downgrade in quality and the arrival of a whole bunch of image artefacts. That said, I quite like the pictures the camera makes, and you don’t need 20 megapixels for every photograph you take.
Lytro survived the indifferent reception of their first model to make another camera which had a much higher performance sensor and processor and produced much better pictures, but ultimately it was killed by smartphones providing the same kind of focus trickery by using depth cameras and lots of image processing. That said, it is fun to play with and if you are a camera nerd you could do worse that get one. You can find out more about the camera here.
All new lego logo
I’ve just released the latest incarnation of Connected Little Boxes. I’m in the process of converting the original C based system into MicroPython. I’ve got enough of it working to make it useful and now I’m looking for people to break it and tell me it’s rubbish.
You can find it here. If you have a spare Raspberry Pi PICO you might like to give it a spin.
I’ve got a new desk. Gone are the bright red Ikea ones that weighed substantially less than the things we put on them. Now I have a big strong counter which hopefully won’t move much when I strap a steering wheel to it.
Anyhoo, I wanted some holes for cables to go through. And I also fancied the device above, which sets a rather useful mains socket and some powered usb ports into the desk. I discovered that these are 80mm diameter. So I asked for some holes which were 80mm diameter. Big mistake. Turns out that two things which are exactly the same size don’t fit together properly. The result you see above is the result of a bunch of frantic extra sanding on my part…
Inspired by a Discord post (which might be where all the good ideas come from) I thought I’d start a new series of intermittent blog posts about things I’ve done over the years. Starting, of course, with flushing toilets. The University of Hull used to have a “Centre for Applied Electronics” which was a technical “gun for hire”. Companies with problems would get in touch and we would go along and sort them out. Sometimes it was new product developments, sometimes it was automation or sensors. And sometimes it was toilets.
Reckit and Colman, a local chemical company, had built a lab containing toilets from all over the world. They made chemical tablets (also known as “loo blues”) which dissolve over time, releasing chemicals into a toilet each time it was flushed. These were clipped into the toilet bowl to keep things clean and fresh. The company wanted to know how well their tablets worked around the world. Rather than send someone out with a fistful of plane tickets and a case full of loo blues (I’d totally have done that job) they instead brought the world to a lab in Hull.
What they wanted was a way of producing timed flushes which mimic typical household use. Someone else built the actuators and I was called in to make the control system. At the start of the job the customer pointed to a manhole cover in the courtyard below the lab and said “If you flush all the toilets at once, that’s the cover that lifts up and floods everywhere. Don’t ask me now I know”.
I ended up programming a microcontroller in Forth to control the toilet actuators. It had quite a few timeouts in it. The controller was connected to a brand new (at the time) IBM PC XT. All the software was written in GW (Gee Whizz) BASIC which worked a treat. I discovered that the language had an ON TIMER GOSUB construction which let me build a system that allowed the user to edit and store time profiles while the toilets were being controlled in the background.
We installed the system and left them to it. We went back six months later and they told us they had a problem with the cathode ray tube (CRT) display “burning in” the screen. They asked what I could do about it and I pointed at the brightness control on the screen and suggested that they turn this down after use. In the end I added a screen timeout, mindful of the possibility that I would now get calls from people saying “The screen keeps going blank”.
Anyhoo, the system worked well for years, and I was rather cheered by the thought that, at any time of day or night a piece of my software could be flushing a toilet. Not a lot of programmers can say that.
def update(self):
for name, mgr in self.manager_entries:
start_time = time.ticks_ms()
mgr.update()
now = time.ticks_ms()
mgr.update_time_ms=time.ticks_diff(now,start_time)
self.status[name] = mgr.get_status()
This is the update loop for the Python version of the Connected Little Boxes software. It works through all the managers and updates them all. It also records how long each manager took to update and stores this value in the manager. I’ve found this to be incredibly valuable when trying to measure performance. When I display the status of the managers I also show the update_time value, which tells me who is slowing things down. When you make something that might be a bit performance sensitive its always worth adding a tiny bit of telemetry to find out what is going on.
“Vibe coding” is apparently a phrase of the year. It describes a programming practice where you tell an AI system what you want a program to do and then AI writes the code for you. Then you test the code, it works perfectly, you embed it in a mission critical system and everyone lives happily ever after. Or not.
I’ve tried this a few times and what I end up doing is what I call “Reverse Vibe Coding”. I describe what I want, the AI makes something which mostly works. I describe what changes I think should be made to make it work properly, the AI then makes something new which may, or may not, be better. And then we repeat. There seem to be inflection points in the process where the AI can jump in massively the wrong direction and you have to kick it back on track. Rather than AI helping me solve my problem I end up helping AI solve its problems. This is kind of fun, but not usually very efficient. Although the AI probably learns a lot.
We like Hyper Japan in London. So we thought we’d try Hyper Japan Manchester. The journey was different, in a car rather than on a “more exciting than we needed train”. But no less exciting as it turned out, thanks to the antics of Apple Maps navigation which insisted on taking us off the motorway so that we could enjoy some A-road action and a trip through Oldham that we didn’t expect. Then, when we needed it most in the middle of Manchester, the navigation had a complete meltdown spouting random instructions to head off down unknown streets and make sudden U-turns. I’ve no idea what caused it, but fortunately I kept my nerve and found the car park next to the venue.
You could say that the event was “more intimate” than the one in London. You could also say it was smaller. But it was no less interesting and enjoyable. Although we didn’t find anyone selling bubble tea. We got great stands, amazing musicianship and good food. Plus fantastic costumes. I’ve dropped some pictures down below. You can find all my Hyper Japan pictures here.
This is useful if you want to find out how your otherwise perfect code has just fallen to pieces. One of the nice things about Python is that when a program fails you get a description of what happened and where:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "main.py", line 21, in <module>
NameError: name 'zanzibar' isn't defined
However, if you catch the exception you need a way of displaying this useful information in the handler. This is how you do it:
try:
mgr.setup(mgr.settings)
except Exception as e:
print(f"[CLB] Manager {name} crashed during setup:")
sys.print_exception(e)
The call of sys.print_exception takes in the exception object that was thrown and prints the terribly useful message. If you want to put the message into a string (perhaps so you can log it or send it somewhere) you can do this:
import io
import sys
try:
x=zanzibar
except Exception as e:
buf = io.StringIO()
sys.print_exception(e, buf)
trace = buf.getvalue()
print("bang")
print(trace)
The code above will throw an exception (unless your program contains a variable called zanzibar). The exception is copied into the variable called trace which you can then do what you like with.
Does anyone know how I can delete all the emails from a particular sender on Gmail using the web client? You would think that this would be easy. There would be some way of specifying the sender and then a convenient button that you could press to delete everything.
If there is such a button, I’ve not been able to find it. All I can do is work my way through pages of mails, deleting everything in each page. It’s almost as if Google want to make it hard for you to get rid of dross so that your email fills up and you have to pay them for extra storage….
There is a lot of detail in the gloom, Thanks to Ben for arranging the elements in this shot
We had great fun taking pictures and developing film at the Hardware Meetup tonight. Ian’s film, taken on a 100 year old camera, looks really good. My shots suffered from serious underexposure/developing, but I’ll have some scans tomorrow.
Update: By using a magical power called “Posting From the Future” I’ve added a picture. It seems that I seriously overestimated the power of the flash I was using. I think it looks good and properly atmospheric.
Im quite pleased with how this picture looks as well.
Writing Python using ChatGPT:
time taken to design and create an event service bus and create publish, subscribe and service discovery methods: 20 minutes
time taken to fix the indentation problems in the Python source caused by the use of spaces and tabs in the source code: 20 minutes
I’m getting bits and bobs together for the Film Processing Hardware Meetup on Wednesday this week (12th of November). We’ll have 120 and 35mm film plus some cameras to play with, along with some cameras to play with. We’ll take some pictures and then develop them. If you fancy having a go at analogue photography (or just want to see how it works) then come along to the MakerSpace at the top floor of Hull Central Library on Wednesday evening from 5:00pm. We’ll develop a few films and you’ll be able to take your negatives home with you (although they might be a bit wet).
The time display can be slightly ambiguous…
Hmm. What kind of person designs a word search clock and leaves out the words “hour”, “minute”, “quarter” and “half”? That would be me…
After yesterday’s test print we have the finished result. All I have to do now is write the software….
I need to work on the letter sequencing…
I’ve been working on the self-solving wordsearch for a while now. Today I’ve been creating two different models for the case, one is the white outer case and the other is the black letter grid. I managed to print out a small test piece and I’m quite happy with how things turned out. The idea is that I put lights behind the letters and you can watch the answers appear.
This is the back of the text. There are some bad bits, but they don’t really show
The design is built using Python in FreeCAD which made it very easy to create and align the two models. Next step is to make the full size (16x16) wordsearch and then print it out, which might take a while. Great fun.
If you are in Hull you should go to Tech Sessions. If you aren’t in Hull you should come to Hull. And then go to Tech Sessions. I’m doing half of a session at the University of Hull starting at 6:30 pm on December 2nd in the Brynmor Jones library. I’m talking about making stuff. The other half of the session is from Rory Reid who is talking about writing meaningful, valuable, and maintainable tests.
And there will be free food and drinks too. And it’s free to attend. You can sign up here. Why would you not?
The self-solving wordsearch project is coming along nicely. I’ve been experimenting with printed letters and they seem to work quite well. Tomorrow will be all about software….
A nice person can be expected to give you what you want. A kind person can be expected to give you what you need (which might not be what you want). AI is in the business of being nice. Once it has figured out what you want it considers that the job is done. It is really hard for a human to work out how best to be kind, and it is a human thing to want to try.
I’m far from convinced that we can ever encode kindness into an AI. I think it adds a layer of introspection which would be an order of magnitude bigger than what we are doing at the moment. This doesn’t mean that we can’t use AI. It just means that when we do we need to remember that is only ever nice.
I’ve reached a point in a project where nothing works, but I know how it all should work. I think this would be a good time to sleep on it, and finish the whole thing off tomorrow.
Rob Miles is technology author and educator who spent many years as a lecturer in Computer Science at the University of Hull. He is also a Microsoft Developer Technologies MVP. He is into technology, teaching and photography. He is the author of the World Famous C# Yellow Book and almost as handsome as he thinks he is.