Archive for September, 2005

Calculated fields in CAML

Monday, September 26th, 2005

So you have a SharePoint list with a calculated field. You want to select items based on the calculated field beginning with some specific substring. You write a CAML query:

<Where> <BeginsWith> <FieldRef Name=”SortDate” /> <Value Type=”Calculated”>200509</Value> </BeginsWith> </Where>

This won’t work. (At least on my [...]

Month names. i18n, you know

Monday, September 26th, 2005

Whenever you see something like this you should come to an idea something is wrong (for instance, the guy who wrote this is still alive):

‘month names in Latvian Dim sMonth() As String = _ {“Janvāris”, “Februāris”, “Marts”, “Aprīlis”, _ [...]

Asm?

Friday, September 23rd, 2005

Kā jums šķiet, vai “objektorientētais asamblers” ir oksimorons? Zinu tikai to, ka “objektorientācija” un “asemblers” vienmēr ir rādīti kā pretstati. Bet varbūt tak tomēr ir kāds gudrinieks, kurš pamanījies to apvienot?

Spell the word

Thursday, September 22nd, 2005

A tiny solution for the common English spell-by-letter problem. Written by me, plain PHP. Sources available on demand.

My favourite word, mississippi.

Parse the Enum!

Wednesday, September 14th, 2005

What if we need to save the value of an instance of an enumeration (Enum) as string and then get back the value again?

For instance, we have the following code:

Dim eDay As System.DayOfWeek = DayOfWeek.Monday

So now we can get a textual representation of eDay using the built-in ToString() method:

MessageBox.Show(eDay.ToString())

This yields a messagebox saying “Monday”. But [...]

String.Concat instead of &

Monday, September 5th, 2005

We all know that the concatenation operator & is evil when you use it intensively. We know writing like this is no good:

Dim s as String = “” s &= “<” s &= spFieldName s &= “>” s &= spFieldValue s &= “</” s &= spFieldName s &= “>”

This is no good because a new String object is being created for every [...]