Thursday, September 29, 2016

How do you find the compatibility level of a SQL Server database?

The compatibility level of a SQL Server database matters since the T-SQL code from a higher compatibility level will not work in a database with lower compatibility level.

How to find compatibility level?

Launch SQL Server Management Studio and pick the database for which you want to find the compatibility level.

Right click the database node. From the drop-down pick Properties. In the properties page click Options and you will find the compatibitlity level as shown. This is for SQL Server 2012.


Tuesday, September 27, 2016

How do you get date and time information using PowerShell?

PowerShell has a cmdlet for most of the usual things including date and time.

The basic cmdlet to get the current date and time is Get-Date.

Start Windows PowerShell by typing powershell in the search box (Windows 10).


PowershellSearch.png

Click Windows PowerShell ISE to open the window shown.


PowershelSE.png

Enter Get-Date in the top pane and click the right pointing arrow to run the script.



PowersheGetDateCmdLet.PNG

You immediately get the response in the bottom pane as shown.

 PowerShellGetDateResponse.png

Now you can the date and time parts of current date using the DisplayHint parameter specifying which part you need. Here is the modified script to get the date part.

The ISE has intellisense and you do get support as shown

PowersheGetDateDisplay.PNG


PowersheGetDateParams.png
Click on DisplayHint and enter a space to get the params that you can access with the DisplayHint


PowershellDisplayHintParams.png

Run the script as shown below in the top pane and hitting the 'green' arrow and you will see the following in the bottom pane.
Get-Date -DisplayHint Date
The response in the bottom pane: 
PS C:\Users\Jayaram> Get-Date -DisplayHint Date
Tuesday, September 27, 2016

How to get the year part of the date?
If you pick year from the drop-down box, you end up with an error

PS C:\Users\Jayaram> Get-Date -Year
Get-Date : Missing an argument for parameter 'Year'. Specify a parameter of type
'System.Int32' and try again.
At line:1 char:10
+ Get-Date -Year
+          ~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Date], ParameterBindingExcept
   ion
    + FullyQualifiedErrorId : MissingArgument,Microsoft.PowerShell.Commands.GetDateCo
   mmand

In order to get around this, you change it to:
PS C:\Users\Jayaram> $x=Get-Date
$x.Year
2016

Another way would be to get the date in a string; split it and take the last part as in the following:

$g="Tuesday, September 27, 2016"
$y=$g.Split()
$y[3]
PS C:\Users\Jayaram> $g="Tuesday, September 27, 2016"
$y=$g.Split()
$y[3]
2016

Monday, September 26, 2016

How do I find the current geolocation using JavaScript?


In HTML5 supported browsers you can find your geographical location using the GeoLocation API.

You can access this site for more:

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation


The Navigator object's geolocation should be checked first to verify if it is supported. You can just insert this between script tags.
----------------------
if (navigator.geolocation){alert("geolocation is supported")};
---------------
If Geolocation is supported then this script will write to the browser the latitude and longitude:

var watchID = navigator.geolocation.watchPosition(function(position) {
 document.write( "Longitude= "+position.coords.longitude,"
","Latitude= "+position.coords.latitude);
});

---------------
For the above code in a web page the following response was received. Sometimes there may be browser message asking for permission to use your current location.

My current location is right next to Chaminade University in Honolulu and the coordinates are correct.



What is meant by JavaScript Lint?


JavaScript Lint is designed to check JavaScript and helps you prevent making coding mistakes in the JavaScript code you write. Many JavaScript implementations do not have warning mechanisms built-in to check the code for errors and that is where JavaScript Lint beocmes very useful. Using JavaScript Lint you need not actually run the code and you need not even open a web page which has JavaScript code.

Where do you get it?

You can download it from this site: javascriptlint.com. You also find documentation there.

JavaScript Lint is based on the Javascript engine for Firefox browser which makes it possible not only to check JavaScript syntax but also warn about quesitonable code.

To get started with JavaScript Lint, download the appropriate package and extract its contents.
JavaScript Lint 0.3.0 for Windows (jsl-0.3.0-win32.zip)
JavaScript Lint 0.3.0 for Mac OS X Intel (jsl-0.3.0-mac.tar.gz)
JavaScript Lint 0.3.0 Source (jsl-0.3.0-src.tar.gz)


JavaScript Lint can be run in different ways:
Integrate it into Visual Studio
From Windows Explorer
Using command line


Developers can also integrate them into their Windows programs or from a PHP site.
More on Forums, Wiki etc here:
https://sourceforge.net/p/javascriptlint/wiki/Home/

Wednesday, September 21, 2016

What is jsFiddle?

jsFiddle a nice tool to have, especially for web developers. It is a 'What you see is what you get tool that can do HTML, CSS and JavaScript. It can also access great many script libraries like, jQuery, Dojo, etc.

This is a must have tool if you are working on web pages. If you are a beginner or, one trying to learn web page authoring this is a great tool.

This is an online tool and therefore you do not need to install anything on your computer. You should have internet connection, though. .

You access this site https://jsfiddle.net/ and you get this displayed. All set and ready to go.


jsFiddle_00

You can test your HTML, CSS and JavaScript online with this tool

Test HTML:
In the HTML pane, just type this:

Welcome to jsFiddle

and click Run at the top.
Immediately you will see the result in the Result pane as shown.



jsFiddle_01



Add CSS and Test again:

Now I will style the text we  just wrote by adding the style rule in the CSS pane (right of HTML). This is the rule I am going to add:

h1{color: Magenta;
   text-align: center;
  font-family: verdana;}


After typing in click Run and you will immediately see the change as shown:


js_fiidle_02

Add HTML fragment to place a button with the text 'Click me' as shown.
You should see the button on the document.




 Write script for the button click:
Write the javascript code as shown which does the following:
When you click the button, the function test is run which should bring up the alert message.
The jsFiddle with button and JavaScript is as shown.


jsFiddle_03

When you click the button, you should see this:








Thursday, September 15, 2016

What is a Rufuss USB Installer?

Rufus is a very useful utility and if you do not have it, you should get it in your toolbox.


Rufus creates a bootable USB stick (/drive) which can be used for installing, for example UBUNTU Linux.

Rufus formats and creates a bootable USB drive to which you can attach memory sticks, pen drives, etc.

These are some of the use cases (rufus.akeo.ie):
  • You need to create USB installation media from bootable ISOs (Windows, Linux, UEFI, etc.)
  • You need to work on a system that doesn't have an OS installed
  • You need to flash a BIOS or other firmware from DOS
  • You want to run a low-level utility
Rufus is supported by many operating systems.


Download these executables from the link at the beginning of this post.


I downloaded both but ran the 2.11.exe and it made entries in the Registry.


I am planning to work with Ubuntu Linux in my Windows 10 laptop and this is just a preparatory step.

Wednesday, September 14, 2016

What is TOR?

If you want to improve your Internet privacy and security TOR is the solution.TOR works on volunteer-operated servers. In fact you can volunteer yourself to take on this task. Using TOR, you and your target are not connected directly by recognizable Internet intermediate points but you are connected to your target by virtual tunnels. This way you can share information without compromising privacy. You can even access blocked sites.


What are use case scenarios:
  • Identity thefts and unscrupulous marketing will be a thing of the past. Your identity information may leak out of your ISPs or your web surfing activities.
  • Protecting your children on line who may share private information without realizing the seriousness
These above are only some of the simple scenarios that normal people use but many others have great use for such a service:
  • Journalists and their audience
  • Law Enforcement Officers
  • High and low profile folks
  • Business executives
  • Bloggers
  • IT Professionals
  • Military
  • Activists and whistleblowers
While anonymity provides a secure shield for you it can also be misused.

The safe way is to surf the internet using the Tor Browser. Don't use Torrent file-sharing applications while using Tor browser as they ignore and make direct connection. Also do not install any kind of plug-ins as they can compromise privacy. Do not open applications downloaded while using Tor Browser.

There is a possibility that Tor Browser may not work as censors may block Tor traffic even when what are called Tor bridges are used.

It is still possible to work around to use Tor Browser review this link:
https://www.torproject.org/docs/bridges.html.en

You can download the Tor Browser from the above site. Here are some screen shots of my download.


 Double click the executable that you downloaded.


This is where Tor files are installed.


 I used the first option by making direct connection to a Tor Network.


 You can use this short cut to use your Tor Browser. I will be using mostly to do some surfing. I am not planning to visit sites that require username/password authentication.


Tor Browser starts after installation.


Enjoy surfing knowing your privacy info is intact!

Friday, September 9, 2016

What is a box plot?

This kind of data plot is required while showing statistical analysis of distributed financial data. It is usually called Box plot and sometimes Box and Box & Whisker plot.

Here is an example of how it looks:


BoxPlot_00


The plot represents some Financial data (Amount) over 4 quarters for three years.

The details of what the plot shows is in the next image:





BoxPlot_01

This data is from the demo database on SAP SQL Anywhere 17 server. The data visualization is carried out by using R Script in Power BI.

Thursday, September 8, 2016

How do you create WordCloud? Is there a online tool?

Word Cloud ( a group of words with various sizes having the appearance of a cloud) takes in lots of words and produces a picture of the words with their sizes based on how many counts of them are in the lot.

Here is an example of words that I used as keywords in one of my blogs (used a subset only):

Visual Studio 2015 Community Update 3, Visual Studio Community, Visual Studio Dev Essentials., Visual Studio Express 2015 for Desktop, Visual Studio Express 2015 for Windows Desktop, Visual Studio Extensions, Voice commands, Voice Over, VoIP, VP8 Codec, VS 2008, VS 2015 Community, VSIX, W3C, Warmer color, watchOS, WaveHC, Web, web app, Web Application, Web Apps, Web Browser Control, Web content loading; Head compression, Web Matrix, Web Matrix 3, Web Note, WEB page data, Web Pages, Web Server, Web Services on

When I create a Word Cloud this is the picture you see:


Wordle_00

Yes there is an online program. The image is created using an online java program which you can access here:
http://www.wordle.net/create

I had to upgrade my Java to a new version before I can see this on my Firefox browser. This may not work on Microsoft Edge.


Here is the UI of the WordCloud that you can customize with fonts, colors, layouts etc.

In order to create use the Create menu in the online tool. In the text box enter a number of words separated by commas. Hit Go and yo will see the image which you can customize.

Tuesday, September 6, 2016

What is involved in setting up R Services in SQL Server 2016?

While installing SQL Server 2016 you can install all components related to R Services (in-database). After installing you need a few more additional steps required to enable R Services feature like cconfiguring accounts and giving permissions to specific objects etc.

These are the steps:

Step 1: Install R Services (In-database) on SQL Server 2016

Step 2: Enable R Service and Verify that Local R Script Execution Works

Step 3: Enable Implied Authentication for Launchpad Accounts

Step 4: Give Non-Admin Users R Script Permissions-Grant Permission script

For further details go here:
https://msdn.microsoft.com/en-us/library/mt696069.aspx
For details of Step 1 go here:
http://hodentekmsss.blogspot.com/2016/06/installing-sql-server-2016-developer.html
For details of Step 2 go here:
http://hodentekmsss.blogspot.com/2016/07/problem-enabling-r-service-in-sql.html
http://hodentekmsss.blogspot.com/2016/09/enabling-r-service-and-verifying-local_6.html

Friday, September 2, 2016

Can you install SAP SQL Anywhere server on Windows 10?

Yes, you can.

You need to download the installation file from here after registering here:

https://go.sap.com/cmp/syb/crm-xu15-int-sqldevft/index.html

You can download both SAP SQL Anywhere 16 which requires a key that you get after registering or SAP SQL Anywhere 17 which does not require a key. The product you get is a developer edition good for developing on your machine and not for production.

If you do not know about SAP SQL Anywhere may be this is a good place to start:

It is available for Linux as well as Windows. I downloaded the Windows version (x64 bit).
As the ad says, it just Works.

After installation you should be seeing these on your Windows 10 computer.


There are a number of built-in tools that you can use.


Get dozens of tutorial articles on Sybase/SAP SQL Anywhere from here.

Can you connect to SQL Server Compact in SQL Server Management Studio?

Unfortunately no. It was once possible long ago.

You could however connect to SQL Server Compact using Visual Studio 2015 Community Update 3 (this is what I am using).

In addtion to this you should download and install the SQL Server Compact/SQLite Tool box extension for Visual Studio from here:

(https://github.com/ErikEJ/SqlCeToolbox).

Once you do this, you can access the tool box extension you added in Visual Studio and if you have a SQL Server Compact on your computer you can cconnect to it as shown here:


If the version of SQL Server Compact is 3.5 like mine was, the tool box upgrades it to version 4.0.

In Visual Studio 2008 or 2010 you could do this:

http://hodentekmsss.blogspot.com/2010/07/sql-server-compact-35-basics-you-must.html


https://www.packtpub.com/books/content/connecting-microsoft-sql-server-compact-35-visual-studio