GreenRock Software Code Comment

June 19, 2008

Get your ducks in a line!

Filed under: New Posts — greenrocksoftware @ 8:27 am

OMG – It actually can be done!!

June 18, 2008

Googling Typos – Don’t

Filed under: New Posts — greenrocksoftware @ 2:09 pm

You type a word – it comes out wrong. Just take it from me – don’t Google it!

June 10, 2008

VS2008: Arrrrgh (I’m not impressed)

Filed under: New Posts — greenrocksoftware @ 1:52 pm

OK I am over it now.

New rule: If you can’t find out what is going on – why your dll never gets from the obj to the bin directory with phantom shadow errors then exit VS2008.

Mental note –> EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT EXIT

Don’t waste two hours doing “get latests” dozens of times, building the solution ad infinitum and tracking dll’s all over your hard drive.

EXIT VS2008, curse Microsoft three times and continue on your merry way!!

June 5, 2008

Fuel Savings on the Cheap

Filed under: New Posts — greenrocksoftware @ 10:26 am

I was a fast driver once. To slow myself down, I used to put a rock on the bonnet of my car – I called it “Pet Rock” and like most pets, it slowly became part of my life. It traveled with me everywhere, on the bonnet.

That slowed my driving down considerably for all sorts of reasons!! But after a while I saw the eminent threat to bystanders and stowed Pet Rock away!

Last week, and suffering from escalating fuel prices, I realized I could use Pet Rock again – in a safe way – allowing roadside dwellers to return!

This time Pet Rock has gone under the accelerator pedal of my Honda Jazz – I’m going to get 100 mpg out of that car if it kills me!! And, it has the bonus of clearing the road ahead of traffic. Admittedly, there is a queue of traffic behind me the length of the island – but a simple twist of the rear vision mirror makes them disappear. And they should be thanking me – I’m saving them money as well!

I am sure there is an idea here – this concept needs more development i.e something under the pedal to make it harder to put the foot down … something softer than a rock me thinks!!

Windows Workflow

Filed under: New Posts — greenrocksoftware @ 10:10 am

Yep, I finally made it after half the planet is already doing it (workflow that is!!). Yes – even in England.

I started doing B#’s first walkthrough but that was just a bit simplistic. This one is much better.

May 28, 2008

Strange Operators

Filed under: New Posts, Ramblings — greenrocksoftware @ 11:43 am

private string GridViewSortDirection
{
get { return ViewState["SortDirection"] as string ?? “ASC”; } // if the value is null then return “ASC”
set { ViewState["SortDirection"] = value; }
}

See more here

May 22, 2008

Validation – Its just too easy

Filed under: New Posts — greenrocksoftware @ 4:48 am

Yes, I know we have been using this stuff for years but its still a buzz to use instead of custom javascript.

<asp:CompareValidator id=”someID” ControlToValidate=”someControl”
ControlToCompare=”someControl” or ValueToCompare=”someValue”
Type=”Currency|DateTime|Double|Integer|String”
Operator=”DataTypeCheck|Equal|GreaterThan|GreaterThanEqual|LessThan|LessThanEqual|NotEqual”
Display=”Dynamic|None|Static”
ErrorMessage=”"
runAt=”server” >
ErrorMessage (e.g. “*”)
</asp:CompareValidator>

<asp:RequiredFieldValidator id=”someID” ControlToValidate=”someField”
Display=”Dynamic|None|Static”
ErrorMessage=”some error message”
RunAt=”Sever”>
ErrorMessage (e.g. “*”)
</asp:RequiredFieldValidator>

<asp:RangeValidator id=”someID” ControlToValidate=”someControl”
MaximumControl=”someControl”
MinimumControl=”someControl”
MaximumValue=”someValue”
MinimumValue=”someValue”
Type=”Currency|DateTime|Double|Integer|String”
Display=”Dynamic|None|Static”
ErrorMessage=”some error message”
RunAt=”server” >
ErrorMessage (e.g. “*”)
</asp:RangeValidator>

<asp:RegularExpressionValidator id=”someID” ControlToValidate=”someControl”
ValidationExpression=”some expression”
ErrorMessage=”some error message”
Display=”Dynamic|None|Static” >
ErrorMessage
</asp:RegularExpressionValidator>

<asp:CustomValidator id=”someID” ControlToValidate=”someControl”
onServerValidation=”someFunctionThatReturnsABoolean”
ClientSideValidation=”someFunction”
ErrorMessage=”some error message”
Display=”Dynamic|None|Static” >
ErrorMessage (e.g. “*”)
</asp:CustomValidator>

<asp:ValidationSummary id=”someID”
Showsummary=”True|False”
DisplayMode=”BulletList|List|SingleParagraph”
HeaderText=”some text”
RunAt=”server” >
</asp:ValidationSummary>

May 2, 2008

USB Drives Letters

Filed under: New Posts, Ramblings — greenrocksoftware @ 7:30 am

My USB flash drive went AWOL after I added a new USB hard drive.

When a USB drive is first attached, Windows allocates it the first available drive letter even if the letter is an existing network share. This is because XP network shares are specific to the current user and not visible in the context of the system where the letter is assigned. The USB drive then appears to be invisible.

The resolution is to give the flash drive a new drive letter i.e.

1. Right click My Computer then Manage
2. Select Disk Management
3. Right click on the troublesome USB disk
4. Use Change Drive Letter and Paths to give it a new drive letter

If you are still getting grief have a look here for a tool to help you manage your USB drive allocations.

And one more thing since I first posted this .. there is a limitation to what drive letter you can assign a USB drive to … its around F(ish).

April 16, 2008

Is this C# object a collection?

Filed under: New Posts — greenrocksoftware @ 12:40 pm

Courtesy of Daniel and Paul and the other guy (wotzisnameagin)

if (e.ReturnValue is System.Collections.ICollection)
{
//The return value is a collection, invoke the Count property to get the number of items.
System.Collections.ICollection collection = e.ReturnValue as System.Collections.ICollection;
RecordsCount = collection.Count;
}

More here

WCF with LINQ

Filed under: New Posts, Ramblings — greenrocksoftware @ 10:30 am

From Chris comes this. Interesting how the WCF layer passes through entities from the GUI or from afar.

« Newer PostsOlder Posts »

Blog at WordPress.com.