Cuminestown Art Group Annual Art Exhibition

The Cuminestown Art Group held their Annual Art Exhibition at St. Luke’s Hall, Cuminestown, running from Friday 16 June to Sunday 18 June. Entry was £3, but included some very nice refreshments as part of entry. The organisers engaged visitors in conversation, and enquired into their interests in art.

There was a raffle and a chance to vote on your favourite painting. I struggled to chose my favourite between about six paintings, but in the end selected Loch au Eilan (sorry, I forget the exact title) by Miraya Peters. It appears in the bottom right of the last photograph of this blog entry.

The organisers were kind enough to let me take photographs of the exhibition. My snaps do not show the complete display of paintings.

DSCF0003.JPG

DSCF0001.JPG

DSCF0002.JPG

 

Posted in Grampians, Uncategorized | Tagged , | Leave a comment

SGI – Stanley Gibbons – drops 20%

SGI drop 20% today to 10.5p on its announcement of strategic review and formal sales process. Paul Scott’s stand-in comments on the news over at Stockopedia (http://www.stockopedia.com/content/small-cap-value-report-12-june-2017-sgi-motr-ntbr-kbt-trd-193329/):

> So I’m not tempted to dabble in SGI shares in these conditions.

SGI has a stock rank of 25, and is classified by Stockopedia as a Value Trap.

I last wrote about SGI back in Nov 2015 (https://mcturra2000.wordpress.com/2015/11/20/sgi-l-stanley-gibbons-a-comment-on-the-balance-sheet/), where I said that

> I think that this company is a lot weaker than many realise.
Those words have turned out to be prophetic indeed. The share price was 97.99p at the time. I had noted that it had negative free cashflow for at least three years. That trend has continued. Its net debt is close to its market cap, a sure sign that the company is in distress.

It appears that some bulletin board posters are expecting nothing less than 20p per share from a takeover. Given that the shares currently stand at about half that price, and the shares have never reached 20p in the past year, I would say that an offer of 20p is unlikely.

10.5p

Posted in Uncategorized | Leave a comment

Switched my dad from Linux to Windows

My dad was experiencing some problems with an ageing LXLE Linux distro. It was becoming mysteriously slower. I did a full upgrade, but still no joy. So then I downloaded the latest version of LXLE, installed it, and updated the sytem. Unfortunately, there seems to be a bug in either the screen saver or power manager, as the screen becomes blocky after leaving the machine for awhile.

I could not handily locate the settings. Seeings I had a spare copy of Windows 7 professional, I decided to install that instead. So far, so good.

LXLE is based off of Ubuntu Stable. Unfortunately, I think that there is a distinct lack of quality control with many so-called stable distributions.

It’s undoubtedly about this time that Linux advocates offer their “why don’t you try” lines. My short response is: no. The longer answer is: trust me, I am an expert Linux user, and the answer is still “no”. Debian Stable is too old for me, Ubuntu’s usability is not quite what I want, Fedora is highly crash-prone, and so on, and so forth.

Posted in Uncategorized | Leave a comment

Magic Hat – EPWN in, KCOM out

The MHP (Magic Hat Portfolio) on Stockopedia (http://www.stockopedia.com/fantasy-funds/magic-hat-463/) is an experiment by me to see if a human can improve on a mechanical Greeblatt Magic Formula screen. I am trying to weed out “mistakes” that I feel the screening commits: unseasoned companies, scams, foreign companies (particularly Chinese), fishy accounting, and statistical quirks. Apart from that, I am agnostic as to the sector the company operates in, although I will try to avoid heavy concentration in any one sector. I will mostly apply “Strategic Ignorance”, by which I mean that I wont try to be clever in my stockpicking. My picking will be mostly mechanical. A summary of most of my Magic Hat articles can be found on the web page http://www.markcarter.me.uk/money/greenblatt.htm This will allow you to see, at a glance, what shares have been bought and sold in the past, as well as what shares have been rejected from consideration and why.

KCOM is ejected from the portfolio by rotation, having lost about 17%. Its shares fell off a cliff in late November 2016 on the back of poor interim results. Personally, I would have sold the shares on such an announcement, but that’s not how this portfolio operates. The shares have traded sideways since then, so it would not have been a bad idea to sell. I have been itching to eject this share from the portfolio for many months.

EPWN (Epwin Group) joins the portfolio. Epwin Group Plc is a manufacturer of extrusions, moldings and fabricated low maintenance building products, operating in the repair, maintenance and improvement, new build and social housing sectors. I selected it on the basis of Stockopedia’s Greenblatt Magic Formula Screen, eliminated those companies with a StockRank less than 90, and selected the stock with the highest Value score.

The portfolio has done well for itself, with 3 of the 12 shares having more than doubled. In my books, that’s good.

Posted in Uncategorized | Leave a comment

Magic Hat – WIN stays in

The MHP (Magic Hat Portfolio) on Stockopedia (http://www.stockopedia.com/fantasy-funds/magic-hat-463/) is an experiment by me to see if a human can improve on a mechanical Greeblatt Magic Formula screen. I am trying to weed out “mistakes” that I feel the screening commits: unseasoned companies, scams, foreign companies (particularly Chinese), fishy accounting, and statistical quirks. Apart from that, I am agnostic as to the sector the company operates in, although I will try to avoid heavy concentration in any one sector. I will mostly apply “Strategic Ignorance”, by which I mean that I wont try to be clever in my stockpicking. My picking will be mostly mechanical. A summary of most of my Magic Hat articles can be found on the web page http://www.markcarter.me.uk/money/greenblatt.htm This will allow you to see, at a glance, what shares have been bought and sold in the past, as well as what shares have been rejected from consideration and why.

This is another quiet month, like last month. Industrial transportation company WIN (Wincanton) is due for eviction from the portfolio today. It still passes the Greenblatt Screeen, and has a Stockopedia StockRank in the 90’s. So it stays in. Stockopedia classifies as it as a Turnaround, according to their new system that they introduced today by webinar.

Posted in Uncategorized | Leave a comment

LRD – Laird – update, and case study

LRD (Laird) is a company that I have disparaging rather uniformly. I had sold out in Oct 2016 a 159p, having bought in Jan 2016 at 354p. BUT, I think emergency rights issues make interesting material for investigating special situations.

Companies land themselves in hot water, and are often forced to have a rights issue at precisely the wrong time in the cycle. We saw that happen with at least one builder a few years ago, for example.

But the theory is, that provided the business is reasonably viable, these types of rights issues are actually buy signals. That was certainly the case with builders. It did not work out well with PFD (Premier Food), however. Perhaps this type of investing is more suitable for investing in cyclical companies, though. I’m not sure how investors in LMI would have fared. I will need to investigate that a little further.

On 4 Apr 2017, the New Shares were issued to the market. The shares closed at 147p. The shares declined steadily thereafter, reaching a low of ~138p on 26 Apr.

LRD issued a trading update on Fri 28 Apr, sending the share price up 6.2% to 150p at the close. So the market clearly liked the results.

So let’s see if LRD can beat the market over one year, assuming a purchase price of 150p.

150p. ASX 3962

 

 

 

 

Posted in Uncategorized | Leave a comment

Toying with a data query #grammar in #perl6

I have written an accounts package in C++. I have a minuscule knowledge of COBOL which ought to be well-suited the task, but I have found it almost cumbersome to wrangle. COBOL is still interesting in the sense that it tries to be a declarative language for exactly this kind of domain.

The thought occurred to me that it would be great if we had a much better DSL for handling data. COBOL, but better, plus SQL, but better, and as a first-class construct of the language, and untethered to a database.

Perl6 seemed an obvious choice to use for this purpose.

My experiment is very preliminary at the moment, and the code consists of ~100 lines. You can view the complete source here.

So, you create a record structure like so:

record person
        name string;
        age  int;
end-record

That’s not spectacular so far, of course. Pascal, COBOL, C, etc. already give you syntax for creating structures. It’s where we’re going that is perhaps more important. The grammar for this is straight-forward:

grammar rec {
	token TOP { * }	
	token record-spec { * 'record' \s+  +  'end-record'  }	
	token rec-name { \S+ }
	token field-descriptor { *  +  * ';' }
	token field-name { \S+ }
	token field-type { <[a..z]>+ }
	token ws { <[\r\n\t\ ]> }
}

Due to my newness with P6 (perl 6), construction took a long time. I should also probably be working in terms of rules and protos instead of just using tokens all the time. The feature set of P6 is vast, so just getting something working is good enough for me at this stage.

Two classes naturally suggest themselves: Fields, which store information about the name and type of a field, and Recs, which aggregate the fields into a record. The definition of a Field is straightforward:

class Field {
        has Str $.namo is rw;
        has Str $.type is rw;
}

A Rec is a little more complicated:

class Rec {
        has Str $.namo;
        has Field @.fields;
        has %.flup; # look up from field name to an indexed number
        has @.fnames; # field names

        method add_field(Field $f) {
                @.fields.push: $f;
                @.fnames.push: $f.namo;
                %.flup{$f.namo} = %.flup.elems;
        }
}

‘namo’ is the name we want to assign to the record, and ‘fields’ is a list of the component Fields. We also want a couple of convenience variables: ‘flup’, to obtain an index number for the position of field, and ‘fnames’, just the names of the fields as an array.

We create a class of actions, qryActs, which creates some data structures for us:

class qryActs {
	has Rec %.recs is rw;

	method record-spec ($/) { 
		my $r = Rec.new(namo => $.Str);
		for $ -> $fd {
			$r.add_field($fd.made);
		}
		%.recs{$.Str} = $r;
	}

	method field-descriptor ($/) { make Field.new(namo =>$.Str, type => $.Str); }
}

We parse our textual description ($desc) of the record(s) using:

my $qa = qryActs.new;
my $r1 = rec.parse($desc, :actions($qa));

and we extract the column names for the record like so:

my @cols = $qa.recs{"person"}.fnames;

Let’s define some inputs to play with:

my $inp = q:to"FIN";
adam    26
joe     23
mark    51
FIN

and extract them to an array of arrays, splitting up the input by newlines and whitespace:

my @m = (split /\n/, (trim-trailing $inp)).map( -> $x { split /\s+/, $x ; } );

‘@cols ‘ is useful, because we can use the P6 module ‘Text::Table::Simple’ to print a table:

sub print_table(@data) {
        lol2table(@cols, @data).join("\n").say;
}

and print out what we have so far:

print_table @m;
O------O-----O
| name | age |
O======O=====O
| adam | 26  |
| joe  | 23  |
| mark | 51  |
--------------

Ideally we want to incorporate this into our grammar; perhaps something like this:

import tabbed file "mydata.txt" of person into people
show people

An inlining facility would be useful. There is a world of possibilities for importation. We may want to import CSV, QIF files, all sorts. Perhaps some way is required to extend the language given the general nature of importation. Or perhaps an external utility would be a better and more flexible approach.

What we would like next is a way to filter data. Suppose we wanted a table of all people who were less than 50 years old. We want to write ‘age < 50’ for such a query. I created a new grammar to handle that:

grammar predi {
        token TOP { <ws>* <arg> <ws>* <rel> <ws>* <arg> <ws>* }
        token arg { <field-name> | <value> }
        token field-name { <[a..z]> \S+ }
        token value { <[0..9]>+ }
        token ws { <[\r\n\t\ ]> }
        token rel { '<' }
}

and a function that calls the grammar to create a subset:

sub filter-sub($pred-str) {
        my $pr = predi.parse($pred-str);

        sub get-val($idx, $row) {
                my $v = $pr<arg>[$idx];
                my $ret;
                if $v<field-name>:exists {
                        my $fnum = $qa.recs{"person"}.flup{$v};
                        $ret = $row[$fnum];
                } else {
                        $ret = $v<value> ;
                }
                $ret;
        }

        my @filtered;
        for @m -> $row { 
                my $v1 = get-val(0, $row);
                my $v2 = get-val(1, $row);
                if $v1 < $v2 { @filtered.append: $row; }
        }
                        
        @filtered;
}

The grammar is only primitive at the moment. It does not allow for logical operations, and has ‘<‘ hard-wired as a comparison operator. Still, it is at least possible to do:

my @some = filter-sub("age < 50");
print_table @some;
O------O-----O
| name | age |
O======O=====O
| adam | 26  |
| joe  | 23  |
--------------

How cool is that?

There are many many directions that this idea can expand in. The predicate logic really needs to be completed and merged in with the main grammar as a first step.

One possibility for extension: maybe we do not know the names or the types of the records initially. So there would need to be a way of creating data structures on the fly, as you might need for a generic dataframe library.

Conversely, maybe you do know the record layout ab initio, and you could like to generate static C++ or COBOL code as a back-end. You would then be able to create a processor that is very fast.

Other obvious extensions: support for derived fields, report-writing, nested records, user-level record editing, table joining, heuristics for guessing datatypes (think dataframes), statistics, effortless serialisation, and grouping.

One last thing. Although the idea of using natural languages for programming is discredited, I’m wondering: what about constructed languages? Here, I am thinking along the lines of Esperanto or Lojban. Experanto, because you can always deduce the object, subject, adjectives, etc. in a sentence merely by looking at the word. Lobjan because it is apparently an unambiguous language aimed at the precise expression of ideas. An idea so insane that it might just work?

 

Posted in Uncategorized | Leave a comment