Wednesday, August 23, 2017

Jumpstart Javascript to program IoT controllers using Johnny-Five

HTML/JavaScript option to work with IoT will have a large following. Johnny-Five a JavaScript Robotics platform (by the Bocoup group released in 2012) will be very popular with IoT developers.


If you use the Johnny-Five Inventor's kit (J5IK, $125.95) you can program a lot and learn a lot.
The J5IK empowers users to build internet-connected, JavaScript-powered hardware projects by marrying the ubiquitous language with the Tessel 2 single-board computer and several components to get users started immediately.

Tessel 2 Features (from Tessel site):

This kit (from Johnny-Five site):
  • Provides a powerful foundation for IoT projects
  • Includes everything needed to complete 14 circuits
  • Does not require previous programming experience or soldering
  • Connects users with a thriving community and exemplary documentation.
  • Supports beginner and more advanced projects 
Although the applications are limitless, the kit allows users to control and read external sensors and displays, control motors, and use and learn JavaScript.

Tuesday, August 22, 2017

Turn your smart phone into a PC

It is more correct to call it Samsung DeX Station (hardware) that pairs with Samsung's Galaxy S8 phone to provide you a real desktop experience that you always wanted.

Hear what VMware calls this:
"Samsung DeX redefines what a smartphone can do to keep mobile workers productive with just their smartphones."

Your Samsung Desktop would consist of a computer monitor, keyboard, mouse, Samsung Galaxy S8 and the DeX Station.
Review the below image:


As you can see in the above image, Microsoft is there with all its Office 365 products.  Microsoft's dream of entering the mobile world may still be realized although Windows Phone is near extinction.
Microsoft has played a smart hand in going with Samsung on this.

Looks like Google Drive is still accessible and there are still few more programs(Hancom Office, Citrix Receiver and VMware Horizon Client).

Hancom Office consists of Hanword (a.k.a. Hangul, hwp), Hancell (Spreadsheet), and Hanshow (Presentation program).

Citrix Receiver is a suite of products that allow client devices to connect to various desktop virtualization services offered by Citrix.

VMware Horizon:
VMware Horizon delivers true Windows desktop and applications computing experience on Samsung Galaxy S8 through the VMware digital workspace and Samsung Desktop Experience (DeX)



Friday, August 18, 2017

Page navigation in Single Page Applications! using AngularJS

Actually there are no 'Pages' in a Single Page Application (SAP) but no problem. If you are familiar with anchor tags in HTML, you could follow it with the help of the SRC's in your script that will help updating the page dynamically calling up the routing in AngularJS.

These are two important script references that you should add to your SPA:<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script><br /><script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script> 
This is an important module that makes routing possible:
ngRoute:

ngRoute module provides the routing and deep linking services and directives for a Angular JS applications.

You should read the documentation which gets clearer when you do an example.

ngRoute teams up with ngView directive to render the partial views.

ngView:
"ngView is a directive that complements the $route service by including the rendered template of the current route into the main layout (index.html) file. Every time the current route changes, the included view changes with it according to the configuration of the $route service."

