Nice RegEx Overview / Test Page#

I don't often need regular expressions, but when I do need them it is nice to have a page that gives you a quick index and even a place to test it out.

That is exactly what this page has:

http://www.quanetic.com/regex.php

keyword: regexp

Categories: Programming
Wednesday, May 10, 2006 1:57:26 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Run ASP.NET Web Server From Any Folder#

Rob McLaws has this cool extension that lets you click on a folder and run a webserver from it.

The article, with some comments on alternative ways to do it, or ways to improve it can be found here.

http://weblogs.asp.net/rmclaws/archive/2005/10/25/428422.aspx

From the page:

I've been doing some web development work again lately, and I haven't wanted to screw with setting up IIS on my virtual machine. The .NET Framework 2.0 comes with a built-in webserver, based on the old Cassini web server. So I wanted to be able to easily set up any directory to have its contents served up on an as-needed basis. The result is an addition to the Windows Explorer right-click menu, as shown below:

This is enabled by a simple modification to the registry. You can take the text below and dump it into a file named "WebServer.reg", and then run it, to immediately get the item in the context menu.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\VS2005 WebServer]
@="ASP.NET 2.0 Web Server Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\VS2005 WebServer\command]
@="C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Webdev.WebServer.exe /port:8080 /path:\"%1\""

There are a couple caveats to this tool, however:

  1. The web server does not randomly assign a port number, so it has to be hard-coded into the registry.
  2. The web server does not automatically assign a virtual directory, so it will always be "http://localhost:port"
  3. A command prompt window will be spawned, and cannot be closed without closing the web server process.

Moving foward, there are a couple of options to fix these issues:

  1. Someone who knows more about variables in the registry can help me fix issues #2 and #3
  2. I can build a wrapper executable that solves all three problems
  3. Microsoft can put in a DCR and fix it before it goes gold in a few days.

#3 is not likely, so I'd love to hear what you think. Hope this trick is useful.

 

Categories: .Net | .Net Framework | ASP.Net | Tools
Tuesday, May 09, 2006 3:55:26 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Dropdown1 has a SelectedValue which is invalid because it does not exist in the list of items.#

'Dropdown1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

This error has been a real pain to deal with.  I finally have a work around and a guess at the underlying problem, and because I see that people are having this same problem I thought I would do a little writeup about it.

 

Obviously, if you look at the actual error message, there are cases when you can get this message and the problem is easy to solve.  e.g. you have a dropdown populated with EmploID values and you try to databind with: 

Value='<%# Bind("EmployeeName") %>

 
Well of course that won't work if all your values are integers and you are trying to set the value to "Bill Smith".
 
But my problem was a bit more complicated.
 
I was building a web user control (aka ASCX) that was a "Location" dropdown.  The control basically contains a dropdown, and all the necessary logic to populate the dropdown, and I was trying to use this control inside the EditTemplate of a GridView.
 
To make things more complicated, in this case, I didn't JUST want all the Locations, I also wanted to add a "Please Select" item to the list, with a value of 0.
 
But I kept getting the error above when the value was supposed to be 0.
 
I stepped through my code to try to find out what was going on.  I believe the issue is this:
 
On load, on value set, and on databind I call my "Populate" method.  This method sees if there are items in the dropdown.  If not, it gets a list from the database and binds to the dropdown.  It also checks if there is a "Please Select" item, and adds it if there isn't one.
 
But still when Dropdown's "DataBound" event was fired the last time, my manually added item had been removed.
 
So what I think what is happening is that :
1) I set the dropdown DataSource to a collection of business objects
2) I add the "Please Select" item
3) The dropdown is told to databind itself by the Gridview.
4) The dropdown says... "Oh, I do have a datasource, so I'm going to ditch my current list and rebind to that old collection"
5) The dropdown says "Holy shnikies, I am supposed to bind to value "0", but I don't have one!!"
 
I think there are 2 possible solutions.
 
1) I created an adapter class that only has Id and Description properties that are going to be used by the control, and I wrote a function to take my collection of business objects and build a collection of Adapters (adding my "Please Select") to the list of adapters.  To see what I am talking about I will post this code below.
 
2) Manually add items to the dropdown instead of databinding, so that when the control is told to databind, it doesn't have a datasource to use.
 
 
Here is my adapter code:
            '**** In my populate method
