prettify

baseline

C# Collection Class Template

Use this class as a template for Collection classes.
This is the class Persons to accompany the class Person.

Javascript Collection Class

Javascript does not need a Template for Connection Classes.
One Class fits all!
Items.js:

C# class template

Template for a business class in C#.
The example is the "Party" from the "Party-Person-Organization" pattern.

CORS Cross Origin Resource Sharing Javascript

For many years we were stuck with JSONP if we needed to make a cross domain query.
JSONP was OK except for one major point: The amount of data to send where limited by max URL length and then again it had to be URI encoded.
Now we have a solution supported by all browsers except IE7 & Opera (for some reason).

Google Translate using JSONP

We have a web page.
In this page there is a set of Fields (input-text/ textarea) with Greek (or whatever google supports) text content.
There are some corresponding Fields where we like to have the english translation.
First get a key from Google API console
You have to remember that max URL length is 2038 characters for IE, that gives less than 1K for the string to translate. You can get more (a lot) from chrome, firefox, opera (>64K).
Google says that you can to it with POST instead of GET, but that is another post.