Wednesday, February 14, 2018

What is LoRaWan protocol?

LoRaWan is a long range RF protocol that helps connect 'things' (IoT) to the Internet over a long range. It's main advantages are:

  • It is Open Source and not tied to a vendor
  • It is battery efficient-very low power consumption
  • It is long range.

Battery life is something like 5 years(Wow!). It is Open Standard and uses the unlicensed spectrum as part of the Industrial, Scientific and Medical(ISM) RF band (868 MHz). In US the 925 MHz is used. The Open Standard is governed by the LoRa alliance, an Industry group with 500 or more members (Microchip, Cisco, Softbank, etc).

There is a round the world following for this technology including Comcast, Orange, SK Telecom, etc.
Download LoRa specs from here:

Sunday, February 11, 2018

How do you code for XAML ListView's SelectionChanged event?

In my previous post (UWP: XAML's ListView Control and its SelectionChanged event - Part 1) you learnt the following:

Part 1
  • Progressively build a ListView Control 
  • Place ListViewItems inside a ListView's ItemTemplate
  • You will place three named ListView items
In this part you will learn how to write code to change the properties you set for the ListViewItems by the SelectionChanged event.

The following image shows the app after a successful run. This displays how the app is displayed at this stage:

              
JListView_23

This next image shows the effect of the SelectionChanged event.


JListView_28

You could set the FontSize properties in design as shown.To start with all the ListViewItem's FontSize was 15px and FontFamily Segoe UI (defaults). Clicking the ListViewItem for 'Dog', you can change its size in the property box (now focus is on 'bird').


JListView_15

As shown in the next image, you insert 'SelectionChanged' inside the ListView. If you just type the letter S, you should get a selection list in which you will find 'SelectionChanged'.


JListView_17

Place the "=" sign after it and you should get the "New Event Handler" and when you click this you will create the ListView_SelectionChanged event.


JlistView_18

In the code behind (MainPage.xaml.cs), the new event is displayed as shown


JlistView_19

We will go back to Design view and name the ListViewItems (lvi1,lvi2 and lvi3) as shown here. It makes it easier to handle in code.


JlistView_21

We change the FontSize of the first ListViewItem as shown here using a single line of code.


JlistView_22

Build, deploy and run the app in the Local Machine and you will see the app displayed as shown.


JlistView_23

Now click any of the ListViewItems and you will see this:



JlistView_24

In order to see the changes in the other ListViewItems you need to add more code as shown:


JlistView_26

Now after building, deploying and running, you see the following:


JlistView_28





Saturday, February 3, 2018

How do you find in JavaScript that a certain element is contained in an array?

You can define an array in couple of different ways in JavaScript which essentially is a list of elements. In order to find whether a certain element exists or not, you need to use Array.includes() function as shown in the next example. The argument of this function is the element you want to know exists in the array. JavaScript is case sensitive.

Here is an example of a web page which you can test in your local IIS.



Here is what you see on the browser:



Friday, February 2, 2018

What does JSON.parse() do?

JSON.parse() takes a JSON string as an argument and produces a JSON Object.

Here is a example web page for JSON.parse().



Thursday, February 1, 2018

What does JSON.stringify() do?

It takes a JSON object as an argument and converts it to a JSON string.

Here is a code:


Does Microsoft SQL Operations Studio support Windows Power Shell?

Yes. It does.
You can access the console in Microsoft SQL Operations Studio by clicking this option in the User Interface as shown.


PS_SQLOPS_0.png

This displays the terminal.



PS_SQLOPS_1.png

The following version of Power Shell is supported:



PS_SQLOPS_2.png


Monday, January 29, 2018

How do you find the value of this JSON object --- {"70":27.4"} ?

These are two validated JSON objects:

I am trying to find the value for the second JSON object:
The code shown at the end works and provides a value of 2.85
----------------------
var jobj2={"tuesday":"2.85"};
alert(jobj2.tuesday );//---alerts 2.85

------------------------------------
If I use the exact code that I used for recovering the value for the first JSON object, I end up with an error.
---------------
var obj2={"70":"27.4"};
alert(obj2.70);//--spawns an error
--------------------
The work around which I guessed that would work for the first object provides the value 27.4

var x;
x=70;
var obj={"x":"27.4"};
alert(obj.x);----//alerts 27.4

---------------------------------------

If you want to take a look, just take out the relevant comments and run. There could be a better way of resolving this rather than re-formatting the question.