Archive

Archive for the ‘Uncategorized’ Category

Flooring Again

April 22nd, 2004 No comments

Measure Twice, Cut once.

Doesnt really help when you lost both tape measures and your using a pencil and thumbnail as a marker on then pencil. Also if you do it perfectly only to find the strip of laminate was the wrong way round and they only click together in one direction.

Still nearly done.

Categories: Uncategorized Tags:

Literals

April 20th, 2004 No comments

I have been using Literals to dump the return values from database queries etc. as I dont need the overhead of formatting them. But today I found a reason to use Labels instead for these things.
In my repeater I had a Name literal to contain Surname + Forenames from the database. Now I often set my own name to contain German characters as to test things. My repeater was spitting out nonsense, Damn i thought need to do evil Encoding stuff.

Nope, thanks to Mark Sheppard who suggested using a label, it just worked as if by magic.

So labels chaps.

Categories: Uncategorized Tags:

Holiday

April 15th, 2004 No comments

Why don’t I fit some of that snap together wood flooring Sue is always telling me she wants. So I did.

It is as easy as it sounds but there are few things I learned in the process.

  • They dont always snap together easily, you will need a tapping block (wide side of hammer will do)
  • if you can get hold of one get a tool that will allow you to pull the boards together for when you cant get a hammer in to tap
  • Don’t abitrarily cut under the Architrave of your doors, chances are this will not help you get the wood underneath them, remember with snap-togethers you have to lower them once in place you cant shove them into place laying them flat.
  • Remove the skirting boards, dont skimp and use plastic, besides 1 bundle of skiting is cheaper than 1 length of proprietory plastic strip
  • When trying to get the last of the boards underneath the architraves and various cut outs, remember this is a floating floor, remove the spaces on the one wall slide the floor across, drop it in to place then put the spacers back to get the positioning right, (this could be tricky on a large surface area).
  • GripFill is a great bit of kit (used to glue skirting into place)
  • Dont hammer nails all the way in when gripfilling your skirting, to hold it in place while it dries, only half tap them in the job will be easier to complete with the nails removed, (doh!)
  • Contouring tool/edge profiler came in handy for corners
  • Dont use a jigsaw where your edges will be seen, ie fireplaces, other edges, fill the gap with Mastik (builders mate or even silicone sealant) this still looks better than plastic strips and again is cheaper
  • Just another two more rooms to do now.

    Categories: Uncategorized Tags:

    Expression’s again

    April 15th, 2004 No comments

    In my last post I mentioned the great expression column and accessing the parent. I had some trouble though when passing back thru a webservice the client freaked out with an XML parser error, which is obviously a bug as the XML is fine. But it cant handle the Parent/Child thing, it can manage other types of expression over the WS but not that one.

    As Dino Espisito wrote an article on this I mailed him in case he had come across this problem, Im waiting for a reply.

    Categories: Uncategorized Tags:

    Expression Values in Datasets

    April 15th, 2004 No comments

    There’s a cool little function in STD’s called the expression, you can use it to do math etc on a column without getting the database to return it. Thus making life easier on the DB.

    In one of my webservices Im writing there is a monster of a Set part of this set contains the Languages Spoken by a person and a table of languages.

    Now rather than the client having to do a lookup themselves for the language description I was doing a join in the DB and returning the Description from the Languages table. Now Fact is I’m already returning all the languages in a table with a relation on it so what a waste of a join I thought. Why cant I calculate the Parent rows description in the expression field I have the key after all.

    Well you can, in the expression you can do something like:-

    Parent(RelationNameWithoutQuotesAndInBrackets).Description

    (See page 320 in ADO.NET Book)

    Categories: Uncategorized Tags:

    Statics and thread safe-ness

    March 18th, 2004 No comments

    A while ago I raised a question in the newgroups about Static functions and how is it that they can be thread safe, a look through the C# language specifications (mspress book and w3c), various mspress programming, wrox books, msdn, a bit of a google, shed no light on the situation.

    This is quite a big deal if you are writing web sites as whilst you may be coding single threaded you are by the very nature of web writing multi-threaded apps, you should be aware of this stuff.

    I thought well ok you have this Static method with parameters or local variable store, and you can also have class level static variables. In all the examples It shows how to lock the Static class so that the class level static is safe, so how is it the parameters are safe ? They must be in the .NET equivalent of thread local store (something I remembered from vb6 com days). But now where could I find out if this was the case.

    Well I raised a call with MS and it is.

    Basically all parameters and local variables are stored on the stack, or pointers to variables on the heap are stored in the stack, as each thread running maintains its own stack the parameters and local store are hidden from each other.

    Another great thing is that this applies to databases so long as the database connection/adaptor/set etc are also thread local to the static method.

    Another piece of info that was voluteered from MS was an attribute you can “attach” to a static variable.

    [ThreadStatic]
    static int value;

    This has the effect of making this static variable local per thread, which would be quite useful in writing the c# equivalent of global functions.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemThreadStaticAttributeClassTopic.asp

    This makes an insteresting point about why not to use the attribute, in certain circumstances.
    http://www.hanselman.com/blog/PermaLink.aspx?guid=320

    Categories: Uncategorized Tags: