Wednesday, 16 January 2013

WPF Docking with Avalon Dock

Avalon Dock brings docking to W-P-F - Awesome! Check it out on CodePlex - Microsoft's free open source project hosting site!

Wednesday, 9 January 2013

Four Octets - Demystifying Networking Jargon

An octet is basically 8 bits. The term is used in telecommunications, particularly when referring to IP addresses. An IPv4 address is referred to as "four octets", usually represented by decimal values from 0 to 255, for example: 255.255.255.255 (the highest representable IPv4 address). This is known as "dotted-decimal" notation. Maximum number of addresses is 2^32 or 256^4 = 4.29 billion.

TCP/IP Concepts for Windows Programmers

Everybody claiming to be a Windows Joe should know the basic concepts of TCP/IP.

The TCP/IP "Reference Model"

The TCP/IP "reference model" was based on an older "reference model" known as the OSI Reference Model, which was, in comparison, very complicated, made up of seven layers from the Application to the Physical layer. TCP/IP came and it was simpler: declaring Application, Transport, Internet and Host-to-Network as the four major layers. Understanding the reference model, gives you more idea of the relationship between TCP and IP.

Details of TCP/IP including Three-Way Handshake

After all, that's how the Internet works!  The Internet works thanks to two protocols working in partnership. The first, Transmission Control Protocol, is what establishes the "virtual connection" between two endpoints and ensures smooth data transfer. TCP, if you will, is the "taxi driver" that takes data from A to B.

You can get a sense of round-trip time for TCP using traceroute, or in Windows, tracert. You will notice that TCP is not optimised for performance but for reliability.

A three-way handshake is what initialises the TCP connection (SYN, SYN-ACK and ACK).

What is the relationship between TCP and IP?  The TCP information is transported in IP datagrams, which at the receiver end get processed by IP software and sent to TCP software for "demultiplexing" and further processing. If TCP is the Airway Bill, then IP are the boxes being shipped. Again, refer back to the TCP/IP reference model for renewed conceptual clarity.

TCP Offload Engines and Gigabit Ethernet

One bit of jargon that's gone into fore is "TCP Offload Engine". TCP, being a fairly CPU-intensive protocol, has been embraced by certain network interface cards (NICs) to offload the processing from the main CPU(s). It is used in high-speed network interfaces, such as Gigabit Ethernet (GbE) for moving data at a BILLION BITS PER SECOND.

Wednesday, 26 December 2012

Single cast delegate vs. Multi cast delegate

In C# all delegates are multicast delegates. A singlecast delegate is simply a multicast delegate with one handler attached. All delegates inherit from System.MulticastDelegate in mscorlib.

The Underlying Type of an Enum

Enums in C# are generally backed by the underlying type int (actually System.Int32). This is a signed value ranging from -2 billion to positive 2 billion (a little over, actually, 2.147 billion).  However, this underlying type can be overridden e.g. enum Selection : sbyte. Now the enum is a signed 8 bit integer (ranging from -128 to 127). Note, however, that the base type of Selection is System.Enum and not sbyte! Forget what you know about base type specification!

Sunday, 2 December 2012

Technology

Technology (especially hardware) can be quite intimidating for those unaccustomed to the products out there. Features seem to be implemented beyond what the end-user wants or needs. It takes time to get familiar with the products out there. There may be many manufacturers. This is more true for appliances e.g. kitchen appliances, home technology etc. much more so than computing, which has become quite commoditised as of late.

Disable Privacy Warnings in Excel when Saving Workbooks

Go to Developer tab, and select the "Macro Security" button (with the "Roadworks" sign), Privacy Options and un-check everything. Hey Presto, you are done!