A Programming “20 Minute Challenge”, NodeJS, VS Code, Project Oxford

So I tried a “20 Minute” challenge on my macbookpro and entered hell. The Project Oxford API was not responding when I ran it.
Problem with my tool installation, firewall, them? Who knows?
So I dug into the installation logs and found a problem with a missing file from the installation of the dependencies for the project. Not saying this was the problem, but it had a big smell about it.
Tried to Full Stack Overflow my way out of it, but didn’t find much.
This challenge may work on a clean machine that isn’t used for daily hacking but my machine was not that machine.
I tried using my Windows 10 image but hit hurdles trying to follow their instructions.
So I was going to have to understand the problem. Back to the mac.
Cloned NodeJS/Node from Github to copy the supposed missing file to the place it was missing. I sensed a bigger issue in the configuration for the mac but I was too much a noob to Nodejs to know better.
That caused trouble:
npm install —save  in the project directory
➜ bobblegit:(master)✗npm install --save gifencoder
bobble@0.0.0 /Users/mo/Dev/node/bobble
└── gifencoder@1.0.6 
➜  bobblegit:(master) ✗ npm install --save jimp      
> node-zlib-backport@0.11.15 install /Users/mo/Dev/node/bobble/node_modules/node-zlib-backport
> node-gyp rebuild
  CXX(target) Release/obj.target/zlib/src/node_zlib.o
In file included from ../src/node_zlib.cc:32:
/Users/mo/.node-gyp/5.11.0/include/node/node_internals.h:6:10: fatal error: 'util-inl.h' file not found
#include "util-inl.h"
         ^
1 error generated.
make: *** [Release/obj.target/zlib/src/node_zlib.o] Error 1
gypERR!build error 
gypERR!stack Error: `make` failed with exit code: 2
gypERR!stack    at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gypERR!stack    at emitTwo (events.js:100:13)
gypERR!stack    at ChildProcess.emit (events.js:185:7)
gypERR!stack    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gypERR!System Darwin 15.4.0
gypERR!command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gypERR!cwd /Users/mo/Dev/node/bobble/node_modules/node-zlib-backport
gypERR!node -v v5.11.0
gypERR!node-gyp -v v3.3.1
gypERR!not ok 
npmWARNinstall:node-zlib-backport@0.11.15 node-zlib-backport@0.11.15 install: `node-gyp rebuild`
npmWARNinstall:node-zlib-backport@0.11.15 Exit status 1
bobble@0.0.0 /Users/mo/Dev/node/bobble
└─┬ jimp@0.2.22

sudo didn’t help either.
Led to here:
This led to:
npmERR! node-zlib-backport@0.11.15 install: `node-gyp rebuild`
npmERR! Exit status 1
npmERR! 
npmERR! Failed at the node-zlib-backport@0.11.15 install script 'node-gyp rebuild'.
npmERR! Make sure you have the latest version of node.js and npm installed.
npmERR! If you do, this is most likely a problem with the node-zlib-backport package,
npmERR! not with npm itself.
npmERR! Tell the author that this fails on your system:
npmERR!    node-gyp rebuild
npmERR! You can get information on how to open an issue for this project with:
npmERR!    npm bugs node-zlib-backport
npmERR! Or if that isn't available, you can get their info via:
npmERR!    npm owner ls node-zlib-backport
npmERR!There is likely additional logging output above.

Created a Node Azure machine hoping for better luck. Not so.
Tried on Azure Windows 10, got an InvalidImageSize error.
Tried on mac and parallels Windows 10, and got timeout.
Installed Node 6 on mac that was just released yesterday.
Redid installation of node, express, etc. on mac:
InvalidImageSize error on different images sizes and types.
“Image size is too small or too big.”
This was progress. Going from timeout to error is a big gain.
Apparently if I can send an http path instead of local image path, this bug won’t occur. Couldn’t get it to work without changing too much code for a 20 minute challenge. Put on the back burner.
Also, apparently if I put a .jpg on the end of the file that gets sent to Project Oxford, it will work. Not so.
I subscribed to two bug reports on github for the next move and am now waiting…
Apparently the problem was a regression issue where streaming no longer recognised the file type from the stream contents. Local file names without an extension that gave the game away with respect to the type of file now cause a problem. Not sure if that covers the problems I have experienced, though.
A pull request to fix the issue has been submitted. Stay tuned.

Moving old code to new platforms

We are starting a project to build a transpiler. I did it a long time ago (1996) when I converted some aspects of a young version of javascript into the English language and converted language phrase selections back into javascript. One can do it by brute force or with finesse. I did it by brute force at the time.

The new transpiler project is here:

https://github.com/allballsin/upgrade-suite

Macbook Pro Repeated Boot Kernel Panic Scare

I was computing away on the train this morning, buy viagra when suddenly I couldn’t use Evernote any more because of an invalid security certificate. This was not what it seemed, and sure enough Safari started showing a bunch of blank security certificates. I closed down the computer and restarted. And received a kernel panic about 10 seconds into the boot before it restarted continually.

tl;dr – Problem solved!

Thankfully that I had backed up on Time Machine the night before, I booted off the backup drive and went into the Disk Utility. I couldn’t repair the SSD because I couldn’t unmount it. The Unmount button didn’t work.  The computer wouldn’t boot into safe mode.

I rebooted from a Recovery DVD (although I could have done it the boot from the Time Machine too)

What unmounted it was selecting the disk in Disk Utility and selecting Info to get the name of the disk – for me it was disk0s2.

Closed Disk Utility and select Utilities >> Terminal

cd /
cd dev
umount -fv disk0s2

I could now run Repair Disk and Repair Permissions in Disk Utility.

I had no problems with the Repair Disk (phew!) but there were permissions that were unable to be repaired by Disk Utility and the computer still kernel panicked when I booted.

Rebooted with Time Machine to the Terminal, unmounted the hard disk as above, and tried to restore from Time Machine Backup.

The system failed to see the hard disk.

Erased the partition, and it gave me a formatter error.

Tried to restore again from the Time Machine for the hell of it.

It couldn’t erase the disk.

I took out the SSD, and loaded it in a USB slot with a cable, then booted from the Recovery DVD and erased and reformatted the SSD. Success.

(6 hours later)

It then restored successfully from the Time Machine backup.

Moral of the story? Have recent backups and a Recovery DVD around (but I think the SSD or its cable might be on its way out 🙂

update: problem recurred. Will try a new Sata cable as suggested in numerous places on the internet.

(several days later)

update: new cable did the trick.

The clue that it wasn’t the SSD drive was that it didn’t have any errors on it when I ran Repair Disk in the Disk Utility. Phew!

Recovering from a Broken WordPress Theme

If you assign your WordPress site to a theme that is broken, physician it could make every page show white. If you have access to the files of your WordPress site, discount navigate to wp-content/themes/ and either delete or change the name of the directory that contains the theme you selected.

This will revert the WordPress site to the default theme and you will be able to start to work out what happened.

2013 in Review

2013

Hi all.

This was a great year, viagra but the tone may sometimes be darker. It was an effort to capture all the moods.

Rather than the usual chronological ordering of the year, recipe this one is by category. This way you only have to read the sections that either interest you or make sense. It also frees me from worrying about trying to entertain, click inform or be understood by everybody.

The rest is on Facebook I suppose. It’s where the more immediate reactions to the world get recorded.

It has been shown in studies that time changes our memories so Facebook is probably a better reflection of what we think of the things that happen rather than future summaries.

 

Career

I have been in the same job for fifteen years. The work has changed over the time, but the most exciting aspect this year was convincing the firm of the benefits of getting the development team the latest development tools. Now we have an exciting cliff to climb that will benefit everybody.

As a result of this, I discovered BizSpark, a Microsoft initiative to get startup companies to develop with their tools and platforms. They provide nearly all of their products for free for three years to get companies going. After many nights of effort, I’ve got Windows 8.1 running on my aging MacBook Pro which looks kind of amusing. I’m developing with about $50K of free software.

As it happens, I can’t get a network connection from my MacBook to my Windows Phone. Not sure if it is Microsoft or Apple’s fault.

I delivered a presentation at the 2013 CPA Conference which is held for customers of the practice management system that we use at Davies Collison Cave. It went down very well if under duress as a result of their excellent fun management the night before at Madame Tussard’s wax museum. I sent a couple of pics of One Direction to Allysha from there and nearly hooked her.

Allballsin.com received a lot of time this year. Let’s say I think the rewards have been good but mostly intangible at this point. I have more to say in the Entrepreneurial Pursuits section.

 

Music

It’s been a journey of discovery. In order to help a friend out, I bought some music production software and found a world of cool sounds. Tam’s 40th present for me switched from skydiving to a musical keyboard that could take advantage of the software. I somewhat ambitiously took on writing the ultimate love song and learnt several important things:

1) Music Production takes a serious amount of time.

2) Auto-tune needs a decent vocal effort to begin with or it sounds crap.

3) No amount of effects can make a keyboard sound like an electric guitar.

The final result of this effort can be heard here:

https://soundcloud.com/allballsin/a-part-of-me

You can hear where I had no more time for the song as the timing, levels, and tuning fall to pieces. I like the lyrics though. The automatic drummer choked on his vomit, probably voluntarily.

Tam’s 41st present to me was an electric guitar. I love how she gets me exactly what I want, sometimes without even knowing she has until I show her. I am now practising music again. Hooray for scales! I’m like a mature age student at university. I actually understand the importance of the boring stuff. Probably won’t have decent results for years. I’ll let you know.

On the point of the practice of spelling practice and practise as practise or practice, I came up with a useful rule for the spelling in the Queen’s English.

You can s*** someone, but you can’t c*** them. Therefore, advise is a verb and advice is a noun. Practice is a noun and practise is a verb.

S*** is a doing word, c*** is not. Puerile but effective. I have less politically correct ways of remembering things like which keys are flat in major scales, but I literally cannot bring myself to share them.

An old school-friend I hadn’t spoken to for about twenty years found me on Facebook, and we started doing some musical collaboration. I wrote some lyrics for music that he had written, and I am waiting for him to arrange them and get it sung by somebody who can sing better than me.

 

40th Birthday

I had a great 40th birthday, shared with Chris Paine. A backyard party on a 37 degree day. Remember them? If you stepped outside at about 11pm this week you would. For my birthday I planned to have forty lunches or dinners, but ran out of steam after ten. “Age shall not weary them” does not apply to me.

 

Politics

I despaired of seeing my political party worry more about its internal business than running the country. So did the country it seemed, and they replaced them. It is worse seeing the good work they actually did do (disability, broadband, climate, education etc.) undone so quickly by the only viable alternative government.

I despaired of seeing our party offer greater democracy to its members and then take it away with brazenness because a few people with power in the party thought they could and that having a better society wasn’t as important.

I despaired of the devolution of the office of political service and the policies to the level of an argument between two-year-olds over a shared toy.

I am split whether I can do more good outside of a political party rather than within it. While government decisions these days tend to be controlled by polls, the media, lobbyists and pressure groups, there is a movement within the ALP to make it more democratic and hopefully more representative of our country and its people, especially the less powerful and the unlucky.

The federal election saw the change of government from a bunch of aggro navel-gazers to a mob who think the ALP care too much about the sick, the poor, the disabled, the “non-straight”, women, the uneducated and the unemployed. So it’s time to rub shoulders again with people, some of whom I just don’t like, on behalf of the voiceless.

I also know plenty of good and smart people in the party who want to make our country humane and successful.

I joined a new Policy Committee this year. It is not as vibrant as my last one but it is another avenue for trying to push some ideas around that I think are important – see Lobbying.

I will be on the executive of the Glen Waverley ALP branch again this year. They are a lovely bunch of opinionated people led by a well-connected and straight-playing secretary who manages to regularly get some very interesting speakers to attend. The speakers then get pummelled with questions from the audience, and I think everyone leaves satisfied.

At the ALP State Conference this year, I saw Dad get awarded a lifetime membership award for forty years of membership of the ALP. It was awarded by Julia Gillard, our Prime Minister at the time.

 

Entrepreneurial Pursuits

Allballsin had the following results:

fbShoosher made $95, RightsFinder made $8

We were pretty frugal with our expenses, but not $100 frugal. Anyway, the availability of time to throw at this project may be more limited from now on, so we are putting what we have out there, and focussing on other things. OK, that’s not entirely true. I like to flog dead horses. Sometimes for years. The difference between a rat and a human is that if you put a rat in a maze, and it finds the cheese, it returns until the first time the cheese is no longer there. Humans keep going back in the hope cheese will reappear. Hope separates our species. And we have cool thumbs.

 

Medical Pursuits

I have only two medical pursuits to report this year:

