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:


Monday, June 19, 2017

AngularJS Directives that you should know

AngularJS directives are extensions of HTML markups. They can be attributes, element names, CSS class etc. AnuglarJS script reference is important and the script can be found here:

https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"
The above script reference needs to be added to your hTML page.

You can find the whole list of directives here:
https://docs.angularjs.org/api

Here is the usage of some directives placed in a html page that can be displayed on your localhost (in this case the IIS in Windows 10). Place this code with a suitable name in the inetpub / wwwroot directory.

======================


  Some directives in AngularJS

ng-app
Sorry, blogger still does not support the "pre" tag!. The ng-app directive can be in the 'html' or the 'body' (shown here).
==============
When viewed on the browser (in this case Microsoft Edge), the HTML page renders as shown.



Type anything it gets copied next to Hello
Enter the increment region with your mouse, the count (presently 1) gets incremented
Click the link and you get to the page

More to come in future posts on AngularJS