February 2003 - Posts
Mads writes:
Maintaining complete object hierarchy in-memory
The alternative would be to load all objects into memory at startup or first use. This way, using stateful session beans, each client could make requests on references to real objects directly, with these references placed in their state on the application layer.
The big "how" in this scenario is search. How to do an effective complex search in large object hierarchies? If I have 4000 contacts of different types with sub-contacts and aggregated objects etc. it would probably take ages to do what a simple SQL SELECT could do in seconds.
Maybe you should give a look at XPath for objects. An example of this for Java is JXPath.
Note: I should have a prototype for .NET any time soon.
Tim writes:
If you haven't already, though, I would recommend checking out Anakrino, an awesome open-source C# decompiler. It can be very useful to get insight into a .NET assembly, either to extend / specialize functionality or to debug weird issues. And sure, the source code generated isn't quite as good as the original - for example, MSIL doesn't keep local variable names, so you lose those - but it still does the trick.
I know for me it has proved useful on more than a few occasions.
[Loosely Coupled]
A great resource for the source code of the standard components of .NET is Mono. They've already done the reverse engineering for us.
Check the Mono Class Libraries, a valuable resource for component writers!
I've created a custom DropDownList web control that enables the use of custom attributes on its items. This is just a rather simple improvement over the standard .NET web control, but a useful one in my opinion.
For example, this control can be used as follows:
<mad:DropDownList id="ddlTest" runat="server">
<asp:ListItem Value="">An</asp:ListItem>
<asp:ListItem Value="" style="color:red;font-weight:bold;text-align:center">invalid</asp:ListItem>
<asp:ListItem Value="">item</asp:ListItem>
<asp:ListItem Value="">is in here</asp:ListItem>
</mad:DropDownList>
The result being this: 
The source code is available of course.
Warning: not all CSS attributes work with Internet Explorer. This screenshot comes from Phoenix, but at least the color attribute works with IE.
On a project I have worked on, we needed to display a tree view in an ASPX page. The client needed the ability to print the page through IE print command. We started to use the TreeView control coming with the IE Web Controls released by the ASP.NET team. Then we realized that the tree view was not printing correctly due to the use of a client behavior coming with the TreeView server control. The client behavior is automatically activated on IE 5.5+, and deactivated for previous or non IE browsers. ...But, the client behavior cannot be deactivated on up-level browsers!
I was not panicked as luckily MS had released the source code of the IE Web Controls not long before. After some investigation in the existing code, I found a way to create a custom TreeView control that would allow the client behavior to be deactivated. My TreeView is just an extension of the base TreeView with an added BehaviorUsage property which values can be Default, Deactivated or Forced. The source code is available for your curiosity or use.
This case is just an other example of the advantages of releasing source code...
Here is a quick summary of the steps to add Stored Procedures to the .NET IDE:
- Install VS.NET on client machine
- Install VSS on client machine
- Open the VS.NET IDE and make sure to enable "version control" on the "Tools | Options | Database tools" tab. The option is "Enable version control"
- Install VSS on server machine
- Make sure SQL is running as a domain account and that that account has been added to the VSS database on the server
- Run the VS.NET install on the server machine, deselecting everything but "Server components/VS 6 Stored Procedure Version Control"
- Open the VS.NET IDE and create a connection to that SQL database
- Right click on the "stored procedureS" node and select "Add to Source Control". This creates the initial project structure in VSS
- You must now still add the individual SP's. You can click on the top one, hold down shift, and click on the last one. This will highlight all the SP's allowing you to right click and add to Source Control
I do not remember where I found this information, but more information can be found on MSDN.
Update: Thanks to Dominic Fenton, here is an official Microsoft reference document on this subject: HOW TO: Add SQL Server 2000 Stored Procedures to Visual SourceSafe by Using Visual Studio .NET
I've been struggling with CTRL+TAB since the first day I started working with VS. Till today, I still do not know how to jump to the next (visually speaking) tab in the editor. CTRL+TAB does not make it as it jumps to the next (randomly speaking) tab. I don't understand the logic behind it, and it's not working as I wish it would.
Does someone know of a working solution to jump between tabs without having to use the mouse?
I've put a search page for dotnetweblogs.com on my weblog. Thank you goes to Google.
(Scott, I included aspnetweblog.com too :-) )
Update: forgot to mention that I've added a link (Search) on my main page to make the search page easier to find.
While showing-off the previous tip to a mate I was eagerly pointed in the direction of this link:
http://www.sellsbrothers.com/spout/default.aspx?content=archive.htm#vs.netfunfacts
Chris Sells does it yet again!
[Darren Neimke]
Two I like and didn't know about:
I recommend to use this with "Synchronize Class View" from the editor context menu.
Update: The two tips above seem to work only for C#.
A nice little tool useful if you are working with HTML tables.
Escaping from our .NET world for a second (as we are leaving in a real world too...):
Slavomir Furman wrote:
Keith Ballinger wrote:
Floor speech by Senator Robert Byrd. A brilliant articulation of how I feel.
[Floor speech by Senator Robert Byrd. A brilliant articulation of how I feel.]
+1
Although I never heard about Senator Robert Byrd before and although I'm not an U.S. citizen, I think that this speech articulate also my feelings about all this Iraq thing we heard in news every night everywhere. Great speech!
Very good. A must read.
Good to see these opinions clearly expressed!
More Posts
Next page »