1) A little anonymous boy with leukaemia responded well to my bone marrow.

2) I got a top’n’tail (Colonoscopy / Endoscopy) that surprised my bottom mechanic. He said I don’t have to see him for a few years. I hope he’s right.

 

Philanthropic Pursuits

Getup.org does not enjoy tax-deductions on their donations. But they still do well. I’ll tip a little something into causes that I think are just.

There are about 600 000 registered charities in Australia that receive tax breaks, and a commission to look into them was postponed by the Labor government.

Not sure where it is going now, but tax breaks are tax-payer funded and there needs to be accountability and visibility when there is free money offered to others by the government on behalf of taxpayers.

 

Hatch, Match and Dispatch

Several marriages and babies again this year – the late bloom is continuing.

Rohan Donnelly, a cricket friend from years ago, died from an aneurysm. About 400 people turned up to his funeral. He had become the vice principal of a school for willing kids. One of the kid’s families turned up and did a haka for him out of respect and gratitude for what he had given the child.

 

Children

Ollie starts primary school this year. He is very excited about it. He gets to keep most of his friends from kinder and will meet some profoundly deaf classmates when he gets there that will continue his diversity education.

Matilda loves childcare but there will be a few tears from the baby room staff when she has to go into the toddlers room. Her cuteness seems to overcome the dread she causes by climbing up everything and falling off.

 

Gender

The justification for men-only social catch-ups is weakening. I still keep a couple going, but there are regular incursions. These days it’s more about having someone spare to keep the kids company as well as sharing experiences that I had in an environment where it just happened to be me and other men (school and certain friendships). Your mileage may vary.

The best I can come up with in terms of gender equality is this:

Gender is an expression of hormones and experience – a shifting spectrum for some, a single point for others. It does not determine your rights nor should it be used to do so.  It is not based on your genitals.

Having said that, I have two thoughts about gender politics:

1)   Grown-ups usually can’t have their attitudes changed. It might be better to concentrate on the next generation.

2)   If you gather socially on the basis of sharing past experiences, if they were historically male or female dominated, then that’s what your group will look like.

Me-only events, however, need strengthening. More time on my own is required, but “at this busy time in our lives” it is not as available as it used to be. I’m in a “procreation-caused time crisis” and I wouldn’t have it any other way, so long as there is some sort of “calm-down” date in the future.

 

Success and Envy

Something I have noticed this year is that now that I am at the commonly accepted middle of my life (male) I am becoming envious of the success of my nearest and dearest. I can explain this with an evolutionary angle, but it’s still there. I know all the justifications and reasons and wherefores for why it is wrong, etc. but I also think I am not alone in this most human of reactions.

 

Justice and Institutions

State and federal commissions into past abuses of children raises strong reactions in nearly everybody. Some cannot believe it happened because it will destroy their view of a dearly beloved institution. Others want it to go away. I think we are all secretly scared to have our own depravities held up to the light in the way a government can truly expose a corrupt institution. Too many people are killing themselves, however, as a result of their past experiences with trusted community leaders, and it needs to be prevented or reduced in the future. Bringing people and institutions to justice is hopefully one way that can be achieved.

 

Christmas

This year we had an Osborne Christmas at our villa in Glen Waverley. It rolled on nicely thanks to Tam’s awesome work. We didn’t quite get dessert out, but we didn’t hear too many complaints. We had the usual Osborne gift orgy of throwing them around while unwrapping others and ending up not knowing all of what’s yours or where it came from. Thanks to all who made it fun.

 

State of Mind

I am a slave to my own body. No, I must remember that the slave is me. The duality is an illusion. The flesh is me. I am my flesh. The loops, spirals and patterns of behaviour are the sum and product of my experience and the processes that give me my consciousness. I am both the rider and the ridden, and they are one and the same person. I am an expression of what can happen after an unimaginable time passes. And so are you.

I’m in an interesting situation at present. I’m pretty sure that I’m too old to change much, but I won’t achieve some of my goals unless I do. I tried to approach the problem from the other direction, and just change my goals. This equation rings true to me:

happiness = satisfaction / desires

(Lower the desires and the happiness increases.)

But it doesn’t quite work because:

Satisfaction = happiness * desires

(Greater satisfaction requires greater desires?)

Anyway, I’ll try banging my head against a few impenetrable walls this year and see what happens. Sorry if this is a bit vague, but it needs to be at present.

 

Pondering the Imponderables

Among many other thoughts and ideas that demand but never receive enough of my time or attention are:

The Social Value of a Human

It is not their financial cost/benefit to society

It is not their employment status

It is not their relationship status

It is not their social status

Immeasurable does not equal unimportant

 

Collecting Tax

Do we honour the risk takers when they win?

Do we discourage the risk takers by taking a bigger cut?

People should be taxed according to the risk they are taking?

How much is enough for you?

Do you have any spare to share?

How much of your fortune was gifted?

How much do you owe the government?

Recipients of Windfall:

Should windfalls be shared?

Is inheritance a right?

What is wrong with inequality of income if the base is rising?

Recipients of the fruits of labour:

Working gives fulfilment?

Should generosity be enforced?

When people are forced to be generous to others they may resent the people they are generous to instead of the people who forced them to share: Parenthood 101.

Or will they learn the benefits of sharing, including the altruistic high, by being forced to share?

Or should we trust our nature to share of its own accord?

 

How should tax be spent?

Spend tax dollars on future?

Helping Victims of hatred, misfortune, prejudice?

Should the “natural” distribution of luck be accepted or shared?

Should we look after victims of the future as well as the present?

Would victims prefer to be noticed or ignored?

Should quiet people be punished by their nature? They do not form the social networks that would protect them in times of misfortune. What about a***holes (3 stars!) who are lonely because of their condition, too? Should they be considered victims of their natural misfortune? And so, in the search for an answer to the question of whether we should be forced to contribute to their welfare, we would do well to consider that we are a single physical blow from requiring it ourselves, and if our own networks cannot support us, then what to do?

And what is the “blow”? Violent, psychological, medical?

It is any event that makes us no longer able to support ourselves financially, resulting in starvation and homelessness without support.

Power

Power is the exercise of identifying and neutralising opposing forces.

Changing People

30+ year old people don’t change their beliefs?

Should people be saved from themselves against their will?

Lobbying

Senate Voting Reform

We should reform the federal Senate voting system with the following steps:

1) Preference as few or as many candidates as you want

2) No above the line voting

3) Robson rotation

These changes should result in a return of more determination of the outcome to voters and less to chance and preference deals between parties.

http://electoralreformaustralia.org

 

Statistics in Media

There should be a requirement for published statistical information (in advertising, news and political messages) be made available with the following information:

• sample size

• population size

• sample standard deviation

• mean

• median

• margin of error

• confidence interval (with confidence level)

This can be done either with a published link to a website containing the information, or within the article or advertisement itself.

This is in recognition that there is current public and political interest in reviewing the media and its representation of current issues. This motion will help protect consumers of media from misleading statistics (either deliberately or accidentally). This will help commentators, experts and readers determine whether to take the statistical assertions seriously or not.

 

Mental Health Impact of Advertising

Regulation and banning of advertising which promotes feelings of inadequacy, insecurity or incompleteness within a person.

This is in recognition that it is time for mental health to be treated more seriously as a human rights issue by government. It is moved on the basis that if an ad is attempting to generate or reinforce harmful thoughts in order to sell its product, it is undertaking abusive behaviour.

 

Euthanasia

That there be government support for the legalisation of euthanasia subject to:

1) Psychiatric evaluation and consultation with more than one qualified practitioner present at all times.

2) An estate tax on applicants will apply.

3) Medical Institutions and Practitioners should pay a government levee equal to the estimated palliative care in order for a patient to be administered euthanasia.

This way, a legal path, indexed to the wealth of the applicant, is available to those who wish to end their lives with their own sense of dignity with a number of potential pitfalls addressed:

1) Will reduce the chance of it occurring out of medical malpractice.

2) The estate tax will discourage over-eager family members from manipulating or influencing their decision-making.

3) This should prevent cost-efficiency being taken into account by medical decision-makers, relatives and friends.

http://www.bbc.co.uk/ethics/euthanasia/infavour/infavour_1.shtml

http://www.bbc.co.uk/ethics/euthanasia/against/against_1.shtml

 

Final Note

Here’s wishing you find many more positives than negatives in 2014, and that your eyes are as open as they need to be but not too much. That hope leads you towards better things and not away from them.

Cheers,

Mark Daniel Osborne