Me.LocationsDropdown.DataSource = LocationAdapter.LocationsToAdapters(locations)
Me.LocationsDropdown.DataTextField = "LocationDescriptionWithActiveAttribute"
Me.LocationsDropdown.DataValueField = "LocationId"
Me.LocationsDropdown.DataBind()



'*************************************
'*************************************




Private Class LocationAdapter
Public ciLocationId As Integer
Public csLocationDescriptionWithActiveAttribute As String
Public Property LocationId() As Integer
Get
Return ciLocationId
End Get
Set(ByVal value As Integer)
Me.ciLocationId = Value
End Set
End Property

Public Property LocationDescriptionWithActiveAttribute() As String
Get
Return csLocationDescriptionWithActiveAttribute
End Get
Set(ByVal value As String)
Me.csLocationDescriptionWithActiveAttribute = Value
End Set
End Property

Public Sub New(ByVal loc As Location)
Me.LocationId = loc.LocationId
Me.LocationDescriptionWithActiveAttribute = loc.LocationDescriptionWithActiveAttribute
End Sub
Public Sub New(ByVal Id As Integer, ByVal Desc As String)
Me.LocationId = Id
Me.LocationDescriptionWithActiveAttribute = Desc
End Sub

Public shared Function LocationsToAdapters(ByVal locations As List(Of Location)) As List(Of LocationAdapter)
Dim adapters As New List(Of LocationAdapter)
adapters.Add(New LocationAdapter(0, "--Location"))
For Each loc As Location In locations
adapters.Add(New LocationAdapter(loc))
Next
Return adapters
End Function

End Class
 
 
 
Categories: Programming | .Net | ASP.Net
Sunday, May 07, 2006 2:45:48 PM (Central Daylight Time, UTC-05:00) #    Comments [7]  | 

 

Windows XP "Help and Support" Start Menu#

I never ever ever want to click on the "Help and Support" button in the WinXP start menu, but I frequently do when trying to click on something else (usually "Run...").

I found this info on http://www.winxptutor.com/hidehlp.htm

To remove the Help and Support link from XP Start Menu, try this:

  • Right-click Taskbar, choose Properties
  • In the Start Menu tab, click Customize
  • Select the Advanced tab
  • Uncheck Help and Support option.
  • Click OK, OK and close the dialog

For Windows Classic Start menu, you may need to modify the registry directly:

  • Click Start, Run and type Regedit.exe
  • Navigate to the following location:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Advanced

  • In the right-pane, create a new REG_DWORD value named NoStartMenuHelp
  • Double-click NoStartMenuHelp and set it's value to 1
  • Close Regedit.
Categories: Software | Tweaks | Windows
Friday, May 05, 2006 1:45:48 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

AWStats#

This is a well known log analyzer application that can provide a nice web interface for viewing we stats.

http://awstats.sourceforge.net/ 

Categories: Networking | Hosting | Programming | HTML | Tools
Thursday, May 04, 2006 3:55:16 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Adding a Single Project To Source Control? #

In previous versions of VS.Net you could take a project and go File->Source Control->Add Selected Project To Source Control and you could simply add the project to your VSS provider.

Now in VS.Net 2005 (maybe caused by VSS 2005, or VSS 2005 over HTTP), if you follow this route you will end up with File->Source Control->Add Project to Source Control, and your project will be added with the following path:

$\MyProject.root\MyProject.

Thanks VSS, thanks a lot.  I really needed that .root in there.

To get around this problem, just add another existing project to VS.Net (creating a solution).  Now highlight the actual project you want to add and do:

File->Source Control->Add Selected Project to Source Control and all will be wonderful.

Categories: Programming | .Net | VS.Net | VSS
Tuesday, May 02, 2006 2:43:04 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

GirlSpeak to English#

This is really funny!  I used to joke that I was going to write a book about this stuff, but this page about sums it up.

GirlSpeak to English Translator

Example:

She says                               English
---------                              -------
We need                                I want
Do what you want                   You'll pay for this later
We need to talk                      I need to complain

Categories: Funny Stuff
Tuesday, May 02, 2006 2:29:44 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

No Tools->Macros in VS.Net 2005#

Some people I work with have no Macros menu under Tools in vs.net 2005.

I am still trying to figure this one out, but in the mean time you can access most of the features with the following shortcuts:

Categories: Programming | .Net | VS.Net
Tuesday, May 02, 2006 10:44:43 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

ASP.NET 2.0 Page Life-cycle#

ASP.NET 2.0 has a added a bunch of extra spots in the page lifecycle for programmers to insert their logic.

The guys over at www.csharper.net have put together a great list of these events and some notes about them in applicable.

You can see the article here, or you can click through to my full article where I copied their table.

Categories: Programming | .Net | ASP.Net | Architecture
Sunday, April 30, 2006 10:13:38 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Grant Execute Rights To All SPs#

Many times you can have a database that has access to it restricted to SPs.  If the database is application specific, then there is a good chance that 1 user account will need to access all these SPs to run the application.

My friend Phil found and updated this script to run in SQL Server 2005 to generate the necessary code to grant execute rights to all SPs in a database for a given user.

SELECT 'GRANT EXECUTE ON ' + sysobjects.name + ' TO AccountName' + 

CHAR(10) + CHAR(13) + CHAR(10) + CHAR(13) 

FROM sysobjects 

WHERE type = 'P' and category = 0 AND name not like 'sp_%'

 

Categories: Database | SQL Server | T-Sql
Thursday, April 27, 2006 6:54:32 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

SQL Server Query Results To Excel#

There are many times when I just want to run a query and send the results to someone in an excel spreadsheet.

You can easliy copy the and past the results, but you don't get column headers, and you lose formatting in many cases.

Dinakar Nethi has a good article about how to directly import the results of a query into excel.

I just used his method and it worked great.

Categories: Database | SQL Server
Thursday, April 27, 2006 2:51:33 PM (Central Daylight Time, UTC-05:00) #    Comments [3]  | 

 

Secret Message#

I think this is pretty cool.

Check out the image below.  Then use the link below to open up just the image in a new browser window.

Resize the image (make it smaller) to see the secret message.

 




secret.gif (139.54 KB)

 

Categories: Cool | Interesting | Misc
Thursday, April 27, 2006 10:34:20 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

VS2005 VB.Net Create Properties From Private Fields#

"Refactor!" has the ability to turn your fields into public accessible properties, but it kinda sucks because 1) you have to do it 1 at a time, and 2) the naming convetion is all wrong. 

For example if you have a private integer called myInt then your property will be MyInt1.  Not exaclty what I am looking for.

So I updated my 2002 macro for creating these properties.  It should allow you to follow a variety of naming conventions "m_XXX", "ciXXX", "strXXX" etc.

Just include the macro below, then just highlight your private fields, and run the macro.

   ' highlight the private properties
Public Sub AddClassProperties()

Dim oTextSelection As TextSelection = DTE.ActiveWindow.Selection
Dim iLinesSelected = oTextSelection.TextRanges.Count
Dim colPropertyList As New Collection()
Dim iIndex As Integer
Dim oStart As EditPoint = oTextSelection.TopPoint.CreateEditPoint()
Dim oEnd As TextPoint = oTextSelection.BottomPoint

'Create an Undo context object so all the changes can be
'undone by CTRL+Z
Dim oUnDo As UndoContext = DTE.UndoContext

'Supress the User Interface. This will make it run faster
'and make all the changes appear once
DTE.SuppressUI = True

Try

oUnDo.Open("Comment Line")

Dim sProperty As String
Dim sLineOfText As String

Do While (oStart.LessThan(oEnd))

sLineOfText = oStart.GetText(oStart.LineLength).Trim
'*** do some kind of simple check to make sure that this line
'*** isn't blank and isn't some other kind of code or comment
If (sLineOfText.IndexOf(" As ") >= 0 And ( _
(sLineOfText.IndexOf("Public ") >= 0) Or _
(sLineOfText.IndexOf("Private ") >= 0) Or _
(sLineOfText.IndexOf("Dim ") >= 0) Or _
(sLineOfText.IndexOf("Protected ") >= 0) Or _
(sLineOfText.IndexOf("Friend ") >= 0) Or _
(sLineOfText.IndexOf("ReDim ") >= 0) Or _
(sLineOfText.IndexOf("Shared ") >= 0) Or _
(sLineOfText.IndexOf("Static ") >= 0) _
)) Then

sProperty = oStart.GetText(oStart.LineLength).Trim.Replace(" New ", " ").Replace("()", "")

colPropertyList.Add(sProperty)
End If

oStart.LineDown()
oStart.StartOfLine()

Loop

If colPropertyList.Count > 0 Then

For Each sProperty In colPropertyList
Call InsertProperty(sProperty)
Next

Else
MsgBox("You must select the class properties")
End If

Catch ex As System.Exception

Debug.WriteLine(ex)
If MsgBoxResult.Yes = MsgBox("Error: " & ex.ToString & vbCrLf & "Undo Changes?", MsgBoxStyle.YesNo) Then
oUnDo.SetAborted()
End If

Return
Finally

'If an error occured, then need to make sure that the undo context is cleaned up.
'Otherwise, the editor can be left in a perpetual undo context
If oUnDo.IsOpen Then
oUnDo.Close()
End If

DTE.SuppressUI = False
End Try


End Sub

Private Sub InsertProperty(ByVal sProp As String)
Dim oTextSelection As TextSelection = DTE.ActiveWindow.Selection
Dim sMember As String = sProp.Substring(sProp.IndexOf(" ")).Trim
Dim sDataType As String
Dim sName As String
Dim i As Integer
Dim iAscVal As Integer

i = sMember.IndexOf("(")
If Not i = -1 Then
sMember = sMember.Substring(0, i)
End If

i = sMember.IndexOf("=")
If Not i = -1 Then
sMember = sMember.Substring(0, i)
End If

sDataType = sMember.Substring(sMember.IndexOf(" As ") + 1)

For i = 0 To sMember.Length - 1
'iAscVal = Asc(Mid(sName, i, 1))
iAscVal = Asc(sMember.Chars(i))
If iAscVal > 64 And iAscVal < 91 Then
sName = sMember.Substring(i)
Exit For
End If
Next i

sName = sName.Substring(0, sName.IndexOf(" As ") + 1).Trim

If sName.Length = 0 Then
MsgBox("Unable to process the class property: " & sMember & ". This is usually caused by an incorrect naming convention (e.g. not cxName)")
Return
End If

sMember = sMember.Substring(0, sMember.Length - sDataType.Length).Trim

With oTextSelection
.MoveToPoint(.ActivePoint.CodeElement(vsCMElement.vsCMElementClass).GetEndPoint(vsCMPart.vsCMPartWhole))
.LineUp()
.EndOfLine()

.Text = "Public Property " & sName & "() " & sDataType
.NewLine()
.Text = "Return " & sMember
.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, True)
.Copy()
.LineDown(False, 3)
DTE.ExecuteCommand("Edit.Paste")
.Text = "Me." & sMember & " = Value"
.LineDown(False, 2)
.NewLine(2)

End With

End Sub

 

 

Update1: When using code that you cut and paste from here, you might need to first paste it into Word or Wordpad.

Update2: When using this macro, you need a space (new line) between the last private field variable and your end of class line.

Categories: .Net | VB.Net | VS.Net | Tools
Thursday, April 27, 2006 9:53:16 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

450 Freeware Utilities#

This is a pretty good list of freeware utilities for all kinds of applications:

http://www.econsultant.com/i-want-freeware-utilities/index.html

 

Categories: Computers | Software | Tweaks | Windows | Utilities
Wednesday, April 26, 2006 9:25:22 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

applicationSettings, appSettings. app.config, web.config and userSettings#

I have seen lots of posts from people in the newsgroups trying to figure out what the deal is with the new config options in .net 2.0.

The main reason people run into problems is due to MS making a number of changes, including changes between the beta and the RC product, resulting in different answers based on how early you encountered the issues.

You can still do things the way you did with .Net 1.x.

       <appSettings>

              <add key="MyKeyName" value="somevalue"/>

       </appSettings>

and then you can access it with:

Dim myvalue As String = System.Configuration.ConfigurationSettings.AppSettings.Item("ConnectionString")

However, if you try this, VS.Net will warn you:

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings

It is important to note that the "!" above indicates that the fully quallified class listed, is located in the System.Configuration assembly, which of course you have to add to your project. 

So unlike previous versions, you need to manually add a reference to System.Configuration in order to make this new call.

Now, .net 2.0 and vs.net 2005 have teamed up to offer a new option for storing user settings which may seem more complicated at first if you don't know exactly what you are doing.  In the project properties you can select a "Settings" tab where you are able to modify application settings, which are in turn stored in app.config.  These settings can either be "User" settings, or "Application" settings. 

Application settings are stored in the app.config (or web.config), and are read-only.  User settings have a default value that is stored in the app.config, but your application can overwrite these default values as needed, and the users settings will be stored in:

%USERPROFILE%\Local Settings\Application Data\<Company Name>\<appdomainname>_<eid>_<hash>\<verison>\user.config. (non roaming)

OR:

%USERPROFILE%\Application Data\<Company Name>\<appdomainname>_<eid>_<hash>\<verison>\user.config (roaming)


The other nice feature of the 2.0 way of accessing these settings is that the settings are saved as a specific type from a wide collection of available types (String, System.DateTime, System.Drawing.Color, System.Guid, Bool, StringCollection etc) and when you access them from your code they are available in intellisense.

This may seem like it isn't important, but it means you can't mistype a setting key, or accidently try an invalid cast from one of your settings.  Also, storing a collection was a real pain in 1.x.    Now you can create a collection quickly and it will be added to the user settings like this:

   <setting name="MyCol" serializeAs="Xml">

        <value>

            <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xmlns:xsd="http://www.w3.org/2001/XMLSchema">

                <string>I am first</string>

                <string>second</string>

                <string>me third</string>

                <string>I am number four</string>

            </ArrayOfString>

        </value>

    </setting>

Pretty nice!

To access these properties you have 2 different ways depending on if you are using VB.Net or C#.

For VB.Net you use the "My" namespace and access it like this:

Dim mySetting As String = My.Settings.MySetting

For C# you access these settings through the "Properties" object

       string mySetting = Properties.Settings.Default.MyUserSetting;

That's it!

Categories: Programming | .Net | .Net Framework | C# | VB.Net
Wednesday, April 26, 2006 8:36:40 AM (Central Daylight Time, UTC-05:00) #    Comments [9]  | 

 

Virtual Server Networking With External Access#

I was having such a hard time getting MS Virtual Server setup so that my virtual servers could access the public network and vice versa.

In the end the problem was caused by a service that is running to enable my VPN connections.

The service is called:

Cisco Systems, Inc. VPN Service.

As soon as I turned off that service, everything with my virtual servers network worked just fine.

 

Categories: Interesting | Networking
Tuesday, April 25, 2006 3:54:49 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Composed vs Comprised#

I have no idea why I have such a hard time remembering composed vs comprised.

  • A car is composed of many parts
  • The parts compose the car.
  • A car comprises many parts

 

Categories: Misc
Tuesday, April 25, 2006 3:34:38 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Serialization / Deserialization of Objects With Version Changes#

CSLA as well as well as the proxy architecture I created for my last project, utilize serialization of objects to be passed across the wire, and deserialized on the other side into the same type of object.

This is different from passing datasets, which are then read into business objects.  We are actually passing the serialized version of the business object.

So what happens if you make a change to a business object such as adding a public property.  Will clients who have the old version of the Business Object be forced to upgrade? 

To see the answers along with some sample code for testing this out click on the link to read the full article.

So lets say you have a class that exposes 20 properties and 40 methods.  This business object is deployed on hundreds of clients computers.  When they send the BizObject over the wire, it is deserialized back into the exact same object on the server. 

But now, for whatever reason, you need to add 1 property to this BizObject.  For the current set of clients using this business object, you don't really need to deploy the updated change unless you have to in order to keep it from breaking.

So do you need to redeploy?  Probably not.

I serialzied a business object into a base64 encoded string and then added a public property to the object and tried to deserialize it with the "old" serialized string.  The result?  It worked.  The properties that had values when I first serialized it kept their values.  The fact that there were new properties didn't cause a problem.

How about going the other way: removing a public property that had a value when it was serialized, but doesn't exist with deserialized.  Again, this works. 

When doesn't it work?  When you are trying to deserialze into a different class, or a different namespace for the same class. 

So you can't serialize classA and deserialize it into classB, even if both expose the exact same signature.  The same goes for namespaces.  If you serialize classA, and then change it's namespace and try to deserialize it, you will get an exception.

You can try it out with the following code:

Imports WindowsApplication1.ASDF


Public Class Form1

Private Sub toString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdToString.Click
Dim o As New A
o.A11 = "this is a test"
o.Asdf1 = "another test"

Me.TextBox2.Text = EncodeBase64(o.CloneString)
MsgBox(EncodeBase64(o.CloneString))
End Sub

Private Sub fromString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fromString.Click
Dim o As A = A.Hydrate(DecodeBase64(Me.TextBox1.Text))
MsgBox(o.A11)
MsgBox(o.Asdf1)
MsgBox(o.asdfdsa)
End Sub

Public Function EncodeBase64(ByVal input As String) As String
Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
Return System.Convert.ToBase64String(strBytes)
End Function

Public Function DecodeBase64(ByVal input As String) As String
Return System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(input))
End Function

End Class


<Serializable()> _
Public Class Parent

Public Function CloneString() As String
Dim bFormatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim stream As New System.IO.MemoryStream()
bFormatter.Serialize(stream, Me)
stream.Flush()
stream.Position = 0
Dim bytes() As Byte = stream.ToArray()

Return System.Text.Encoding.Default.GetString(bytes)
End Function

Public Shared Function StringToStream(ByVal str As String) As System.IO.Stream
Return New System.IO.MemoryStream(System.Text.Encoding.Default.GetBytes(str))
End Function

End Class

<Serializable()> _
Public Class A
Inherits Parent

Private a1 As String
Private asdf As String
Public Property A11() As String
Get
Return a1
End Get
Set(ByVal value As String)
a1 = value
End Set
End Property

Public Property Asdf1() As String
Get
Return asdf
End Get
Set(ByVal value As String)
asdf = value
End Set
End Property
Public Function asdfdsa() As String
Return "Asdf"
End Function
Public Shared Function Hydrate(ByVal s As String) As A
Dim bFormatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim stream2 As System.IO.MemoryStream = StringToStream(s)
stream2.Flush()
stream2.Position = 0
Dim newClone As A
newClone = CType(bFormatter.Deserialize(stream2), A)
Return newClone
End Function

End Class


 

Categories: Programming | .Net | .Net Framework | Architecture
Sunday, April 23, 2006 7:35:24 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Rocky Lhota at CNUG#

I was able to get to the CNUG meeting where Rocky Lhotka was the feature speaker.

I had a chance to ask Rocky a couple of questions that had been bugging me about CSLA.

1)  He agreed that using the method of multiple result sets in datareader is not really a good idea in some instances, where a dataset would be much more useful.

2)  He suggested that you should usually not have an object that is sometimes a child and sometimes a parent.  I am not sure I agree with idea.  I believe I understand his point that if you are dealing with a Project object that has a collection of Employees assigned to it, you probably don't need the Employees to be as complex as if you were dealing with an Employee who is assigned to a bunch of Projects, but at the same time you are talking about writing 2 classes with 2 sets of data access scripts, vs 4 classes and 4 sets of data access.  But, he said that there are techniques for making a business object be both a parent and a child.  This is apparently detailed in Ch 7. 

Rocky suggested the book Object Thinking by Dave West

3) He mentioned that people have built UI Frameworks that run on top of CSLA.  I will have to look into this.

4) He was showing an example using an ASP.NET MultiView control, looked like a great way to enable multiple views of the same data.

5) I didn't get a chance to ask him about serialization and deserialization of classes that have small differences.  For example if you serialze an object and use the same byte array to deserialize a similar class, will it blow up if small changes are made, like you add a public property?  I will have to try this out myself.

In all, Rocky was a very good speaker.  Very engaging, funny, and on point. 

Oh and I won the raffle at the end, to get a copy of his book, the one I just paid 60 bucks for :-).

Categories: Programming | .Net | Architecture
Saturday, April 22, 2006 5:27:52 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Cool Icons#

A friend of mine has been using Plesk to automate some hosting settings.

I was taking a look at it and thought they had a lot of cool looking icons.

Not that anyone would want to download icons from a website and use them... :-)

Categories: Programming
Saturday, April 22, 2006 4:57:32 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<May 2006>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: