Friday, July 31, 2015

What are variables in C++ and how do you declare them?

Please review this previous post before you dig into this post.

A variable is a portion of the memory to store a value very similar to your pigeon-hole in your mail office at work.


This picture shows all mailboxes of same size, in C++ and other programming languages you have variables of different sizes and the above analogy has to be modified. The idea that a variable indicates the storage in memory is valid.

In order to declare a variable you need a name and type. The name can be anything other than the names reserved for its (C++ Program) use. You can find them in references (for example:

The type however, depends on what the variable stands for, such as, is it an integer or a floating point; is it a single character or a bunch of characters; does it represent time in some fashion? etc.

Declaring variable that are integers

The following three lines declare three integers

int a;
int z;
int axc;

The following line declares 3 integers as well. Note that to declare in a single line all of them should be of the same type. This is a short hand for declaring more than one variable.

int result1, result2, result3;

Just declaring a variable is not enough, to work a program, you need to provide a value to the variable, that is called assigning a value.3

Assuming you declared variables as indicated earlier, now the following lines assign values to them:


Once you have a bunch of varibales declared and assigned as above you can operate on them in various ways;

result1=a+z; //(this should produce the result 25
result2=axc/(a+z);//(this should produce the result 60)
result3=axc/100;// (this should produce 15)

Here the operators are + (add), and / (divided by)

Now this is all put inside a project called Variables_01 as shown using Visual Studio Express 2015 for Windows Desktop. Of course you can use any other program with C++ compiler.

I assume you reviewed the post mentioned earlier, if not go back and review.

You need to reference in your stdafx.h file as shown:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently

#pragma once
#include "targetver.h"



Build and run this program, the result displayed as shown.


Tuesday, July 28, 2015

How do you create a C++ Windows Console Application in Visual Studio 2015?

In a recent post I described why you cannot use Visual Studio Express 2015 Community for developing C++ Windows Console Application.

You need Visual Studio Express 2015 for Windows Desktop to develop the C++ Windows Cosole application. Downloading and installing the same and the various templates that you can use are described here .

Launch Visual Studio Express 2015 for Windows Desktop (just VSDesktop in this post) from its shortcut.Click on New Project... to open the New Project window and expand the Visual C++ node as shown highlighting the Win32 Console Application. Change the name of the project to Console2015 and accept default directory for saving.


Click on Win32 Console Application to display the Welcome wizard screen as shown.


Click Next button at the bottom of screen to display the Win32 Applicaiton Wizard screen as shown.


Accept all items on the above screen and click Finish.

The project window opens as shown with the Console255.cpp file on the left and the project folders/files in the Solution Explorer as shown. This should build without errors.

Double click and view the stdafx.h file. Add the indicated (in red) '#include' files as shown as we are planning to use the console as well as 'string' variables.
#include "targetver.h"

// TODO: reference additional headers your program
//requires here
Open the Console2015.cpp by clicking the same in soltuion explorer.

Add the followind code to this file as shown. 'endl' adds an empty line to the output.
#include "stdafx.h"

int main()
 std::string mystring = "Hello, from Waikiki";
 std::string mystring2 = "This is Jay";

 std::cout << mystring2;
 std::cout << std::endl;

 std::cout << mystring;
 std::cout << std::endl;
 return 0;


From Main menu click Build | Build Solution. You should see the
following in the Build Outpt screen.
1>------ Build started: Project: Console2015, Configuration: Debug
Win32 ------
1>  stdafx.cpp
1>  Console2015.cpp
1>  Console2015.vcxproj -> c:\users\jayaram\documents\visual studio

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped

Hit Start without debugging (CTRL+F5) to run the program. The output
is displayed in the console as shown.


By using the namespace designation the above code can be modified as
shown (stdafx.h stays uncchanged):
// Console2015.cpp : Defines the
// entry point
// for the console application.

#include "stdafx.h"
using namespace std;

int main()
string mystring = "Hello, from Waikiki";
 string mystring2 = "This is Jay";

 cout << mystring2;
 cout << std::endl;

 cout << mystring;
 cout << std::endl;
 return 0;




Saturday, July 25, 2015

How do you create a C++ Console Application in Visual Studio 2013?

First of all get a copy of Visual Studio 2013 Community as described in the following posts.

Launch Visual Studio 2013 from its shortcut.


Click on New Project... to open the New Project window as shown.



Expand Visual C++ and under Win32 there are two templates as shown.


Change the name of the project from ConsoleApplicaiton1 to Testing and accept the default location and other items. Click OK.
Win32 Application Wizard opens to the Welcome window as shown. Read the readme.txt file.


Click Next.
The second page of the wizard (Application Settings)is displayed as shown.


Since you started with Windows Console application, the application type is already chosen-Console application. You can leave the other  options as they are. Click Finish.
The Project folders and files are created as shown in the left and Testing.cpp file is shown on the left. You can build the project and it will build as shown.

Include in the stdafx.h file which has only the following:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently

#pragma once
#include "targetver.h"

// TODO: reference additional headers your program requires here
Modify the Testing.cpp by replacing the existing code with the
following as shown in the next image.
int main()
 std::cout << "Hello Jay! ";
 std::cout << "I'm not a C++ programmer";



Click Build in the main menu. Build is successful as shown.


Click Ctrl+F5 to run without debugging. The command window is displayed with the output of the program written to it as shown.



Tuesday, July 21, 2015

What is Zigbee and what is its importance to IOT?

Zigbee is an open global wireless protocol standard that addresses the needs of low-cost, low-power networks that connect IOT devices such as home automation; (automating functions like opening doors, garage openers, water sprinklers, etc.); environment control like temperature; controlling traffic; and other IOT devices and not just home automation. The range is around 10 to 100 meters and a Zigbee  network can support 1000's of end devices.

Technically speaking the Zigbee standard operates on IEEE 802.15.4 (physical and MAC layers)  physical radio specificaiton and operates in unlicensed bands 2.4GHZ, 900MHZ and 868 MHZ (

The Zigbee protocol was been created and ratified by member companies belonging to the Zigbee alliance consisting of more than 300 leading semicondutor manufacturers; technology companies; service providers; and OEMS. You can find the member list here:

Zigbee components:
  • Coordinator
  • Router
  • End device
The componets are connected in mesh or star. The coordinator which is installed first  as well as the routers which join the Zigbee network next are always up and the end  devices (bulbs, thermostats, etc.) that join later can stay up or down. The end devices are usually battery operated.


Here is an example of setting up a Zigbee network with a specific device. network.

Zigbee being open stardard, the adoption will be slow and vendors add their own special tweaks. Xbee is a special kind of Zigbee manufatured by Digi International. Review this link for more info on Digi and IoT(


Saturday, July 18, 2015

How do you create JSON data with Visual Studio?

You can create JSON formatted data using a text writer as it is really a text file specially
formatted and saved with the extension .json. JsonTextwriter is derived from System.IO assembly.

You can look at everything (properties, methods, etc.) in Newtonsoft.Json which you added to a
Visual Studio project in a previous post using the Object Browser in Visual Studio IDE (herein Visual Studio2013 Community edition.

Browse for Newtonsoft.Json in My Solution as shown in your Visual Studio IDE after displaying the Object Brower.


The first step is to create a C# (could be VB also, but here it is a simple console project)
Project and add reference to Newtonsoft.JSON as described in the previous post.

The following code taken from the Newtonsoft site was slightly altered to make it work in the
Visual Studio 2013 Community edition(free).

The original code is here:


In order to build and run this code in Visual Studio you need to provide references to the various assemblies you will be including in the code. You will be using the various methods that Newtonsoft.Json provides which you can see in the object browser.

The code instantiates a String Builder to take the text writer's text (name and value) and build the Json formatted object.

In order to use String Builder you need to reference System.IO assembly and the result of running the code will be displayed in the Console as shown:


However if you want to display the result in the Debug Output window in Visual Studio IDE you need to do a couple of things:

1. You should add a reference to System.Diagnostics.Debug assembly.
    This may not be available in the default installation of Visual Studio 2013 but you should browse for it in the Window Phone related assemblies (this was where it was found)

2. In the project properties Application page you should change the output type from the default 'Console Application' to 'Windows Application'.


3. Add a line of code to display using System.diagnostics.debug.print()
Now build and run the program and you will display result in the debug output window as shown.


Here is the code that was run to display the above.
using System;
using System.Collections.Generic;
using System. Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.IO;
using System.Diagnostics;

namespace JsonWrite

class Program
static void Main(string[] args)
StringBuilder sb=new StringBuilder();
StringWriter sw = new StringWriter(sb);
JsonWriter writer = new JsonTextWriter(sw);

writer.Formatting = Formatting.Indented;

writer.WriteValue("DVD read/writer");
writer.WriteValue("500 gigabyte hard drive");
writer.WriteValue("200 gigabype hard drive");

// Console.WriteLine(sb.ToString());


Thursday, July 16, 2015

How do you install JSON.NET?

The installation of is very easy. There are three ways you can do it. When you hit the download button on this site you will see the details.


Since I will be using the Visual Studio IDE. I will show how to install it by invoking the Packet Manager console.

Launch Visual Studio 2013 Community edition (this is a free version).

Create a new C# project with the name JsonRead. This creates the folder JsonRead in Solution Explorer and the C# file, JsonRead.cs as shown.


From Tools | NuGet Packet Manager click on the Packet Manager Console as shown.

The Packet Manager Console pane opens as shown. I have already added the package Newtonsoft.Net package to another project called JsonWrite,


Type in the following at the PM> prompt as shown

PM>Install-package Newtonsoft.Json
Json.Net gets added to the project JsonRead as shown in the Solution Explorer


Newtonsoft.Net gets added to the project as shown.


Wednesday, July 15, 2015

When do you use JSON.Net?

JSON is JavaScript Object Notation. You can read all about JSON by reviewing the following:

What is JSON?:

Working with JSON:

SQL response in JSON:

Let us take this fruit (object) which has,
fruit should be used before (Expiry)=12/28/2008
Sizes=small, big, extra large

This object can be represented it in JSON as:
"Name": "Apple",
"Expiry": "2008-12-28T00:00:00",
"Sizes": [

JSON.NET is a high-performance JSON Framework for .NET.

You can read all about JSON.NET here.

The benefits of using JSON.NET are the following (quoted from the above site):

  • Flexible JSON serializer for converting between .NET objects and JSON
  • LINQ to JSON for manually reading and writing JSON
  • High performance: faster than .NET's built-in JSON serializers
  • Write indented, easy-to-read JSON
  • Convert JSON to and from XML
  • Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store
 In order to use it in your .NET project you need to add a reference to NewtonSoft.JSON

Tuesday, July 14, 2015

How to navigate to an URL in Internet Explorer using powershell?

To navigate to an URL use the New-Object definition as in the following: (in this case
PS C:\Users\Jayaram> $ie = New-Object -com InternetExplorer.Application

You get to display the following (contents will be different):


Can you change the size of the window?

Yes, you can change as shown by adding attributes.


When you run the above in Windows PowerShell you get to display a different sized window:


These are supported for the Internet COM Object in PowerShell:


How many powershell modules should I have on my computer?

It depends on what version of Windows you have on your computer (the version of Powershell).

On my windows 8.1 computer, I can get the version of powershell by running this code in powershell:
PS C:\Users\Jayaram> Get-host

Name             : Windows PowerShell ISE Host
Version          : 4.0
InstanceId       : 88471f59-d3a1-4cfe-8293-717336f8bdde
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.Host.ISE.ISEOptions
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
The number of modules and their listing can be obtained by the following:
PS C:\Users\Jayaram> Get-module -ListAvailable

    Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version    Name                                ExportedCommands                                                                    
---------- -------    ----                                ----------------                                                                    
Manifest    ActiveDirectory                     {Add-ADCentralAccessPolicyMember, Add-ADComputerServiceAccount, Add-ADDomainContro...
Manifest    AppBackgroundTask                   {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticLog, Se...
Manifest    AppLocker                           {Get-AppLockerFileInformation, Get-AppLockerPolicy, New-AppLockerPolicy, Set-AppLo...
Manifest    Appx                                {Add-AppxPackage, Get-AppxPackage, Get-AppxPackageManifest, Remove-AppxPackage...}  
Script    AssignedAccess                      {Clear-AssignedAccess, Get-AssignedAccess, Set-AssignedAccess}                      
Manifest   1.0        BestPractices                       {Get-BpaModel, Get-BpaResult, Invoke-BpaModel, Set-BpaResult}                       
Manifest    BitLocker                           {Unlock-BitLocker, Suspend-BitLocker, Resume-BitLocker, Remove-BitLockerKeyProtect...
Manifest    BitsTransfer                        {Add-BitsFile, Complete-BitsTransfer, Get-BitsTransfer, Remove-BitsTransfer...}     
Manifest    BranchCache                         {Add-BCDataCacheExtension, Clear-BCCache, Disable-BC, Disable-BCDowngrading...}     
Manifest    CimCmdlets                          {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession...}       
Binary    ClusterAwareUpdating                {Get-CauPlugin, Register-CauPlugin, Unregister-CauPlugin, Invoke-CauScan...}        
Manifest   1.0        Defender                            {Get-MpPreference, Set-MpPreference, Add-MpPreference, Remove-MpPreference...}      
Manifest   1.0        DFSN                                {Get-DfsnRoot, Remove-DfsnRoot, Set-DfsnRoot, New-DfsnRoot...}                      
Binary     1.0        DFSR                                {New-DfsReplicationGroup, Get-DfsReplicationGroup, Set-DfsReplicationGroup, Remove...
Manifest    DhcpServer                          {Add-DhcpServerInDC, Add-DhcpServerv4Class, Add-DhcpServerv4ExclusionRange, Add-Dh...
Manifest    DirectAccessClientComponents        {Disable-DAManualEntryPointSelection, Enable-DAManualEntryPointSelection, Get-DACl...
Script     3.0        Dism                                {Add-AppxProvisionedPackage, Add-WindowsDriver, Add-WindowsImage, Add-WindowsPacka...
Manifest    DnsClient                           {Resolve-DnsName, Clear-DnsClientCache, Get-DnsClient, Get-DnsClientCache...}       
Manifest    DnsServer                           {Add-DnsServerConditionalForwarderZone, Add-DnsServerDirectoryPartition, Add-DnsSe...
Manifest    FailoverClusters                    {Add-ClusterCheckpoint, Add-ClusterDisk, Add-ClusterFileServerRole, Add-ClusterGen...
Manifest    GroupPolicy                         {Backup-GPO, Block-GPInheritance, Copy-GPO, Get-GPInheritance...}                   
Binary     1.1        Hyper-V                             {Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMHardDiskDrive, Add-VMMigrationNetwor...
Manifest    International                       {Get-WinDefaultInputMethodOverride, Set-WinDefaultInputMethodOverride, Get-WinHome...
Manifest    IpamServer                          {Get-IpamDhcpConfigurationEvent, Remove-IpamDhcpConfigurationEvent, Get-IpamConfig...
Manifest    iSCSI                               {Get-IscsiTargetPortal, New-IscsiTargetPortal, Remove-IscsiTargetPortal, Update-Is...
Manifest    IscsiTarget                         {Add-ClusteriSCSITargetServerRole, Add-IscsiVirtualDiskTargetMapping, Checkpoint-I...
Script    ISE                                 {New-IseSnippet, Import-IseSnippet, Get-IseSnippet}                                 
Manifest    Kds                                 {Add-KdsRootKey, Get-KdsRootKey, Test-KdsRootKey, Set-KdsConfiguration...}          
Manifest    Microsoft.PowerShell.Diagnostics    {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter...}                      
Manifest    Microsoft.PowerShell.Host           {Start-Transcript, Stop-Transcript}                                                 
Manifest    Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path...}                      
Manifest    Microsoft.PowerShell.Security       {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...}                           
Manifest    Microsoft.PowerShell.Utility        {Format-List, Format-Custom, Format-Table, Format-Wide...}                          
Manifest    Microsoft.WSMan.Management          {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig...
Manifest   1.0        MMAgent                             {Disable-MMAgent, Enable-MMAgent, Set-MMAgent, Get-MMAgent...}                      
Manifest    MsDtc                               {New-DtcDiagnosticTransaction, Complete-DtcDiagnosticTransaction, Join-DtcDiagnost...
Manifest    NetAdapter                          {Disable-NetAdapter, Disable-NetAdapterBinding, Disable-NetAdapterChecksumOffload,...
Manifest    NetConnection                       {Get-NetConnectionProfile, Set-NetConnectionProfile}                                
Manifest    NetEventPacketCapture               {New-NetEventSession, Remove-NetEventSession, Get-NetEventSession, Set-NetEventSes...
Manifest    NetLbfo                             {Add-NetLbfoTeamMember, Add-NetLbfoTeamNic, Get-NetLbfoTeam, Get-NetLbfoTeamMember...
Manifest    NetNat                              {Get-NetNat, Get-NetNatExternalAddress, Get-NetNatStaticMapping, Get-NetNatSession...
Manifest    NetQos                              {Get-NetQosPolicy, Set-NetQosPolicy, Remove-NetQosPolicy, New-NetQosPolicy}         
Manifest    NetSecurity                         {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal,...
Manifest    NetSwitchTeam                       {New-NetSwitchTeam, Remove-NetSwitchTeam, Get-NetSwitchTeam, Rename-NetSwitchTeam...}
Manifest    NetTCPIP                            {Get-NetIPAddress, Get-NetIPInterface, Get-NetIPv4Protocol, Get-NetIPv6Protocol...} 
Manifest    NetWNV                              {Get-NetVirtualizationProviderAddress, Get-NetVirtualizationGlobal, Get-NetVirtual...
Manifest    NetworkConnectivityStatus           {Get-DAConnectionStatus, Get-NCSIPolicyConfiguration, Reset-NCSIPolicyConfiguratio...
Manifest    NetworkLoadBalancingClusters        {Add-NlbClusterNode, Add-NlbClusterNodeDip, Add-NlbClusterPortRule, Add-NlbCluster...
Manifest    NetworkTransition                   {Add-NetIPHttpsCertBinding, Disable-NetDnsTransitionConfiguration, Disable-NetIPHt...
Manifest   1.0        NFS                                 {Get-NfsMappedIdentity, Get-NfsNetgroup, Install-NfsMappingStore, New-NfsMappedIde...
Manifest    PcsvDevice                          {Get-PcsvDevice, Start-PcsvDevice, Stop-PcsvDevice, Restart-PcsvDevice...}          
Manifest    PKI                                 {Add-CertificateEnrollmentPolicyServer, Export-Certificate, Export-PfxCertificate,...
Manifest   1.1        PrintManagement                     {Add-Printer, Add-PrinterDriver, Add-PrinterPort, Get-PrintConfiguration...}        
Binary     1.0        PSDesiredStateConfiguration         {Set-DscLocalConfigurationManager, Start-DscConfiguration, Configuration, Get-DscC...
Script    PSDiagnostics                       {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace...
Binary    PSScheduledJob                      {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...}              
Manifest    PSWorkflow                          {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}                        
Manifest    PSWorkflowUtility                   Invoke-AsWorkflow                                                                   
Manifest    RemoteAccess                        {Add-DAAppServer, Add-DAClient, Add-DAClientDnsConfiguration, Add-DAEntryPoint...}  
Manifest    RemoteDesktop                       {Get-RDCertificate, Set-RDCertificate, New-RDCertificate, New-RDVirtualDesktopDepl...
Manifest    ScheduledTasks                      {Get-ScheduledTask, Set-ScheduledTask, Register-ScheduledTask, Unregister-Schedule...
Manifest    SecureBoot                          {Confirm-SecureBootUEFI, Set-SecureBootUEFI, Get-SecureBootUEFI, Format-SecureBoot...
Script    ServerManager                       {Get-WindowsFeature, Install-WindowsFeature, Uninstall-WindowsFeature, Enable-Serv...
Cim    ServerManagerTasks                  {Get-SMCounterSample, Get-SMPerformanceCollector, Start-SMPerformanceCollector, St...
Manifest    SmbShare                            {Get-SmbShare, Remove-SmbShare, Set-SmbShare, Block-SmbShareAccess...}              
Manifest    SmbWitness                          {Get-SmbWitnessClient, Move-SmbWitnessClient, gsmbw, msmbw...}                      
Manifest    StartScreen                         {Export-StartLayout, Import-StartLayout, Get-StartApps}                             
Manifest    Storage                             {Add-InitiatorIdToMaskingSet, Add-PartitionAccessPath, Add-PhysicalDisk, Add-Targe...
Manifest    TLS                                 {New-TlsSessionTicketKey, Enable-TlsSessionTicketKey, Disable-TlsSessionTicketKey,...
Manifest    TroubleshootingPack                 {Get-TroubleshootingPack, Invoke-TroubleshootingPack}                               
Manifest    TrustedPlatformModule               {Get-Tpm, Initialize-Tpm, Clear-Tpm, Unblock-Tpm...}                                
Manifest    UpdateServices                      {Add-WsusComputer, Approve-WsusUpdate, Deny-WsusUpdate, Get-WsusClassification...}  
Manifest    VpnClient                           {Add-VpnConnection, Set-VpnConnection, Remove-VpnConnection, Get-VpnConnection...}  
Manifest    Wdac                                {Get-OdbcDriver, Set-OdbcDriver, Get-OdbcDsn, Add-OdbcDsn...}                       
Manifest    WebAdministration                   {Start-WebCommitDelay, Stop-WebCommitDelay, Get-WebConfigurationLock, Remove-WebCo...
Manifest    WindowsDeveloperLicense             {Get-WindowsDeveloperLicense, Show-WindowsDeveloperLicenseRegistration, Unregister...
Script     1.0        WindowsErrorReporting               {Enable-WindowsErrorReporting, Disable-WindowsErrorReporting, Get-WindowsErrorRepo...
Manifest    WindowsSearch                       {Get-WindowsSearchSetting, Set-WindowsSearchSetting}                                

    Directory: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules

ModuleType Version    Name                                ExportedCommands                                                                    
---------- -------    ----                                ----------------                                                                    
Manifest   1.0        SQLASCMDLETS                        {Add-RoleMember, Backup-ASDatabase, Invoke-ASCmd, Invoke-ProcessCube...}            
Manifest   1.0        SQLPS                               {Backup-SqlDatabase, Add-SqlAvailabilityDatabase, Disable-SqlAlwaysOn, Enable-SqlA...

    Directory: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement

ModuleType Version    Name                                ExportedCommands                                                                    
---------- -------    ----                                ----------------                                                                    
Manifest   Azure                               {Disable-AzureServiceProjectRemoteDesktop, Enable-AzureMemcacheRole, Enable-AzureS...

    Directory: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules

ModuleType Version    Name                                ExportedCommands                                                                    
---------- -------    ----                                ----------------                                                                    
Manifest   1.0        SQLASCMDLETS                        {Add-RoleMember, Backup-ASDatabase, Invoke-ASCmd, Invoke-ProcessCube...}            
Manifest   1.0        SQLPS                               {Backup-SqlDatabase, Save-SqlMigrationReport, Add-SqlAvailabilityDatabase, Add-Sql...

Monday, July 13, 2015

What is needed to encrypt a database in SQL Server 2016 CTP 2.1?

In order to enable encryption for a database you should set the encryption key.

Here is a database (TestEncrypt with three simple columns) which needs to be encrypted and for which no Enccryption key is set.


Change Encryption Enabled from False to True by clicking on the handle.

Click OK.
You get the following error message:


How do you customize Windows PowerShell ISE?

You can change many of the settings as well as fonts & Colors in the Windows PowerShell ISE.

Code coloring, intellisense settings; script pane  customization; and other settings can be changed in Windows PowerShell ISE.

Launch Windows PowerShell ISE from the run program as shown:


In the Windows PowerShell ISE displayed click to open Tools | Options to display the Options window as shown. In the tabbed page (2 tabs) General you will see the following. These are (may be) the defaults.


In the tabbed page Colors and Fonts you can set the changes you want to make or use defaults for Script Pane as well as Console Panes.


Wednesday, July 8, 2015

What is Sass?

Well, Sass is not software as super service. Sass stands for Syntactically Awesome StyleSheets. It is actually an extension of CSS to make CSS more powerful and elegant. Sass helps organizing unwieldy large CSS and let smaller CSS to run faster using the Compass Style Library.

The main features from Sass documentation are:

  •     Fully CSS3-compatible
  •     Language extensions such as variables, nesting, and mixins
  •     Many useful functions for manipulating colors and other values
  •     Advanced features like control directives for libraries
  •     Well-formatted, customizable output
Sass has two types of syntaxes, one older and the other new. The more recent SassyCSS (Scss) is an extension of CSS3 which essentially means that all CSS3 stylesheets are valid SCSS file with the extension .scss.
The older syntax called Sass uses indented syntax instead of brackets for nesting the selectors and has the extension .sass.

It is easy to go from one to the other with a simple convert command.

Note: Sass is Ruby based and windows users need to install Ruby .

After installing Ruby, you can convert the .Scss file to .css file calling the sass command as shown here:   
           sass input.scss output.css
The CSS generated is what you are going to use in your web page.

Here is the reference to documentation:

Here is an example of variables defined with .scss syntax being converted to .css:
$font-stack:    Helvetica, sans-serif;
$primary-color: #333;

body {
  font: 100% $font-stack;
  color: $primary-color;

$font-stack and $primary-color are variables in the Scss syntax and this gets changed to .css after processing as in the following:
body {
  font: 100% Helvetica, sans-serif;
  color: #333;

The above is just an example of a variable, but dig deeper to find the rich coding possibilities.

Well give it a try and find out yourself in what ways you can improve your styling.

Friday, July 3, 2015

What are the different Web Apps you can build in Microsoft Azure?

Between Web Apps and Native apps, the browser based Web Apps have a lot of advantages while in some cases Native Apps are more advantageous.

In the beginning there were ASP.NET Web sites and Cloud Services made their appearance later on Windows Azure, and now there are lots of Web Apps.

Under Web Apps you can build the following kind of apps. Some of the web apps can be built in the Windows Azure Portal and those in preview can only be accssesed in the preview portal:

  • App Service Environment
  • Application Insights
  • Template deployment-classic
  • Web App
  • Web App+MySQL
  • Web App+SQL
  • ......
While the above are all from Microsoft, there are others from third party such as:
  • DNN Platform from DNN Corporation
  • Scalable Wordpress from WordPress
  • Engine Yard Platform as Service
  • SendGrid Email Delivery from SendGrid
  • Umbraco CMS from
  • Notification Hub -not ready even for preview
  • Joomla! from Joomla
  • .....
There are many more and you login to the preview portal here to obtain the details (Search for Web+mobile).


How do you add an URL to the exception site list to run a Java Application?

I recently wanted to access an online java application  which had only a self-signed certificate. Since the application required a Java version higher than the one I had, I installed the Java 8 Update 45 (April 15 release). The installation removed the older versions successfully.

The following warning suggested that I put the web site on the Exception Site List.

However starting with Java 8 Update 20, the medium security level has been removed from the Java Control Panel. Only high and very high levels are available.

In order to run an application with a self-signed certificate, the application's URL must be added to the exception site list.

"The exception site list provides users with the option of allowing the same applets that would have been allowed by selecting the Medium option but on a site-by-site basis therefore minimizing the risk of using more permissive settings."

In order to place the URL on the exception site list, Open the Java Control Panel. As this is a Windows 8 computer you can get a link to the Java Control Panel in the Windows Control Panel. The Java Control Panel opens as shown.


Click on the Security tab to display the following, the default is very high.


Click on the Edit Site List... to open the following:


You can add an item to the list (presently empty) by clicking the Add button. The recommended protocol is HTTPS, but you can also add HTTP and FILE protocols as long as you are sure they are safe.

You need to type in the URL as shown and click OK.


Now although the site has only self-signed certificate you can still run the Java program.

What is Java Mission Control?

Java Mission Control provides you with the tool to troubleshoot your java applications. Using Java Mission Control(jmc) you can manage. monitor and profile Java Applications.

When you install(jmc)( this got installed when I did a Java Update to Java 8 Update 64). I had Java Updates 25 and 71 and these got removed by the Java 8 installed from here (

By installing Java Mission Control, Java Flight Recorder Tool gets installed by default and it records the behavior of JVM at runtime and analyzes the records off line.

You can also install the JMX console that monitors the Java application at runtime and other specialized plug-ins to extend the functionality of JMC.

Here is the JMC UI.

Wednesday, July 1, 2015

Do you need to know the programming language Scala?

BigData is all the rage now.

The functional coding language Scala is Object Oriented, type safe and compiles to ByteCode, the format for JVM. It is therefore interoperable with Java. Apache Spark understands BigData.  For working with Apache Spark and BigData, you better learn Scala.

I would say it is essential to have a knowledge of Scala. Sure Java and Python are also the other languages you should have in your toolbox as all of these allow you to build parallel applications for a distributed environment. In addition to Java, Python, and Scala, R programming can also be used.