Can an algorithm find the pattern?

Consider this picture from Creative Computing Magazine (January 1978). Look closely and you will see a pattern. It represents nicely the human visual systems ability to find patterns in simple drawings. How easy is it for  an algorithm to find the pattern? Likely not that easy, without substantial training afforded to this one particular problem. Some things aren’t reproducible by machines – and maybe it should stay that way. Otherwise why do we even exist?



Why technology may not save us

While the world changes under a maelstrom of climate change, we begin to ponder what life will be like on the “future earth”. The earth will survive – it’s gone through more traumatic changes in the past, although it may not look the same anymore. It’s humans and their infinitive search for a “better life”, that may suffer. Look humans aren’t the smartest of creatures. We build cities on fault lines, or on floodplains (note the word flood?), we are still astonished by forest fires (most of which are lit by humans), and we have filled the oceans with plastic. A “better life” may have existed long before the world became what it is today, and people were more content with what they had. Every day there is some new report of technology that will help save the planet – most are just ideas though – much like the moving sidewalks or atomic trains of the 1950s.  We could build technology to clean up the plastic in the oceans, but instead we think more about colonizing Mars than fixing the place we live on (likely so that Mars can be strip mined, because frankly there is exactly any flora or fauna to worry about disturbing there – that we know about). I doubt cleaning up plastic is a hard task, but there has got to be a want to do it. We could build more energy efficient, smaller houses, and build more efficient, rapid transit. That’s not rocket science – but everyone has to do their part.

When we had less technology, we had fewer problems.


Why most institutions of higher learning are antediluvian

From the perspective of education, universities are the epitome of old-fashioned. We still do lectures, the same way they were done 50 years ago. Yes there is technology involved, and some in-class activities, but the general notion of how we teach students has not changed. The only thing that has vastly changed is the size of classes. The problem is that this form of learning may work in small classes, say less than 20, but large classes don’t work so well, and they never have. Why? because for hundreds of years before, instruction was very much hands-on, and individualized. One did an apprenticeship in some trade and learned all there was to learn, over a period of time (anywhere from 5-12 years). What we have created in society are mills, similar to what happened in the industrial revolution when the work performed in craft industries based in the home transitioned into huge mills. Things were made more efficient, and cheaper, but the end result was maybe not as good a product?

Universities have gone the same way during what we could term the “educational revolution”, from the late 1970s to now, where the emphasis in western society has been placed on higher education above all else. We have also moved from a simple 3-year degree to one where students can spend upwards of five years in an institution of higher learning. What are they learning? To be honest I don’t know. Can one learn anything in a class of 300, 500, 1000? Can one learn anything much from reading textbooks? I doubt it. Much of what I learned I taught myself, programming included. I mean it’s no wonder people find programming boring, because the programs often used to illustrate concepts in computer science are boring – but to be completely fair, it’s impossible to develop an app in a semester, even two.

But, I digress. The real problem is that there is very little experiential learning, and certainly nothing of the sort when it comes to most university experiences. I guess that’s what coop is for, or maybe a semester abroad. One could learn many things from books, because some books are good (some textbooks are rubbish of course, not *all* books are meaningful). But you can’t learn things like design completely from books, and solving problems is often more associated with experience, and “thinking outside the box”, than anything else (higher education is often thinking more “inside the box”). There are of course university educators willing to take the leap of faith, and invest in experiential learning. The problem is cost, and likely an unwillingness of institutions of higher learning to actually change to any great extent. There are *some* institutions that seem to understand the message. One of those is Quest University Canada, with out of the box thinking like the “block plan”, where you only do one class for a set period, integrate experiential learning, small class sizes, and only offering one degree. Yes, some will argue that these things are not achievable in a public institution – but why not? Maybe if we shed this mantra of the lecture-based instruction, we could produce a better learning environment.

Decaying apps

We don’t think much about software decay, or when we do we think about old software, written in Cobol, running on mainframes. But the sad thing is decaying software is all around us. In fact most of us carry such software around with us every day – in the guise of mobile apps. Before the panorama feature came to iOS, there were a number of panorama stitching apps, including AutoStitch. Now Panorama is great, but it only allows for a panorama 1 photo high, whereas AutoStitch allows for at least 2 photos in height. The problem is AutoStitch still works in pre-iOS 11 devices, but will not work in the 64-bit world of iOS 11. How many apps have you had to delete because of the following message?

Developers may just stop updating the app, or maybe they get bought out by a bigger company, who stops supporting the app. For whatever reason, you are left with decaying software, only viable while the current environment remains static. Upgrade the OS, or the hardware, and it might be curtains for the app.

Generating a recursive Romanesco broccoli

Romanesco broccoli is an edible flower of the species Brassica oleracea which includes cabbage, broccoli, Brussel sprouts, cauliflower, collard greens, and numerous other “cultivars”. It was first documented in Italy (as broccolo romanesco) in the sixteenth century. In French it is known as chou Romanesco, which translates to “Romanesco cabbage”, but it is by no means a cabbage. The Germans call it Pyramidenblumenkohl, or “pyramid cauliflower”. Romanesco broccoli is what could be termed a self-similar vegetable. There are vegetables which are composed of smaller copies of themselves ad infinitum, or at least until some limit where the similarity breaks down.

