Search This Blog

Thursday, July 11, 2013

Javascript and objects

Many developers suppose that the document.getElementById() or the windows.print() functions are parts of javascript language. That opinion is wrong. The  Javascript is only one language which collaborate very well with four types of objects. These obects are  the Javascript Objects ,the Browser objects, the DOM Objects and the end The user defined objects.


JS Objects

JS Number
JS String
JS Date
JS Array
JS Boolean
JS Math
JS RegExp

JS Browser (Window) Objects

JS Window
JS Screen
JS Location
JS History
JS Navigator
JS PopupAlert
JS Timing
JS Cookies

DOM Objects

DOM Document
DOM Elements
DOM Attributes
DOM Events

Javascript user defined objects,inheritance and polymorfism



JavaScript is an Object Oriented Programming (OOP) language. A programming language can be called object-oriented if it provides four basic capabilities to developers:
  • Encapsulation . the capability to store related information, whether data or methods, together in an object
  • Aggregation . the capability to store one object inside of another object
  • Inheritance . the capability of a class to rely upon another class (or number of classes) for some of its properties and methods
  • Polymorphism . the capability to write one function or method that works in a variety of different ways


USER-DEFINED  Objects
I Approach.
in order to create user defined object we use the following frame of code:
       
         var newObject = new Object(); // Create the object
         newObject.firstProperty = "some string"; // Assign properties to the object
         newObject.secondProperty = "for example another string";

when we want to access this object we use the following frame of code:

document.write("firstProperty : " + newObject.firstProperty + "
");
document.write("secondProperty is : " + newObject.secondProperty + "
");

II Approach.(using user-defined function)

     function newObject (firstProperty , secondProperty){
this.firstProperty = firstProperty ;
this.secondProperty= secondProperty;
}
.....

var myNewObject = new newObject ("firstProperty value", "secondProp value");
document.write("firstProperty is : " + myNewObject.firstProperty + "
");
document.write("secondProperty is : " + myNewObject.secondProperty+ "
");

Assigning methods  to object.
Objects are composed of attributes. If an attribute contains a function, it is considered to be a method of the object otherwise, the attribute is considered a property.

function someFunctionOfThirdProperty(parammeter){ this.thirdProperty= parammeter; } function newObject (firstProperty , secondProperty){ this.firstProperty = firstProperty ; this.secondProperty= secondProperty; this.someFunctionOfThirdProperty=someFunctionOfThirdProperty;//!!!! } .... var myNewObject = new newObject ("firstProperty value", "secondProp value"); myNewObject.someFunctionOfThirdProperty("parammeterValue"); document.write("firstProperty is : " + myNewObject.firstProperty + " "); document.write("secondProperty is : " + myNewObject.secondProperty+ " "); document.write("thirdProperty is : " + myNewObject.thirdProperty+ " ");
with keyword
 with (object){
    properties used without the object name and dot
}
replace the function above with this function:
function someFunctionOfThirdProperty(parammeter){
     with(this){
       thirdProperty= parammeter; 
     }
}

Wednesday, July 10, 2013

Scripting language

A high-level programming language that is interpreted by another program at runtime(interpreter) rather than compiled in the design time by Compilers  as other programming languages (such as C and C#) are. 
The spectrum of scripting languages ranges from very small and highly domain-specific languages to general-purpose programming languages. The term script is typically reserved for small programs (up to a few thousand lines of code)

Types of scripting languages

  • Job control languages and shell (shell script)
  • GUI scripting (macros)
  • Application-specific language(Lisp)
  • Text processing languages(grep)
  • General-purpose dynamic languages(Perl)
  • Extension/embeddable languages(ECMAScript or javascript)

The key design principles within JavaScript are taken from the Self and Scheme programming languages. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles.It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed..

Definitions
1)A multi-paradigm programming language is a programming language that supports more than one programming paradigm. As Leda designer Timothy Budd puts it: "The idea of a multiparadigm language is to provide a framework in which programmers can work in a variety of styles, freely intermixing constructs from different paradigms." The design goal of such languages is to allow programmers to use the best tool for a job, admitting that no one paradigm solves all problems in the easiest or most efficient way.

2)Icomputer scienceimperative programming is a programming paradigm that describes computation in terms of statements that change a program state. In much the same way that imperative moodin natural languages expresses commands to take action, imperative programs define sequences of commands for the computer to perform.

3)In computer sciencefunctional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state(see also lambda calculus)

Friday, July 5, 2013

Using assembler in C#

The only one easy way to do that is the following:

1) to create some dll  in C++ which contains assembler code.

// Somename.cpp

#include "SysInfo.h"

BOOL __stdcall DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved) {
 return  TRUE;
}
//write some functions in C
extern "C" __declspec(dllexport) int __stdcall someFunction() {
 int retVal;
         //write some C code
 // write some code in assembler
_asm { mov eax, 1 mov retVal, eax } // return result return (retVal)
//write some other functions in C
2)to use dumpbin tool in order to get thwe right name of the Function. Something like that:                             dumpbin -exports Somename.dll    in order to get some output like the following:         ordinal hint RVA name
          1    0 00001005 ?someFunction@@YGXPAD@Z
The Compiler in order to prepare functionw for overloading gives to functions new names,
This step can be ommited if you use the extern "C" keyward . In this manner the C compiler is informed to don't decorate the function name.
Here @ shows the function uses the standard calling convention stdcall

stdcall

The stdcall calling convention is a variation on the Pascal calling convention in which the callee is responsible for cleaning up the stack, but the parameters are pushed onto the stack in right-to-left order, as in the _cdecl calling convention. Registers EAX, ECX, and EDX are designated for use within the function. Return values are stored in the EAX register.

stdcall is the standard calling convention for the Microsoft Win32 API and for Open Watcom C++.
more about calling conventions here 3)to call functions in dll  through some C# program
/ Main.cs


using System;
using System.Runtime.InteropServices;

class MainClass {
 [DllImport("Somename.dll")]
 static extern int someFunction();
 
 
 // main program
 public static void Main() {
  
  //get  someFunction() result

  try {
   int param = someFunction();
   Console.WriteLine("Param value = {0}", param .ToString()                    );
  }
  catch (DllNotFoundException e) {
   Console.WriteLine(e.ToString());
  }
  catch (EntryPointNotFoundException e) {
   Console.WriteLine(e.ToString());
  }
  
  
 }
};

Wednesday, July 3, 2013

Callback Functions

A callback function is code within a managed application that helps an unmanaged DLL function complete a task. Calls to a callback function pass indirectly from a managed application, through a DLL function, and back to the managed implementation. Some of the many DLL functions called with platform invoke require a callback function in managed code to run properly.
Generally speaking a callback is executable code that is passed as an argument to other code

See in the following function's signature:
              BOOL EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam)  
lp prefix comes from the long pointer term.Thus the lpEnumFunc is a pointer to a callback function.

The EnumWindows function enumerates through all existing windows on your computer, calling the callback function to perform a task on each window. Thiw function belongs to the Win32 API (user32.dll).
Also,in the following example:
EnumWindows  unmanaged DLL function. 
CallBack(int hwnd, int lparam) is the managed  callback function
hwnd:handle to the window
lparam:application defined parameter

using System;
using System.Runtime.InteropServices;

public delegate bool CallBack(int hwnd, int lParam);

public class EnumReportApp
{
    [DllImport("user32")]
    public static extern int EnumWindows(CallBack x, int y); 

    public static void Main() 
    {
        CallBack myCallBack = new CallBack(EnumReportApp.Report);
        EnumWindows(myCallBack, 0);
    }

    public static bool Report(int hwnd, int lParam)
    { 
        Console.Write("Window handle is ");
        Console.WriteLine(hwnd);
        //Callback functions generally return nonzero values to indicate success         //and zero to indicate failure. This example explicitly sets the return v        //alue to true to continue the enumeration.

        return true;
    }
}

Similar enumeration functions are: EnumFontFamilies, EnumPrinters

The usage of a callback is usually in asynchronous logic.


Saturday, June 29, 2013

Observer Design Pattern

         Definition in Wikipedia:
"The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems. The Observer pattern is also a key part in the familiar Model View Controller (MVC) architectural pattern. In fact the observer pattern was first implemented in Smalltalk's MVC based user interface framework. The observer pattern is implemented in numerous programming libraries and systems, including almost all GUI toolkits."
          In www.dofactory.com the Observer Design Pattern is the  this:
          

In terms of the .NET Framework the terminology is a bit difference:
The abstract class Observer is replaced by the IObserver  interface.
The  abstract class Subject is replaced by the IObservable  interface.
The class ConcreteSubject usually is called Observable.
The function Attach is replaced by the function Register.
The function Dettach is replaced by the function Unregister
Also under the term  container we mean some generic type collection in which we can have the observers.

Wednesday, June 26, 2013

Boxing and Unboxing

"Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap.Unboxing extracts the value type from the object. Boxing is implicit; unboxing is explicit."
          During the process of unboxing two types of exception can be  appeared:

  •  NullReferenceException ( if you try to unbox null object)
  • InvalidCastException ( if you try to unbox to to an incompatible value type )

        // Boxing
                     int k = 2;
            // The following line boxes i.  
            object o = k;   
       // Unboxing
                     int j = (int) o; // that creates InvalidCastException: int j = (short) o;

Events

Events is something like to interrupts in hardware design.There is and here -behind of the scenes- the main endless loop(listener) .Generally speaking  many of modern Operating Systems support the event driven programming.
There are two approaches to implement events in .NET. The first one by using delegate keyword and the second by using EventHandler keyword
We will start with the first approach:
This approach is used when we want to pass the event's source object as parameter(sender)..
Example: ((EventDelegate ) sender).Add("one","Greg")
We have three classes.:EventDelegate ,Listener and Test Class.

Tuesday, June 25, 2013

polymorfism in ANSI C

The key point here is to create Virtual Tables (xxx_vtables) in which you can have the chance to use pointer to function 
"const char* (*sound)();"


#include 

struct animal_vtable {
    const char* (*sound)();
};

struct animal {
    struct animal_vtable methods;
    const char* name;
};

const char* cat_sound() {
    return "meow!";
}

const char* dog_sound() {
    return "bark!";
}

void describe(struct animal *a) {
    printf("%s makes \"%s\" sound.\n", a->name, a->methods.sound());
}

struct animal cat = {{&cat_sound}, "cat"};
struct animal dog = {{&dog_sound}, "dog"};

int main() {
    describe(&cat);
    describe(&dog);

    return 0;
}
}

Delegates

Delegates in terms of C language is  pointer to function.
Firstly I will try to explain what does this mean.

Pointer to Function
 In the following example we define one  function pointer named pt2Function.
This point to function, which take three int parameters and return an int
// define a function pointer and initialize to NULL
int (*pt2Function)(int, int, int) = NULL;  
// assign an address to the function pointer
int Fun1  (int a, int b, int c){    return a+b+c; }
int Fun2 (int a, int b, int  c)const{ return a-b+c; }
pt2Function = &Fun1;    // correct assignment using address operator
if(pt2Function >0){                           // check if initialized
   if(pt2Function == &Fun1)
      printf("Pointer points to Fun1\n"); }
else
   printf("Pointer not initialized!!\n");
// calling a function using a function pointer
int result = (*pt2Function) (12, 3, 5);  
Now  we will see :How to Pass a Function Pointer as an Argument
//  How to Pass a Function Pointer
//  is a pointer to a function which returns an int and takes three int
void PassPtr(int (*pt2Func)(int, int, int))
{
   int result = (*pt2Func)(12, 3, 6);     // call using function pointer
  
}
 and in some other point we execute this function
.....
PassPtr(&Fun1);
.....
and at the end we will see:How to Return a Function Pointer as function's return value
//  How to Return a Function Pointer
int (*GetPtr1(int f1))(int, int,int)
{
   if(f1==0)
      return &Fun2;
   else
      return &Fun1;
}
and in some other point inside of some function
// define a function pointer and initialize it to NULL
   int (*pt2Function)(int, int, int) = NULL;
pt2Function=GetPtr1(1);   // get function pointer from function 'GetPtr1'
int result = (*pt2Function) (12, 3, 5);    // call function using the pointer
Now we can go on with delegates.
Delegates
Generally speaking we can divide delegates in two types:Simple and multicast delegate.

