Monday, March 27, 2017

Is Microsoft Band 2 dead?

I thought it was a nice fitness device, not as flashy as Apple Watch. I was even preparing to buy one. The only place where I could by was at amazon.com. It is not available in Microsoft Stores.

I believe Microsoft has pulled it out of the stores. Even the developers SDK is not available anymore.

Cutting of the limbs like this can only mean one thing. Microsoft Band 2 is dead.

I have to look at other options. There seems to be too many with a staggering price range.

Well what about Samsung's band? I will look into it. It will not come cheap.

Sunday, March 26, 2017

Creating a database in SAP's Ultralite 17 - Part 2

Mobile apps without data are not very interesting especially for enterprise / business applications. Most  businesses are data-centric. Ultralite databases with their small foot print are ideal for mobile applications. As described in the previous post you can use the APIs to create apps on many different devices.

In this post I describe the steps to create a database with all the default settings using the SQL Central interface. If you are new to SQL Central (was previously called Sybase Central) you may want to read my older posts here.

Launch SQL Central from All Programs under SQL Anywhere 17.
Click Tools and choose under UltraLite to create a database as shown.


Create_00.png

 Creating a database is driven by the Wizard which appears as soon as you click Create Database... in the above window. The following sequence of windows shows how the database is created. Although you can make many changes to the database settings, all defaults are used in this post.

You start with the welcome window. Read the notes here.


Click Next,


Use the Browse... button to find the location for the database you are going to create and provide a name. Herein the name is Mar25_2017.

Click Next. Accept the default storage settings.

 Click Next.
Next choose the Collation and character set. Herein Ultralite defaults are accepted.

 Click Next.
Accept the default creation parameters. Have a look at what they are (these are Ultralite defaults).
You can change any or all of them.

 Click Next.
You may leave this as is. Synchronization is important for synchronizing the UltraLite with the main server. For the moment you may leave this empty.


 Click Next after placing a check mark for connecting to the new database. This makes the database available in the SQL Central Management interface.


 Click Next. Oh! you get the command line way of creating this database. What the wizard delivered is the execution of the command line with the parameters (Switches) shown here. This is neat. Next time around you may just use the command line.


 Click Close. The database is created and now appears in the SQL Central under Ultralite 17 (Compare this to the very first image in this post)


Here is the Properties page for this database. Presently it has objects such as Tables, Users etc.


Saturday, March 25, 2017

Developing a mobile app using SAP's Ultralite DB - Part1

Ultralite (formerly of Sybase but now SAP) is a compact relational database management system with many features of the bigger SQL Anywhere. It is ideal for small foot print devies like smart phones, hand-held computers, tablets, etc. Ultralite using its in-built features can synchronize with a central database or with other Ultralite databases using Mobilink.

SQL Central the managment user interface can also be used with Ultralite.


Ultralite Management can be carried out using SQL Central. The various mobile devices (more common ones) connect to the database via Application Programming Interfaces (APIs).

These are the following APIs that can be utilized:

Ultralite.NET              Windows Mobile
UltraLite C/C++          Windows Mobile
UltraLite C/C++          iOS
UltraLite for WinRT   Windows Phone
UltaLiteJ                       Android


Friday, February 24, 2017

Web page static elements using R Studio

We have seen that R Studio can be used to create Web Page using the 'Shiny' package. One of the first things to do is to create web content in HTML that can be rendered n a browser.

You can use a HTML wrapper function or use the individual wrapper functions of the various tags in formatting a web page. In most of the examples you can directly copy the code and paste it into the R studio console.

Here is an example of how you may wrap with HTML:

library(shiny)
ui <-fluidpage br="">  HTML("

Test

")
)
server <-function br="" input="" output="">
shinyApp(ui=ui, server=server)


This is how it gets rendered.


Static_00

In the following there are few more tags that are frequently used. I will try to get all of them in future posts.

Here are the tags a, h1 and br.

library(shiny)

ui <-fluidpage b="">a
(href="http://hodentek.blogspot.com",h1("Hodentek")),
               br(),a(href="http://hodentekMSSS.blogspot.com",
                      "Hodentek SQL Server Blog"))
server <-function br="" input="" output="">
shinyApp(ui=ui, server=server)

Static_01

Here are the tags h1 through h6, em and p:

library(shiny)
ui <-fluidpage br=""> h1("First Level"),
  h2("Second Level"),
  h3("Third Level"),
  h4("Fourth Level"),
  h5("Fifth Level"),
h6("Sixth Level"), p("some text"),em("italicized")
)
server <-function br="" input="" output="">shinyApp(ui=ui, server=server)


The rendered page is as shown:


Static_02

Look forward more of R Studio stuff here or 
here.







Workaround for this error in R Studio

You started your learning and some times you encounter this error in your RStudio console:

ERROR: [on_request_read] connection reset by peer
 
What are you going to do? 

What is described here is not a complete fix (unless you want to change your default browser)but a possible explanation of what is happening. It is most probably related to RStudio using the Microsoft Edge in Windows 10 operating system.

There are three modes that you can run to display in a viewer. This are shown in this image here:


ShinyError_000.png

Run in Window mode:

Run in Window opens a window ~ -Shiny as shown and runs the highlighted code to display the result.


ShinyError_00.PNG

Notice that the tab that is open is http://127.0.01:6170. Now if you change over the tab to 'Open in Browser', Microsoft Edge opens displaying the same URL. Now if you close the browser you see the error messages as shown. I am not sure why it repeats so many times.


ShinyError_02.PNG

However, if you copy the URL (http://127.0.0.1:6170) and paste it into a Firefox browser you will see 'Hello World' displayed again. But if you close this browser, no error is reported in RStudio console.

Hence in Run in Windows mode you can get away without producing error and stopping by pasting the code in Mozilla Firefox (assuming you want to see it in a browser).

Run External:

In this mode the Run result is displayed in the external browser which happens to be Microsoft Edge and you cannot avoid the error. Of course the code runs and displays the result but when you close the browser the error crops up in the console.

Run in Viewer Pane:

Viewer pane is one of the panes of RStudio. When you run the code in this mode the result will be displayed as shown.

The error crops up immediately as shown.


ShinyError_04.PNG

You need to click the Stop button to return to console prompt.

You can avoid this problem by choosing Mozilla Firefox as your default browser.


ShinyError_05.PNG

Monday, February 20, 2017

Building Web apps with R Language - Part 1

 R language is open source with a huge number of developers. It has a great arsenal of great stuff already accomplished. It is a language that you should get exposed to yourself. You just install R Gui and you are ready.


Shiny is an enterprise-grade web application framework targeted for those who want to develop with R using the familiar HTML5, CSS and JavaScript. Using R you can turn terrific analytic solutions you have developed/developing into interactive web applications.

Go to this site (https://shiny.rstudio.com/) directly and learn more.

 
Rshiny-00

If you have R Studio you have Shiny because Shiny is a package that you can download.

In this first part we only talk about the very basics.

I assume you have read my previous hands-on R examples in my blogs.

http://hodentekhelp.blogspot.com/2015/09/what-is-good-way-to-learn-r-language.html
http://hodentekhelp.blogspot.com/search?q=R+language

Here I just show a very basic (aka Hello World) example of creating content for a web page using R GUI. More will come later in my blogs.

Launch R Gui as shown and provide reference to the shiny "library" as shown by typing in the three lines of code (The four lines of code in red).


 HelloWorld_00

When you hit Enter after the third line where you define the shiny app, a browser window will open as shown displaying the apps output as shown at a port of the local host.



HelloWorld_01

You also get a response (the last line) in the R GUI as shown.




HelloWorld_02
That is all there is to create a content.

The ui summarizes your user interface, the server is something like a web server and shinyApp is your web response. No fuss, very simple.

Friday, February 17, 2017

Before you create a database based app on Appery.io read this

In creating a mobile app based on back-end data in Appery.io, server code that accesses a collection can be used as shown here.

In this post we start with a collection we created by importing a CSV file, FFD.csv.

We now create a Server Side script to access this collection.

In the appery.io platform  click on Server Code tab to open the user interface as shown.  In the script editor there may be some default code. Remove this script.



ApperyIO7_00.PNG

From the Snippets side click and add Retrieve all Objects. This inserts a line of code into the editor as shown below:

var result = Collection.query("dbId", "collectionName"); 

You need to insert correct values for the arguments. The JsonTest was the database in which the imported collection was saved. The imported CSV file was named as a collection with the name 'Custo'. The dbId parameter was found from the Settings tab for the JsonTest database


ApperyIO7_02.PNG

If the script is properly formulated you could Run the script. If there are errors you would see it in Trace info.

ApperyIO7_03.PNG

After the first line of code click return for a new line. In the Script Editor add another line of code to appear below the first line. For this choose the snippet, responseSuccess.

This inserts this code:

Apperyio.response.success({"param1":"value1"}, "application/json");

Modify this code as shown below:

Apperyio.response.success(result, "application/json");

Click Save.



ApperyIO7_05.PNG

Click Save and Run. You should the response to the script in the panel as show below.


ApperyIO7_06.PNG