From shamil at smsconsulting.spb.ru Sun Jun 1 03:23:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 1 Jun 2008 12:23:22 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web Image Control Message-ID: <003401c8c3c0$c147bb60$6401a8c0@nant> Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil From ebarro at verizon.net Sun Jun 1 13:49:32 2008 From: ebarro at verizon.net (Eric Barro) Date: Sun, 01 Jun 2008 11:49:32 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: References: Message-ID: <00a601c8c418$3e4be6c0$c403000a@advancedinput.com> Thanks to all who replied. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 10:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jun 2 23:07:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 3 Jun 2008 08:07:40 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl In-Reply-To: <003401c8c3c0$c147bb60$6401a8c0@nant> Message-ID: <01b201c8c52f$5e344dc0$6401a8c0@nant> Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Tue Jun 3 10:54:34 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Tue, 3 Jun 2008 08:54:34 -0700 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl In-Reply-To: <01b201c8c52f$5e344dc0$6401a8c0@nant> References: <003401c8c3c0$c147bb60$6401a8c0@nant> <01b201c8c52f$5e344dc0$6401a8c0@nant> Message-ID: <002601c8c592$1ea5f970$0200a8c0@murphy3234aaf1> Hello Shamil, I am not familiar with the subject but was looking at chart controls for use in aspx pages the other day and skimmed this article, http://aspnet.4guysfromrolla.com/articles/072507-1.aspx, that discussed a similar technique for putting chart images on web pages without actually creating an image file on the server. It may be of some use. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, June 02, 2008 9:08 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 02:28:28 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 11:28:28 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: <047001c8c6dd$bfeb4c80$6401a8c0@nant> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 03:40:54 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 10:40:54 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From shamil at smsconsulting.spb.ru Thu Jun 5 04:03:46 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:03:46 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048e01c8c6eb$0fc48250$6401a8c0@nant> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 04:25:27 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:25:27 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048f01c8c6ee$17abcbb0$6401a8c0@nant> Hi Gustav, BTW, there is an IronPython for .NET: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython IOW, if you (and I :) ) have ever time to study Python we can use it within VS for development - I guess one can develop class libraries (/apps) on IronPython for the tasks the best suited for Python and then use these class lubaries (/apps) together with C# class libraries(/apps) within a solution... There is also IronBuby (http://www.ironruby.net/ ) as you probably know better than me ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 5 04:44:44 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 11:44:44 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil OK, yes the approach is quite fascinating - and Google does not exclude future language additions to the Google App Engine: http://code.google.com/appengine/docs/whatisgoogleappengine.html Perhaps we should just wait and see ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 11:03 >>> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 09:23:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 16:23:38 +0200 Subject: [dba-VB] Parallel Extensions to the .NET Framework June 2008 CTP Message-ID: Hi all Who was requesting this? JC? http://blogs.msdn.com/pfxteam/archive/2008/06/02/8567802.aspx .. we have begun to add the third major API component, the Coordination Data Structures, to the technology package. As we build PLINQ and the Task Parallel Library, we use a lot of components under the covers to handle synchronization, coordination, and scale to contain data reads and writes from multiple procs. .. /gustav From shamil at smsconsulting.spb.ru Fri Jun 6 01:08:37 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 6 Jun 2008 10:08:37 +0400 Subject: [dba-VB] Initiating and monitoring long running ASP.NET 2.0 server side process... Message-ID: <055701c8c79b$c2b85de0$6401a8c0@nant> Hi All, I need to do the following: - start a long running (up to 1 minute) process on the ASP.NET 2.0 application server side by (e.g.) clicking ASP.NET web form's button; - immediately get ASP.NET web form freed from waiting of this process getting finished; - but in the same time something like JavaScript script started on client side sending, say, every second an XMLHTTP request to the ASP.NET server side, and getting back the status of long running process and presenting it on the client side - just in a textbox/label would be ok for starters... The above (or similar) procedure can be done for sure I just need to know ASAP how to do that as I haven't yet programmed something like that - a link to a good sample on Internet would be good enough for me to study and to make here my adapted custom solution.... Please note - I need ASP.NET 2.0 solution, without AJAX extension - just using async callback feature if possible. Async callback's simple sample is in the P.S. of this message but I need more: - where alert(...) is called in the below sample on client side there should be a call to JavaScript periodically every 1 second sending XMLHTTP request to the server...........??? Thank you. -- Shamil P.S. <%@ Page Language="C#" Title="Fun with callbacks: a simple one" %> <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %> Asycn Callback sample
Enter your name here: " />
From Johncliviger at aol.com Tue Jun 24 10:21:54 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 24 Jun 2008 11:21:54 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Tue Jun 24 11:09:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jun 2008 18:09:25 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From michael at ddisolutions.com.au Tue Jun 24 19:56:42 2008 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 25 Jun 2008 10:56:42 +1000 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D013BFAF7@ddi-01.DDI.local> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From wdhindman at dejpolsystems.com Tue Jun 24 22:19:34 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Tue, 24 Jun 2008 23:19:34 -0400 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <1A2C8794C45742678AA0A53DB76F6EE0@jislaptopdev> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I > need a very similar form and It seems a real drag to type that lot again. > Any > sugesstions? > > TIA > > johnc > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Jun 25 02:32:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:32:19 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi Michael For my case the forms have been too different. So the first form have been just a sort of template for the copy. /gustav >>> michael at ddisolutions.com.au 25-06-2008 02:56 >>> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Wed Jun 25 02:34:55 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:34:55 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi William I have done so. Same issue. Or am I missing something? /gustav >>> wdhindman at dejpolsystems.com 25-06-2008 05:19 >>> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I need a very similar form and It seems a real drag to type that lot again. > Any sugesstions? > > TIA > > johnc From Johncliviger at aol.com Wed Jun 25 03:41:07 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Wed, 25 Jun 2008 04:41:07 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Cheers Guys for the feed back. johnc From Gustav at cactus.dk Thu Jun 26 01:21:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 08:21:13 +0200 Subject: [dba-VB] Open XML Format SDK for .Net (Office 2007 docs) Message-ID: Hi all Woody's Office Watch posted this: Programming tools for Office 2007 documents now available See this article online http://news.office-watch.com/t/n.aspx?a=639 Microsoft has released a set of programming tools to let developers work with Office 2007 documents without the Office applications themselves. The Open XML SDK v1.0 is available from here with information and 'how to' over here. It works in any language supported by the .net framework. The Software Development Kit lets you access Word, Excel and Powerpoint documents from programs. You could extract data, add or replace text and many other things. Chances are good you'd do many of these things inside an Office VBA program but that can be quite slow and requires an Office license on each computer it's running. A separate program using the SDK can do the job faster and without more Office licenses. In practice, the SDK is mainly useful for companies that want to link Office documents with other non-Office systems. The 'How do I *' page is especially useful with answers to particular questions: http://msdn.microsoft.com/en-us/library/bb491088.aspx As you'd expect from Microsoft, version 1.0 isn't the end of the matter. There'll be a v2 of the SDK later this year and yet another with the next version of Office (aka Office 14). Download is here: http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&displaylang=en The 2007 Microsoft? Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel? 2007, and Microsoft Office PowerPoint? 2007 all use these formats as the default file format. Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace. The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. /gustav From shamil at smsconsulting.spb.ru Thu Jun 26 02:32:32 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 11:32:32 +0400 Subject: [dba-VB] Getting TextReader from strings... Message-ID: <047201c8d75e$cbc71a20$6401a8c0@nant> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From Gustav at cactus.dk Thu Jun 26 03:49:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 10:49:53 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jun 26 10:06:09 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 08:06:09 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054301c8d7a4$5f73c490$6401a8c0@nant> Hi Gustav, You're a Geek! :) I prefer "mere mortals' way". I think I see some advantages of MMW against MGW but I'd better stay quiet to not make this thread like getting into flame mode :) Yes, from aesthetic point of view I like MGW but from practical I prefer MMW... The only disadvantage would be if the code generated for MGW would be somehow considerably quicker for large strings' sets... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054201c8d7a4$5ecf4730$6401a8c0@nant> Hello Charlotte, Thank you for your opinion. You're surely a Geek also as Gustav is. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, June 26, 2008 7:06 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:55:45 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:55:45 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054701c8d7a5$18568c40$6401a8c0@nant> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 26 11:30:15 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 18:30:15 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From shamil at smsconsulting.spb.ru Thu Jun 26 13:30:24 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 22:30:24 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <055e01c8d7ba$b2ee9c10$6401a8c0@nant> <<< ... that's when I stopped playing smart. >>> YES! :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 8:30 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Jun 26 17:32:44 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 27 Jun 2008 08:32:44 +1000 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > From cfoust at infostatsystems.com Thu Jun 26 18:16:35 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 16:16:35 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> References: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Message-ID: Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 18:34:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 03:34:19 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05a001c8d7e5$28127500$6401a8c0@nant> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 02:12:51 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 09:12:51 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From shamil at smsconsulting.spb.ru Fri Jun 27 04:06:57 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 13:06:57 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05d701c8d835$26ba77c0$6401a8c0@nant> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 11:13 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From Gustav at cactus.dk Fri Jun 27 04:42:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 11:42:13 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html From shamil at smsconsulting.spb.ru Fri Jun 27 06:09:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:09:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05f901c8d846$353c1720$6401a8c0@nant> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 06:24:23 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 13:24:23 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.chm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleStyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From shamil at smsconsulting.spb.ru Fri Jun 27 06:52:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:52:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05fd01c8d84c$370fde00$6401a8c0@nant> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From Gustav at cactus.dk Fri Jun 27 07:15:47 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 14:15:47 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I see. NDoc is indeed dead. No activity since Feb. 2005. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:52 >>> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav From DWUTKA at Marlow.com Fri Jun 27 09:54:08 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 09:54:08 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From cfoust at infostatsystems.com Fri Jun 27 10:18:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jun 2008 08:18:06 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jun 27 11:17:30 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 11:17:30 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: Oh, certainly. I have a LOT of classes that are identical in structure, I call them Object/Collection classes. One class is an object, such as an Employee. It has properties and functions for an Employee (including reading and writing data to a database). The second class would be Employees, which would contain a collection of all the employees. I actually have an Add-in I wrote that builds these classes automatically, as soon as I give it a table or query to build it from. (The properties are then based off of field names). But if one of these classes needs some special features, then I put in comments. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 10:18 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From Gustav at cactus.dk Mon Jun 30 03:27:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 30 Jun 2008 10:27:25 +0200 Subject: [dba-VB] Improving Web Services Security: Scenarios and Implementation Guidance for WCF Message-ID: Hi all A beta2 version of a quite comprehensive guide (680 pages) on: Improving Web Services Security: Scenarios and Implementation Guidance for WCF is available here: http://blogs.msdn.com/joestagner/archive/2008/06/11/microsoft-patterns-practices-improving-wcf-services-security.aspx Should keep you busy on a rainy weekend. /gustav From shamil at smsconsulting.spb.ru Sun Jun 1 03:23:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 1 Jun 2008 12:23:22 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web Image Control Message-ID: <003401c8c3c0$c147bb60$6401a8c0@nant> Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil From ebarro at verizon.net Sun Jun 1 13:49:32 2008 From: ebarro at verizon.net (Eric Barro) Date: Sun, 01 Jun 2008 11:49:32 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: References: Message-ID: <00a601c8c418$3e4be6c0$c403000a@advancedinput.com> Thanks to all who replied. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 10:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jun 2 23:07:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 3 Jun 2008 08:07:40 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl In-Reply-To: <003401c8c3c0$c147bb60$6401a8c0@nant> Message-ID: <01b201c8c52f$5e344dc0$6401a8c0@nant> Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Tue Jun 3 10:54:34 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Tue, 3 Jun 2008 08:54:34 -0700 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl In-Reply-To: <01b201c8c52f$5e344dc0$6401a8c0@nant> References: <003401c8c3c0$c147bb60$6401a8c0@nant> <01b201c8c52f$5e344dc0$6401a8c0@nant> Message-ID: <002601c8c592$1ea5f970$0200a8c0@murphy3234aaf1> Hello Shamil, I am not familiar with the subject but was looking at chart controls for use in aspx pages the other day and skimmed this article, http://aspnet.4guysfromrolla.com/articles/072507-1.aspx, that discussed a similar technique for putting chart images on web pages without actually creating an image file on the server. It may be of some use. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, June 02, 2008 9:08 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 02:28:28 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 11:28:28 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: <047001c8c6dd$bfeb4c80$6401a8c0@nant> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 03:40:54 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 10:40:54 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From shamil at smsconsulting.spb.ru Thu Jun 5 04:03:46 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:03:46 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048e01c8c6eb$0fc48250$6401a8c0@nant> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 04:25:27 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:25:27 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048f01c8c6ee$17abcbb0$6401a8c0@nant> Hi Gustav, BTW, there is an IronPython for .NET: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython IOW, if you (and I :) ) have ever time to study Python we can use it within VS for development - I guess one can develop class libraries (/apps) on IronPython for the tasks the best suited for Python and then use these class lubaries (/apps) together with C# class libraries(/apps) within a solution... There is also IronBuby (http://www.ironruby.net/ ) as you probably know better than me ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 5 04:44:44 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 11:44:44 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil OK, yes the approach is quite fascinating - and Google does not exclude future language additions to the Google App Engine: http://code.google.com/appengine/docs/whatisgoogleappengine.html Perhaps we should just wait and see ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 11:03 >>> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 09:23:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 16:23:38 +0200 Subject: [dba-VB] Parallel Extensions to the .NET Framework June 2008 CTP Message-ID: Hi all Who was requesting this? JC? http://blogs.msdn.com/pfxteam/archive/2008/06/02/8567802.aspx .. we have begun to add the third major API component, the Coordination Data Structures, to the technology package. As we build PLINQ and the Task Parallel Library, we use a lot of components under the covers to handle synchronization, coordination, and scale to contain data reads and writes from multiple procs. .. /gustav From shamil at smsconsulting.spb.ru Fri Jun 6 01:08:37 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 6 Jun 2008 10:08:37 +0400 Subject: [dba-VB] Initiating and monitoring long running ASP.NET 2.0 server side process... Message-ID: <055701c8c79b$c2b85de0$6401a8c0@nant> Hi All, I need to do the following: - start a long running (up to 1 minute) process on the ASP.NET 2.0 application server side by (e.g.) clicking ASP.NET web form's button; - immediately get ASP.NET web form freed from waiting of this process getting finished; - but in the same time something like JavaScript script started on client side sending, say, every second an XMLHTTP request to the ASP.NET server side, and getting back the status of long running process and presenting it on the client side - just in a textbox/label would be ok for starters... The above (or similar) procedure can be done for sure I just need to know ASAP how to do that as I haven't yet programmed something like that - a link to a good sample on Internet would be good enough for me to study and to make here my adapted custom solution.... Please note - I need ASP.NET 2.0 solution, without AJAX extension - just using async callback feature if possible. Async callback's simple sample is in the P.S. of this message but I need more: - where alert(...) is called in the below sample on client side there should be a call to JavaScript periodically every 1 second sending XMLHTTP request to the server...........??? Thank you. -- Shamil P.S. <%@ Page Language="C#" Title="Fun with callbacks: a simple one" %> <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %> Asycn Callback sample
Enter your name here: " />
From Johncliviger at aol.com Tue Jun 24 10:21:54 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 24 Jun 2008 11:21:54 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Tue Jun 24 11:09:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jun 2008 18:09:25 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From michael at ddisolutions.com.au Tue Jun 24 19:56:42 2008 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 25 Jun 2008 10:56:42 +1000 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D013BFAF7@ddi-01.DDI.local> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From wdhindman at dejpolsystems.com Tue Jun 24 22:19:34 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Tue, 24 Jun 2008 23:19:34 -0400 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <1A2C8794C45742678AA0A53DB76F6EE0@jislaptopdev> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I > need a very similar form and It seems a real drag to type that lot again. > Any > sugesstions? > > TIA > > johnc > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Jun 25 02:32:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:32:19 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi Michael For my case the forms have been too different. So the first form have been just a sort of template for the copy. /gustav >>> michael at ddisolutions.com.au 25-06-2008 02:56 >>> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Wed Jun 25 02:34:55 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:34:55 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi William I have done so. Same issue. Or am I missing something? /gustav >>> wdhindman at dejpolsystems.com 25-06-2008 05:19 >>> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I need a very similar form and It seems a real drag to type that lot again. > Any sugesstions? > > TIA > > johnc From Johncliviger at aol.com Wed Jun 25 03:41:07 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Wed, 25 Jun 2008 04:41:07 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Cheers Guys for the feed back. johnc From Gustav at cactus.dk Thu Jun 26 01:21:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 08:21:13 +0200 Subject: [dba-VB] Open XML Format SDK for .Net (Office 2007 docs) Message-ID: Hi all Woody's Office Watch posted this: Programming tools for Office 2007 documents now available See this article online http://news.office-watch.com/t/n.aspx?a=639 Microsoft has released a set of programming tools to let developers work with Office 2007 documents without the Office applications themselves. The Open XML SDK v1.0 is available from here with information and 'how to' over here. It works in any language supported by the .net framework. The Software Development Kit lets you access Word, Excel and Powerpoint documents from programs. You could extract data, add or replace text and many other things. Chances are good you'd do many of these things inside an Office VBA program but that can be quite slow and requires an Office license on each computer it's running. A separate program using the SDK can do the job faster and without more Office licenses. In practice, the SDK is mainly useful for companies that want to link Office documents with other non-Office systems. The 'How do I *' page is especially useful with answers to particular questions: http://msdn.microsoft.com/en-us/library/bb491088.aspx As you'd expect from Microsoft, version 1.0 isn't the end of the matter. There'll be a v2 of the SDK later this year and yet another with the next version of Office (aka Office 14). Download is here: http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&displaylang=en The 2007 Microsoft? Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel? 2007, and Microsoft Office PowerPoint? 2007 all use these formats as the default file format. Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace. The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. /gustav From shamil at smsconsulting.spb.ru Thu Jun 26 02:32:32 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 11:32:32 +0400 Subject: [dba-VB] Getting TextReader from strings... Message-ID: <047201c8d75e$cbc71a20$6401a8c0@nant> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From Gustav at cactus.dk Thu Jun 26 03:49:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 10:49:53 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jun 26 10:06:09 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 08:06:09 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054301c8d7a4$5f73c490$6401a8c0@nant> Hi Gustav, You're a Geek! :) I prefer "mere mortals' way". I think I see some advantages of MMW against MGW but I'd better stay quiet to not make this thread like getting into flame mode :) Yes, from aesthetic point of view I like MGW but from practical I prefer MMW... The only disadvantage would be if the code generated for MGW would be somehow considerably quicker for large strings' sets... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054201c8d7a4$5ecf4730$6401a8c0@nant> Hello Charlotte, Thank you for your opinion. You're surely a Geek also as Gustav is. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, June 26, 2008 7:06 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:55:45 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:55:45 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054701c8d7a5$18568c40$6401a8c0@nant> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 26 11:30:15 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 18:30:15 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From shamil at smsconsulting.spb.ru Thu Jun 26 13:30:24 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 22:30:24 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <055e01c8d7ba$b2ee9c10$6401a8c0@nant> <<< ... that's when I stopped playing smart. >>> YES! :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 8:30 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Jun 26 17:32:44 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 27 Jun 2008 08:32:44 +1000 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > From cfoust at infostatsystems.com Thu Jun 26 18:16:35 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 16:16:35 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> References: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Message-ID: Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 18:34:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 03:34:19 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05a001c8d7e5$28127500$6401a8c0@nant> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 02:12:51 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 09:12:51 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From shamil at smsconsulting.spb.ru Fri Jun 27 04:06:57 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 13:06:57 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05d701c8d835$26ba77c0$6401a8c0@nant> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 11:13 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From Gustav at cactus.dk Fri Jun 27 04:42:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 11:42:13 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html From shamil at smsconsulting.spb.ru Fri Jun 27 06:09:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:09:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05f901c8d846$353c1720$6401a8c0@nant> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 06:24:23 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 13:24:23 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.chm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleStyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From shamil at smsconsulting.spb.ru Fri Jun 27 06:52:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:52:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05fd01c8d84c$370fde00$6401a8c0@nant> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From Gustav at cactus.dk Fri Jun 27 07:15:47 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 14:15:47 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I see. NDoc is indeed dead. No activity since Feb. 2005. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:52 >>> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav From DWUTKA at Marlow.com Fri Jun 27 09:54:08 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 09:54:08 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From cfoust at infostatsystems.com Fri Jun 27 10:18:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jun 2008 08:18:06 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jun 27 11:17:30 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 11:17:30 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: Oh, certainly. I have a LOT of classes that are identical in structure, I call them Object/Collection classes. One class is an object, such as an Employee. It has properties and functions for an Employee (including reading and writing data to a database). The second class would be Employees, which would contain a collection of all the employees. I actually have an Add-in I wrote that builds these classes automatically, as soon as I give it a table or query to build it from. (The properties are then based off of field names). But if one of these classes needs some special features, then I put in comments. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 10:18 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From Gustav at cactus.dk Mon Jun 30 03:27:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 30 Jun 2008 10:27:25 +0200 Subject: [dba-VB] Improving Web Services Security: Scenarios and Implementation Guidance for WCF Message-ID: Hi all A beta2 version of a quite comprehensive guide (680 pages) on: Improving Web Services Security: Scenarios and Implementation Guidance for WCF is available here: http://blogs.msdn.com/joestagner/archive/2008/06/11/microsoft-patterns-practices-improving-wcf-services-security.aspx Should keep you busy on a rainy weekend. /gustav From shamil at smsconsulting.spb.ru Sun Jun 1 03:23:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 1 Jun 2008 12:23:22 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web Image Control Message-ID: <003401c8c3c0$c147bb60$6401a8c0@nant> Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil From ebarro at verizon.net Sun Jun 1 13:49:32 2008 From: ebarro at verizon.net (Eric Barro) Date: Sun, 01 Jun 2008 11:49:32 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: References: Message-ID: <00a601c8c418$3e4be6c0$c403000a@advancedinput.com> Thanks to all who replied. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 10:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jun 2 23:07:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 3 Jun 2008 08:07:40 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl In-Reply-To: <003401c8c3c0$c147bb60$6401a8c0@nant> Message-ID: <01b201c8c52f$5e344dc0$6401a8c0@nant> Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Tue Jun 3 10:54:34 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Tue, 3 Jun 2008 08:54:34 -0700 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl In-Reply-To: <01b201c8c52f$5e344dc0$6401a8c0@nant> References: <003401c8c3c0$c147bb60$6401a8c0@nant> <01b201c8c52f$5e344dc0$6401a8c0@nant> Message-ID: <002601c8c592$1ea5f970$0200a8c0@murphy3234aaf1> Hello Shamil, I am not familiar with the subject but was looking at chart controls for use in aspx pages the other day and skimmed this article, http://aspnet.4guysfromrolla.com/articles/072507-1.aspx, that discussed a similar technique for putting chart images on web pages without actually creating an image file on the server. It may be of some use. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, June 02, 2008 9:08 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 02:28:28 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 11:28:28 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: <047001c8c6dd$bfeb4c80$6401a8c0@nant> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 03:40:54 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 10:40:54 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From shamil at smsconsulting.spb.ru Thu Jun 5 04:03:46 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:03:46 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048e01c8c6eb$0fc48250$6401a8c0@nant> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 04:25:27 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:25:27 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048f01c8c6ee$17abcbb0$6401a8c0@nant> Hi Gustav, BTW, there is an IronPython for .NET: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython IOW, if you (and I :) ) have ever time to study Python we can use it within VS for development - I guess one can develop class libraries (/apps) on IronPython for the tasks the best suited for Python and then use these class lubaries (/apps) together with C# class libraries(/apps) within a solution... There is also IronBuby (http://www.ironruby.net/ ) as you probably know better than me ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 5 04:44:44 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 11:44:44 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil OK, yes the approach is quite fascinating - and Google does not exclude future language additions to the Google App Engine: http://code.google.com/appengine/docs/whatisgoogleappengine.html Perhaps we should just wait and see ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 11:03 >>> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 09:23:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 16:23:38 +0200 Subject: [dba-VB] Parallel Extensions to the .NET Framework June 2008 CTP Message-ID: Hi all Who was requesting this? JC? http://blogs.msdn.com/pfxteam/archive/2008/06/02/8567802.aspx .. we have begun to add the third major API component, the Coordination Data Structures, to the technology package. As we build PLINQ and the Task Parallel Library, we use a lot of components under the covers to handle synchronization, coordination, and scale to contain data reads and writes from multiple procs. .. /gustav From shamil at smsconsulting.spb.ru Fri Jun 6 01:08:37 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 6 Jun 2008 10:08:37 +0400 Subject: [dba-VB] Initiating and monitoring long running ASP.NET 2.0 server side process... Message-ID: <055701c8c79b$c2b85de0$6401a8c0@nant> Hi All, I need to do the following: - start a long running (up to 1 minute) process on the ASP.NET 2.0 application server side by (e.g.) clicking ASP.NET web form's button; - immediately get ASP.NET web form freed from waiting of this process getting finished; - but in the same time something like JavaScript script started on client side sending, say, every second an XMLHTTP request to the ASP.NET server side, and getting back the status of long running process and presenting it on the client side - just in a textbox/label would be ok for starters... The above (or similar) procedure can be done for sure I just need to know ASAP how to do that as I haven't yet programmed something like that - a link to a good sample on Internet would be good enough for me to study and to make here my adapted custom solution.... Please note - I need ASP.NET 2.0 solution, without AJAX extension - just using async callback feature if possible. Async callback's simple sample is in the P.S. of this message but I need more: - where alert(...) is called in the below sample on client side there should be a call to JavaScript periodically every 1 second sending XMLHTTP request to the server...........??? Thank you. -- Shamil P.S. <%@ Page Language="C#" Title="Fun with callbacks: a simple one" %> <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %> Asycn Callback sample
Enter your name here: " />
From Johncliviger at aol.com Tue Jun 24 10:21:54 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 24 Jun 2008 11:21:54 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Tue Jun 24 11:09:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jun 2008 18:09:25 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From michael at ddisolutions.com.au Tue Jun 24 19:56:42 2008 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 25 Jun 2008 10:56:42 +1000 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D013BFAF7@ddi-01.DDI.local> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From wdhindman at dejpolsystems.com Tue Jun 24 22:19:34 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Tue, 24 Jun 2008 23:19:34 -0400 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <1A2C8794C45742678AA0A53DB76F6EE0@jislaptopdev> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I > need a very similar form and It seems a real drag to type that lot again. > Any > sugesstions? > > TIA > > johnc > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Jun 25 02:32:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:32:19 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi Michael For my case the forms have been too different. So the first form have been just a sort of template for the copy. /gustav >>> michael at ddisolutions.com.au 25-06-2008 02:56 >>> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Wed Jun 25 02:34:55 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:34:55 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi William I have done so. Same issue. Or am I missing something? /gustav >>> wdhindman at dejpolsystems.com 25-06-2008 05:19 >>> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I need a very similar form and It seems a real drag to type that lot again. > Any sugesstions? > > TIA > > johnc From Johncliviger at aol.com Wed Jun 25 03:41:07 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Wed, 25 Jun 2008 04:41:07 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Cheers Guys for the feed back. johnc From Gustav at cactus.dk Thu Jun 26 01:21:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 08:21:13 +0200 Subject: [dba-VB] Open XML Format SDK for .Net (Office 2007 docs) Message-ID: Hi all Woody's Office Watch posted this: Programming tools for Office 2007 documents now available See this article online http://news.office-watch.com/t/n.aspx?a=639 Microsoft has released a set of programming tools to let developers work with Office 2007 documents without the Office applications themselves. The Open XML SDK v1.0 is available from here with information and 'how to' over here. It works in any language supported by the .net framework. The Software Development Kit lets you access Word, Excel and Powerpoint documents from programs. You could extract data, add or replace text and many other things. Chances are good you'd do many of these things inside an Office VBA program but that can be quite slow and requires an Office license on each computer it's running. A separate program using the SDK can do the job faster and without more Office licenses. In practice, the SDK is mainly useful for companies that want to link Office documents with other non-Office systems. The 'How do I *' page is especially useful with answers to particular questions: http://msdn.microsoft.com/en-us/library/bb491088.aspx As you'd expect from Microsoft, version 1.0 isn't the end of the matter. There'll be a v2 of the SDK later this year and yet another with the next version of Office (aka Office 14). Download is here: http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&displaylang=en The 2007 Microsoft? Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel? 2007, and Microsoft Office PowerPoint? 2007 all use these formats as the default file format. Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace. The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. /gustav From shamil at smsconsulting.spb.ru Thu Jun 26 02:32:32 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 11:32:32 +0400 Subject: [dba-VB] Getting TextReader from strings... Message-ID: <047201c8d75e$cbc71a20$6401a8c0@nant> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From Gustav at cactus.dk Thu Jun 26 03:49:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 10:49:53 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jun 26 10:06:09 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 08:06:09 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054301c8d7a4$5f73c490$6401a8c0@nant> Hi Gustav, You're a Geek! :) I prefer "mere mortals' way". I think I see some advantages of MMW against MGW but I'd better stay quiet to not make this thread like getting into flame mode :) Yes, from aesthetic point of view I like MGW but from practical I prefer MMW... The only disadvantage would be if the code generated for MGW would be somehow considerably quicker for large strings' sets... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054201c8d7a4$5ecf4730$6401a8c0@nant> Hello Charlotte, Thank you for your opinion. You're surely a Geek also as Gustav is. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, June 26, 2008 7:06 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:55:45 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:55:45 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054701c8d7a5$18568c40$6401a8c0@nant> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 26 11:30:15 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 18:30:15 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From shamil at smsconsulting.spb.ru Thu Jun 26 13:30:24 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 22:30:24 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <055e01c8d7ba$b2ee9c10$6401a8c0@nant> <<< ... that's when I stopped playing smart. >>> YES! :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 8:30 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Jun 26 17:32:44 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 27 Jun 2008 08:32:44 +1000 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > From cfoust at infostatsystems.com Thu Jun 26 18:16:35 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 16:16:35 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> References: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Message-ID: Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 18:34:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 03:34:19 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05a001c8d7e5$28127500$6401a8c0@nant> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 02:12:51 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 09:12:51 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From shamil at smsconsulting.spb.ru Fri Jun 27 04:06:57 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 13:06:57 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05d701c8d835$26ba77c0$6401a8c0@nant> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 11:13 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From Gustav at cactus.dk Fri Jun 27 04:42:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 11:42:13 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html From shamil at smsconsulting.spb.ru Fri Jun 27 06:09:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:09:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05f901c8d846$353c1720$6401a8c0@nant> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 06:24:23 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 13:24:23 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.chm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleStyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From shamil at smsconsulting.spb.ru Fri Jun 27 06:52:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:52:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05fd01c8d84c$370fde00$6401a8c0@nant> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From Gustav at cactus.dk Fri Jun 27 07:15:47 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 14:15:47 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I see. NDoc is indeed dead. No activity since Feb. 2005. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:52 >>> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav From DWUTKA at Marlow.com Fri Jun 27 09:54:08 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 09:54:08 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From cfoust at infostatsystems.com Fri Jun 27 10:18:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jun 2008 08:18:06 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jun 27 11:17:30 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 11:17:30 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: Oh, certainly. I have a LOT of classes that are identical in structure, I call them Object/Collection classes. One class is an object, such as an Employee. It has properties and functions for an Employee (including reading and writing data to a database). The second class would be Employees, which would contain a collection of all the employees. I actually have an Add-in I wrote that builds these classes automatically, as soon as I give it a table or query to build it from. (The properties are then based off of field names). But if one of these classes needs some special features, then I put in comments. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 10:18 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From Gustav at cactus.dk Mon Jun 30 03:27:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 30 Jun 2008 10:27:25 +0200 Subject: [dba-VB] Improving Web Services Security: Scenarios and Implementation Guidance for WCF Message-ID: Hi all A beta2 version of a quite comprehensive guide (680 pages) on: Improving Web Services Security: Scenarios and Implementation Guidance for WCF is available here: http://blogs.msdn.com/joestagner/archive/2008/06/11/microsoft-patterns-practices-improving-wcf-services-security.aspx Should keep you busy on a rainy weekend. /gustav From shamil at smsconsulting.spb.ru Sun Jun 1 03:23:22 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Sun, 1 Jun 2008 12:23:22 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web Image Control Message-ID: <003401c8c3c0$c147bb60$6401a8c0@nant> Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil From ebarro at verizon.net Sun Jun 1 13:49:32 2008 From: ebarro at verizon.net (Eric Barro) Date: Sun, 01 Jun 2008 11:49:32 -0700 Subject: [dba-VB] Updating dataset from datagrid In-Reply-To: References: Message-ID: <00a601c8c418$3e4be6c0$c403000a@advancedinput.com> Thanks to all who replied. -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 10:01 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric and Shamil I located the links Shamil posted in January: You can start here with ASP.NET: http://www.asp.net/get-started/ http://quickstarts.asp.net/QuickStartv20/aspnet/Default.aspx http://www.asp.net/learn/ http://www.asp.net/learn/data-access/ The last does a good job explaning data access using DataTable and DAL. /gustav >>> shamil at smsconsulting.spb.ru 30-05-2008 14:45 >>> Hi Gustav, <<< So go for option 3. (!) >>> What is option 3? -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, May 30, 2008 11:21 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Updating dataset from datagrid Hi Eric > What I don't like about the approach in Option 1 is that you have to hard-code the SELECT statement I think all this SQLAdapter and SQLCommand mechanics are left-overs from old .Net and ASP. MS has done a tremendous work with the DataTable, DataTableAdapter, DAL (Data Access Layer), and LINQ. Shamil has posted several links for tutorials and I can highly recommend looking these up. Problem is, that if you google for code on various topics, the net is flooded with old SqlThisAndThat quick-and-dirty code from ASP kiddies which won't help you in the long run. So go for option 3. (!) /gustav _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Mon Jun 2 23:07:40 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Tue, 3 Jun 2008 08:07:40 +0400 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl In-Reply-To: <003401c8c3c0$c147bb60$6401a8c0@nant> Message-ID: <01b201c8c52f$5e344dc0$6401a8c0@nant> Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From dw-murphy at cox.net Tue Jun 3 10:54:34 2008 From: dw-murphy at cox.net (Doug Murphy) Date: Tue, 3 Jun 2008 08:54:34 -0700 Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl In-Reply-To: <01b201c8c52f$5e344dc0$6401a8c0@nant> References: <003401c8c3c0$c147bb60$6401a8c0@nant> <01b201c8c52f$5e344dc0$6401a8c0@nant> Message-ID: <002601c8c592$1ea5f970$0200a8c0@murphy3234aaf1> Hello Shamil, I am not familiar with the subject but was looking at chart controls for use in aspx pages the other day and skimmed this article, http://aspnet.4guysfromrolla.com/articles/072507-1.aspx, that discussed a similar technique for putting chart images on web pages without actually creating an image file on the server. It may be of some use. Doug -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Monday, June 02, 2008 9:08 PM To: 'Discussion concerning Visual Basic and related programming issues.' Subject: Re: [dba-VB] ASP.NET 2.0 - Displaying image from memory on WebImageControl Hi All, Here is the solution on my test site - http://shamils-4.hosting.parking.ru/Pics : as it's written in the article referred below to show a picture on ASP.NET Image control one has to create special helper .aspx page and pass to this page a parameter defining the source of the image - the latter could come from anywhere (file, database, external source (e.g. web service) etc.) or even be generated using System.Drawing... ...generated image is converted into array of bytes and then it's returned as binary stream within helper .aspx page... ...that sounds tricky but it works and I didn't find any less complicated solution - if anybody knows/will find another solution, which uses somehow an instance of HttpRequest/HttpResponse manually (in custom code) created and filled with an image bytes' stream - that would be useful here... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil Salakhetdinov Sent: Sunday, June 01, 2008 12:23 PM To: 'Access-D - VB' Subject: [dba-VB] ASP.NET 2.0 - Displaying image from memory on Web ImageControl Hi All, In ASP.NET 2.0 VB.NET or C# I wanted to load and image from a file (or get it downloaded/streamed it from somewhere but into memory) and then display it on an Image control *without write it to file*. I have found this sample (http://programming.top54u.com/post/Asp-Net-Display-Image-from-Database.aspx ), which gets image from db and displays them on Image control in a grid: I think I can adapt it to my case but if somebody can point m eon ready to use sample fitting my certain case I'd be very pleased to get it and to reuse... Thank you. -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 02:28:28 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 11:28:28 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: <047001c8c6dd$bfeb4c80$6401a8c0@nant> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 03:40:54 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 10:40:54 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From shamil at smsconsulting.spb.ru Thu Jun 5 04:03:46 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:03:46 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048e01c8c6eb$0fc48250$6401a8c0@nant> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 5 04:25:27 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 5 Jun 2008 13:25:27 +0400 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable In-Reply-To: Message-ID: <048f01c8c6ee$17abcbb0$6401a8c0@nant> Hi Gustav, BTW, there is an IronPython for .NET: http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython IOW, if you (and I :) ) have ever time to study Python we can use it within VS for development - I guess one can develop class libraries (/apps) on IronPython for the tasks the best suited for Python and then use these class lubaries (/apps) together with C# class libraries(/apps) within a solution... There is also IronBuby (http://www.ironruby.net/ ) as you probably know better than me ... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 5 04:44:44 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 11:44:44 +0200 Subject: [dba-VB] FYI: Principles and Guidelines for an Optimized Use of BigTable Message-ID: Hi Shamil OK, yes the approach is quite fascinating - and Google does not exclude future language additions to the Google App Engine: http://code.google.com/appengine/docs/whatisgoogleappengine.html Perhaps we should just wait and see ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 11:03 >>> Hi Gustav, I just wanted to point on conceptual approach, not specific technology: I'm also C#/ASP.NET/MS SQL/MS Office-"hooked", and I do not plan to switch to the other development technologies... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 05, 2008 12:41 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] FYI: Principles and Guidelines for an Optimized Use ofBigTable Hi Shamil Also the comments are interesting to read. However, if I understand it right, BigTable is only available via Google Apps, and the API of this is strictly Python only - so for me no big deal - I have enough challenges with C# ... /gustav >>> shamil at smsconsulting.spb.ru 05-06-2008 09:28 >>> Hi All, FYI: Principles and Guidelines for an Optimized Use of BigTable http://www.infoq.com/news/2008/05/principles-to-big-table -- Shamil From Gustav at cactus.dk Thu Jun 5 09:23:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 05 Jun 2008 16:23:38 +0200 Subject: [dba-VB] Parallel Extensions to the .NET Framework June 2008 CTP Message-ID: Hi all Who was requesting this? JC? http://blogs.msdn.com/pfxteam/archive/2008/06/02/8567802.aspx .. we have begun to add the third major API component, the Coordination Data Structures, to the technology package. As we build PLINQ and the Task Parallel Library, we use a lot of components under the covers to handle synchronization, coordination, and scale to contain data reads and writes from multiple procs. .. /gustav From shamil at smsconsulting.spb.ru Fri Jun 6 01:08:37 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 6 Jun 2008 10:08:37 +0400 Subject: [dba-VB] Initiating and monitoring long running ASP.NET 2.0 server side process... Message-ID: <055701c8c79b$c2b85de0$6401a8c0@nant> Hi All, I need to do the following: - start a long running (up to 1 minute) process on the ASP.NET 2.0 application server side by (e.g.) clicking ASP.NET web form's button; - immediately get ASP.NET web form freed from waiting of this process getting finished; - but in the same time something like JavaScript script started on client side sending, say, every second an XMLHTTP request to the ASP.NET server side, and getting back the status of long running process and presenting it on the client side - just in a textbox/label would be ok for starters... The above (or similar) procedure can be done for sure I just need to know ASAP how to do that as I haven't yet programmed something like that - a link to a good sample on Internet would be good enough for me to study and to make here my adapted custom solution.... Please note - I need ASP.NET 2.0 solution, without AJAX extension - just using async callback feature if possible. Async callback's simple sample is in the P.S. of this message but I need more: - where alert(...) is called in the below sample on client side there should be a call to JavaScript periodically every 1 second sending XMLHTTP request to the server...........??? Thank you. -- Shamil P.S. <%@ Page Language="C#" Title="Fun with callbacks: a simple one" %> <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %> Asycn Callback sample
Enter your name here: " />
From Johncliviger at aol.com Tue Jun 24 10:21:54 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Tue, 24 Jun 2008 11:21:54 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Tue Jun 24 11:09:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Tue, 24 Jun 2008 18:09:25 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From michael at ddisolutions.com.au Tue Jun 24 19:56:42 2008 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 25 Jun 2008 10:56:42 +1000 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D013BFAF7@ddi-01.DDI.local> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From wdhindman at dejpolsystems.com Tue Jun 24 22:19:34 2008 From: wdhindman at dejpolsystems.com (William Hindman) Date: Tue, 24 Jun 2008 23:19:34 -0400 Subject: [dba-VB] VB.Net 2005 copy a form References: Message-ID: <1A2C8794C45742678AA0A53DB76F6EE0@jislaptopdev> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I > need a very similar form and It seems a real drag to type that lot again. > Any > sugesstions? > > TIA > > johnc > > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > From Gustav at cactus.dk Wed Jun 25 02:32:19 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:32:19 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi Michael For my case the forms have been too different. So the first form have been just a sort of template for the copy. /gustav >>> michael at ddisolutions.com.au 25-06-2008 02:56 >>> Maybe copy to a diff project and remane there and then copy back might fix the refactor issue? OTOH maybe inherit from the 1st form (base) to create 2 new forms... cheers MM Hi John You can copy and paste the .cs file in the Solution Explorer pane. The copy will be renamed and you can rename that to what you want. However, if you in the Properties pane later rename the copy of form to the new name, I've found that the refactoring mechanics will rename references to your form not only in the .Designer.cs file (correct) but also in the original .Designer.cs file (really nasty)! What do others do? /gustav >>> Johncliviger at aol.com 24-06-2008 17:21 >>> Hi All How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. I need a very similar form and It seems a real drag to type that lot again. Any sugesstions? TIA johnc From Gustav at cactus.dk Wed Jun 25 02:34:55 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 25 Jun 2008 09:34:55 +0200 Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Hi William I have done so. Same issue. Or am I missing something? /gustav >>> wdhindman at dejpolsystems.com 25-06-2008 05:19 >>> ...upgrade to vs2008 :) William "Sen. McCain will bring a lifetime of experience to the campaign... Sen. Obama will bring a speech that he gave." Hillary Clinton -------------------------------------------------- From: "Gustav Brock" Sent: Tuesday, June 24, 2008 12:09 PM To: Subject: Re: [dba-VB] VB.Net 2005 copy a form > Hi John > > You can copy and paste the .cs file in the Solution Explorer pane. The > copy will be renamed and you can rename that to what you want. > > However, if you in the Properties pane later rename the copy of form to > the new name, I've found that the refactoring mechanics will rename > references to your form not only in the .Designer.cs file (correct) but > also in the original .Designer.cs file (really nasty)! What do others do? > > /gustav > >>>> Johncliviger at aol.com 24-06-2008 17:21 >>> > Hi All > > How do you copy a Form in VB.Net 2005? I have a form with 100+ controls. > I need a very similar form and It seems a real drag to type that lot again. > Any sugesstions? > > TIA > > johnc From Johncliviger at aol.com Wed Jun 25 03:41:07 2008 From: Johncliviger at aol.com (Johncliviger at aol.com) Date: Wed, 25 Jun 2008 04:41:07 EDT Subject: [dba-VB] VB.Net 2005 copy a form Message-ID: Cheers Guys for the feed back. johnc From Gustav at cactus.dk Thu Jun 26 01:21:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 08:21:13 +0200 Subject: [dba-VB] Open XML Format SDK for .Net (Office 2007 docs) Message-ID: Hi all Woody's Office Watch posted this: Programming tools for Office 2007 documents now available See this article online http://news.office-watch.com/t/n.aspx?a=639 Microsoft has released a set of programming tools to let developers work with Office 2007 documents without the Office applications themselves. The Open XML SDK v1.0 is available from here with information and 'how to' over here. It works in any language supported by the .net framework. The Software Development Kit lets you access Word, Excel and Powerpoint documents from programs. You could extract data, add or replace text and many other things. Chances are good you'd do many of these things inside an Office VBA program but that can be quite slow and requires an Office license on each computer it's running. A separate program using the SDK can do the job faster and without more Office licenses. In practice, the SDK is mainly useful for companies that want to link Office documents with other non-Office systems. The 'How do I *' page is especially useful with answers to particular questions: http://msdn.microsoft.com/en-us/library/bb491088.aspx As you'd expect from Microsoft, version 1.0 isn't the end of the matter. There'll be a v2 of the SDK later this year and yet another with the next version of Office (aka Office 14). Download is here: http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&displaylang=en The 2007 Microsoft? Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel? 2007, and Microsoft Office PowerPoint? 2007 all use these formats as the default file format. Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace. The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. /gustav From shamil at smsconsulting.spb.ru Thu Jun 26 02:32:32 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 11:32:32 +0400 Subject: [dba-VB] Getting TextReader from strings... Message-ID: <047201c8d75e$cbc71a20$6401a8c0@nant> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From Gustav at cactus.dk Thu Jun 26 03:49:53 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 10:49:53 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From cfoust at infostatsystems.com Thu Jun 26 10:06:09 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 08:06:09 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054301c8d7a4$5f73c490$6401a8c0@nant> Hi Gustav, You're a Geek! :) I prefer "mere mortals' way". I think I see some advantages of MMW against MGW but I'd better stay quiet to not make this thread like getting into flame mode :) Yes, from aesthetic point of view I like MGW but from practical I prefer MMW... The only disadvantage would be if the code generated for MGW would be somehow considerably quicker for large strings' sets... Thank you. -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:50:33 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:50:33 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054201c8d7a4$5ecf4730$6401a8c0@nant> Hello Charlotte, Thank you for your opinion. You're surely a Geek also as Gustav is. :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Thursday, June 26, 2008 7:06 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I don't see what the point of an array would be ... Unless you were passing one into the routine. Populating an array in the code wouldn't be any simpler or any geekier, IMO. And while I personally tend to use the MMW approach in my own code, I find the geekier version *easier* to read in this case, maybe because of all the extra punctuation in C#. If I had to debug it, I'd have to deconstruct it, but I'm becoming more comfortable with the geek approach. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 1:50 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 10:55:45 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 19:55:45 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <054701c8d7a5$18568c40$6401a8c0@nant> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Thu Jun 26 11:30:15 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 26 Jun 2008 18:30:15 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } From shamil at smsconsulting.spb.ru Thu Jun 26 13:30:24 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Thu, 26 Jun 2008 22:30:24 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <055e01c8d7ba$b2ee9c10$6401a8c0@nant> <<< ... that's when I stopped playing smart. >>> YES! :) -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 8:30 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Ha, I'm glad even you can be confused! Still, Geek or no-Geek? I like some Geek code just for fun. But I've learned the hard way to stay off for production code. As said, no one assigns you points for writing tight not-so-comprehensible code. It simply doesn't pay off. One example is that - most of us, I guess - often copy snippets of code from one project to another to reuse not as is but as a skeleton for something similar. If you have to spend several minutes just figuring out how your original code works, you are wasting your time. The real lesson is when you after many minutes still can't find out - that's when I stopped playing smart. This is different from speed optimization. If a piece of code has to appear "Geeky" to run fast, so be it. But then you often spend so much time reaching the final code that you easily can spend the few minutes to insert decent in-line comments. I write much in-line code; it doesn't take much time, and sometimes - while you are thinking - write it down. Great value when you return a year later to adjust the code! /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 17:55 >>> Hello Gustav, Sorry in my previous e-mail I did suppose you prefer MGW but you're preferring MMW as I do.... But anyway - you're a real Geek as well as Charlotte is :) Thank you. -- Shamil P.S. Sorry again - programmed here all the day through, and it looks like WITIRINWWWIADEMIR - "What I'm Thinking I'm Reading Is Not What Was Written In Access-D E-Mail I'm Reading"... :) -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Thursday, June 26, 2008 12:50 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil I prefer the MMW. Much easier to read. You can read that code in one go. With the MGW you most often have to locate the "core", here GetBytes(sb.ToString(), then read backwards to find out what is done, and then forward once again. And you obtain no points for using a smaller count of characters. Also, it is much easier to modify. Say you later found out that you had to verify the count of bytes: System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); Just insert: byte[] bytes = ascii.GetBytes(sb.ToString()); if (bytes.Length > something) ... do something As for ILDASM, I don't have it but I doubt the difference in code will be of any significance. For a geeker method, I guess you could replace the multiple AppendBuilder calls with an array somehow but it would just raise the level of unreadability. /gustav >>> shamil at smsconsulting.spb.ru 26-06-2008 09:32 >>> Hi All, Below is a useful code written two ways: 1) "mere mortals' way" (MMW) 2) "geek way" (geeks will agree hopefully - in fact there exists even "geekier" version of this code (contest! contest! - for Friday :)) - I used "moderate geek way"(MGW) mode) Questions: 1) Which way you prefer? (I personally prefer "mere mortals' way". 2) Anybody who is in love with ILDASM could you please check does the two version of code generate the same IL in code optimization mode or even always? Thank you. -- Shamil P.S. Subject code: //1. MMW private TextReader Test1() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); System.Text.ASCIIEncoding ascii = new ASCIIEncoding(); byte[] bytes = ascii.GetBytes(sb.ToString()); MemoryStream ms = new MemoryStream(bytes); return new StreamReader(ms); } //2. MGW private TextReader Test2() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Line1"); sb.AppendLine("Line2"); sb.AppendLine("Line3"); return new StreamReader( new MemoryStream(( new ASCIIEncoding( )).GetBytes(sb.ToString()))); } _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Jun 26 17:32:44 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 27 Jun 2008 08:32:44 +1000 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > From cfoust at infostatsystems.com Thu Jun 26 18:16:35 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Thu, 26 Jun 2008 16:16:35 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> References: <4864A5AC.15193.287EB820@stuart.lexacorp.com.pg> Message-ID: Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From shamil at smsconsulting.spb.ru Thu Jun 26 18:34:19 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 03:34:19 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05a001c8d7e5$28127500$6401a8c0@nant> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 02:12:51 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 09:12:51 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From shamil at smsconsulting.spb.ru Fri Jun 27 04:06:57 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 13:06:57 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05d701c8d835$26ba77c0$6401a8c0@nant> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 11:13 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil Of course - and don't use dirty language. Quite a few comments to that article. This one from Solomon Grundy I like: Comments are just as important as the code itself. Otherwise you get what I call the 'Stonehenge' effect: in years to come no one will remember how to use it, or even what it does. Resulting in some coder saying, well, we just have to start all over again because this doesn't make any sense. (sort of like extreme coding, haha) The projects I lead are not complete until they are fully commented. Comments are part of the developers job, and if they can't get them done in a normal working day, that's too bad - they're either working late or taking it home. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 01:34 >>> "Just don't overdo the comments, as comments must be maintained along with the code." http://www.theregister.co.uk/2008/03/28/case_for_comments_code/ -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 3:17 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Uh, isn't that why they invented *comments*? Properly commented geek code isn't any harder to understand later than properly commented MMW code. It's the totally undocumented stuff that makes you think of changing careers, regardless of how it's written. Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Thursday, June 26, 2008 3:33 PM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Even worse is when you get called back to modify the project two years later and have to try and work out what you did all that time ago :-( On 26 Jun 2008 at 18:30, Gustav Brock wrote: > simply doesn't pay off. One example is that - most of us, I guess - > often copy snippets of code from one project to another to reuse not > as is but as a skeleton for something similar. If you have to spend > several minutes just figuring out how your original code works, you > are wasting your time. The real lesson is when you after many minutes > still can't find out - that's when I stopped playing smart. From Gustav at cactus.dk Fri Jun 27 04:42:13 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 11:42:13 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html From shamil at smsconsulting.spb.ru Fri Jun 27 06:09:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:09:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05f901c8d846$353c1720$6401a8c0@nant> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From Gustav at cactus.dk Fri Jun 27 06:24:23 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 13:24:23 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.chm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleStyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From shamil at smsconsulting.spb.ru Fri Jun 27 06:52:03 2008 From: shamil at smsconsulting.spb.ru (Shamil Salakhetdinov) Date: Fri, 27 Jun 2008 15:52:03 +0400 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: <05fd01c8d84c$370fde00$6401a8c0@nant> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:09 >>> <<< ...the XML commenting method I haven't used yet... >>> Hi Gustav, That should be easy for you to adapt I guess: Download SandCastle: http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE- A715-696E3A4873B2&displaylang=en - start VS2005/VS2008; - create sample project; - add some code with XML comments (watch how VS helps to set cross-refs while you are typing comments - all these crossrefs will be later "automagically" used by SandCastle while generating online help); - right-click on project entry in VS solution explorer - select 'Properties' from popup-menu; - select [Build] tab; - check 'Xml documentation file' checkbox; - (re)build assembly; - start D:\Program Files\Sandcastle\Examples\generic\SandcastleGui.exe; - you'll get Sandcastle main form opened; - make sure presentation style combo-box on the right-hand side is set to vs2005; - add assembly file - [Add] button of top listbox; - add generated comments file .xml (it will be in the same folder where your assembly is located) - [Add] button of middle listbox; - click [Build] button in the bottom - SandCastle is a "heavy beast" - it will take a while for it to generated .chm help even for a small sample project; - when Sandcastle build finishes go to D:\Program Files\Sandcastle\Examples\{YourAssemblyName}\vs2005\chm\{YourAssemblyName}.c hm and enjoy your professionally looking code help file... This Help generation can be automated - there are quite some scripts installed with SandCastle but I haven't used them yet... SandCastle is a really huge "beast" with many features including preparing any kind of documentation - see these links: http://www.codeplex.com/SandcastleStyles http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=SandcastleS tyles&ReleaseId=14068 -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 1:42 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav From Gustav at cactus.dk Fri Jun 27 07:15:47 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 27 Jun 2008 14:15:47 +0200 Subject: [dba-VB] Getting TextReader from strings... Message-ID: Hi Shamil I see. NDoc is indeed dead. No activity since Feb. 2005. /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 13:52 >>> Hello Gustav, That is NDoc (http://ndoc.sourceforge.net/ ) generated help I guess. NDoc is "dead" now "killed" by SandCastle... -- Shamil -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 3:24 PM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil That looks very promising, thank you! So, as: - Sandcastle is used internally to build .Net Framework documentation I guess this, as an example, is what these guys have used: http://www.e-conomic.com/apidocs/Documentation/index.html /gustav From DWUTKA at Marlow.com Fri Jun 27 09:54:08 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 09:54:08 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From cfoust at infostatsystems.com Fri Jun 27 10:18:06 2008 From: cfoust at infostatsystems.com (Charlotte Foust) Date: Fri, 27 Jun 2008 08:18:06 -0700 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: References: Message-ID: Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, June 27, 2008 4:42 AM To: dba-vb at databaseadvisors.com Subject: Re: [dba-VB] Getting TextReader from strings... Hi Shamil > I do not argue, OK? :) OK, that's also how I understood your comments. I see your point. There's a big difference between code modules like that of Rocky's with 2000 lines and a series of small functions and classes where all variables and methods and properties are given names which clearly indicate the purpose. Unfortunately, the XML commenting method I haven't used yet ... /gustav >>> shamil at smsconsulting.spb.ru 27-06-2008 11:06 >>> Hi Gustav, I do not argue, OK? :) The point is that inline commenting is becoming less and less important/useful (and imposes too much costs to be true) as nowadays (r-)evolutionary agile Test_Driven-Design (TDD) programming practices progress: when applied by experienced agilist these practices result in small max 10-15 code lines "self-explaining" streamlined methods. Classes/Modules and Methods DO have XML comments, where the purpose of classes/modules/methods and all their parameters are described with needed level of destabilization, as well as additional remarks to explain the purpose and usage of method in details if needed are supplied but usually no inline comments in code at all. I have seen somewhere an article from Martin Fawler or maybe another famous agilist who were "pushing" this approach. And I do use it and I like it - this is why I write about it :) (IOW I'm not arguing for the purpose of "pure" arguing but I'm referring to everyday practices, which I do follow with successfully finished projects and satisfied customers with some of them being also experienced developers...) The everyday practice in TDD is that you can "mercilessly refactor" a well covered by Unit/Integration tests piece of code several times a day, and if it has inline comments then they become a trouble (they result in additional significant support costs) as you need to modify them as often as you refactor your code. But with clean streamlined code every class, interface, method, parameter is usually self-explaining therefore class level and method level comments are usually good enough... Thank you. -- Shamil P.S. Very mature IMO article on Agile and XP: "Is Design Dead?" - http://martinfowler.com/articles/designDead.html _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From DWUTKA at Marlow.com Fri Jun 27 11:17:30 2008 From: DWUTKA at Marlow.com (Drew Wutka) Date: Fri, 27 Jun 2008 11:17:30 -0500 Subject: [dba-VB] Getting TextReader from strings... In-Reply-To: Message-ID: Oh, certainly. I have a LOT of classes that are identical in structure, I call them Object/Collection classes. One class is an object, such as an Employee. It has properties and functions for an Employee (including reading and writing data to a database). The second class would be Employees, which would contain a collection of all the employees. I actually have an Add-in I wrote that builds these classes automatically, as soon as I give it a table or query to build it from. (The properties are then based off of field names). But if one of these classes needs some special features, then I put in comments. Drew -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Friday, June 27, 2008 10:18 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... Class modules, absolutely, when they're pure classes. But when you are working with WinForms, comments help a lot. And if you want anyone else, including yourself a year down the line, to remember WHY you did it that way, even in a class module, comments are still valuable!! Charlotte Foust -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Friday, June 27, 2008 7:54 AM To: Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] Getting TextReader from strings... I also agree. Class modules can almost be completely self explanatory. Drew The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. From Gustav at cactus.dk Mon Jun 30 03:27:25 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 30 Jun 2008 10:27:25 +0200 Subject: [dba-VB] Improving Web Services Security: Scenarios and Implementation Guidance for WCF Message-ID: Hi all A beta2 version of a quite comprehensive guide (680 pages) on: Improving Web Services Security: Scenarios and Implementation Guidance for WCF is available here: http://blogs.msdn.com/joestagner/archive/2008/06/11/microsoft-patterns-practices-improving-wcf-services-security.aspx Should keep you busy on a rainy weekend. /gustav