Equiangular spirals (also known as logarithmic spiral, Bernoulli spiral, and logistique) describe a family of spirals. It is defined as a curve that cuts all radii vectors at a constant angle.

How do we build a visualization of this vegetable? In Processing of course! Here is the Processing code to generate the Romanesco broccoli. The first piece of code handles setting up the Processing environment, and defining constants like the Golden ratio, the number of florets. It also sets up the Processing draw() function, which executes drawRomanesco(), and takes a snapshot of the final picture.

The remainder of the code deals with the function drawRomanesco() [1].

This is a nice recursive function, which as the base case draws a circle, using the function ellipse(). The recursive case, sets up some parameters, then uses a loop to derive the florets, which internal to the loop, recursively calls itself. The depth of the Romanesco is controlled by the number of levels, which in the case of the example above is 3. The first level is the overall Romanesco with 60 florets, the second level builds each of 60 florets within those florets, and the third level builds the florets within the florets, within the florets. The resulting image of the Romanesco broccoli, is below, showing the Romanesco from above. Of course it is not perfect, because the florets on the real Romanesco are angled out from the main axis.

[1] Code derived from algorithm on


Digital photography: some things just aren’t possible

Despite the advances in digital photography, we are yet to see a camera which views a scene the same way that our eyes do. True, we aren’t able to capture and store scenes with our eyes, but they do have inherently advanced ability to optically analyze our surroundings, thanks in part to millions of years of coevolution with our brains.

There are some things that just aren’t possible in post-processing digital images. One is removing glare, and reflections from glass. Consider the image below, which was taken directly in front of a shop window. The photograph basically reflects the image from the opposite side of the street. Now getting rid of this is challenging. One idea might be to use a polarizing filter, but that won’t work directly in front of a window (a polarising filter removes light beams with a specific angle. As the sensor doesn’t record the angle of the light beams, it can’t be recreated in post-processing.). Another option is to actually take the shot at a different part of the day, or the night. There is no fancy image processing algorithm that will remove the reflection, although someone has undoubtedly tried. This is a case where the photographic acquisition process is all.

Any filter that changes properties of the light that isn’t captured by the digital sensor (or film), is impossible to reproduce in post-processing. Sometimes the easiest approach to taking a photograph of something in a window is to wait for an overcast day, or even photograph the scene at night. Here is a similar image taken of a butcher shop in Montreal.

This image works well, because the contents of the image are back-lit from within the building. If we aren’t that concerned about the lighting on the building itself, this works nicely – just changes the aesthetics of the image to concentrate more on the meat in the window.


Are great writers born?

Are great writers born, or is it a skill that you learn over time? The same question is often asked of artists – can one teach oneself to become a great painter or architect, or is there something innately within a person.

Most people don’t find their inherent ability to write until later in life. One cannot expect a young adult in high school or even university to be a good writer. Yet for some reason we do. Having someone sit through years of classic English prose, and grammar  does not necessarily provide them with the skills to become a good writer. I barely remember any of those things they drummed into us in high school. I found the literature we studied boring – others may find Steinbeck’s “The Grapes of Wrath”,  or F. Scott Fitzgerald’s “The Great Gatsby” enduring – although their works do have meaning, they are often boring – at least for a teenager. This is partially to do with a lack of experience and understanding. One cannot expect a teenager to really understand the underlying message in many of these books, because they are lacking in life experience. You cannot expect a 18-year old in the first year of university to produce a critical piece of literature. Some might be able to, most won’t. It’s not their fault, it’s that they simply lack life experience to put things into perspective. Life experience is not the Internet, no amount of YouTube videos and social media feeds can replace the physical act of experiencing life. With age comes the realization of life’s rich mosaic. Getting older also means you can coalesce your experiences into your writing abilities.

Additionally we become better writers if we read. If you don’t read varied literature your writing skills will never improve. By varied literature I mean fiction, non-fiction, magazines, blogs, comics – anything really. The act of reading will subconsciously add words to your vocabulary, and you also absorb varied methods of writing. Reading only scientific literature will not make you a better writer, in fact it will have the opposite effect – scientific writing is often staid, and uninspiring. It never use to be like that – people in fields like computer science use to be able to write beautifully, Dijkstra is a great example (and often English was not even their mother language). However the likes of Dijkstra come from a different time. Of course some people don’t read that much because they live in houses devoid of books. They never experience the joy of reading a *real* book. My house is filled with books of every sort. I borrow cookbooks from the library just to read them. I read anthologies on cooking, books on woodworking techniques, books on architecture, history, trains, historical mysteries – a range of varying topics. Shelves of books fill every room. Not electronic books, real tangible reading material.

Writing is a skill that anyone can develop, it just takes time. Some people do their best writing sitting in a cafe, for others it is travelling on a train. I like the idea of sitting in a cottage in winter, in front of a roaring fireplace, watching the snow slowly drift to ground through the strands of birch trees. Just saying.


Is computing sustainable anymore?

Computing is hardly a sustainable field, with the IT “ecosystem ” representing approximately 10 per cent of the world’s electricity generation. That’s 10%. We are at the point now where out foray into the future is helping the climate to change, and as this recent article in The Guardian suggests, endangering the planet. Apparently data centres are soon to have a larger carbon footprint than the entire aviation industry. We have become too addicted to technology, and it seems to be getting worse all the time, not better. Gains made by low-wattage LED lightbulbs in our houses, are wiped out by devices that need feeding everyday. This is largely a factor of replacing mechanical things with things that use energy. Cars are a good example – they are filled with differing forms of technology, some good, but some quiet mediocre. We have to ask ourselves “do we need all this technology”?

A recent study predicted that the global footprint of information and computer technologies (ICT), would reach 14% by 2040, which will be more than half the relative contribution of the entire worldwide transportation sector.  How “green” autonomous vehicles will be is yet to be seen… they are loaded with sensors and computers which all use power, and all have to be manufactured. We won’t even talk about the lifecycle costs of the car batteries. Never mind that electric cars are all good and well, but the electricity has to come from somewhere right?  Some of this could be offset by requiring greater use of renewable energy, but it’s not only the energy used by ICT, it’s also the environmental cost of their lifecycles – how they are manufactured, and ultimately how they are recycled. The carbon footprint of the iPhone X is 79kg over the course of its life (better than the iPhone 6+ at 110kg, but not as good as the 45kg of the iPhone SE).

Partially it’s our own fault because we don’t really teach anyone about sustainable computing. But maybe we should also spend less of our lives focused on the screen. The world might be a better place if we were actually doing non-technology related things as well. Do we need AI to make our lives easier? No, what we need to make our lives easier is *less* technology, and maybe taking the time to do some forest bathing. Plant more trees – that will ultimately help curb climate change, not AI, unless someone is planning to develop some form of autonomous tree planting robot, or maybe something to clean the oceans of all that stupid plastic.

Is the world too complex?

Thor Heyerdahl, the Norwegian adventurer behind the  Kon-Tiki expedition in 1947 once said that “Progress is man’s ability to complicate simplicity.”. We have spent the past hundred and fifty years complicating the world, to the extent that we likely already broken the planet we call home. Not that climate change will in any way impact the existence of the world because it has progressed through these cycles before. Plant and animal life will adapt to the newly morphed world, and life will go on – we hope. It might just be a bit of a jolt for humans because we believe we live in some sort of stable world where nothing should go wrong. But volcanoes still exist, as do earthquakes and forest fires. We have tried to control our world so much that we find it anomalous when “disasters” happen. But they happened before, and they will happen again. Maybe in some respects we should be thankful for volcanoes and the like because it reminds us that we are not omnipotent, that we do not control all – and that we likely should not build things so close to volcanoes. Just like we shouldn’t built towns in flood plains.

We have added complexity to every aspect of our lives, usually in an attempt to make our lives easier. it hasn’t really worked. Computers are somewhat to blame. Each new device we add is suppose to something miraculous – few do. Sure i love the ability to watch NETFLIX, and record shows on my PVR so I don’t have to watch commercials. I don’t like LED light bulbs because they don’t last as long as they should, they contain too much technology, and it takes too much effort to find the right light bulb for the right application. Yes, incandescent light bulbs sucked energy – but they were simple. Programming languages were once simple – now most created are overly complex, and little has been done to make learning them any easier. Look many of the things we do now we justify with the mantra that it “will make our lives easier”… things like AI. Now we have fridges with screens so we can see what’s in them without opening them. Really? We can’t just open them to see?

And maybe as the world gets more complex under the guise of simplicity, some of us just want more simplicity in our lives. That’s it, I want Nordic type programming language that exudes simplicity (while I still care about coding). I want a minimalistic house, with  a view, that contains minimalistic things, like an old-style oven, and heated using highly efficient Swedish stoves. Off the grid – why not? If everyone attempted to make their lives simpler, and to make their homes more efficient (and by this I do not mean adding technology), maybe we would all be better off, and our footprint on the planet would be reduced.


When algorithms may not be optimal

Last month whilst in Scotland I read an article in The Guardian Weekend,  titled “The algorithm method” by Olivia Sudjic, which dealt with using a digital contraceptive app in place of more conventional means of contraception. It is an interesting read because of the idea of using an algorithm to determine a woman’s fertility on a daily basis using daily body temperature, and statistical methods. Known as Natural Cycles, the software was developed by two (Swedish) former Cern scientists. The software is effectively designed to map menstrual cycles – which it seems to do effectively 93% with regular use. The problem with developing algorithms of this nature is of course that their scope can sometimes be somewhat narrow because the information base itself is narrow. Humans can not always be statistically buttonholed, into categories and there is a danger in creating apps which may not be as inclusive as they seem. An interesting read.