RSS

What is Prototype?

In JavaScript, objects also have one additional attribute: a pointer to another object. We call this pointer the object’s prototype.

Prototype allows you to create inheritance in JavaScript objects.

var man = Object.create(null);
defineProperty(man, 'sex', "male");

var yehuda = Object.create(man);
defineProperty(yehuda, 'firstName', "Yehuda");
defineProperty(yehuda, 'lastName', "Katz");

yehuda.sex       // "male"
yehuda.firstName // "Yehuda"
yehuda.lastName  // "Katz"

Object.getPrototypeOf(yehuda) // returns the man object

Read more: Yehuda Katz’s Understanding Prototype in JavaScript

 
Leave a comment

Posted by on March 21, 2014 in Architecture

 

Tags: ,

What is CLR?

The Common Language Runtime (CLR) is the virtual machine component of Microsoft’s .NET framework and is responsible for managing the execution of .NET programs.

A language like C# requires the .NET Common Language Runtime (CLR) to execute. Essentially, as an application that is written in C# executes, the CLR is managing memory, performing garbage collection, handling exceptions, and providing many more services that you, as a developer, don’t have to write code for. The C# compiler produces Intermediate Language (IL) , rather than machine language, and the CLR understands IL. When the CLR sees the IL, it Just-In-Time (JIT) compiles it, method by method, into compiled machine code in memory and executes it. The CLR manages the code as it executes.

Read more: Common Language Runtime – Wikipedia

 
Leave a comment

Posted by on March 21, 2014 in Architecture

 

Tags: ,

ASP.NET Web API and OData’s Verbose JSON

OData v3 and Verbose JSON

Whenever you work with OData in ASP.NET Web API, the return result will be JSON format. It’s noteworthy to know that by default Web API will return new OData JSON format specified in OData version 3. For older OData, the JSON format is different. It has more ‘unnecessary’ placeholders. This old OData JSON is also referred as ‘Verbose JSON’. In short, there are two types of OData JSON:

  • OData v3 has new JSON format
  • Verbose JSON is used in older OData versions.

ASP.NET Web API (.Net 4.5) and Verbose JSON

As mentioned before, by default Web API will return new OData JSON.

To change this behavior, you can request Web API to return old OData JSON format by specifying ‘odata=verbose’ in Accept header. Below is the sample of jQuery Ajax call specifying verbose JSON:

$.ajax({
    url: "/api/Products",
    dataType: "json",
    accepts: { json: "application/json;odata=verbose" }
}).done(function() {
    // do work ...
});

How it Looks Like?

For the curious:

Verbose JSON

{
    "d" : {
        "results": [
            {
                "__metadata": {
                    "uri": "http://demos/Orders(10248)",
                    "type": "SampleModel.Order"
                },
                "ProductId": 10248,
                "Name": "Vgnon"
            }
        ],
        "__count": "1"
    }
}

OData v3 (and above) JSON

{
    "odata.metadata":"http://localhost:43111/api/$metadata#Products",
    "odata.count":"1",
    "value":
    [
        {
            "ProductId":2,
            "CreatedDate":"2013-06-10T23:53:26",
            "CreatedBy":0,"Name":"Camera"
        }
    ]
}
 
Leave a comment

Posted by on October 7, 2013 in Programming

 

Tags: , ,

Compare Two URL Strings

URL String Compare

What is the best approach to compare two URLs and determine if they are the same or not?

For example:
http://stack247.wordpress.com and stack247.wordpress.com are the same URL.
https://stack247.wordpress.com and stack247.wordpress.com are the same URL.
http://stack247.wordpress.com/tag/interview-question/ and stack247.wordpress.com/tag are NOT the same URL.

 
Leave a comment

Posted by on July 31, 2013 in TechChallenge

 

Tags: , ,

Introducing technophile.co

Stay Up-to-date With Web Technologies

Home Slide

We are launching technophile.co today! It’s a new way to stay up-to-date with web technologies. We are adding more and more technologies to our library everyday, so check it out!

What is it?

tech·no·phile (noun) \ˈtek-nə-ˌfī(-ə)l\

One who has a love of or enthusiasm for technology, especially computers and high technology.

Technophile helps developers stay up-to-date with web technologies. That is, framework, library, plug-in or language of your technology stack.

It’s a directory of web technologies that you can browse and search. Technophile is still in Beta but we are actively developing new features to provide better user experience.

The Problem We’re Trying to Solve

When it comes to web technologies, developers are facing with choices far more than our needs.

For front-end / client-side alone, there are countless JavaScript frameworks available in open source projects. A developer is also expected to master few server-side technologies, be it database, back-end, service layer and presentation. To top it all, even in our own technology stack, .Net, Java or JavaScript, there are enormous choices of framework, library and plug-in. With this excessive alternatives in web technologies, it’s next to impossible to keep up with all of them.

Then, there is a decision to be made.

We all hope to make a good decision if not a smart one. Reality is, with choices far more than we can grasp, it becomes a immensely difficult decision. It’s a decision to be made, nonetheless.

In short, we want to equip developers with knowledge of vastly-available web technologies out there to help them make a smart decision when it comes to choosing web technologies.

 
Leave a comment

Posted by on July 29, 2013 in General

 

Denormalization

The process of attempting to optimize the read performance of a database by adding redundant data or by grouping data.

For online analytical processing (OLAP – primarily read operation) databases, redundant or “denormalized” data may facilitate business intelligence applications. In many cases, the need for denormalization has waned as computers and RDBMS software have become more powerful, but since data volumes have generally increased along with hardware and software performance, OLAP databases often still use denormalized schemas.

Source: Wikipedia: Denormalization

 
Leave a comment

Posted by on July 29, 2013 in Dictionary

 

Tags: ,

New Series of Keeping Up with The Cartesian

The Series Never Exists

Why would a programming blog care about the new series of “Keeping Up with The Kardashians”, you may ask. Well, we don’t. And, it’s actually the Cartesian, not the Kardashians. The new series never exists.

Keeping Up

When it comes to web technologies, developers are facing with choices far more than our needs. A developer is expected to master few server-side technologies, be it database, back-end, service layer and presentation. Take an example, .Net stack, there are enormous choices of framework, library and plug-in for .Net framework. It’s next to impossible to keep up with all of them. Until Now… Well, Monday, July 29, 2013 to be exact. We are introducing a new site that will help developers to keep up with all web technologies out there. Stay tune!

And yes, the title of the post has nothing to do with the content. If you happen to be curious about the Cartesion: here you go: The Cartesian Product

 
Leave a comment

Posted by on July 26, 2013 in General

 
 
Follow

Get every new post delivered to your Inbox.

Join 34 other followers

%d bloggers like this: