Sunday, December 7, 2014

What is LINQ?

We know that a query is a question we pose to the database to retrieve some information that we would like to know. For example, in a database that consists of men and women, you may want to know how many men and how many women. Let us go a step further and say that there are people of all nationalities in the database of men and women. You may want to know how many women who hail from Europe are there. This is only filtering of the information but a query can much more complex. This is of course querying a database, let us say a relational database such as the SQL Server where you use the Structured Query Language(SQL), a special language you have to learn.

All data are not in relational databases and they could be in some kind of an XML document, a web service or something else. For example, in order to find some filtered content in an XML document you would use a language called XQuery which is not the same as SQL. This means there is need to learn another query language.

Beginning with Visual Studio 2008 and .NET Framework 3.5 Microsoft introduced LINQ which stands for Language-Integrated Query an innovation that made it possible to query a SQL Server database, an XML document, Web Services etc with a single lanugage and it is a first class query language.

In Visual Studio you can write LINQ in both VB and C# for any collection that supports IEnumerable or the generic IEnumerable interface (or to put it simply a collection in which one can go through the collection item by item).

For example you may have a list  of names ("John", "Tom", "June", "Diana") etc.  or  the number of rows in a database table , etc. and they can be queried using LINQ.

Need to query SQL Server with LinqPad, review the following posts:

Tuesday, December 2, 2014

What are the different frameworks you can use with Intel XDK App Designer project?

In the latest version of Intel XDK you can create one of four frameworks to work with. They are,
  • App Framework
  • BootStrap 3
  • jQuery Mobile
  • TopCoat
App Framework
Basically used for mobile devices and supports native OS such as Googl Android, Apple iOS, RIMBlackberry and Microsffot Windows 8. It has no outside dependencies and optimized for speed. It is Javascript library for mobile HTML5 apps.

Bootstrap 3
It is an open source UI library mostly used for web. Although not meant for mobile devices it still works OK. It is heavy on CSS3 and uses jQuery

jQuery Mobile
Uses JQuery and meant for mobile and optimized for touch. Use HTML5 for UI design for rsponsive weeb and apps (smartphone, tablet and desktop).

Pure Open source CSS for clean mobile and web apps. Optimized for performance with no other dependencies. It has its origins in Adobe design.

Thursday, November 27, 2014

Can you access ODATA with PowerShell?

Yes you can. However you need to use PowerShell Version 4.0

Here is an example.
I take the example of using the ODATA service provided by ODATA.Org
Here is the URL of this service:

If you were to type this into you browser,you would see this.

This shows meta data of the collection in this service

Launch Windows PowerShell with elevated permissions.

Verify you are using Version 4
PS C:\Windows\system32> $PSversionTable.PSversion
Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1


Declare a $Categories variable as shown
You will be returned to the next line if there are no errors
Let us see what is in categories
PS C:\Windows\system32> $categories
id       :
category : category
link     : {link, link, link}
title    : title
updated  : 2014-11-27T21:11:29Z
author   : author
content  : content

id       :
category : category
link     : {link, link, link}
title    : title
updated  : 2014-11-27T21:11:29Z
author   : author
content  : content

id       :
category : category
link     : {link, link, link}
title    : title
updated  : 2014-11-27T21:11:29Z
author   : author
content  : content
Looks like there are three categories
Let us look at the titles and link of these categories
PS C:\Windows\system32> $categories.title
type                                                        #text
----                                                        -----
text                                                        Food
text                                                        Beverages
text                                                        Electronics

PS C:\Windows\system32> $
rel                                     title                                   href
---                                     -----                                   ----
edit                                    Category                                Categories(0) Products                                Categories(0)/Products Products                                Categories(0)/$links/Products
edit                                    Category                                Categories(1) Products                                Categories(1)/Products Products                                Categories(1)/$links/Products
edit                                    Category                                Categories(2) Products                                Categories(2)/Products Products                                Categories(2)/$links/Products


Tuesday, November 25, 2014

What is a Easy Transfer Cable? or do you need to go from XP to Windows 7?

You have already heard that Windows XP support is history. If not, read the following:

After Windows XP came a number of OS Upgrades the most important ones being Windows Vista, Windows 7, Windows 8, Windows 8.1 and soon Windows 10. Of course there were two different architectures as well x32bit and x64bit.

If you had had a Windows XP and migrating to Windows 7 you would need a easy tool. Looks like Windows Easy Transfer was utility made just for this and should be available in Windows 7.

With this utility there were three ways you could transfer stuff between two computers as shown in the opening screen of Windows Easy Transfer (migwiz.exe).

If you were without a network connection you could use the Easy Transfer Cable or create a file on a external HD or a USB Flash drive.

Well what is this Easy Transfer Cable?

It is a USB Male-to-Male connector with an intervening electronic device that allows fast transfer between the connected computers while providing short-circuit protection.

You could buy this cable from a number of vendors such as Belkin (Model FSU258, FSU279),  Dynex (DX-C113231), and many others.

Here is a picture of one of the Belkin cables.
 Here is a listing of transfer support it provides.

Read more here:

Friday, November 21, 2014

How can I install PHP on Windows 8.1?

In order to install PHP on your machine you should have the local web server working which is IIS 8.0 on a Windows 8 OS.  if it is not activated you can activate it from Control Panel (Turn Windows features on or off ).

If the IIS 8.0 is activated you should be able to see the following screen when you access  http://localhost in  browser on your computer.

For the current laptop the following is the response:

Assuming you had no problem activating IIS 8.0 we can move to the next step of installing PHP 5.x.

Downloading and installing PHP 5.X:

PHP can be downloaded (free) using the latest Web Platform Installer (WebPI) which happens to be WebPI version 5.0 from here:

The advantage of using the WebPI is that it not only it installs PHP engine but also configures it to work with IIS.

Downloading and installing is quite easy as shown in the following post:

After installing PHP engine you should test to verify it is working correctly by browsing the info.php file shown next from the following file location:


Here is the simple code listing for info.php:

If your PHP engine is working well you should see the following (only part of a very long page is shown) when you browse this file in your IIS or type the following in the address box of your browser.
This completes the installation of PHP 5.6 on Windows 8.1 Professional that works well with IIS 8.0

In a future post we take a look at accessing SQL Server 2012 from a PHP application.

Related must read article:
I have covered in detail how to use PHP applications (PHP versions 5.2.4 or later) to access data on Microsoft Azure SQL Databases (formerly called  Microsoft SQL Azure) using PHP Data Objects. Details are on pages 369-373, Chapter 10 in my 2010 book here:

You can buy or join the library here:



Wednesday, November 19, 2014

What is DMCA?

DMCA stands for Digital Millennium Copyright Act (it is part of the US Copywrite law) and it criminalizes, "production and dissemination of technology, devices, or services intended to circumvent measures (commonly known as digital rights management or DRM) that control access to copyrighted works".

This United States copywrite law implements two 1996 treaties of World Intellectual Property Organization.

Follow Wikipedia for further details:

According to this law you could be penalized and pay penalties for copywrite infringement on the Internet.

DMCA provides protection to online providers such as Google from copywrite infringement liability claims provided, Google and similar providers remove or disable the alleged infringing sites.
You can get more information here for DMCA related information for Google Products:

If you think you are the target of copywrite infringement (Let us say your blog or some picture) you could bring it to the notice of Google or the other provider so that they can take steps to remove.

How effective is this process?

Internet is big and the complexity grows each day and I am not really sure how much protection you can get. I have been the target and you can read about it here  and here.


Monday, November 10, 2014

What is the difference between Windows PowerShell and Windows PowerShell ISE?

Windows PowerShell is not a GUI application and it runs the PowerShell engine in the host program. You will see the following screen displayed when you access Windows PowerShell from the Search charm on Windows 8.1.

If you choose to launch you should search for 'Windows PowerShell ISE. The following screee will be displaced. It is rich interface that has many features including interactive help in scripting. If you are new to Power Shell you should begin your learning with this tool.

You can launch them as administrator which gives you more power (Run as Administrator) and is called launching with elevated permissions.

You can launch multiple instances.

You may be interested in these two posts as well: