Sunday, November 8, 2015

What is SQL CLR or SQLCLR?

In order to understand what is SQLCLR, you need to know what the individual parts, Sequential Query Language (SQL) and Common Language Runtime (CLR) are.

Common Language Runtime is the programming that manages the execution of programs written in any of the supported languages such as C#, VB, Visual C++ etc to share common object orineted classes. Thiss is somewhat like Java Virtual Machine for programs run from Java. CLR is also called 'managed execution environment'. CLR is therefore related to .NET programming.

SQL is a language that is needed to run queries (post questions to) against SQL Server databases. It is not specific to Microsoft SQL Server. It can also be used with other databases like Oracle, Sybase, etc.
However Transact SQL (T-SQL) is the enhancement to add some progrmmability to SQL.
SQL Common Language Runtime (SQLCLR) is the combo technology (SQL Server and .NET) for hosting .NET common language runtime engine within SQL Server. In other words you can run managed code from within SQL Server.

Since T-SQL already adds to SQL the programming capability why does one need SQL CLR?

The reason I that there are certain useful class of programs that are just not handled by T-SQL, or make it much more complex and less secure. Of course there are more reasons why SQL CLR is needed. This is the reason for the development of SQL CLR. Also Microsoft made extensive integration of SQL Server with its massive .NET programming which makes it lot more flexible.

For, Creating a Visual C++ CLR Console Application in Visual Studio 2015 go here.

Thursday, November 5, 2015

What is needed to visualize data in R?

Basically you need a graphic program.

When you install R you already have a basic graphic package and you can verify it by using the command library() in the R Gui. If you do not have R on your computer you should get one as described here.  It is really quite easy.

Graphics_00.png

Installing R gets only Graphics in the above list of packages. While this is a basic package, you also can use the more comprehensive plotting package called ggplot2.

You install it using the following command:

> install.packages("ggplot2")

Graphics_01.png

