Archive for the Doodling Category

Everything old is new again…

Posted in Doodling on July 28, 2016 by asteriondaedalus

I just downloaded a free book from O’Rielly press: Free ebook: Object-Oriented vs. Functional Programming.

Sad really.

Consider my first programming language (gag I’m 57 in a couple of weeks so let’s be gentle and say 30 years ago) was LISP.

I did like LISP.

So much I build a LISP interpreter in FORTH.

I did like FORTH.

So, why the hard sell on functional languages?

To me, they were always gold.

OO is a funny thing.  Functional thinking, so called, is an Anti-Pattern.  Of course, that’s only true when constructing programs in OO.  However, OO always did too good a job at obfuscating the functionality – to its detriment.  Go figure, the JVM was eventually fitted with journalling to ostensibly provide a functional look at what was going on in your application, that is people felt it necessary to provide a tool to reverse engineer the running application – scary.

Still.

History eh?!

I was speaking to a younger (like me ex) software engineer.  I would mention things like the “Software Crisis” – he would have a blank look on his face.

Smalltalk?

Another blank look.

Smalltalk, remember wasn’t going to catch on because it is byte code interpreted on a virtual machine.

Up the horsepower and viola!  Java byte coded virtual machine a winner! For a while, as it made never get over J2EE.

So, Erland and Elixir are gold I tell you.  Best of both worlds.  Running on a virtual machine and functional.

That’s it.

That’s my rant over.

Pathetic.

 

How boring!

Posted in Doodling on July 23, 2016 by asteriondaedalus

My 5 C.H.I.P. have turned up.  I got a HDMI board as I will be for working Elixir port but the other 4 are destined for piping Airplay around the house.  I will need get four more later for shed, gazebo, pool area and Madam’s bathroom.

There is already a Airplay client install for the C.H.I.P. so a slow poke through first one to work out the process and then the other three will be a snap.

Just need to mull over speakers.

Wow

Posted in Doodling on April 16, 2016 by asteriondaedalus

Kennedy Space centre. Booked that sucker for Sunday. Today it’s air boats in the swamps around Orlando. Yes. That pesky conference that has taken up so much of my time is happening and so a few touresty things seem like the right thing to do.

It never rains …

Posted in Doodling on March 3, 2016 by asteriondaedalus

… it is pouring conference papers.

I have just had two more papers accepted at another conference so hobby things back on hold.

Still might do some more work on crawler this weekend while watching a movie.

Yeah I know…

Posted in Doodling on February 16, 2016 by asteriondaedalus

… but be fair.

My Uncle died.  My Mother in Law had a stroke the night before my wife was to fly out with me to my Uncle’s funeral.  My dogs ate some of the irrigation pipes.  And, I am in a fluster trying to get a paper out for a conference in the US.

I am, I promise, I will get back to dabbling.

 

Oh and all true.  When death confronts you, the things in life take on new meaning.

 

Now that’s a hobby space!

Posted in Doodling on January 5, 2016 by asteriondaedalus

20160105_205105

Of course it’s a new desk and storage unit.

And yes still setting it up but got waylaid by building a camera gimble that I bought.

Nope, not for that tired ARDrone which is more or less kaput.  Building a new quad from bits!  More fun that way.

Phew!

Posted in Doodling on January 2, 2016 by asteriondaedalus

Thank GOD! I bought a serial cable for the ODROID-W baseboard.

I was trying to setup a WiFi static address and must have blown the edit so I couldn’t get into my ODROID-W as I had lost both eth0 and wlan0.

Not to mention that I ran a apt-get upgrade which wipe my LCD setup – so I couldn’t even get in with USB mouse/keyboard.

All good, reset everything and up a running again – though I have to go back to drawing board to set the static IP up.  Likely should not be tippling on rum and scotch whilst telneting – yes I think that is a good rule.

The problem was that the DNS is updating my ODROID-W IP address and I loose connection in the middle of things like, say, installing node-red.

I also gave up on installing the emqttd after I found that the apt-get upgrade lifted my erlang install from 17 to 18.  The emqttd install notes warn that one must use 17 because of a memory leak problem in 18.

So, I installed mosquito to provide the mqtt server requirements from my house.  I guess I am building a thingyboxythingy then but with a much smaller footprint.

I may look at downgrading the erlang at least to allow for an emqttd install.  Still, the IoT aspects of the house won’t (or shouldn’t) know the difference.

Happy New Year by the way.

 

There goes that theory

Posted in Doodling, Hardware on December 21, 2015 by asteriondaedalus

As a kid we had an ultrasonic control for the television and I used to torment the dogs with it as they would react whenever it was used.

Fast forward and I am trying to find ways to keep out dogs out of patches of garden and especially the lawn.

So, why not I thought so I got a couple to three ultrasonic sensors for a mere couple of dollars each and threw one onto my trusty old (and expendable) MEGA 1280.

And…

Well either my boxerXstaffy is deaf or I suspect the power output of the tranducer isn’t high enough.

Begs the question then about some of the units you can by from China for a few dollars.

In any event, back to the drawing board.  I will likely need a more expensive and higher powered transducer.

In the meantime …

Posted in Doodling, Processing on August 14, 2015 by asteriondaedalus

… it occurred that fuzzy controllers might be possible in Processing if a fuzzy library was imported.  I opted to try out jFuzzylite as it appeared more compact than jFuzzyLogic.

I built the jar using ant and then imported it into a Processing sketch.  Just use “Add file” menu thus:

addfile

The modified example is coded below in Processing.  Quirk is it opens a small window (as expected) but fills the console with window event logging – as well as the intended print out at bottom.  So, needs some investigating but the fuzzylogic works.

jFuzzylite is also supposed to work with Android so I will switch the Android mode in and see what happens.  The fuzzy logic will be useful for the omni sensor app as the steering may need to be fuzzy to take account of the possible “noise” in the visual field.

Looking good.  Especially as it has a visual tool to design the fuzzywuzzyness that will export to various formats.

qtfuzzy

Very neat.

 __________________________________________

import com.fuzzylite.Engine;
import com.fuzzylite.FuzzyLite;
import com.fuzzylite.Op;
import com.fuzzylite.defuzzifier.Centroid;
import com.fuzzylite.imex.FldExporter;
import com.fuzzylite.norm.s.Maximum;
import com.fuzzylite.norm.t.Minimum;
import com.fuzzylite.rule.Rule;
import com.fuzzylite.rule.RuleBlock;
import com.fuzzylite.term.Triangle;
import com.fuzzylite.variable.InputVariable;
import com.fuzzylite.variable.OutputVariable;

Engine engine = null; 
OutputVariable power = null;
RuleBlock ruleBlock = null;
InputVariable ambient = null;

void setup() {
   engine = new Engine();
   engine.setName("simple-dimmer");
   
   ambient = new InputVariable();
   ambient.setName("Ambient");
   ambient.setRange(0.000, 1.000);
   ambient.addTerm(new Triangle("DARK", 0.000, 0.250, 0.500));
   ambient.addTerm(new Triangle("MEDIUM", 0.250, 0.500, 0.750));
   ambient.addTerm(new Triangle("BRIGHT", 0.500, 0.750, 1.000));
   
   engine.addInputVariable(ambient);
 
   power = new OutputVariable();
   power.setName("Power");
   power.setRange(0.000, 1.000);
   power.setDefaultValue(Double.NaN);
   power.addTerm(new Triangle("LOW", 0.000, 0.250, 0.500));
   power.addTerm(new Triangle("MEDIUM", 0.250, 0.500, 0.750));
   power.addTerm(new Triangle("HIGH", 0.500, 0.750, 1.000));
 
   engine.addOutputVariable(power);

   ruleBlock = new RuleBlock();
   ruleBlock.addRule(Rule.parse("if Ambient is DARK then Power is HIGH", engine));
   ruleBlock.addRule(Rule.parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
   ruleBlock.addRule(Rule.parse("if Ambient is BRIGHT then Power is LOW", engine));
   
   engine.addRuleBlock(ruleBlock);
 
   engine.configure("", "", "Minimum", "Maximum", "Centroid");
 
   noLoop();
}
void draw() {
   StringBuilder status = new StringBuilder();
   
   if (!engine.isReady(status)) {
      throw new RuntimeException("Engine not ready. "
      + "The following errors were encountered:\n" + status.toString());
    } 

   for (int i = 0; i < 50; ++i) {
      double light = ambient.getMinimum() + i * (ambient.range() / 50);
      ambient.setInputValue(light);
      engine.process();
      println(String.format( "Ambient.input = %s -> Power.output = %s",
      Op.str(light), Op.str(power.getOutputValue())));
   }
}

Try, try again.

Posted in Chase That Dog!!, Doodling, Vision on July 19, 2015 by asteriondaedalus

After breaking the setup my Processing for Android installation, I opted to rip out the Android SDK, rip out Processing, delete all remaining files and folders and environment variables.

I then re-installed Processing and let the fresh Android Mode install the Android SDK (rather than hook into my own  installation).

A little wrestling with the permissions on the sketch for the camera and I was (finally) able to get both my front and my back camera running on my Samsung S2.

Now we are away with modifying a bloggie lens to sit on the phone and to use the processing unwrapping of the bloggie image to knock up a collision sensor.

Cyclops!

One snazzy sensor