lambda-tester: verifying callbacks

Their (see post from last night) documentation is really clear with good examples that you can easily work from.

So I’ve now moved on to trivial callback verification. Some screenshots as I inched forward…

npm install chai -g
npm install chai --savedev
npm init
mocha

 

 

Gist.

Advertisements

Git: move or rename a file or folder

as


If you want to change the case of a file or folder, but not rename it, then you need to do this in 2 steps. E.g. given a folder [Test], that I want to change to [test], then do this:

git mv Test temp

git mv temp test

Github Desktop, for example, will interpret that as a single rename (Test -> test), and you can commit without further ado. I could not find a single step way to do this rename.

 

Linux (Zorin 12.1): what can you do

This is firstly a test post, using Chromium on Linux, specifically Zorin. Although 30 (ahem) years ago I might have considered myself a Unix whizz… well I’ve forgotten a lot of what I knew. It’s sitting there, but needs to be teased out. And of course at that time there was no GUI to speak off.

The very first positive thing I note is that speed of bootup (I have installed native rather than live) compared to Windows (7 in this case). The mechanical disk in the old laptop I am using really struggles to return the command prompt in less than say 5 minutes on Windows, whereas having wiped Windows and replaced with Zorin, I would say it is close to 1 minute. It’s entirely my impression and anecdotal.

Apart from installing LastPass for Linux, my first non-admin task is to install Android Studio. Instructions for Linux are here.

Android: the absolutely simplest thing

I have abandoned Windows Phone, and any development on it. I now have a Moto 4G, and I’m very pleased with it.

This is JUST about how to get the most basic of applications running on your Android phone, with 2 pre-requisites:

  • A Windows 10 box on which to develop the app. (I’m sure IOS etc work just as well, but I’m a Windows person).
  • An Android phone (because we will deploy directly to the phone, and not bother with an emulator)

This is a screenshot from my phone, representing Success. (Please note that deploying to the Play Store is not in scope: this is just for deploying to your own phones and tablets.) The “development” took 1 minute, the deployment to the phone took 1 minute, and it took longer that that to upload the screenshot from the phone to Google Photos:

Screenshot_20170731-233411.png

These are the steps:

  1. Install Android Studio

AnStudio012. In Android Studio, go to File/New/New Project, and follow this example, or if you know what you are doing, something like it. Then click Next (not shown here):

3. Target Android Devices… is what it says. Let’s say your phone and all your tablets are running Marshmallow. So follow this setup (else chose an alternative option against Minimum SDK), then click Next (not shown):

4. Add an Activity to Mobile. Pick Basic Activity, click Next, and on Customize the Activity, click Finish:

5. After about 20 seconds (on my laptop), the build completes, and you see this (I’ve compressed to save screen space), where “Hello World!” appears by default in the XML, and is rendered as a graphic

6. Running the app on your device. For this, let us use the real thing, not an emulator. Firstly, you need to get your phone in Developer mode. I won’t go into this here, but if you google [android tap seven times], you’ll find lots of advice.

Now hook up your phone or other device to your laptop or PC, using a cable you know can transfer data.

On the menu, select Run. This prompts Android Studio to look for a usable device. If your phone hookup went well, you see something like this:

AnStudio08

 

Click OK. It is not obvious that anything is happening, apart from the discrete bar at the bottom of the screen:

AnStudio09

After some seconds, you have this on your phone/device – I’ve used an actual photo of the phone rather than a screenshot, as evidence that the “app” really has gone directly to the phone. And that’s it. Sure, there’s a whole world of pain before you get to an app of any usefulness, but this was all about just showing the flow from PC via Android Studio to your phone.

LivePhone

But while we are here, a quick look at standards…

https://google.github.io/styleguide/javaguide.html

And this just cos I darn well liked it…

https://blog.codinghorror.com/new-programming-jargon/

OK Google commands

  • OK Google (seems to activate more easily if you “train” it in Android)
    • Text [Jan mobile]
    • Call [Jan mobile]
    • get to [Slough]([by car] | [by bike])
    • Bluetooth [off|on]
    • Wi-Fi [off|on]
    • Wake me up in [3] minutes
    • Wake me up at [7 oh 2] am
    • Remind me to [buy milk] at [5 PM]
    • Where’s the closest [Caffe Nero]
    • What is my schedule for tomorrow
    • What is my schedule

Links

http://trendblog.net/list-of-google-now-voice-commands-infographic/

http://www.greenbot.com/article/2359684/android/a-list-of-all-the-ok-google-voice-commands.html