Friday, September 15, 2017

A much more global view

My previous post was deliberately (self consciously?) Australian in scope. Of course there is a bigger, global, picture. This post is about that.

  1. A global "speculation tax"

    A substantial component of the inequality that besets the world, not to mention the financial craziness that gave us the Great Depression and the Global Financial Crisis, is driven by speculative trading in the stock market. These days much of that is done by computer.

    The idea of a small, fraction of a percent, tax on those trades is quite actively considered and this Wikipedia page discusses it. Within the page look for Securities transaction tax.
  2. Universal Basic Income

    A reasonable living wage, regardless of employment is called the Universal Basic Wage

    Again this is a ripe chestnut of an idea as this YouTube about doing it in the USA shows.

    I have seen, but cannot track down, a post that relates these two. The rate of global tax to pay the basic income to 8 billion people was tiny.

    The beauty of this is that robots and artificial intelligence can end as much work as they need to - yet there will still be people paid wages to consume what the robots make. Without this the factory owners are on a hiding to nowhere. Karl Marx called that the fundamental contradiction of capitalism

    What's more, as has been seen in many developed European countries economic security leads to smaller families and hence a stabilisation of world population.

    Something that I would throw in here is the idea that a condition of receiving the basic income be a maximum of two children. More children, as many religions might dictate, and you would simply have to work.

    My personal wish is that this would lower religiosity - the underlying cause of most conflict and terror. Peace in the Middle East?

    Also throw in the cheapness, technology driven, of things The $10 Android Smartphone and Elon Musk's, soon to come, global WiFi make life, growing up in Africa on the Basic Income, very different.
  3. An end to Majority Governments

    The fine balance, in the English speaking world, between the left and right leads to political absurdities. In Australia the bizarre deals with the independent senators thrown up by preferential voting. In the UK the Ulster weirdos that keep Theresa May in power. The US government shutdowns from a power block in the Houses.

    Underneath all of these lie the lack of a convincing middle ground in politics. In many European countries coalition governments, amongst middle size parties, results in negotiation that is about policy - how precisely to reach a generally agreed endpoint - rather than dogma.
  4. An end to Home Ownership

    Again referencing what is more normal in Europe. The approach to a secure home where you might install solar panels or upgrade the kitchen. Rents are controlled. Lifetime tenancies are the norm. Inheriting property, or bequeathing property, is not "a thing"

    The speculative craziness that underlaid the GFC, that besets Australian property values, is not necessary. It is what banks and investors want.
  5. Universal Renewable Energy

    If energy were cheap, and harmless, a lot would be different.

    The one I light upon is desalination which could, potentially, turn the Sahara (back), not to mention Australia into fertile, arable land along with lowering global sea levels which have, sad to say, "got away from us"

    The state of Climate Modelling is probably such that this last idea could be checked out
  6. Electric, Autonomous, Non-owned vehicles

    Summoning up the transport that you need, regardless of age (kids going to school, those who are too aged or infirm to still have a driver's permit) without needing to afford ownership would be world-changing.

    Not to mention that these vehicles already last a million kilometers and have so few moving parts.    

Monday, August 21, 2017

What could be passed if the Coaltion looses control of both Houses after the High Court

The easy one is marriage equality but there is much more exciting agenda and it goes like this.

  1. An end to negative gearing
  2. National introduction of controlled rents
    As common in many European countries this results in stable, long term tenancies and therefore a reduction in home ownership. Less home ownership means that parents whose children have left home are more likely to move into smaller, lower rent accommodation.
  3. Fibre to the home NBN
    This increases the proportion of the population that can work from home and hence less transportation costs to those families and less transport infrastructure development costs to State and Federal governments.
  4. An ambitious shift toward renewable power sources coupled with carbon pricing to stimulate innovation.
    This would halt the rise in power prices and it would also facilitate large scale desalination.
    Large scale desalination would have two very favourable side-effects:
    - Significant volumes of water would be removed from the oceans, reversing the already irreversible rise in sea level due to climate change
    - Significant, currently uninhabitable, areas of Australia could be farmed and inhabited meaning that a more relaxed immigration policy, leading to a higher population, could be considered.
  5. A shift toward autonomous vehicles.
    This would lessen the need for vehicle ownership. Coupled with more flexible work times this would also stabilise transport infrastructure costs.
  6. The effect of 2, 3, 4 and 5 would be to stabilise family or individual living costs such that a social wage could be paid to all adults of working age regardless of whether they worked. (as in Finland)
     level of this wage could be tied to the controlled rent being paid and hence the overall cost to government limited.
    This could also be limited by not making this social wage available to those who, for religious or other reasons, insisted on more than two children for two adults
  7. The submarine building program, and warplane purchasing plans could be abandoned. Apart from discarding the pretence of mid-century "defence planning" in 2015 Federal expenditure would be saved. The employment argument that has, so far, pertained would be discounted by the social wage

Tuesday, March 7, 2017

Those Google blog emails...

A way to keep track of a blog is to sign up by email. This means that each time there is a new post on the blog you will receive an email.

I have MS so I follow the Barts MS blog put out by the St Bartholomew’s Hospital in London. I read each post carefully, often comment if I can contribute something useful and, in many ways, am the ideal [not to mention humble ;-) ] blog user. I say this with authority as my TrailRider Tales blog has almost 70,000 page views.

Of course I then save the emails so that I can go back to the posts and that's where the problem begins. My email folder ends up looking like this and it is hard to find a particular post because the Subject of the email does not include the post title

To fix this you need to be clear whether your blog is on the Google Blogger platform. You will know. If it is then your email subscriptions are handled by something called Feedburner which, once you are logged in will take you to your feeds and it is the default setting for the Subject of the email sent that is causing the problem. This post will show you how to change that.

Start by clicking on the name of your blog and then select the Publicize tab

Next use the Email subscriptions link, on the left, to view this page. Almost there...

Now you will see a new link, Email branding at the left which will display this page:

It is the HOT TIP on the right that is the answer to all your prayers. 

Add ${latestItemTitle} to the beginning of  Email Subject/Title and click Save at the bottom.

Important to note - those are squiggly brackets - { }

This works brilliantly

Tuesday, January 31, 2017

Gmail - select BCC recipients from your Contacts list

OK, this is the scenario - you want to send fro m Gmail to multiple recipients selected from your Contacts list. Easy eh? You select the contacts (or select All) and then hit the little envelope button.

There's just one problem - all these addresses end up in the To field. They can see each other's addresses and, perhaps more dangerously, spammers can.

Moving these addresses into the Bcc field was not a self-evident thing to do.

This is what you do:

  • Check the contacts you want to send to
  • Click the envelope button to open a new email. All the contacts you selected will be in the To field
  • Click in that field and select Bcc at the right
  • Click on the last contact and use Shift-Up arrow to select all the contacts
  • Use Ctrl-X (Command-X on a Mac) to cut them
  • Click in the Bcc field and use Ctrl-V (Command-V) to paste them
  • Don't forget to write the email!

Sunday, May 4, 2014

Facebook scraping Blogger post descriptions

It is a very long time since I've posted here. Really this blog is reserved for truly nerdy "ahah" moments and I've just had one. 

When you plug a blog URL into a Facebook post FB goes away and "scrapes" the URL looking for certain information which it then uses in the post. Two items matter:

  1. A picture that comes from the blog post along with arrows to select if there's more than one and the ability to upload something completely different.
  2. Some text which is highlighted and can be changed. In theory this text comes from the blog post.
The problem with a Blogger Blog is that this text is the same for every post - it is simply the blog's description text

Of course I read around this. If the blog contains Open Graph tags then the og:description tag content will be used but this means that every post will need to be html-editted to add this tag with an appropriate value. Not good - we want something that automatically applies to every post.

In the absence of og tags the scraper looks for the first occurrence of a <p> tag and uses the text it finds there.

That leads to the first, smaller "ahah" moment The reason the blog description keeps getting found is that it is within a <p> tag. At the foot of this post you will find some suggestions about working with Blogger HTML but for now take it on trust. This fragment, using a <p> tag, causes the scraper always and only to find the description text:
  <div class='descriptionwrapper'>
    <p class='description'><span><data:description/></span></p>
If the <p> tags are changed to <div> tags this is fixed:

 <div class='descriptionwrapper'>
    <div class='description'><span><data:description/></span></div>

So far so good but the next bit of <p> tag enclosed text is in the comments header and we don't want that either. What we want is the first paragraph or so from the post body. Start by locating this piece of HTML:

      <div class='post-body entry-content' expr:id='&quot;post-body-&quot; +' itemprop='articleBody'>

This is the occurrence of post.body that actually appears online. If you modify this as below all posts on the blog will be scraped appropriately,

      <div class='post-body entry-content' expr:id='&quot;post-body-&quot; +' itemprop='articleBody'>
       <p> <data:post.body/></p>

Working with Blogger HTML

  1. Use Template/Backup to backup your existing template in case you blow it
  2. Use Template/Edit HTML
  3. Note that sections are collapsed which makes searching for stuff difficult - but there are line numbers
  4. Use an editor with line numbers (I use Context) to edit the backup XML file and find things. Note the  line number. Do not modify this file.
  5. Find the line number in the Blogger editor, make changes, and save the template
  6. Try starting a FB post for one of your posts - use the full post URL

Monday, April 22, 2013

A tale of ten Nexi - a Google Nexus classroom

This is the story of organising a classroom set of Nexus pads so that a series of workshops can be given in a number of locations. The issue is to make sure that each user, in each workshop, starts out with a pad in a clean state.

If the state required was the standard factory state there would be no problem but each workshop requires a different configuration so the problem becomes one of managing multiple Android images across multiple devices.

Clearly the keys are:
  • A recovery image program on each device
  • A USB storage device that can be moved between devices
Taking these two requirements leads quite directly to the TWRP (Team Win Recovery Project) image as this has clearly enunciated support for an external drive.

The USB device needs to have power requirements that allow it to be seen by the Nexus and this has meant that only my newest thumb drive would do.

Recovery images are quite large so the next problem is to make sure that only one copy of  each image needs to be stored. Linking between files or directories is not available in FAT32. It is availale in NTFS but TWRP cannot read NTFS. This means an ext filesystem must be used on the memory stick.

The directory structure for multiple devices backed up to a single USB drive is as shown with a cryptically named directory to identify the device and named folders within for each backup.that contain the backup files.

The simplest approach might be to have actual backup files in the directory for for one device and then symlink the other folders for the other devices to that one copy that contains the actual files. However TWRP does not handle softlinks so the problem has to be solved with hard links to the individual files. Hard links are incontrovertible in the ext file system - there is an actual inode that references the file so TWRP uses them correctly,

To summarise a structure is required where there is a single copy of each workshop's backup along with hard links from the corresponding folder for every other device.

In practice it is convenient to have a single "master device" for each workshop so the arrangement of linking is relatively complex and handled by a script.

# Identify the four devices that will be used to work on
# and backup the device image


# The current directory when running the script is the
# one named BACKUP,that is the parent of all the device
# thus $dirs will contain a list of the devices


# Make sure that at least one device has directories
# for each of the images

mkdir $master0/StockRooted
mkdir $master0/Workshop1
mkdir $master0/Workshop2
mkdir $master0/Workshop3

# $subdirs will contain the names of all the images

subdirs=$(ls $master0)

# For each device...

for dir in $dirs

# For each image...

for subdir in $subdirs

# Figure out if the actual image files are stored here

if [ "$subdir" == 'StockRooted' ] && [ "$dir" == "$master0" ]
echo "$master0 found"
if [ "$subdir" == 'Workshop1' ] && [ "$dir" == "$master1" ]
echo "$master1 found"
if [ $subdir == "Workshop2" ] && [ $dir == $master2 ]
echo "$master2 found"
if [ $subdir == "Workshop3" ] && [ $dir == $master3 ]
echo "$master3 found"

# If we get here this was *not* one of the master images
# Figure out which one it was..

case $subdir in
'StockRooted') master=$master0 ;;
'Workshop1') master=$master1 ;;
'Workshop2') master=$master2 ;;
'Workshop3') master=$master3 ;;

# Get rid of what was there and build a new directory

rm -r $dir/$subdir
mkdir $dir/$subdir

# Figure out what files are in the master image and
# hardlink to them

files=$(ls $master/$subdir)
for file in $files
ln $master/$subdir/$file $dir/$subdir/$file
chmod -R 777 *

Thursday, August 16, 2012

Back to life

Back to life

I haven't posted much here recently - not that I haven't been busy fiddling with things - so this is my public (!) resolve to start writing again about the things I'm absorbed in. 

This means more than just the nerdy stuff - here, for now, are my passions:
  • The TrailRider all-terrain wheelchair which I experienced in Canada and on my return to Australia introduced to Parks Victoria. There are 5 now in Victoria and I will write a page that pulls together the current state of things.
  • The Folding Bedpole is something that a disabled person on the road would kill for. Something that fits into a suitcase yet will expand in the hotel to slide under the mattress and make it possible to turn over in bed. I have had a crude prototype made and am about to commission two better-looking ones.
  • Renewable Newstead is the local community organisation that seeks to see our small town supplying all its energy needs. This will most likely involve some intermittent (sun,wind) generation and therefore grid-level power storage becomes crucial. Watch the site at
  • Many nerdy ventures chiefly centering at the moment around Android devices.
Talk soon