Since it is not on the machine a list of mirror sites will be displayed where you can get the package. When I chose 'California' (US(CA 1), mirror in this list, after going to the site the program returned the message that 'ggplot2' is not available for R version 3.2.2.



When the search failed, the R Gui came up with the following command:
>chooseCranmirror()

When a different mirror site in Texas was chosen, the program was able to download and install it on the computer.
The result of installing is shown here, copied from the R GUI interface:
----
> chooseCRANmirror()
> install.packages("ggplot2")
also installing the dependencies ‘stringi’, ‘magrittr’, ‘colorspace’, ‘Rcpp’, ‘stringr’, ‘RColorBrewer’, ‘dichromat’, ‘munsell’, ‘labeling’, ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/stringi_1.0-1.zip'
Content type 'application/zip' length 14265659 bytes (13.6 MB)
downloaded 13.6 MB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/magrittr_1.5.zip'
Content type 'application/zip' length 149844 bytes (146 KB)
downloaded 146 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/colorspace_1.2-6.zip'
Content type 'application/zip' length 393156 bytes (383 KB)
downloaded 383 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/Rcpp_0.12.1.zip'
Content type 'application/zip' length 3189762 bytes (3.0 MB)
downloaded 3.0 MB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/stringr_1.0.0.zip'
Content type 'application/zip' length 82841 bytes (80 KB)
downloaded 80 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 26681 bytes (26 KB)
downloaded 26 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/dichromat_2.0-0.zip'
Content type 'application/zip' length 147785 bytes (144 KB)
downloaded 144 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/munsell_0.4.2.zip'
Content type 'application/zip' length 126094 bytes (123 KB)
downloaded 123 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/labeling_0.3.zip'
Content type 'application/zip' length 40880 bytes (39 KB)
downloaded 39 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/plyr_1.8.3.zip'
Content type 'application/zip' length 1114785 bytes (1.1 MB)
downloaded 1.1 MB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/digest_0.6.8.zip'
Content type 'application/zip' length 151939 bytes (148 KB)
downloaded 148 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/gtable_0.1.2.zip'
Content type 'application/zip' length 64140 bytes (62 KB)
downloaded 62 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/reshape2_1.4.1.zip'
Content type 'application/zip' length 503481 bytes (491 KB)
downloaded 491 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/scales_0.3.0.zip'
Content type 'application/zip' length 603649 bytes (589 KB)
downloaded 589 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/proto_0.3-10.zip'
Content type 'application/zip' length 458603 bytes (447 KB)
downloaded 447 KB

trying URL 'https://cran.revolutionanalytics.com/bin/windows/contrib/3.2/ggplot2_1.0.1.zip'
Content type 'application/zip' length 2677225 bytes (2.6 MB)
downloaded 2.6 MB

package ‘stringi’ successfully unpacked and MD5 sums checked
Warning: unable to move temporary installation ‘C:\Program Files\R\R-3.2.2\library\file4b804f971e0f\stringi’ to ‘C:\Program Files\R\R-3.2.2\library\XXXXXXXXsti’
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘colorspace’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘stringr’ successfully unpacked and MD5 sums checked
package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘dichromat’ successfully unpacked and MD5 sums checked
package ‘munsell’ successfully unpacked and MD5 sums checked
package ‘labeling’ successfully unpacked and MD5 sums checked
package ‘plyr’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
package ‘gtable’ successfully unpacked and MD5 sums checked
package ‘reshape2’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘proto’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\Jayaram\AppData\Local\Temp\XXXXXXXX\downloaded_packages
>

Now if you run the command
>library()
You will see that ggplot2 is now in the installed list as shown.

Graphics_03.png

To know more about ggplot2 go here.
Good luck with data visualization!



Wednesday, November 4, 2015

Are you looking for a computer inventory tool?

MAP toolkit is a great tool to find information on various items of your computer/server. Before you think of migration of any kind, a tool such as this one is going to be very helpful.

MAP which stands for Microsoft Assessment and Planning Tool, presently in version 9.3 is according to Microsoft,

"The Microsoft Assessment and Planning (MAP) Toolkit is an agent-less inventory, assessment, and reporting tool that can securely assess IT environments for various platform migrations—including the latest versions of Windows client and server operating systems, Microsoft Office and Office 365, Microsoft SQL Server, Hyper-V, Microsoft Private Cloud Fast Track, and Windows Azure.
"
MAP Toolkit can deal with most of the following scenarios although some of what you read in this post deal with SQL Servers (database):

  • Cloud
  • Desktop
  • Server
  • Desktop Virtualization
  • Server Virtualization
  • Database
  • Usage tracking
  • Environment
This covers all most everything you ever dealt with in you computer.
Where can I get this tool?

Download from here .
Double click the downloaded file and you are ready to go.

Here are things you can find about the Desktop:

Map_Desktop

This one about what you can find about the Cloud:


Map_Cloud.png

You can use MAP to inventory any of these. This is indeed a big list.

•Windows 10
•Windows 8.1
•Windows 8
•Windows 7
•Windows Vista
•Windows XP Professional
•Office 2013 and previous versions
•Windows Server 2012 R2
•Windows Server 2012
•Windows Server 2008 R2
•Windows Server 2008
•Windows Server 2003 R2
•Windows Server 2003
•Windows 2000 Professional or Windows 2000 Server
•Internet Explorer
•VMware vSphere
•VMware vCenter
•VMware ESX
•VMware ESXi
•VMware Server
•Selected Linux distributions
•SQL Server
•Oracle
•Hyper-V
•Lync
•System Center Configuration Manager
•Forefront Endpoint Protection
•Exchange Server
•SharePoint Server
•BizTalk Server
•Visual Studio 2010 and 2012 Premium and Ultimate editions
•Software ID (SWID) Tags

Tuesday, October 27, 2015

How do you use the PHP Explode function?

This post describes some examples run on a Windows 10's Internet Information Services. This is relevant for PHP 4 and PHP 5.


First directly from documentation:
array explode ( string $delimiter , string $string [, int $limit ] )

Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter.


Parameters ¶

delimiter

The boundary string.

string

The input string.

limit


If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string.

If the limit parameter is negative, all components except the last -limit are returned.

If the limit parameter is zero, then this is treated as 1.

Here is an example PHP file (a text file saved with the extension php) in the root directory (wwwroot) of Inetpub on a computer running Windows 10.
============
explodephp.php
============


Explode Function


$str="A thing of beauty, is a joy for ever!";
print_r(explode(" ",$str));
?>

-----------------
At first the file should not be saved to wwwroot with extension txt, it must be php

In the SaveAs window it can he saved as ANSI, Unicode, UTF-8 or Unicode Big Endian - you have to choose the correct one.

In the first position of the explode() function you need to choose the delimiter which can be, space, comma, etc and then the $str variable is to be set.

Here are some examples with parsed content. If there is no response as in some examples here, a FALSE is returned. Also if a delimiter is not present, the whole string is returned.


Parsing a string in Japanese


Friday, October 23, 2015

How do you fix the WLDCORE.dll error in Windows 10?

I upgraded my Windows 7 (x64) Ultimate on Toshiba Laptop (Satellite S70 Series) to Windows 10 without using an ISO.

I installed Mail and Movie Maker (1, 2) couple of months ago and at that time I did not install all the programs in Windows Essentials.

The missing DLL error

When I tried to access the Windows Live Mail app in all Apps as shown here,


 WldcoreDLLError9.png
I would immediately get a missing DLL Error.

EmailDriverProblem.png

I would also get this error if I try to click on an email link on Microsoft Edge to send the mail.

I looked for this file on the computer as well as in the registry. I could not find the file. It appears to me that if you do not install all the programs in Windows Essentials then you would not have this dll in your computer although Windows Essentials 2012 is on your computer.

The programs in Windows Essentials2012 are:

  WldcoreDLLError.png

I did find Windows Essentials on my computer (Control Panel | Programs and Features | Programs) .

WldcoreDLLError6.png

Hence I decided to repair the program by opting to Change rather than Uninstall.
Here are some repair shots:




This fixed the problem and I could start Windows Live Mail without any problems. The wldcore.dll was found in Program Files(x86.
Windows Live Mail has a neat user interface and I may stop using gmail.











Thursday, October 22, 2015

How do I find the Java Control Panel in Windows 10?

Java is a key program which is widely used and you invariably need Java on your computer. Microsoft Windows is another equally important operating system and with Windows 10 and the new Microsoft browser, Microsoft Edge, one of course need to know about how Java works on Windows 10.

Finding Java Control Panel
Go to Control Panel | Programs
You will find Java

CPL_Java1.png
Click on Java. Java Control Panel opens as shown.

CPL_Java2.png

This is how it is registered in the Windows Registry.


CPL_Java3.png

This advice is from Java web site.
From Windows Search, type in Java. In the search results, select Configure Java. The Java Control Panel will appear.

Monday, October 19, 2015

Is there telnet client/server in Windows 10?

Presently Telnet Server is not implemented on Windows 10. Telnet Client is installed but not enabled. Most probably it is deprecated as was done for the latest server.
---------
Telnet server deprecated use remote desktop
---------------
TELecommunication NETwork protocol is an unsecured (username/password is in text, not encrypted) network protocol and its use will be prejudicial to security on local networks as well as Internet.
It was still available in Windows 7. Follow these threads (1, 2) for Installing
Telnet Client and Telent Server on Windows 7.

Telnet client is installed but not enabled on Windows 10 and you need to
enable it. You can go this directory to access telnet.exe on Windows 10.
C:\Windows\System32\telnet.exe. Presently it is used to connect to remote servers
at.

Enabling the client on Windows 10:

Here are screen shot(s) to enable Telnet Client on Windows 10 and test it.

This is how your Windows Features accessible from Control Panel |
Programs | Programs and Features | Turn Windows Features On or Off
appears when telnet client is enabled. When not its not enabled there is no check mark:


telnet1.png

Place check-mark for Telnet Client (if not checked) and click OK.

You can now test the client as shown using command line:
C:\WINDOWS\system32>telnet
You get the following response:
Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet>

You get the help now using the following command:
Microsoft Telnet>help /?
The response will be:
Commands may be abbreviated. Supported commands are:

c    - close                    close current connection
d    - display                  display operating parameters
o    - open hostname [port]     connect to hostname (default port 23).
q    - quit                     exit telnet
set  - set                      set options (type 'set ?' for a list)
sen  - send                     send strings to server
st   - status                   print status information
u    - unset                    unset options (type 'unset ?' for a

list)
?/h  - help                     print help information