Monday, June 24, 2013

Wrapper class




/// Example for Wrapper class
Structural design patterns 
Proxy, Decorator, and Adapter also use thiw approach.
see more...


public class WrapperExample
{
    private int x = 20;
    private int y = 10;

   
    public WrapperExample()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public int mul(int x, int y)
    {
        Wrapper.internalClass obj = new internalClass();
        //core functionality of this method is written in the wrapped class.
        int res = obj.mul(x, y);
        return sum;
    }

    ///
    /// this class is wrapped by the WrapperExample class.
    /// we can access only inside this class.
    /// outside the class, we cant access this class.
    ///
    private class internalClass
    {       

        public int mul(int x, int y)
        {
          
            return x * y;
        }
    }
}
 

IHttpHandlerFactory and Abstarct Factory Design Pattern

http://www.dofactory.com/Patterns/PatternAbstract.aspx


In terms of Abstract Factory design pattern, the IHTTPHandlerFactory forms the abstract factory,
the IHTTPHandler forms the abstract product, the PageHandlerFactory forms the concrete factory and the Page class forms the concrete Product. 

IHTTPHandlerFactory<->Abstract Factory
IHTTPHandler<->abstract produc
pagehandlerfactory<->concrete factory (1 or more)
Page Class<->concrete Product.  (1 or more)

HTTPRuntime,HTTPApplication,HTTPContext.HTTPHandler,HTTPModule....

   I extract from the following exelent article
    http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp
"From Browser to ASP.NET
Let’s start at the beginning of the lifetime of a typical ASP.NET Web Request. A request starts on the browser where the user types in a URL, clicks on a hyperlink or submits an HTML form (a POST request). Or a client application might make call against an ASP.NET based Web Service, which is also serviced by ASP.NET. On the server side the Web Server – Internet Information Server 5 or 6 – picks up the request. At the lowest level ASP.NET interfaces with IIS through an ISAPI extension. With ASP.NET this request usually is routed to a page with an .aspx extension, but how the process works depends entirely on the implementation of the HTTP Handler that is set up to handle the specified extension. In IIS .aspx is mapped through an ‘Application Extension’ (aka. as a script map) that is mapped to the ASP.NET ISAPI dll - aspnet_isapi.dll. Every request that fires ASP.NET must go through an extension that is registered and points at aspnet_isapi.dll.
 Depending on the extension ASP.NET routes the request to an appropriate handler that is responsible for picking up requests. For example, the .asmx extension for Web Services routes requests not to a page on disk but a specially attributed class that identifies it as a Web Service implementation. Many other handlers are installed with ASP.NET and you can also define your own. All of these HttpHandlers are mapped to point at the ASP.NET  ISAPI extension in IIS, and configured in web.config to get routed to a specific HTTP Handler implementation. Each handler, is a .NET class that handles a specific extension which can range from simple Hello World behavior with a couple of lines of code, to very complex handlers like the ASP.NET Page or Web Service implementations. For now, just understand that an extension is the basic mapping mechanism that ASP.NET uses to receive a request from ISAPI and then route it to a specific handler that processes the request.
 
The ISAPI Connection
ISAPI is a low level unmanged Win32 API. The interfaces defined by the ISAPI spec are very simplistic and optimized for performance. They are very low level – dealing with raw pointers and function pointer tables for callbacks - but they provide he lowest and most performance oriented interface that developers and tool vendors can use to hook into IIS. Because ISAPI is very low level it’s not well suited for building application level code, and ISAPI tends to be used primarily as a bridge interface to provide Application Server type functionality to higher level tools. For example, ASP and ASP.NET both are layered on top of ISAPI as is Cold Fusion, most Perl, PHP and JSP implementations running on IIS as well as many third party solutions such as my own Web Connection framework for Visual FoxPro. ISAPI is an excellent tool to provide the high performance plumbing interface to higher level applications, which can then abstract the information that ISAPI provides. In ASP and ASP.NET, the engines abstract the information provided by the ISAPI interface in the form of objects like Request and Response that read their content out of the ISAPI request information. Think of ISAPI as the plumbing. For ASP.NET the ISAPI dllis very lean and acts merely as a routing mechanism to pipe the inbound request into the ASP.NET runtime. All the heavy lifting and processing, and even the request thread management happens inside of the ASP.NET engine and your code.
 
As a protocol ISAPI supports both ISAPI extensions and ISAPI Filters. Extensions are a request handling interface and provide the logic to handle input and output with the Web Server – it’s essentially a transaction interface. ASP and ASP.NET are implemented as ISAPI extensions. ISAPI filters are hook interfaces that allow the ability to look at EVERY request that comes into IIS and to modify the content or change the behavior of functionalities like Authentication. Incidentally ASP.NET maps ISAPI-like functionality via two concepts: Http Handlers (extensions) and Http Modules (filters). "
Aw we can see in the following article Introduction to HTTP Handlers and Modules HTTP handlers and modules can be defined as
"HTTP handlers proces the request and are generally responsible for initiating necessary business logic tied to the request. "
"The following consists of a list of events that should be considered when implementing your HTTPmodule:
  • BeginRequest
  • AuthenticateRequest
  • AuthorizeRequest
  • ResolveRequestCache
  • AcquireRequestState
  • PreRequestHandlerExecute
  • PostRequestHandlerExecute
  • ReleaseRequestState
  • UpdateRequestCache
  • EndRequest
  • PreSendRequestHeaders*
  • PreSendRequestContent*
  • Error*
"

Also

Asynchronous and Synchronous HTTP Handlers

An HTTP handler can be either synchronous or asynchronous. A synchronous handler does not return until it finishes processing the HTTP request for which it is called. An asynchronous handler runs a process independently of sending a response to the user. Asynchronous handlers are useful when you must start an application process that might be lengthy and the user does not have to wait until it finishes before receiving a response from the server.
Asynchronous HTTP handlers enable you to start an external process, such as a method call to a remote server. The handler can then continue processing without waiting for the external process to finish. While an asynchronous HTTP handler is processing, ASP.NET puts the thread that would ordinarily be used for the external process back into the thread pool until the handler receives a callback from the external process. This can prevent thread blocking and can improve performance because only a limited number of threads can execute at the same time. If many users request synchronous HTTP handlers that rely on external processes, the operating system can run out of threads, because many threads are blocked and are waiting for an external process.
When you create an asynchronous handler, you must implement the IHttpAsyncHandler interface. You must also implement the BeginProcessRequestmethod in order to initiate an asynchronous call that processes individual HTTP requests. In addition, you must implement the EndProcessRequest method to run cleanup code when the process ends.

Saturday, June 22, 2013

Turing Machine

FSM

File:DFA example multiplies of 3.svg

Turing Machine

addone
TM simulator

Types of JIT Compilers

There are the following three types of JIT Compilers in Microsoft .Net Framework


1) Pre-JIT: Pre-JIT Compiler compiles the whole source code into native code in a single cycle, done at the time of deployment of the application itself.

2) Econo-JIT: Econo-JIT Compiler compiles only specific methods that are called at runtime. These compiled methods are removed once their processing is finished and not required in further execution.

3) Normal-JIT: - Normal-JIT Compiler compiles only specific methods that are called at runtime. These methods are compiled once and are stored in the cache. When the same methods are called again, the compiled code from cache will be used for execution.

See How the CLR Creates Runtime Objects

Before the CLR executes the first line of the managed code, it creates three application domains. Two of these are opaque from within the managed code and are not even visible to CLR hosts. They can only be created through the CLR bootstrapping process facilitated by the shim—mscoree.dll and mscorwks.dll (or mscorsvr.dll for multiprocessor systems). 

See more....

null in C#

From Microsoft MDSN:
The null keyword is a literal that represents a null reference, one that does not refer to any object. null is the default value of reference-type variables. Ordinary value types cannot be null. However, C# 2.0 introduced nullable value types. See Nullable Types (C# Programming Guide).
.............

There are three things in C# that "null" can be. A reference, a pointer, and a nullable type.

  • The implementation of C# on the CLR represents a null reference by zero bits
  • The a null pointer is represented also by  zero bits
  •  A null nullable value type is also implemented by zeroes, though in a different way. When you say
int? j = null;
what we actually create is the moral equivalent of:
struct NullableInt
{
    int value;
    bool hasValue;
}


The following example demonstrates use of nullable data types:
using System;
namespace CalculatorApplication
{
   class NullablesAtShow
   {
      static void Main(string[] args)
      {
         int? num1 = null;
         int? num2 = 45;
         double? num3 = new double?();
         double? num4 = 3.14157;
         
         bool? boolval = new bool?();

         // display the values
         
         Console.WriteLine("Nullables at Show: {0}, {1}, {2}, {3}", 
                            num1, num2, num3, num4);
         Console.WriteLine("A Nullable boolean value: {0}", boolval);
         Console.ReadLine();

      }
   }
}
When the above code is compiled and executed, it produces following result:
Nullables at Show: , 45,  , 3.14157
A Nullable boolean value:            


The Null Coalescing Operator (??)

The null coalescing operator is used with the nullable value types and reference types. It is used for converting an operand to the type of another nullable( or not) value type operand, where an implicit conversion is possible.
If the value of the first operand is null, then the operator returns the value of the second operand, otherwise it returns the value of the first operand. The following example explains this:
using System;
namespace CalculatorApplication
{
   class NullablesAtShow
   {
         
      static void Main(string[] args)
      {
         
         double? num1 = null;
         double? num2 = 3.14157;
         double num3;
         num3 = num1 ?? 5.34;      
         Console.WriteLine(" Value of num3: {0}", num3);
         num3 = num2 ?? 5.34;
         Console.WriteLine(" Value of num3: {0}", num3);
         Console.ReadLine();

      }
   }
}
When the above code is compiled and executed, it produces following result:
Value of num3: 5.34
Value of num3: 3.14157

DBNull

DBNull.Value is what the .NET Database providers return to represent a null entry in the database. DBNull.Value is not null and comparissons to null for column values retrieved from a database row will not work, you should always compare to DBNull.Value.

DBNull Class

C# bitwise oerators

OperatorDescriptionExample
&Binary AND Operator copies a bit to the result if it exists in both operands.(A & B) will give 12 which is 0000 1100
|Binary OR Operator copies a bit if it exists in either operand.(A | B) will give 61 which is 0011 1101
^Binary XOR Operator copies the bit if it is set in one operand but not both.(A ^ B) will give 49 which is 0011 0001
~Binary Ones Complement Operator is unary and has the effect of 'flipping' bits.(~A ) will give -60 which is 1100 0011
<<Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand.A << 2 will give 240 which is 1111 0000
>>Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand.A >> 2 will give 15 which is 0000 1111

example

Try following example to understand all the bitwise operators available in C#:
using System;
namespace OperatorsAppl
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 60;            /* 60 = 0011 1100 */  
            int b = 13;            /* 13 = 0000 1101 */
            int c = 0;           

             c = a & b;           /* 12 = 0000 1100 */ 
             Console.WriteLine("Line 1 - Value of c is {0}", c );

             c = a | b;           /* 61 = 0011 1101 */
             Console.WriteLine("Line 2 - Value of c is {0}", c);

             c = a ^ b;           /* 49 = 0011 0001 */
             Console.WriteLine("Line 3 - Value of c is {0}", c);

             c = ~a;               /*-61 = 1100 0011 */
             Console.WriteLine("Line 4 - Value of c is {0}", c);

             c = a << 2;     /* 240 = 1111 0000 */
             Console.WriteLine("Line 5 - Value of c is {0}", c);

             c = a >> 2;     /* 15 = 0000 1111 */
             Console.WriteLine("Line 6 - Value of c is {0}", c);
            Console.ReadLine();
        }
    }
}
When the above code is compiled and executed, it produces following result:
Line 1 - Value of c is 12
Line 2 - Value of c is 61
Line 3 - Value of c is 49
Line 4 - Value of c is -61
Line 5 - Value of c is 240
Line 6 - Value of c is 15

About Me

An seasoned developer, architect and with some Team Leading exposure, offering full project life cycle experiences within multi cultural, multi National environments and within differing business streams and all primarily on a .Net platform.