How to find SQL Query text, network protocol information via Wireshark

Recently I had to find out if SQL server connections are getting encrypted or not and if so whether it's happening over TLS 1.2 or not. Wireshark made it very easy and provided lots of other info as well.

Python Fundamentals

With the advent of Machine Learning and Automation - one language that was standing out was Python. It seemed to be a language that can do ML, automation, desktop, web, data analytics and even Raspberry pi. So, I thought it is worth to understand the basics.

Thinking

Thinking as a human activity has always fascinated me. In this blog, I will write some of the lessons learned from the books I have read. Both the books were great, by the way!

SQL Joins - ON AND and WHERE

Recently I encountered some SQL join queries where the ON clause of join had few more conditions with AND. I used to think that this is same as putting the conditions in the WHERE clause. However, that was not the case. 

TypeScript Fundamentals

In this blog, I will create a small program showing how TypeScript language can be used to write great javascript code. 

Remote Data Annotation in ASP.NET MVC

In this blog, I will create a small sample demonstrating how "Remote" data annotation attribute works in ASP.NET MVC.

English Grammar

In this blog, I will summarize some of the basics of English grammar that I wished I knew when I was in school...

Basics of how .NET garbage collection works

In this post I will summarize the workings of .NET garbage collection. The notes are from the book Writing High Performance .NET Code by Ben Watson. 

Economics

In this blog, I will write down some basic economic terms that I have learned from the internet and I hope to increase my understanding about economics over time.

Software Architecture

In this blog, I will write some notes about software architecture that I have learned through experience or through books.

Equals & GetHashCode

In this blog, I will create a sample to demonstrate why we should always override GetHashCode when we override Equals.

Javascript Currying

In this blog, I will create an example for demonstrating currying concept in javascript.

Inversion of Control

In this blog, I will create a sample showing how using IoC containers can help achieve a good design - mainly in reducing dependencies.

Orchard Notes

Currently I am evaluating Orchard (http://www.orchardproject.net/) for few of my project needs. In this blog, I will document some of my notes.

Algorithms - Calculating Prime Numbers

In this blog, I will write a small sample showing how to calculate prime numbers in javascript using a technique called memoization. 

jQuery - on example

In this blog, I will create a basic example for the jQuery's on method. On method is a replacement for bind, delegate and live method.

jQuery Examples - 6 (deferred and promise)

In this blog, I will create a small sample which will demonstrate the usage of deferred and promise objects in jQuery.

jQuery Examples - 5 (events)

In this blog, I will cover the basics of jQuery events. I will create an example to demonstrate how the on method works, how we can control bubbling of events and how we can create custom events.

jQuery Examples - 4 (data method)

In this blog, I will create a simple example demonstrating how the data method in jQuery works. I will demo how to add/update, retrieve and remove data. I will also demo the events that get fired when data is set or get.

jQuery Examples - 3 (plugins)

In this blog, I will create an example to demonstrate how custom plugins can be created in jQuery.

ASP.NET MVC Notes

In this blog, I will document some of the useful notes while creating ASP.NET MVC applications. This blog can be used as a quick refresher for ASP.NET MVC concepts.

javascript - finding screen sizes

In this blog, I will create a small sample demonstrating how we can find the various size information that can be accessed using javascript.

jQuery Examples - 2 (custom selector)

In this blog, I will create a simple example for creating our own custom selector in jQuery. I will also create example to add a utility method to the jQuery object and to override an existing method in jQuery.

jQuery Examples - 1 (pushStack, end, extend etc)

In this blog, I will create a few samples to demonstrate some of the helpful utility functions in jquery.

Javascript - Closure and Scope

In this blog, I will create a small sample to demonstrate what Javascript closure and scoping is all about.

Javascript Prototype

In this blog, I will take an extensive look at how the prototype object in javascript works.

Javascript Basics - 3

In this blog, I am going to create an example demonstrating the dom ready and load events.

Javascript Basics - 2

In this blog I will create a small sample demonstrating how to define classes, private, public and global variables and functions in javascript.

Javascript Basics - 1

In this blog, I would create a few sample examples to demo basic javascript concepts. 

Javascript Functions

In this blog, I will create a small sample showing how javascript functions work, how they are called and what happens when they are called.

Javascript Notes

I am currently reading "Javascript - The Good Parts" by Douglas Crockford. I would recommend this book to anyone who works with javascript or jQuery or any other js based libraries. In this blog, I would note down few of the important lessons from this book and some other books I have read so far on this subject -

Raven DB Basics

In this blog, I will try to understand the basics of NoSQL databases. I will also try to see how one of the NoSQL databases i.e Raven DB works.

Photography Basics

I have a point and shoot Canon s100 camera with handful of manual functions. Mostly I take pictures in the "auto" setting but I wanted to learn the basics so that in case of moving objects or dim-lit areas, I can take nice pictures. Below are few notes from my experimentation.

Regular Expressions

In this blog, I will create few simple examples demonstrating regular expressions using javascript.

Philippe Starck on design

In this blog, I am just trying to understand what Philippe Starck is trying to say in terms of life, our role in life and design.

Bit Manipulation

In this blog, I am going to write some code demonstrating how bit operators work in C#.

Javascript setTimeout and setInterval functions

In this blog I will create a small sample demonstrating the usage of javascript setTimeout and setInterval functions.

HTML 5 Canvas and Shapes Basics

In this blog, I will create some basic shapes in a canvas.

CSS Cheatsheet

In this blog, I would like to cover some basics of CSS. CSS helps us in abstracting styles (presentation) from markup and business logic. 

Knockout and JSRender Converter Example

In this blog, I will create a small sample to demonstrate how we can use the jsrender converters to separate code from templates. 

Knockout with JSRender Example - II

In this blog, I will create another example of working with knockout and jsrender. This example will demonstrate how to go up and down the object tree and how to register and compile the jsrender templates for better performance and reuse.

Knockout with JSRender Example - I

In this blog, I will create a sample which combines the data binding and mvvm characteristics of Knockout with some of the basic templating features of JSRender.

Knockout Containerless Binding Example

In this blog, I will create a sample which demonstrates how we can avoid creating unnecessary div or other containers to use knockout bindings.

Knockout Dependent Observables Example

So many times we have a scenario where we want to populate a dropdown based on selection of another dropdown. For example, selection of country and states or for selection of cars based on make and models. In this blog, we will see how we can use knockout's dependent observable to accomplish this.

Knockout Data Bindings and Templates Example

In this blog, I will continue with the discussion of data bindings in knockout. We will explore a bit of knockout templating as well.

Knockout Data Bindings Example

In this blog, I will create some simple examples which highlight how data binding can be achieved in normal HTML controls such as dropdown, buttons etc using knockout javascript library.

Knockout ObservableArray Example

In this blog, I will create a simple example which will demonstrate how we can use the observable features of knockout on collection of items. 

Simple Knockout Observable and Computed Example

In this blog, I will create a simple example to demonstrate how knockout javascript library can be used to create observable properties.

Simple Revealing Module Pattern Example

In this blog, I will create a simple example to demonstrate the revealing module pattern in javascript.

TCP/IP Basics - III

Continuing from the last blog about TCP/IP, in this blog I will cover the basics of TCP and a little bit about UDP. I will also look into some commands such as telnet and some great utilities like wireshark.

TCP/IP Basics - II

Continuing from the previous post, in this blog, I will talk about routing and subnets.

TCP/IP Basics - I

In this blog, I will summarize the basics of TCP/IP which most developers should know.

Avoid CSRF attack in MVC

Recently, in my project, I had to make sure that my asp.net mvc website is not prone to Cross Site Request Forgery Attacks. I read a few blogs and found that with MVC's built in AntiForgeryToken, its very easy to do so. However, it required manually changing all actions and views. In this blog, I will try to explain what a CSRF attack is and how it can be avoided using action filters.

Javascript with keyword

In this blog I will create a very small example demonstrating how the with keyword means in javascript.

Reading IIS logs using SQL

In this blog, I will show how to read IIS logs to get meaningful information using SQL like language. I would be using the free tool LogParser.

Javascript eval function

In this blog, I will create a sample demonstrating how javascript's eval function works.

Caching static content in IIS

Most of the websites today use client side scripts, styles and images. When browser requests a webpage, it has to make n number of HTTP requests to get each of these resources. Caching, combining, compressing are few techniques we use to improve the performance of such websites. In this blog I will concentrate on caching images using IIS settings. 

Basics of ASP.NET MVC Model Binding

In this blog I will document some of the basics of asp.net mvc model binding. Model binding is the process when action parameters are populated from the ASP.NET request data. Two things happen in this process - collecting data from the request and populating the model with that data. The first part is achieved by value providers and the second part is achieved via model binders.

Task and ConcurrentQueue

In this blog, I will create a sample to demo the usage of Task and ConcurrentQueue. Task allows us to represent an asynchronous operation. ConcurrentQueue is a FIFO data structure similar to Queue, however, it is thread-safe. Thread-safe means that we will not have undesirable results in case multiple threads operate over this data structure.

ASP.NET MVC Caching

In this blog post, I will document the caching mechanism provided in ASP.NET MVC3. MVC allows us to cache results from the whole controller or just some selected actions. It also provides parameters which help in configuring caching according to our needs.

Algorithms - Quick Sort

In this blog, I will create a small sample of quick sort algorithm using javascript and recursion.

Algorithms - Fibonacci

In this blog, I will create a program for generating fibonacci sequence by using javascript and recursion.

Algorithms - Factorial

In this blog, I will create a simple example for calculating factorial by using javascript and recursion.

HTML 5 - Web Sockets and Microdata

In this blog, I will continue to look at the new features of HTML5. This time I will pay attention to web sockets and microdata. Read on to learn more.

HTML5 - Web Storage and Offline Capabilities

In this blog, I will try to understand the new concepts with HTML5, namely, web storage which allows storing data on client side easier and offline capabilities which allow web apps to function even if they are offline.

HTML 5 GeoLocation Example

In this blog, I will try to create a simple sample which uses the new geo location feature of HTML5. Read on -

Simple jQuery getJSON Example in ASP.NET MVC

In this post, I will create a very basic and simple example demonstrating jQuery's getJSON method using ASP.NET MVC.

JQuery Cheatsheet

To be good at JQuery, it is very important to understand and know how to select the HTML DOM elements. In this blog, I just wanted to provide some examples (more on the lines of a cheat sheet) of JQuery selectors which I use most often. I also wanted to document some of the methods that I use most of the times. I didn't want to go through JQuery documentation all the time. As I said, this list is not comprehensive but these are the items I use the most.

EF Code First Example

Entity Framework (EF) recently started supporting code-first development. This means that we don't have to create our database first before we can write any code. It allows developers to create their models (business entities, data objects etc) and then it will automatically create the database after very little configuration. I wanted to see how EF handles relationships. So I created this sample to demonstrate how EF code first handles many-to-many relationship.

.NET Reactive Extensions Rx - 3 (Cleanup)

In this blog, I will create a small app to describe how to perform cleanup after the Rx subscription has finished its work.

.NET Reactive Extensions Rx - 2 (Concurrency)

In this blog, I will further explore Rx framework and specifically look into the concurrency and threading enhancements because I think this is where most of the value for Rx is.

.NET Reactive Extensions Rx - 1 (Basics)

In this blog, I will explore the reactive extensions (Rx) framework. Rx extends .NET. Rx extends LINQ so that results of a query can be converted to an observable sequence. Let's explore more..

HTML 5 Basic Examples

In this blog, I will try to understand what is HTML5 and what enhancements it brings over current HTML. I will also try to write some sample code to demonstrate the new features.

Android - 2 (Eclipse project)

Now that I understand some of the basics of Android development, I will start exploring more into the Android and Eclipse project and get a better idea about what the files in this project mean. Then I will try to create a simple app to sort of gel all the ideas together. Lets get started -

Android - I

In this blog, I will look into the overview of Android and how we can use .NET to build applications for Android. I will continue to explore more until I am ready to create an android app and publish it in the android market. 

HttpModule and HttpHandler

HttpModule and HttpHandler provide mechanism to execute some logic before the page is requested. In this blog I will create a simple demo which shows the utility of these two components.

C# Set Operations

In this blog, I will cover 2 data structures, namely, HashSet and SortedSet and will create small examples to show how we can achieve mathematical set operations of Union, Intersect, Minus etc with these data structures.

LINQ Examples

In this blog, I will try to create samples of LINQ extension methods which are very helpful in accomplishing things which earlier would take 10-15 lines (or more) of code and were difficult to manage as well as to understand. I will also try to keep this blog as a running list of good LINQ extension methods.

Encodings

In this blog post, I will explain how to play around with different types of encodings using C#. I will mainly concentrate on ASCII, UTF-8 and UTF-16.

Storing BLOBs, CLOBs and XML in SQL

In this blog post, I will explore how to use OPENROWSET in SQL to perform operations for BLOBS, CLOBS, external XML files etc.

Windows Azure - Part 1 - Overview

In this blog post, I will cover the basics of Windows Azure and cloud computing. 

Dynamic keyword in C#

In this blog post, I will try to understand the dynamic keyword that was introduced in C# 4.0. These notes are from Alexandra Rusina's article.

Singleton Pattern

In this blog post, I will try to create an example demonstrating the usage of singleton pattern.

Factory Pattern

In this blog post, I will try to create a simple program which will demonstrate the utility and significance of the factory pattern.

Migration from 32bit to 64bit Projects in .NET

In this blog post, I am going to explain the solution for a few issues that I had working with 32bit and 64 bit Operating systems and what we should do to create applications that would work without any code changes in any environments.

Reading a web page

Many times there is a need to read a web page programatically. That is, get the html through code and parse through it to search what you want. Codeplex has a DLL named HTML Agility Pack (HAP) that comes to our rescue.

Saving Application State in Windows Phone 7

In the last post, I created a small app to store the page state. In this blog post,  I will try to create an app that stores some counters across the application lifetime. We will store two counters: 1. How many times this app was used 2. Last datetime this app was used.

Saving Page State in Windows Phone 7

In this blog post, I will try to create a sample app in which we store the page state. By default, once you move away from your windows phone app, the page state is not stored. We need to take measures to store the page state when deactivating and restore the page state when activating.
Read on to see the code snippets and explanation -

IValueConverter Example

WPF and Silverlight extensively use XAML and data binding. Sometimes, such scenarios come up where we need to bind a control to a property but the property value needs to be converted to something which makes sense for the control. That's where IValueConverter comes in.

Windows Phone 7 - Overview

Happy New Year 2011!! 
In this blog post, I will take a look at Windows Phone 7 and how to develop an application for this platform. Why should we develop for Windows Phone 7 -
  • There is a huge market for mobile apps
  • Consumers expect all of their apps (even business apps) to have mobile components

Definitions

Collection of definitions -

Extension Methods in LINQ

In this blog, I will create a sample of a very useful feature provided by LINQ. These are called extensions and can be very handy to write helpful methods.

Stopwatch

Many a times I had to measure the time a method, a module or a functionality is taking. The only way I knew till now was to do it the DateTime way. Now, there is a new class to help us out with that: Stopwatch

Helpful SQL Commands

SQL server provides a rich set of commands to do operations other than the normal CRUD operations. In this blog, I will try to maintain a list of commands that are frequently used and required.

Simple PLINQ example

I love LINQ. From the onset, I liked the idea of having a simple and similar way of accessing any kind of data, be it objects, be it SQL data or xml or any other structured form. MSDN says that PLINQ is a parallel implementation of LINQ to objects. In this blog, I am providing a simple sample about one of the operators for PLINQ.

Data WareHousing and Business Intelligence

In this blog, I look at some of the theoretical concepts behind Data Warehousing and how Data Warehousing helps in achieving Business Intelligence.

Certificates

In this blog, I will examine the basics of cryptography and usability of IIS Certificates. I will also describe symmetric key cryptography, public-private key cryptography, digital signing and SSL.

WCF RIA Services - Authentication/Authorization

In this blog, I continue to research on the Authentication/Authorization piece of WCF RIA Services. If you haven't read the overview, I encourage you to do so in my previous blog post titled "WCF RIA Services Overview". For Authentication/Authorization read on...

WCF RIA Services Overview

WCF RIA Services makes it easy to concentrate on the data and business logic rather than worrying about creating multiple layers. Besides that it also simplifies querying, updating, validation and authentication among other features.

Iron Ruby DLR Sample

Recently, I created a very simple Iron Ruby sample for understanding how it works and what is the concept of DLR (Dynamic Language Runtime). DLR is built on top of CLR (Common Language Runtime). In .NET you can create apps which use IronRuby dynamic code and run them with the help of DLR.

HTTP

In this blog, I will document some basic concepts about HTTP. HTTP stands for Hyper Text Transfer Protocol and is a way to communicate between a server and a client. I will also look into some of the Headers associated with HTTP.

INotifyPropertyChanged and ObservableCollection

In case of binding scenarios, earlier, developers had to write code to make sure that UI and internal objects are all in sync with each other. With INotifyPropertyChanged interface and ObservableCollection<T>, it has become simple to keep those layers in sync.

Useful DOS/Powershell Commands

In this blog, I wanted to document some of the nice DOS/powershell commands that I frequently use.

Helpful Excel Formulas and Tips

Most of the people who use computers, have in some way or form used excel. Its always handy to know few important excel formulas that can help us write 1-liner code that otherwise in normal programming languages like C, C++ or even C# would have taken 10 or more lines of code. In this blog post, I will keep a list of helpful excel formulas.

C# Value Types and Reference Types

In this blog I will discuss what value and reference types in C# are and how we pass them as value and reference.

C# Explicit Interface Implementation

In this blog, I will create a sample to explain the concept of explicit interface implementation in C#.

Events

As I mentioned in my delegates article, it took me quite a lot of time to understand the importance of delegates and events. For some time, I was confused as to when would I need events. I understood the button click events but was not able to come up with a concrete non-UI scenario in which I would like to use events. In this blog post, I will share a scenario which made it very easy for me to understand events. I hope this makes it simple for you too - 

Action and Func Delegates

Earlier in .NET, we had to declare our own delegates definitions. This was cumbersome and more importantly not very intuitive. It took me a lot of time to understand the concepts of delegates. The newer versions of .NET frameworks come up with two handy delegates that are very easy to use -

ASP.NET Authentication

Authentication: Who are you? Default: Windows
Authorization: What are you allowed to do? Default: Anonymous