Saturday, August 15, 2015

WCF Services - How to consume a Service without access to it

When working on a project that contains decentralized approach, different modules are deployed on different servers by different development teams and all that needs to be integrated with each other, there can be issues regarding accessing a web service that hasn't been published for access yet or is deployed on another domain with access restriction.

To access a contract for a service that is out of reach, Visual Studio provides a tool svcutil.exe that can generate a proxy for the service. This tool needs to be executed on the machine the service is deployed to in order for it to generate the required proxy.

Executing the svcutil.exe on command line with the following command will generate the proxy
C:\path> svcutil /t:code /language=cs http://<service address> /out:MyServiceProxy.cs /config:ServiceProxy.config
Now the generated .cs file can be added to the client application project to obtain the classes and method contracts. The endpoint configuration is generated in the .config file that can pe copied to the web.config file of the client application project.

If svcutil.exe is not available in the server machine, it is available for download in the internet as WCF Test Client package.

Tuesday, February 17, 2015

Learning SQL - Part 1 - Fetching Data

What is SQL? It is basically just a standard language for interacting with databases, and that is what we will be doing. SQL stands for Structured Query Language. Manipulating data through SQL is similar throughout all Database Management Systems (DBMS) so we should not worry much about differences in language syntax. Basic syntax and operations are exactly the same among these DBMS. We use SQL mainly for Relational Databases, but we will not discuss that here. For this article it is expected the reader knows what databases are including tables, columns, restrictions, and views.

SQL allows us to create, fetch, modify and delete all elements of a database including tables, records, stored procedures, and views. Tables, simply, represent an entities in databases, much like how classes are in a software program, while records stored in the table follow the rules and columns that are set for that table. A table consists of finite number of columns, exactly how a class in a program contains attributes, but that is not the focus of this article.

Monday, February 16, 2015

Programming 101 - Part 2 - Working with Numbers and Words

Expressions and Data Types


There are six basic atomic data types in C++;

char, int, float, double, void, bool


Any other data type that we may come across are derived from these six. The first listed data type is a single character type, you can save an 'A' or an 'h' but not a complete sentence... we will get to that later on. The second type is of an integer or a number. This can hold a large numerical value... from -32,767 to 32,767. Of-course you can change it to an unsigned form by adding the "unsigned" keyword before "int", the numerical range than gets from 0 to 65,535 - unsigned positive range only.

The third data type is a decimal type with 6 digits of precision. The fourth increases decimal to 10 digits of precision. Both are almost the same but there applications can vary based on the requirement of a program.


The fifth data type is the most distinct one, its name is quite clear, its plain void, meaning the data represented by this type is not zero, not null, just nothing. Seems pretty weird but it isn't. There are many occasions when a program is not able to produce any result, but no result can not always be a zero, sometimes it is appropriate for it to be just nothing. This will get clear once experience is attained in programming for different scenarios and methods that only do something but return nothing.

Kendo UI Grid - Server Side Paging, Filtering and Sorting

There are a number of ways a DataSource can be handled with a Kendo UI Grid. In this article we are going to talk about binding data from a remote location on to a Kendo UI Grid with server side paging, filtering and sorting to ensure server response is smallest and light as possible for quick loading and to be able to handle if the data has thousands of records (that can lead to oversized response objects or time outs). I will give example code snippets to form an understanding of the solution.

The Grid


Below is a Kendo UI Grid declaration for which we will implement the server side manipulation.


Programming 101 - Part 1 - The Very Basic in C++ and Java


Welcome to Programming 101. This topic will consist of several parts all in different posts of-course. This post will include the a Hello World for C++ and Java. More posts will follow to explain how the languages work, but don't expect to master the languages by just reading through the content or watching any videos, if and where provided. Experimenting and working out of the box and over what you have learnt leads to becoming a good programmer. I am only writing these to provide very basic understanding of how to write a program.

Lets begin; to start programming you'll need an IDE which is an Integrated Development Environment. I'd recommend an easy simple one: Bloodshed DevC++ for C++, which can be downloaded for free from the Bloodshed website (search it on Google). Or if you wish to pick up the big guns right away then you can get Microsoft Visual Studio and install it for Visual C++. As for Java, I would recommend an open source IDE known as Eclipse, but you are welcome to try Netbeans as well. This topic will feature only console based coding for now.

Introduction to Computer Programming

You might have heard about computer programming and how with its power you can create your very own computer programs or applications? Well we will begin with that journey shortly. I believe you have sufficient understanding of what basically computer programming is all about. If not, then I suggest going through my previous article "Want to know Computer Programming?"... consider it as a prerequisite.

Moving on... Before we start off with Computer Programming, you require knowledge of 2 basic fundamentals:
  1. Programming environment a.k.a IDE (Integrated development environment) which includes an editor, a compiler, a debugger and build tools. We use these to write our program on and then compile and build them for use.
  2. Programming language, an artificial language designed to express instructions that enables the computer to compute desired results. Common examples include C++, C#, Java and lots more. These languages are written on their designated IDEs to build programs.
Since there are quite many languages, I plan to write basics on some of them. As each tutorial is written or made video off, They will start appearing in the labels of my blog. The basics of all the languages are same so to reduce redundancy of content, all the aspects of all languages will not be covered jointly.

Want to know Computer Programming?

You'd see people in the movies or the TV shows type their wits off senselessly while the computer screen pops green windows full of gibberish text and animating in cool styles, and the person showing expressions as if hes understanding all that is popping up and bla bla.... well snap out!! That is not computer programming or hacking, not even remotely.

Computer Programming is a whole different world. But before you know what that world is you should know why we do computer programming. We, the programmers, work to provide real-time solutions to different problems, i.e. communication, data management, entertainment, and so much more. Now to tell you what the world is....

Computer Programming is done to provide desired results that can be obtained through expertise in required subjects such as knowledge of the application requirements, specialized logic and algorithms.

Computer Programming can be defined as converting solutions to real-life problems into something a computer can understand and perform.