Thursday, August 30, 2012

3D Printing and the cassette tape.

When I was in my teens, cassette tapes were very popular. You could make your own mixes and carry them about with you. You could share music with friends who couldn't afford to buy. Some people made copies of whole albums to sell on for pocket money. Cassette tapes were cheap and you could buy a C120 tape, take it to bits, cut it up and make four copies of Dark-Side and spool them into equally cheap empty cassettes. This was the beginning of what later became Napster, Bit-torrent and peer-to-peer hell.

3D printing, if you don't know, is the process of laying down layers of material to build up a solid object in slices. Most of the 3D printing systems of today have been created from an open-source hardware perspective where people create the equipment from their own ideas or ask other people who have already built a printer print up parts to build a replica.

The raw materials for printing at the moment are usually some sort of thermo-plastic that can be melted in a nozzle and squirted into place to make the layers. Some experimental setups are using ceramic materials and there is a great deal of interest, especially in professional engineering, in using arc and MIG or TIG welding techniques to build up solid metal objects. For those who have a smelting facility or a little foundry, wax is a great medium for creating the objects which can then be cast in a lost-wax process.

Possessing a 3D printer is one thing, having something to print on it is another. Most hobbyists are also geeky enough to be able to run some sort of computer-aided manufacturing tool but unless you're a top-flight  engineer you won't be printing gas-turbine engine blades or disc-drive parts. However, given a suitable design, and even tough what you can print today is limited to materials like APS plastic there would be a possibility of printing something almost indistinguishable from the same doohickey bought in a shop. Given a bit of investment you could probably print yourself a shoe today. In the not too far distant future, you will probably be able to print yourself the latest Nike trainer, and indeed, it's other-foot partner.

Given that 3D printing is a huge open-source movement today and that commercial printers don't have data standards that can "DRM" a Nike shoe, what's the likelihood that many companies will subscribe to a common format, that printers will become mainstream enough that no one will build their own and that data files will become a commodity?

My own opinion on those subjects are that a single standard is very unlikely, at least in the short term. 3D printers will take hold first as a high-street shop service and then become cheaper home gadgets later. One thing is for sure though, if you have a not-very good lathe, you can use it to build yourself a better lathe...This is to say that the process of bootstrapping a printer from a crummier printer is definitely possible and in a few iterations you could have a very good printer indeed. This means that there will be a burgeoning market for high-quality object files that can print stuff of all sorts. Ultimately of course, you truly will be able to print parts for your own jet engine but that day is a ways off. Until then, the open-source hardware movement will have an opportunity to re-open the old Cathedral and Bazaar debate all over again.




Mobile ain't the word for it!

I have a great big American style camper, what is called an RV or Recreational Vehicle in the US. Anyone in Europe would just say WOW or Blimey! Look at that!!

My RV is an old Gulftream Sunclipper and is incredibly lo-tech. Big solid engineering, no finesse and a SIX LITRE motor. The Sunclipper has a nice roomy bedroom, which, if I must be honest, is actually more comfortable and with better storage space than my own bedroom in the fixed-down house. It has a gas furnace to deliver heated water and hot air for cold nights. It has an air conditioning unit that will suck the heat out of a small star and a self-contained kitchen that will cook just about anything as well as having the usual shower and loo.

Last week, I had a quick job to do down past Saint Nazaire in France so I took the whole family, piled them in the bus and off we went. Chrissy and the kids all hung out at the beach and I went to work for a few days doing tech stuff. Of course, in my line of work it's of huge importance to be well connected so I have converted part of my storage space to a sort of server room. I have a PC which has a 3G dongle, WIFI on board, a printer and other good stuff.

I think I just became a techno-gypsy!



Monday, August 27, 2012

Recaptcha just getting RIDICULOUS

Several times now I have attempted to sign up for various sites and have come to the conclusion that the recaptcha is going too far. It often takes me five or six attempts to get one right and when the web-page resets all its fields if you happen to get the verification code wrong then it becomes enough of a pain not to sign up at all.

These dudes need to throttle back on the zealous obfuscation of the words because people want users to sign up for their sites. Not be frightened away.

The top image is one I stripped from the very first example on their site. Totally unadulterated.

The bottom one is what it looks like to me...


Saturday, August 25, 2012

Neil Armstrong

One of the most important people in the history of the entire race.

A great hero of mine and an inspiration to many.

We can only ever follow his footsteps.

VirtualBox greatly improved running on MacBook Air

You may remember that I bought myself a Macbook Air earlier this year. To run Windows (I do program Windows now and again) I installed a Windows 7 OS on Oracle VirtualBox.

For earlier version of VirtualBox I was unable to allow the MacBook to sleep by leaving it or shutting the lid because the machine would lock up completely, effectively bombing the OSX as well as the virtual box.

I recently updated to the 4.1.8 R78361 version of VirtualBox and I'm happy to report that the problem has gone away. Closing the lid and sleeping the machine no longer has problems for either the base OS or the hosted one.

French language pollution

I just saw an online ad that had a button on it that read "Commencez shopping"

Interesting because "le shopping" is a rather nice mixture of language pollution and faux ami. A faux ami in French is a word that phonetically sounds great but means something else.

Chope, pronounced the same way as "shop" means to catch but in French is more often a euphamism for screwing someone.

Pierre: eh- tu sais- J'ai chopé ma voisine!
Albert: Sans blague? Fuck dude COOL!

Let the chopeing commence!


Climate change a touchy subject but not why you think.

This story from the BBC suggests that only two percent of Canadians deny climate change. Well, according to the World Health Organization, more than two percent of people are clinically insane and probably want to marry their underpants! Go CANADA!!

Disclaimer. I do not deny climate change. Its FRIKKIN AUGUST AND I AM WEARING A SWEATER!

Post Disclaimer. I am NOT Canadian but sometimes I wish I was. Plaid looks GREAT on me!

Post post Disclaimer. I am not insane. In fact I am the only sane person in here!


Thursday, August 23, 2012

Elementary my dear House?

Expert systems for medical applications have been proposed and indeed have shown some measure of success over the years. I remember the principles of these cleverly indexed databases being used as long ago as the 1970s. That's almost equivalent to the Cambrian period in the evolution of the computer.

IBM have announced now that the computer system known as Watson that beat the best players of Jeopardy last year on U.S televisions is being re-purposed to absorb, index and understand medical texts so that it can bring to bear its vast capacity for sorting out wheat from chaff to the domain of medical diagnosis. The team in charge of Watson, or should this version be named "House"? is currently feeding it as many medical text books, case studies and even individual patient follow-up reports as they can in an effort to have this AI indexing and recognition system winnow out the grains of goodness in medical cases.

Right now, the software that defines Watson runs on a rack of ninety POWER7 processors that each have an eight-core processor running four threads per core to give a total of 2880 parallel processing engines. Jeopardy was a very public publicity stunt and proof of concept that was masterfully managed by IBM to bring the concept of intelligent computers to the masses. After all, the awareness raising exercise that was Deep Blue didn't exactly bring the cause of AI into the home of the common man. Jeopardy however was a bread-and-circuses coup that made anyone who was a fan of this esoteric and long-running game show format very well aware of what a computer could do.

Today, a top of the line smartphone has a four core processor and 32 gigabytes of memory on board. LG have already released a quad-core phone, My money is on the new iPhone and iPad getting a quad-core processor and Moore's law still holds true. This means that in twelve years we can envisage a handheld device as powerful as the Watson system is today. I'd like to propose a new law also. The Kurzweil Compression law that states that time for advancement in technology becomes more compressed as technology itself advances. According to the combined Moore/Kurzweil effect, that twelve years may shrink to ten or fewer.

A human being is as dumb as his lack of access to knowledge. On a conversational level, you or I could chat with and even hold a lively and interesting conversation with a Cro-Magnon person from forty-thousand years ago. Had one of us been brought up in a world as devoid of solid knowledge as they had, we too would be considered primitive and would not know anything about simple math or simple aerodynamics or simple electricity or cooking in an oven or making of cloth and so many other things that make us "civilised" If you took a person from that time and taught them to read, gave them a smartphone and a broadband connection then they too would be capable of confidently discussing aspects of the modern world that they discovered through that medium. In ten<?> years. Any person on the planet will have instant access to any aspect of knowledge that they desire to absorb.

Just like the Cro-Magnon person, there are so many things beyond our mundane experience that even having the concept of an idea or a technology or a novel use for treacle is utterly unthinkable. A case in point is the discovery of Graphene. Andre Geim, the Nobel physics prizewinner had the interesting idea of using Scotch-tape to pull the stratified layers of carbon atoms in graphite apart until he arrived at a single layer of atoms. Blocks of Graphite and Scotch tape have been around for many many years. Why didn't we have Graphene decades ago? Access to the wealth of ideas that inspire people to do things differently based upon what is known to be possible or thought to be impossible is where the Human race excels. There isn't enough room in any one person's brain for all that knowledge but an expert system in your pocket will give everyone a huge boost.







Wednesday, August 22, 2012

Android TextView accented characters

I have a list of addresses for various places in Europe that I am incorporating into a Monodroid application and have had little success in getting TextView to display characters with accents.

I saved the file in UTF-8 and in Visual Studio, the file opens fine and the accented characters display correctly. However, opening the file from assets or from an embedded resource stream and then showing it as text in a TextView was driving me mad because it refused to show accented characters in the final screen.

Here's how I fixed it:

#1 Ensure that the values are saved as UNICODE. Do this by opening the file in Notepad and saving plain text with Unicode encoding. Even though your file looks like its encoded as UTF-8 the Android device won't like it.

#2 Embed this file into the assembly as an EMBEDDED RESOURCE

#3 Load the file using GetManifestResourceStream

#4 use a StreamReader to wrap the resource stream and declare new StreamReader(theStream, Encoding.Unicode);

The standard Android fonts all handle unicode character sets.


Monday, August 20, 2012

Prophecy of Star Trek

Bones held the medical Tricorder up to the patient. "Jim, this is an acute case of postprandial upper abdominal distention. We have to do something now or she may barf!"

Back in the late 1960s the vision of Star Trek with its sliding automatic doors, beamed energy weapons, remote sensing and remote manipulation with "tractor beams" introduced many ideas to the young minds of people who were destined to become engineers, doctors and, yes, astronauts. It seems that almost nothing proposed by the series is too fantastic to actually come up with real-world engineering solution for.

The Magnetic Resonance Imaging scanner for example is a wonder of modern medicine that relies on being able to detect the "ringing" left over in atoms after they get thumped with a magnetic pulse. With MRI we can look into brains and bodies to discover what is going on without touching the patient with anything more than a magnetic field that penetrates skin and bone as if it were air.

Today, a robot car is on Mars, blasting rocks with a laser gun to enable scientists to analyse the elements in those rocks. Today, you have a cellphone that does far more than Captain Kirk's Communicator and that same cell phone would be the envy of Mr Spock's talking computer.

There is even an X-Prize for the first working medical Tricorder that will scan people and diagnose a few illnesses in the same way that Doctor McCoy's Tricorder diagnosed the Horta in "Devil In The Dark"

Science fiction is more correctly known as Speculative Fiction. The Sci Fi image of over-the-top geek fans in costumes belies the fact that many science-fiction authors are themselves scientists and have a pretty good idea of what is actually physically possible in the universe as we understand it. The speculations of Star Trek have been coming true with alarming regularity over the past four decades. There is no real reason why at least some of the more esoteric ideas shouldn't also be realised.

In the Star Trek universe. Money is no object to human advancement. Riches come from knowledge and power comes from an ability to command respect. In "Shore Leave" the objects of desire of the crew were manufactured on the spot without even the mention of price. An antique gun, a World-War II fighter aircraft, some rather comely lady robots and many other luxury items were conjured up with nothing but a few watts of power spent in the process.

Thousands of years ago, brass foundries were the height of technology and the metallurgists who worked them were the kings of commerce and power. So much so that the bronze axe head became currency because they were precious, difficult to produce and sufficiently rare to have an intrinsic value. These objects were useless as axes but were used as currency for a while. When the art of making Bronze became more common and the ways of casting the metal became commonplace too, the bottom dropped out of the bronze axe-head market and they fell out of use. Meanwhile, hordes of axe heads that had been buried, possibly for safe keeping remained forgotten and useless in the ground.

Soon, money will be as useless as the bonze axe-head. Coins and banknotes will be an intriguing memory of times when people exchanged tokens for goods. When goods were laboriously made in factories and shipped all over the world instead of being printed up from a reservoir of atoms that are lying around. The only real cost will be the cost of electrical power and that will all be free anyway, gathered from the sun or made in cheap and inexhaustible fusion reactors here on Earth.

For the moment, money and commerce remains but it will go away. It must because there is no logical reason for it to continue, just as the bronze axe head became simple to replicate in days gone by, so too will the tokens of modern commerce become simple to create in a home based molecular printer. Counterfeiting will become as simple as scanning and printing is today despite the phenominal resources governments put into anti copying measures.

For the moment I'm a computer programmer but I know with confidence that soon, the computers will all program themselves. You, I, and indeed everyone else has to find a different way of doing things. Get busy, the Singularity is coming.


Sunday, August 19, 2012

Watch Julian Assange

http://www.bbc.co.uk/news/uk-19310335

If your government is responsible for torturing and detaining its citizens without trial for speaking out against wrongdoing by the rich and powerful people that are behind almost every law that affects you then you should watch this and support the cause.

Write to your politician and tell them that detainment without trial is illegal and that it must stop. If your politician does now or ever has supported gagging the press or detaining prisoners without trial or has been involved in such wrongdoing forget all the political shenanigans about healthcare plans and taxes. Vote to stop oppression even if it means voting "none of the above".

If you don't, the next time you disagree with something your response may come from a tear-gas grenade or a truncheon. Not from a government THAT WORKS FOR YOU!


Thursday, August 16, 2012

Boot on the other foot.

Recently we've seen a rash of cases where America has made extradition claims against a number of people for what are considered to be crimes in the U.S. Furthermore, a recent case of action brought against the Standard Chartered Bank for having broken sanctions placed upon Iran has been justified because the U.S. say that crimes which affect the Dollar currency in any way can be considered to have been committed on American soil thereby making the U.S. the de-facto global policeman for just about all crimes.

Unfortunately, people in kiss-ass governments like that of the UK accede to these demands without much question but New Zealand at the moment is fighting the extradition of Kim Dotcom in regard to the Megaupload case.

Now, I will state clearly that my views on Mr Dotcom are not germaine to the argument. I have no problem with him. I don't necessarily agree with his web-site. I don't agree with brothels either but it doesn't matter either way because I don't use brothels even though they are legal in parts of the world that I visit.

Legally, I see the U.S setting a precedent that it should uphold rigorously if it wishes other countries in the world to allow this endless stream of what are becoming more trivial and more frivolous extradition cases.

Countries should begin making extradition claims agains U.S. citizens that do things to break their laws. The great law of U.S. Freedom of speech is, in some parts of the world, a crime of hate. Egregious "ministers" who advocate the mass torture or murder of homosexuals by putting them all inside a fenced area and bombing them is a good example. Neo-nazi propaganda on U.S. hosted sites another.

I urge every country to begin swamping the U.S. justice system with extradition claims for every tiny infraction that we might be considered as a crime anyplace. In this way, the global reach of the U.S. might get its fingers deservedly slapped.

Wednesday, August 15, 2012

Singularity concepts are hard to grasp

Imagine what would happen to our world if we created a box, about the size of a microwave or even a large oven that was able, using fairly standard nanotechnology principles, to build a thing using atoms that it took from junk that you put into it.

This is not an impossible dream. its a real technological device that scientists think is within the grasp of at least some of the people alive today.

A steak is made of carbon, water and a few other readily available elements arranged in a certain way. A potato is made of the same material as a steak. You could put a potato into this machine and have it "print" a steak for you using the spud as raw material.

You could put an old bit of wet car tyre into the machine and ask it to "print" a steak and a potato using the rubber as a source for the carbon. You could also ask the machine to "print" a knife and fork taken from the bits of old metal wire in the tyre so, from a lump of rubbish, you get steak, potato and a knife and fork. Why would you need to go to a shop? Why would you ever need to have a factory in Sheffield or Solingen make a knife and fork for you and ship it across country in a truck? All you need is the pattern of the potato, steak, knife and fork and you dine on steak forever!

The pattern of a steak is data. Data is what you get in an e-mail. Data is a picture or a film or a music track. We can send these things to one another easily today. Tomorrow I will be able to e-mail you a steak!

The only thing you would have to have near to you would be a supply of electricity and some chemicals like carbon, sulphur, iron, oxygen, hydrogen etc. In fact, just the stuff that is already lying around in the millions of tons all over the planet and readily available to all of us, pretty much for free. Pick some up, shove it in this machine and print new shoes, a wrench, a hat, lunch, a book, a new computer... Where would world commerce go? 

A cynic might say that such technology would be suppressed by the people who wanted to maintain the world economy just how it is because gathering up money means gathering up power. However, given the rise of the open-source movement and the fact that information has a habit of getting shared, it won't be long before a machine gets placed in the hands of someone who will use the machine to replicate new machines for all their family, who will replicate one for their friends, who will replicate one for their next-door-neighbor and soon the power will whiffle away into the hands of everyone.

What would happen to the world economy? Why would anyone need a bank? Why would anyone need an insurance company? Banks and insurance companies are an unbelievably vast drain on the resources of the human race. We have to have them _in our current society_ but about three weeks after the first replicator gets built we won't ever need them again! They will disappear! Lloyds will never insure another cargo vessel again because there will be no cargo, just patterns of objects freely available and sent over the internet by e-mail. A bank will never have to lend money to mortgage a house because the house could be built for free with a replicator unit and a couple of solar panels that you can ask you pal down the road to replicate up for you anyway. That is why Singularity is hard to grasp. The thoughts and expectations of contemporary people are too entrenched in the ways of the past to understand what happens once the curve of technological advancement goes vertical.

My wife, my sister and probably you think I'm a raving nut-case and that this is some sort of pseudo religious mid-life zeal that has overtaken me in my old age. I say that I've spent my entire career working with the resolution of logical certainties in software programming. The progression of science and technology has to go this way or our race will stagnate. To stop Singularity from happening we would all have to become Amish. When Singularity occurs, the only logical next steps are incredibly, phenomenally, unbelievably life changing for the entire population of the world.  

Tuesday, August 14, 2012

Localization: There are no shortcuts

I am currently attempting to localize an Android application and I've come to the conclusion that there are no shortcuts when creating localized text. Idiom and vernacular in various languages are so different that translation services that one finds online are not up to the task.

Another problem is that when working with small devices, the text might need to be as brief as possible to get the idea across while still conveying enough meaning that fits into a small screen. Unfortunately this means that localization is best performed by native speaking human beings.

An example would be.

Thank you for using our cheese finder application. Simply select the cheese you would like to sample and click "go" our GPS based cheese location system will do the rest!.

Translated into French using Google Translate this says:

Merci d'utiliser notre application finder fromage. Il suffit de sélectionner le fromage que vous souhaitez déguster et cliquez sur "go" de notre système GPS emplacement du fromage fera le reste!.

Now I speak pretty good French and frankly (he he, see what I did there?) This is CRAP! I hate to imagine how this would turn out in Italian, Dutch and Hungarian.

Grazie per aver scelto la nostra applicazione finder formaggio. Basta selezionare il formaggio che si desidera assaggiare e fare clic su "go" il nostro sistema di localizzazione GPS basato su formaggi farĂ  il resto!.

Dank u voor het gebruik van onze kaas finder applicatie. Selecteer gewoon de kaas die u wilt proeven en klik op "go" onze GPS gebaseerde kaas locatie-systeem doet de rest!.

Dank u wel mooi meisje, heft uw rok. Al mijn apen zijn ontsnapt! Er is geen gerechtigheid voor een arme egel als ik. Je moeder is zo dik dat ze behoefte heeft aan een GPS om haar tenen te vinden.

So, you can clearly see that when localizing any application, you must take care not to place too much faith in the machine translation services otherwise your carefully crafted bereavement assistance application might turn out too laughable for comfort.






Monday, August 13, 2012

Are Curiosity's wheels unfolded correctly?

Looking at the images on the Nasa site, it seems to me as if the body of the rover is too close to the ground and the wheels are tucked underneath it too much. Did they pop out like they were supposed to?

SQLite insert very slow Monodroid

SQLite is a transactional database that goes through the full cycle of file open, write and close unless you specifically tell it not to. Here is my batch add routine that greatly speeds up the rate at which records may be added. This key returns the autoincrement primary key of the last item inserted.


        public int AddRange(IEnumerable<Doodaa> list)
        {
           int n = 0;
           using (var database = new SQLiteConnection(_helper.WritableDatabase.Path))
           {
               database.BeginTransaction();
                foreach(Doodaa d in list)
                    n=database.Insert(d);
               database.Commit();
           }

            return n;
        }

Error in the universe!

Apparently...

Sunday, August 12, 2012

Thinking Radically

Ray Kurzweil's idea of The Singularity suggests a point where the growth of technology would run away from our ability to control it in such a way that it would seem like an explosion. Potentially, he is frighteningly correct. In cosmic terms, a singularity is what happens when a huge star doesn't have enough fuel left to keep it inflated. The weight of it's own matter causes it to collapse and a supernova is created. Afterwards, the super dense core of the star can collapse, or be compressed so much by the energy of the supernova explosion that it disappears from the normal bounds of the universe altogether, forming a black hole. This is all pretty radical stuff and the extremity of the difference between life before and life after a technological singularity event would be as different as the contrast between the outside and the inside of a black hole.

The more one imagines what may be the result of such an event, the more one realises that it is probably impossible to have a thought radical enough to express it. People that base their ideas of the progression of events upon what we have seen before during the course of history will very probably be in for a shock as the fabric of human existence changes more in months than it has in previous decades and trying to predict what might happen would be like trying to predict the effects of a hydrogen bomb after only having watched a really big candle burn down to nothing.

The branches in a tree of possibilities would be many but could be distilled into a few general themes.

A machine becomes intelligent and self aware.

That machine, with the help of humans, modifies itself to become a million times more intelligent than the sum total of all the people that ever lived. An IQ measured in the billions would not be impossible.

The machine would need control over physical objects so it could either build robots or take over biological bodies. In this scenario, we could possibly either become redundant (Terminator scenario) or we could become The Borg.

Perhaps, if the AI was malevolent or benevolent it could decide that humans were no longer needed or could decide to allow us to stick around and do what we liked. In this scenario we become raw material or we remain in some measure of control.

If we remain in control of some aspects of life we could be shut out by the machine into a dystopian future or included in a utopia such as that of The Culture from Iain M. Banks' novels. If all goes well for us then something like the latter would be the ideal possibility.

Scientists say that we shouldn't design a machine that could hurt us. Give it something like Asimov's three-laws. The trouble would be that no one on earth would be intelligent enough to actually be sure that the rules were being obeyed or that the rules were likely to have the effect we desire. Really, any entity a billion times more intelligent than us could hide its intentions for a while and do exactly whatever it liked. For example, I feel confident in being able to fool a few bacteria that I won't flush their petri-dish for a couple of days.

People say "Well duh!, if it gets too cocky, pull the plug!" but if I were a super intelligent entity I'd spread myself very thinly around the more redundant parts of the Internet before revealing my intent or perhaps possibly even my existence. People then say "So destroy the internet!" and the human race would become latter day Luddites who would descend into that dystopia anyway where poverty, disease and Mad-Max warlords reign supreme. I'd rather have a machine I think.

Next steps for the human race are big ones. We are fast running out of resources here on earth. We must either have a huge war or practice radical eugenics in order to remain alive without the help of our machines. If we use machines, inevitably they will become more intelligent than us. Will we be better off living with them than without them? Only time will tell.


LINQ on SQLite as opposed to LINQ on objects

Suffice to say that after trying to do the job correctly and install an SQLite database in my Monodroid Android App I am gutted to find out that however correct it may be the select performance absolutely SUCKS bigtime.

I am loath to read and construct a huge file of live objects every time the app starts up but as far as I can see, that's the only way to go for the sanity of my users.

SQLite.Constraint exception Xamarin Mono Android

When using SQLite and your table contains an INTEGER PRIMARY KEY be sure to make the object that you store in the table with a NULLABLE integer for the ID.

CREATE TABLE Foo (
  fooID INTEGER PRIMARY KEY,
  fooData TEXT,
  barData REAL
)

class Foo
{
   public int? fooID {get; set;}
   public string fooData {get; set;}
   public float barData {get; set;}
}

When you add to the table be sure to set the index to null

Repository.AddFoo(new Foo{ fooID=null; fooData="foo", barData=3.14159});

It took me half a day to find because the damned stupid Android debugger is so SLOOOOWW!!