Monday, 25 May 2009

WolframAlpha

A new computational knowledge base is up and running. It calculates whatever you want, including your mortgage return, distance between cities and much more.

Try it: http://www.wolframalpha.com

In order to add WolframAlpha to search providers of your IE click here and follow instructions on "Create Your Own" section

Monday, 27 April 2009

Google surprises again

Google do not stop to surprise us with their Holiday logos.

They presented their logo in a form of a Gogol's famous nose on his 200th anniversary:


Now they present a logo in Morse code on Samuel Morse's anniversary:


What's next?

Great tool for files synchronizing: GetDropBox.com

There are things, that when we discover them at first we think "How they weren't invented before?", then we get used to them very quickly and finally we can't imagine living without them. One of such things is a great tool that keeps files on your different computers synchronized. The tool is Drop Box: it creates a Drop Box folder on your computers, for example your laptop and your desktop machine and synchronizes them. So you may drop files with any directories structure on your desktop and they will appear on the laptop as well. In addition, you can browse the files on the web, share them with others etc.

Follow this link, so I'll get an extra space:
Drop Box

Thursday, 16 April 2009

WCF CollectionDataContract and DataMember attributes

I came to write this post just occasionally: I was required to add a property to an existing collection. The colleciton was generated on the WCF and was sent to a client. I was surprised to discover, that it's not supported and other people already faced this issue and expressed their frustration and posted different workarounds on the web. Unfortunately, none of these suggestions worked. So I decided to post a tested solution.

So here is the situation, we have an Entity class and a collection of them:
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using System.Collections.Generic;

[DataContract]
public class Entity
{
public int ID {get; set;}
public int Name {get; set;}
}

[CollectionDataContract]
public class EntityCollectionNotSupported : Collection
{
[DataMember]
public int AdditionalProperty { get; set; }
}


* This source code was highlighted with Source Code Highlighter.


It will compile, but will not serialize AdditionalProperty at all! So what can we do about it if EntitiesCollection must stay a Collection?

We can mark our collection as DataContract and wrap another collection inside. Like this:

[DataContract]
public class EntityCollectionWorkaround : ICollection
{
public EntityCollectionWorkaround()
{
Entities = new List();
}

[DataMember]
public int AdditionalProperty { get; set; }

[DataMember]
public List Entities { get; set; }

// Implement here ICollection,
// IEnumerable and IEnumerable members
// by wrapping Entities
}


* This source code was highlighted with Source Code Highlighter.


Hope it helped somebody

Thursday, 25 December 2008

ORA-12154 when using EF Oracle Provider

When using EFOracleProvider, ORA-12154 might occur if there are 2 Oracle clients installed on your machine. The problem is that EFOracleProvider is looking for for tnsnames.ora in client_2 folder instead of client_1. The workaround is copy tnsnames.ora to client_2 folder as well.