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.

Special Characters for HTML

Special characters with their HTML code like:
½ ¼ ¾ © ® ™ ℗
Unicode characters that have not HTML codes but can be used in HTML Pages like:
☎ ✉ ✔ ☒ ✖

HTML5 Sticky Footer

Table layouts are fine for the nonconformists among us.
But there are cases we realy need a CSS layout. Like when we have to rearrange the layout depending on the window size of the browser, to accommodate everything from mobile browsers to extra wide monitors.
Here is a Sticky Footer CSS layout.

Reference

CSS drop caps
Various Font Stacks
and more…

Protect post from copy paste

Friends keep asking me how to protect their blog posts from being copied.
As you can see I have no protection for my blogs because I think that the effort is futile. I'v seen posts of mine plainly copied in other blogs. In some cases they give a reference to my blog, and for those I am really happy.
In other cases they have no reference even though they just copied and pasted without any work of their own.
Still, my friends want to restrict copy-paste, so I prepared a list of the available solutions:

Database Version Control

There are two types of projects I am involved in these days.
  1. Custom enterprise applications where we design the database and manage it.
  2. Web applications, that we host, where each customer has his own copy of the database.
In both cases there are many copies of the database installed.
  • Developer databases
  • Test database (both internal and customer)
  • Production database
It is obvious that these databases should be under some Version Control so that can be easily synchronized.
Usually when a database is upgraded, a new version of the application is issued. If only one application is using the database then application-database sync is easy.
When multiple applications are using the same database then this problem is quite difficult to solve.
This is my solution to database versioning problem: