Archive for May, 2017

Why priori knowledge is so irritating

Posted in Factor programming language, FORTH is it dead or isn't it? on May 20, 2017 by asteriondaedalus

Something so simple, if you have example code on your blog why on earth do you not included the includes.  Priori knowledge is not immediately explicit.

I bumbled through the example of constraint based programming in Factor.  Go figure, the actual code should be:

USE: backtrack
USE: locals

:: solve-711 ( -- seq )
    711 iota amb-lazy :> w
    711 w - iota amb-lazy :> x
    711 w - x - iota amb-lazy :> y
    711 w - x - y - :> z

    w x * y * z * 711,000,000 = [ fail ] unless

    { w x y z } ;

Run it with:

IN: scratchpad solve-711 .

Still, the debugging is fantastic and will suggest vocabularies to include (which helped sort out the missing “includes” aka USE:).

Interestingly Factor has a vocab “models” which sniffs a bit like the idea of models, in the first instance from MVC, but then subtly not unlike the way “model” is used in Elm and therefore Functional Reactive Programming.  Cool.

Although, its Concatenative Reactive Programming really – although that’s postfix functions rather than prefix.  Cool.

The difference is important though.  Elm “compiles” to JSP to “compile” to byte-code to run on the JVM.  In Factor, you are reactive in Factor.

Now, the key difference between Factor and Forth here is that Forth is for embedded systems.  Factor is not.  While you can squeeze Forth onto an AVR chip, they don’t even bother anymore with Factor on ARM.

Still, I get a queasy feeling it’s the FORTH community all over again.

It has just occured to me …

Posted in Chapel, ConCurrency, Erlang, ODROID-C1, Parallel Talk, Parallella on May 19, 2017 by asteriondaedalus

… what a coincidence.

The Parallella and the Odroid-C1 PCB are same size (almost).  Is that Feng Shui, synchronicity or serendipity?

Pity the post holes don’t line up.

Swapping out …

Posted in MQTT, node-red, Orange Pi on May 19, 2017 by asteriondaedalus

… or in.

To give my cluster back an ODROID-C1, I got a 512M Orange Pi to host the mqtt and node-red for my house automation.  It is tini, even with the case ( a couple of max boxes in size ).  So, un-obtrusive to boot.

I will get a couple more once I have sorted some software to monitor my barking dogs.    Python based signal processing to detect the dog back and then, perhaps, hooked into sprinkler zone the dog barking is detected in.

I have an IR sprinkler guarding the side of the house.  Neighbors complained that they’d been barking daily for 12 months, why wait 12 months before telling me?  So they became set in their ways.  However, the sprinkler works the dog psychology as it breaks the fixation on the noise.

However, of course, I want to be a little more sophisticated.  I want to record the activity so I will get a camera for the OPi later.  Wifi it up to the home PC.  Because it has GPIO ports it could also drive a solenoid valve, a horn or a shaker (marbles in a coke can will distract the dog as it doesn’t like that type of noise).

Untitled

Parallela turned up so it and the C1 will be fitted this weekend.

I relented on the idea of an old multi cpu server.  I am fickle … I know.

Quality Control

Posted in Sensing on May 13, 2017 by asteriondaedalus

So, I decided to put a dispute into Aliexpress to get half my $5 back on the lens I ordered.

No markings so you can’t easily tell what focal length it is supposed to be.  Go figure, I pinged the vendor and asked how they know what lens to send if there are no markings and they “apologized” as they couldn’t tell me what focal length it was.

On principle then I will try to get half my money back, which is likely less than the transaction fees on VISA card but will make the vendor think about their quality control – I hope.

Go figure, in the end I found a couple of 2.8mm f/l lens that are marked and decided I can play with the one I have and get an even tighter f/l in which (again) increases the maximum velocity over the ground the sensor can be used for BUT IMPORTANTLY that means I can trade that off and get the sensor closer to the ground for use on my rock crawler.  The 3.6mm “imposter” does bring the sensor height down but it also has a 90 degree field of view which constricts it somewhat.  Any hint of motion in the field of view goes towards the odometry doesn’t it!

The options I had were 100 degree and 110 degree field of view.  I opted for the 2.8mm f/l 110 degree to get more image crammed in.

Arrrrrrrrrrrrrrrrrrrrrrrrrrrrr…

Posted in Help Request on May 10, 2017 by asteriondaedalus

…rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrggggggggggggggggggggghhhhh!

The new lens turned up for my PX4FLOW BUT, of course, it cam wrapped in foam, no details and no markings to confirm it is, in fact a 3.6mm f/l.

How on earth do I work out if they sent me the right one?  I have to set up an optical experiment.

Hmm.  The image size was much bigger on the 16mm f/l that came with the Pix4Flow.  I had it looking at a small pewter mug, with raised relief, I have my pens and pencils in.

At the same distance, the new lens shows most of the mug, while the olde lens is zoomed right in on the raised relief.  This is what I expect (here is a calculator to play with).

It will likely do.

Here is the lens for sub $5.