Here is an example of a SPA hosted on my localhost (the file below is placed in the wwwroot directory of  C:\inetpub

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script>

<body ng-app="HtekApp">
<h1>HODENTEK BOOKS</h1>
<p><a href="#/!">Welcome to Hodentek</a></p>

<a href="#!SSIS">SSIS </a>
<a href="#!SSRS">SSRS</a>
<a href="#!Azure">Azure SQL</a>


<div ng-view></div>

<script>
var app = angular.module("HtekApp", ["ngRoute"]);
app.config(function($routeProvider) {
    $routeProvider
    .when("/", {
        template : "Click on the link to see the contents"
    })
    .when("/SSIS", {
        template : "<h1>SQL Server Integration Serivces 2005"
    })
    .when("/SSRS", {
        template: "<h1>SQL Server Reporting Services</h1><h2>SSRS 2008: ISBN: </h2><h2>SSRS 2012: ISBN</h2>"
    })
    .when("/Azure", {
        template: "<h1>Microsoft SQL Azure Enterprise Application Development</h1>"
    });
});
</script>


</body>
</html>

The page renderings of the links are as shown:











Monday, August 14, 2017

svg in HTML5

SVG is variously described as  'part of HTML5 specification' or an HTML5 extension. In either case, I am very happy as I am a fan of SVG.

In HTML documents you could embed an in-line SVG code.
SVG in some cases appear superior to Canvas in HTML. SVG creates prefabricated graphics that is part of the documnet model which can be accessed by the ID for any event based action, where as the graphics for use in CANVAS needs to be created and rendered during page loading.

Read my SVG related posts here:

http://hodentekhelp.blogspot.com/2015/12/does-microsoft-edge-support-svg.html

http://hodentek.blogspot.com/2009/10/finally-svg-in-visual-studio.html

http://hodentek.blogspot.com/2010/09/svg-gets-rendered-on-ie-90.html

http://hodentek.blogspot.com/2013/08/short-of-cash-get-apache-openoffice-40.html

http://hodentek.blogspot.com/search?q=svg

http://hodentekmobile.blogspot.com/2016/03/intel-xdk-controls-2-usage-of-svg-and.html

Monday, July 17, 2017

Single Page (web) Applications are trending

It is exactly what it says. Single Page Applications (SPAs) are web applications with a single web page that uses AJAX for its dynamic interactions. As page refresh is on the client side the SPAs can have downside of performance degradation if they are not properly designed and SEO optimized.

There are many JavaScript frameworks to write SPAs. There are lots of JavaScript frameworks that you can use to build SPAs. Lots of them are Open Source. Here are some:

WinJS
Angular
React
Ember
Aurelia
Dojo
Vue.js
Cycle.js
Backbone
Dojo


I hear a lot about Angular and Aurelia, perhaps more people are using them.
Intel XDK had both Angular and Backbone templates, but they are not supporting them anymore.

AngularJS is in Version 2.

I have a large number of posts on Intel XDK here.

Friday, June 30, 2017

Comprehensions in JavaScript

Comprehension(s) list(array) is used in many computer languages. What it does is it takes an array and modifies it  to create a new list(array) based on some modifier.

For example if you have a list like this: [ 1,2,3 ],
you can create a new list with each element of list replaced by itself multiplied 3 times like in Example 1

In the second example from Mozilla site, you take an array of lower case letters and use the Javascript string operatory 'toUpper()' to generate a new array with letters of each element capitalized.


Read here:
https://www.xul.fr/javascript/comprehension.php
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Comparison_operators

These were tested to work in Mozilla Firefox (I believe it is version 54). However it does not work in Microsoft Edge. I believe these are still being tested for future version of ECMA script according to the Mozilla Developer site.

Monday, June 26, 2017

Apache CORDOVA is the place to go if you were using Intel XDK

I was following Intel XDK for more than a year  with many posts on my blog for mobile devices and participating in Intel's forums.  I have observed that its emphasis was slowly changing and I started looking for alternatives. There are programs for which you need to pay, which I am not ready, as I do not derive any revenue from what I do. I am looking for free programs.

Progressively Intel XDK has been shifting their focus to mostly Intel IoT devices. The App Designer support does not exist anymore except for a few features in the interface. The Interface as you knew it is now mostly geared for IoT devices. Intel XDK forum suggests that there are more tools freely available (on the Internet) that may do equally well and a strong recommendation for using Cordova CLI.

Well one cannot expect a tool to live eternally and things do change. What is needed on the part of developers\users is to turn somewhat nomadic and look for new pastures.

Here is a link to Apache CORDOVA site where you need to forage next. Of course, Apache CORDOVA will be there much longer than Intel XDK could have been. For one thing, Apache CORDOVA has a neat architecture for building web/native apps which means you need to use the plugins if you need to access sensors in the mobile device.

Here is a picture of the well-knit Apache CORDOVA architecture from their site: