Ad

Thursday, March 31, 2016

Code HelloWorld series: Getting started with Alexa Amazon Echo

Summary:

Best practices and step-by-step notes from a recent Bloc webinar on how to get started and code HelloWorld app aka skill for Amazon Echo Alexa. This blog post provides step-by-step instruction to create a simple app for area code lookup. It covers the best practice and resource recommendations covered in the presentation. 

slides what is Alexa

Presentation slides hello world with Amazon Echo, getting started step by step:

Scroll to the bottom for presentation slides. 

Background info:

Users interact with Amazon Echo by saying Alexa,  blah blah blah  the utterance is the request to be sent to the skill's web server with data and be given a response back. Alexa will voice over the response specified in the <speak></speak>. Alexa also has online, iOS, Android portals, where users can purchase apps called skills, enable and disable skills, and view info cards.

Mark the Alexa project mentor really thinks Amazon Echo is growing in demand and is experiencing a boom in app creation. The device is growing and gaining in market share. That's where developers will want to be. 

Source: Bloc online coding bootcamp webinar on how to develop with Alexa by Henry and Mark

Bloc mentor sample code for Amazon Echo area code lookup app


Notes & Key Steps to Replicate HelloWorld with Amazon Echo Alexa and Lambda Amazon Web Services:

Amazon Echo Alexa Interaction Model Intent Schema screenshot
  • Concept: each app is called a skill that can be enabled or disabled
  • Concept: interacting with the alexa service involves user sending a request and getting a response from Alexa in audio format
  • Step - App idea generation: come up with an original or semi-original app idea for your Alexa project. Alexa has a relatively small growing app store. It's a good time to get started.
  • Step - obtaining and cleaning data: need to find either static or dynamic API data for your app. For example, a list of area codes is a static data set, versus the latest news from NYTimes via its news API is a dynamic data set. For first try, Henry recommends finding data with no copyright attached. He used a JSON converter to convert his data to JSON, which works well with AWS Lambda. 
  • Step - Get your app to work locally: use your local dev environment or use jsbin to ensure that your code can grab and process the data correctly. Then upload as a zip file. Your zip code should have a minimum of three files: your app, data file, and an Amazon specific library file. Can use the boiler plate file for now.
  • Step - Amazon Web Services Lambda: this is a free tier web services that runs on Node.js. It works well with Amazon Echo demo apps, has great out-of-the-box security. Henry recommends this for those familiar with JavaScript. 
  • Step - Build an interaction model: in your Alexa dev portal, access Alexa skill kit for the menu. This is where you can build the interaction model, make configuration changes, test, publish, twig privacy settings. 
    • Concept - testing: 
      • Testing in the Alexa skill kit does not require an Amazon Echo device. You can simulate your app experience by Entering an Utterance which creates an object to be sent to your lambda service for a response. When the response is given, can click the listen button to hear Alexa respond. 
    • Concept - privacy settings: useful for those apps that collect payment information or personal data that is transacted. 
    • Best practice: test a lot, play around a lot to cover all the scenarios of interaction. Get feedback from the Amazon team to be thorough.
  • Step - Publishing Your Alexa app: Code will be reviewed by the Amazon Alexa team. It's a real world professional code review experience for Bloc students. Once submitted, the app will queue up for a review.
Amazon Echo Alexa interaction model


Best practice:

  • It's possible to write Amazon Echo apps in any language such as Ruby and Python, but using JavaScript and JSON data formatmakes it easy to plug-n-play with Amazon Lambda Node.js server written in JavaScript. 
  • Amazon reviewing team consisted of professional developers will review each app and either approve or provide feedback for improvement.
  • Mark: best developers write the least amount of code. Use Amazon Alexa sample apps and sample code when possible. They are vetted. 
  • Resource: Alexa skill sample apps and core concepts page, demo apps

Bloc Online Coding Bootcamp and Mentorship program:


Amazon Echo Alexa programming is not a stand-alone project as of March 2016, but an integrated project block in each of the four famous Bloc tracks including Software Engineering, Full-stack, Rails and Front-end. 

Submitting the app through the Bloc program in June, students will receive a free Echo from the Amazon team. This is a seriously awesome partnership between Bloc and Amazon. May be the future of building an app store ecosystem is to partner with coding bootcamps and the fresh blood they attract. It's a smart way to build a pipeline of developers.


Next steps:



            
  • Subscribe to Mark's newsletter http://askdevweekly.com/
  • Further thoughts: use case for complex Alexa skills including in app purchase, role playing games and writing (not realized skills yet).
  • Further thoughts: experiments have been done on Raspberry Pi which can run Amazon Echo Alexa functionalities. Mark thinks this is proof that Amazon Echo development skills are useful and it is growing in demand. Alexa skills should be able to be applied to run on the internet of things in the future. 

Commonly Seen Errors or Caveats:

  • <say-as interpret-as='digits'>415</say-as> will make Alexa say "four one five" instead of "four hundred fifteen". Useful when decoding area codes and phone numbers.

Tuesday, March 22, 2016

Shopify Unite Conference talk: web Accessibility is not boring it is an essential User Experience

Shopify Developer Conference: web accessibility talk. Web accessibility is about more than just accommodating a minority group of audience with special web browsing needs! It's about reading in sunlight (needing strong color contrast), night stand reading mode, on-the-go mobile browsing with audio input, desktop audio dictation and much more.

* By Steven bosworth of the themes team
* Shopify image alt texts, fall back texts are important
* Best practice: label all things in theme though tedious
* Each form field should be properly labeled even if hidden
* Form error messages need clear label that traces back to the right field
* form.error is the shopify errors object
* tables : accessibility helpers understands how the td s are tied together. Challenging on mobile - single column display. Shopify handles this for us. (Css work around, hidden span s that announce the correct data, hidden visually but accessibility engine readable
* Best Practice: User testing reveals hidden accessibility problems.
* Caveat: accessibility engines, may not understand relationship between two div s whose visual relation is obvious
* Color contrast and text: studies found white on yellow is not accessible in sunlight reading mode.
* Best practice: test color contrast while designing and developing
* Resource: Twitter #a11y topic on accessibility
* Resource: color blindness testing and simulation tools available on the web.

Friday, March 18, 2016

Udacity Class Intro to Java Programming walkthrough, review, rating and notes

Intro to Java Programming
(This document is a work in progress. Please excuse its appearance)
  • General comments:
    • Video has occasional interviews of young female coders, role models - cs students from Stanford
  • Lesson 1 - Introduction
    • Tidying Legos : 
      • Example: use lego swap, sorting, rearrangement as example of algorithm
    • Example: calculation of dinner bill and tip is a good example of an algorithm
    • Moving to the First Yellow-Blue Lego
      • Exercise: really helpful exercise writing pseudo code and understanding algorithm
    • Concept: Why is this not a correct algorithm? 01 description is ambiguous?  02 description contains steps that cannot be executed ? 03 procedure does not always terminate
Udacity Introduction to Java Programming
Move to the First Yellow-Blue
Example algorithm that does not terminate


  • Problem set 0:
    • Install BlueJ and look at folder files to find secret codes. Familiarize yourself with your programming environment
  • Objects
    • Concept - coders organize their code into objects
    • Concept - can use objects already written by other people, stand on the should of the giants
    • Concept - two important things to understand about objects: 01 what can an object do? 02 How to make the object do it?
    • Why is OOP so important?
      • Industry standard, job requirement to use object oriented programming
      • Concept - a person is a perfect analogy of an object (computer science): a person has attributes / properties like height weight, and he/she is can do all kinds of things. OOP is intuitive - it is aligned with the way we think 
    • Objects
      • Analogy - objects are like appliances in a big house. Each appliance such as a heater or the washer has some build-in functionalities 
      • Concept - Object = building block of a program, component with some desired functionality. You can ask objects to do work. 
      • Concept - You don't necessarily know how they do that - how they complete each task. 
      • Analogy - We don't know usually know the granular details how a heater works, as long as it heats water
      • Concept - it's important to understand WHAT an object can do, NOT necessarily HOW it does that
  • Lesson Title : Objects demo
    • Exercise: learn to use an existing project, and start a new instance of an object
    • Concept: It's important to not get hung up on how an object does its task exactly to the greatest details.  The amount of codes in each project can be overwhelming. It's important to follow instruction, and ignore the extra details. 
  • Lesson Title: Lesson 2 - Objects - Classes
    • Concept: in Java, class = objects with common behaviors. Example the day class, when you want to use objects in this class, look at its documentations. Example: the string class defines the common behavior of the string objects.
    • Concept: methods = actions that can be done by a class
    • Comments: this is a really good way to think about objects, for those who are new to OOP
  • Lesson Title: Lesson 2 - Drawing Pictures
    • Exercise: playing with interesting codes that can edit and modify pictures
    • Comment: this is a great exercise, showcasing a real-world application of Java, and how powerful it is for image manipulation
  • Lesson Title: Lesson 2 - Variable Names
    • Concept - Use variable to store a value that you need to retrieve later. Every variable has a name. Analogy: parking lot spot, parking structure label





  • Lesson 2 Objects An Exercise on Variable Names
    • Identify the variable names in variable declarations
  • Lesson 2 Objects Variables
    • Concept Variable Type: in Java writes the type before the variable name. Analogy: parking spot for a bike, versus for motorbikes versus for a car. In Java, we have to specify which type of data the variable holds. 
    • Concept Initial Value : when declaring a new variable, always best practice to specify an initial value. 
    • Concept data type double: a number that can have a decimal point. Ignore the curious name. 
    • Commonly seen types: string, double, int, and more
  • Lesson 2 Objects Comments
    • // double slash comments for humans to understand the code better
    • "Comments are for humans (human readers)"
  • Lesson 2 Objects Variable Declarations: The Fine Print
    • Exercises: spot mistakes in variable declaration statements



Wednesday, March 16, 2016

Udacity giving out free Google I/O 2016 tickets and trip to the Silicon Valley

Udacity gives out free Google I/O 2016 tickets (to Chinese followers and students of their WeChat official channel) and all-expense paid tours of Silicon Valley. 

It's not news that Google and Udacity are close. Previously, in 2015 Google I/O, udacity announced its newly minted Udacity Android Nanodegree track promising potential job opportunities of the brightest of graduates with its hiring partners including Google.

And Google not only gave a physical booth and meeting area to Udacity at the event, but also stages for Udacity speakers and the founder - Sebastian. Google even announced the program in the big event's keynote.

Really really wants to work for Google? May be Udacity is the way to go.


Thursday, March 10, 2016

How to startup? OneMonth (YC company) explains how to make an MVP minimum viable product


What is a MVP? The key is to follow the "minimum" part almost religiously! You need to do the absolute minimum and test out your product as soon as possible see if it gains traction. The MVP is for getting the innovators the first group of people who would adopt new products. By OneMonth, famous learn-to-code tutorial learning company, a part of the YCombinator (YC) famous Silicon Valley startup accelerator.

See this famous product adoption curve to see how people pick up new products and how products can growth hack.
Silicon Valley YCombinator Startup knowledge : product adoption curve

Wednesday, March 9, 2016

Learn Java vs .NET internet parody funny video - gems of the internet, war of programming languages

This funny internet parody movie trailer features two old school yet still very prevalent programming languages: Java and .NET (by Microsoft). The movie depicts the coming of age of Java and how it surpassed .NET as the future of technology... once upon a time. It's entertaining.

Learn AngularJS with Codecademy.com detailed walkthrough lesson 2 step-by-step tutorial under 10 minutes

Lesson 2 Part 2 of Codecademy AngularJS tutorial step by step walkthrough. Lesson 2 Hello AngularJS II


This is the companion blog post abridged transcript about our video walkthrough.


  • Important to read the instruction line-by-line without freaking out
  • The controller uses $scope to pass model data into the view. 
  • MainController.js has the code for the MainController and its $scope special variable
  • $scope is an important AngularJS concept. This is an early exposure. No need to stress too much
  • AngularJS follows the Model View Controller framework. Model is stored in the $scope variable in this case. View is the HTML file. And the controller code is in MainController.js
  • In the HTML file, you can see a <div></div> tag essentially an HTML box or section on a website is associated with the MainController. code: ng-controller="MainController"
  • Every time, this div is asked to display a special value, it will look at the MainController and its $scope to see if there data exists.
  • $scope.product = { name: 'book name', price:19} is the same as $scope.product = {}; $scope.product.name = 'book name'; $scope.product.price = 19;
  • A variable in an object is called a property. A function in an object is called a method

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid