From jwcolby at colbyconsulting.com Tue Jun 5 06:36:22 2012 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 05 Jun 2012 07:36:22 -0400 Subject: [dba-VB] OT: SAS / SATA standards explanation Message-ID: <4FCDEF36.6020403@colbyconsulting.com> This is a good read if you have always wondered... http://www.ioisas.com/about-sas.htm -- John W. Colby Colby Consulting Reality is what refuses to go away when you do not believe in it From jwcolby at colbyconsulting.com Wed Jun 6 12:08:42 2012 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 06 Jun 2012 13:08:42 -0400 Subject: [dba-VB] SQL Server Encrypted field Message-ID: <4FCF8E9A.8060201@colbyconsulting.com> I need to store sensitive data in specific fields of specific tables. I find things like: http://msdn.microsoft.com/en-us/library/ms179331.aspx Which discusses creating a certificate etc. Hmm... what happens if the database is backed up? What happens if I need to move the database? And of course my favorite SQL guy (Pinal Dave): http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/ In the end however what I want do (in this case) is to allow specific information to be encrypted / decrypted on a user specific basis, i.e. based on something user specific. Assume that users need to store their own Email Address, username and password in my database and then use that to send email "on their behalf" from my system. The database is used for generating Community Volunteer passes, and when the pass is created it is printed to PDF, attached to an email and mailed to one or more email address at a specific prison. I have created a new GMail account with a username and password but it would be nice to allow each user to enter their own email address / username / password to send from so that if there are issues and the prison replies to the email, it gets back to them directly. Using my current system it would come back to my general address. Of course I can do a "do not respond to this email" kind of thing but I have already been asked if they can get responses. Obviously if I am going to store a user's email address, username and password it has to be encrypted, but furthermore it has to be retrievable only by that user. -- John W. Colby Colby Consulting Reality is what refuses to go away when you do not believe in it From mcp2004 at mail.ru Wed Jun 13 08:37:56 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 13 Jun 2012 17:37:56 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_31_Days_of_Mango?= Message-ID: <1339594676.204052154@f218.mail.ru> Hi All -- FJY: ?31 Days of Mango http://www.jeffblankenburg.com/category/31-days-of-mango/? Thank you. -- Shamil? From mcp2004 at mail.ru Wed Jun 13 08:38:26 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 13 Jun 2012 17:38:26 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_31_Days_of_Mango?= Message-ID: <1339594706.923925862@f33.mail.ru> Hi All -- FJY: ?31 Days of Mango http://www.jeffblankenburg.com/category/31-days-of-mango/? Thank you. -- Shamil? From mcp2004 at mail.ru Wed Jun 13 08:38:33 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 13 Jun 2012 17:38:33 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_31_Days_of_Mango?= Message-ID: <1339594713.185078906@f171.mail.ru> Hi All -- FJY: ?31 Days of Mango http://www.jeffblankenburg.com/category/31-days-of-mango/? Thank you. -- Shamil? From mcp2004 at mail.ru Wed Jun 13 09:28:26 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 13 Jun 2012 18:28:26 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_31_Days_of_Mango?= In-Reply-To: <1339594713.185078906@f171.mail.ru> References: <1339594713.185078906@f171.mail.ru> Message-ID: <1339597706.270067023@f298.mail.ru> Hi All, I apologize that my subject message got accidentally posted here three times. Thank you. -- Shamil Wed, 13 Jun 2012 17:38:33 +0400 ?? Salakhetdinov Shamil : > Hi All -- > > FJY: ?31 Days of Mango > > http://www.jeffblankenburg.com/category/31-days-of-mango/? > > Thank you. > > -- Shamil? > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Wed Jun 13 12:20:45 2012 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 13 Jun 2012 13:20:45 -0400 Subject: [dba-VB] FYI: 31 Days of Mango In-Reply-To: <1339597706.270067023@f298.mail.ru> References: <1339594713.185078906@f171.mail.ru> <1339597706.270067023@f298.mail.ru> Message-ID: What is Mango? Google listed only things about the fruit and various Thai recipes/ A. On Wed, Jun 13, 2012 at 10:28 AM, Salakhetdinov Shamil wrote: > Hi All, > > I apologize that my subject message got accidentally posted here three > times. > > Thank you. > > -- Shamil > > From dw-murphy at cox.net Wed Jun 13 13:10:32 2012 From: dw-murphy at cox.net (Doug Murphy) Date: Wed, 13 Jun 2012 11:10:32 -0700 Subject: [dba-VB] FYI: 31 Days of Mango In-Reply-To: References: <1339594713.185078906@f171.mail.ru> <1339597706.270067023@f298.mail.ru> Message-ID: <008301cd498f$d9fe11f0$8dfa35d0$@cox.net> I assume your looking for mangodb. http://www.mongodb.org/ -----Original Message----- From: dba-vb-bounces at databaseadvisors.com [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Wednesday, June 13, 2012 10:21 AM To: Salakhetdinov Shamil; Discussion concerning Visual Basic and related programming issues. Subject: Re: [dba-VB] FYI: 31 Days of Mango What is Mango? Google listed only things about the fruit and various Thai recipes/ A. On Wed, Jun 13, 2012 at 10:28 AM, Salakhetdinov Shamil wrote: > Hi All, > > I apologize that my subject message got accidentally posted here three > times. > > Thank you. > > -- Shamil > > _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mcp2004 at mail.ru Wed Jun 13 15:30:23 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Thu, 14 Jun 2012 00:30:23 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_31_Days_of_Mango?= In-Reply-To: <008301cd498f$d9fe11f0$8dfa35d0$@cox.net> References: <1339594713.185078906@f171.mail.ru> <008301cd498f$d9fe11f0$8dfa35d0$@cox.net> Message-ID: <1339619422.95086434@f52.mail.ru> Hi Doug and Arthur -- No, I meant WinPhone 7.5 OS codenamed "Mango" - try googling using mango 7.5 Here is another link on WinPhone 7.5 developer's site: http://msdn.microsoft.com/en-us/windowsphone Thank you. -- Shamil P.S. Windows Phone: Ever Heard Of It? http://anewdomain.net/2012/04/27/windows-phone-ever-heard/ Apple Founder Inventor Steve Wozniak: Why I Love My Windows Phone 7.5 Mango http://anewdomain.net/2012/04/26/apple-founder-inventor-steve-wozniak-why-i-love-my-windows-phone-7-5-fan/ "I'm kind of shocked. Every screen is much more beautiful than the same apps on Android and iPhone..." Wed, 13 Jun 2012 11:10:32 -0700 ?? "Doug Murphy" : > I assume your looking for mangodb. http://www.mongodb.org/ > > -----Original Message----- > From: dba-vb-bounces at databaseadvisors.com > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller > Sent: Wednesday, June 13, 2012 10:21 AM > To: Salakhetdinov Shamil; Discussion concerning Visual Basic and related > programming issues. > Subject: Re: [dba-VB] FYI: 31 Days of Mango > > What is Mango? Google listed only things about the fruit and various Thai > recipes/ > > A. > > On Wed, Jun 13, 2012 at 10:28 AM, Salakhetdinov Shamil > wrote: > > > Hi All, > > > > I apologize that my subject message got accidentally posted here three > > times. > > > > 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 mcp2004 at mail.ru Tue Jun 19 10:57:22 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Tue, 19 Jun 2012 19:57:22 +0400 Subject: [dba-VB] =?utf-8?q?C=23_programming_exercises=3A_Sample_1_-_Run_p?= =?utf-8?q?arallel_tests_from_this_assembly_test_classes?= Message-ID: <1340121442.798714423@f185.mail.ru> Hi All - I wanted to share some code snippets I'm getting written here while mastering C# programming using LINQPad. Presented here code snippet will instantiate and run in parallel two sample test classes resulting in an output as the following: 19.06.2012 19:49:42: Test1 instantiated. 19.06.2012 19:49:42: Test2 instantiated. 19.06.2012 19:49:42: Test1 setup. 19.06.2012 19:49:42: Test2 setup. 19.06.2012 19:49:43: Test2 run started... 19.06.2012 19:49:44: Test1 run started... 19.06.2012 19:49:44: Test2 run completed. 19.06.2012 19:49:44: Test2 tear down. 19.06.2012 19:49:45: Test1 run completed. 19.06.2012 19:49:45: Test1 tear down. All and any comments & remarks are very welcome! Thank you. -- Shamil P.S. Code snippet: --- cut here --- // LINQPad test program start code line - to be commented under VS static void Main() { Program.Main(); } // Program - main entry method class Program { public static void Main(string[] args = null) { try { // Short def: // Run tests from this assembly test classes in parallel // // Long def: // Select classes in this assembly, // which type name starts with a string 'Test', // order selected type names in ascending order, // and then for each selected class // start parallel thread, which will // create class instance, // will cast that instance to ITest interface, // and if cast returns not null ITest instance // will call Setup(), Run() and TearDown() methods... typeof(Program).Assembly.GetTypes() .Where(x => x.Name.StartsWith("Test")) .OrderBy(x => x.Name) .AsParallel() .ForAll(x => { ITest test = Activator.CreateInstance(x) as ITest; if (test != null) { System.Console.WriteLine("{0}: {1} instantiated.", DateTime.Now, test.GetType().Name); test.Setup(); test.Run(); test.TearDown(); } }); } catch (Exception ex) { System.Console.WriteLine("Error = '{0}'", ex.Message); } } } // Logger - utility class public class Logger { protected void log(params dynamic[] args) { System.Console.WriteLine(args[0], args[1], args[2].Name); } } // ITest - test setup, run and tear down interface public interface ITest { void Setup(); void Run(); void TearDown(); } // Test2 - sample test class public class Test2: Logger, ITest { public void Setup() { log("{0}: {1} setup.", DateTime.Now, typeof(Test2)); } public void TearDown() { log("{0}: {1} tear down.", DateTime.Now, typeof(Test2)); } void ITest.Run() { log("{0}: {1} run started...", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); log("{0}: {1} run completed.", DateTime.Now, this.GetType()); } } // Test2 - sample test class public class Test1: Logger, ITest { public void Setup() { log("{0}: {1} setup.", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); } public void TearDown() { log("{0}: {1} tear down.", DateTime.Now, this.GetType()); } void ITest.Run() { log("{0}: {1} run started...", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); log("{0}: {1} run completed.", DateTime.Now, this.GetType()); } } -- cut here -- Thank you. -- Shamil From gustav at cactus.dk Tue Jun 19 11:18:13 2012 From: gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Jun 2012 18:18:13 +0200 Subject: [dba-VB] C# programming exercises: Sample 1 - Run parallel tests from this assembly test classes Message-ID: Hi Shamil That looks clever and tight. I guess if you didn't have the Sleep(1000) method, the code would run with one timestamp only. But do you really run this from within LINQPad? /gustav >>> Salakhetdinov Shamil 19-06-12 17:57 >>> Hi All - I wanted to share some code snippets I'm getting written here while mastering C# programming using LINQPad. Presented here code snippet will instantiate and run in parallel two sample test classes resulting in an output as the following: 19.06.2012 19:49:42: Test1 instantiated. 19.06.2012 19:49:42: Test2 instantiated. 19.06.2012 19:49:42: Test1 setup. 19.06.2012 19:49:42: Test2 setup. 19.06.2012 19:49:43: Test2 run started... 19.06.2012 19:49:44: Test1 run started... 19.06.2012 19:49:44: Test2 run completed. 19.06.2012 19:49:44: Test2 tear down. 19.06.2012 19:49:45: Test1 run completed. 19.06.2012 19:49:45: Test1 tear down. All and any comments & remarks are very welcome! Thank you. -- Shamil P.S. Code snippet: --- cut here --- // LINQPad test program start code line - to be commented under VS static void Main() { Program.Main(); } // Program - main entry method class Program { public static void Main(string[] args = null) { try { // Short def: // Run tests from this assembly test classes in parallel // // Long def: // Select classes in this assembly, // which type name starts with a string 'Test', // order selected type names in ascending order, // and then for each selected class // start parallel thread, which will // create class instance, // will cast that instance to ITest interface, // and if cast returns not null ITest instance // will call Setup(), Run() and TearDown() methods... typeof(Program).Assembly.GetTypes() .Where(x => x.Name.StartsWith("Test")) .OrderBy(x => x.Name) .AsParallel() .ForAll(x => { ITest test = Activator.CreateInstance(x) as ITest; if (test != null) { System.Console.WriteLine("{0}: {1} instantiated.", DateTime.Now, test.GetType().Name); test.Setup(); test.Run(); test.TearDown(); } }); } catch (Exception ex) { System.Console.WriteLine("Error = '{0}'", ex.Message); } } } // Logger - utility class public class Logger { protected void log(params dynamic[] args) { System.Console.WriteLine(args[0], args[1], args[2].Name); } } // ITest - test setup, run and tear down interface public interface ITest { void Setup(); void Run(); void TearDown(); } // Test2 - sample test class public class Test2: Logger, ITest { public void Setup() { log("{0}: {1} setup.", DateTime.Now, typeof(Test2)); } public void TearDown() { log("{0}: {1} tear down.", DateTime.Now, typeof(Test2)); } void ITest.Run() { log("{0}: {1} run started...", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); log("{0}: {1} run completed.", DateTime.Now, this.GetType()); } } // Test2 - sample test class public class Test1: Logger, ITest { public void Setup() { log("{0}: {1} setup.", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); } public void TearDown() { log("{0}: {1} tear down.", DateTime.Now, this.GetType()); } void ITest.Run() { log("{0}: {1} run started...", DateTime.Now, this.GetType()); System.Threading.Thread.Sleep(1000); log("{0}: {1} run completed.", DateTime.Now, this.GetType()); } } -- cut here -- Thank you. -- Shamil From mcp2004 at mail.ru Tue Jun 19 11:27:36 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Tue, 19 Jun 2012 20:27:36 +0400 Subject: [dba-VB] =?utf-8?q?C=23_programming_exercises=3A_Sample_1_-_Run_p?= =?utf-8?q?arallel=09tests_from_this_assembly_test_classes?= In-Reply-To: References: Message-ID: <1340123256.697832950@f315.mail.ru> Hi Gustav -- Yes, I have run this code in LINQPad 4.42.1, I have got purchased a Premium version to have Intellisense etc. LINQPad is a great C# learning/mastering/"code snippeting"/experimenting tool. But you know that LINQPad is a great tool AFAIK :) I have put .Sleep(1000) in Test1 class Setup method to show that in this case Test2 runs first and in parallel - did you mean that? > That looks clever and tight. Thank you, just a bit maybe - when I'm reading "C# 4.0 in a Nutshell" by Joseph and Ben Albahari I'm feeling myself as a 1st grade pupil - the concepts and techniques of modern C# (functional) parallel programming they present in many parts of heir book are so advanced... BTW, I still can't get how LINQPad dynamically builds ADO.NET EF model/assembly from given MS SQL database connection - have you seen/read anywhere how it's done, what (third party) .NET classlibs they use? Thank you. -- Shamil Tue, 19 Jun 2012 18:18:13 +0200 ?? "Gustav Brock" : > Hi Shamil > > That looks clever and tight. > I guess if you didn't have the Sleep(1000) method, the code would run with one timestamp only. > > But do you really run this from within LINQPad? > > /gustav > > > >>> Salakhetdinov Shamil 19-06-12 17:57 >>> > Hi All - > > I wanted to share some code snippets I'm getting written here while mastering C# programming using LINQPad. > Presented here code snippet will instantiate and run in parallel two sample test classes resulting in an output as the following: > > 19.06.2012 19:49:42: Test1 instantiated. > 19.06.2012 19:49:42: Test2 instantiated. > 19.06.2012 19:49:42: Test1 setup. > 19.06.2012 19:49:42: Test2 setup. > 19.06.2012 19:49:43: Test2 run started... > 19.06.2012 19:49:44: Test1 run started... > 19.06.2012 19:49:44: Test2 run completed. > 19.06.2012 19:49:44: Test2 tear down. > 19.06.2012 19:49:45: Test1 run completed. > 19.06.2012 19:49:45: Test1 tear down. > > All and any comments & remarks are very welcome! > > Thank you. > > -- Shamil > > P.S. Code snippet: > > --- cut here --- > > // LINQPad test program start code line - to be commented under VS > static void Main() { Program.Main(); } > > // Program - main entry method > class Program > { > public static void Main(string[] args = null) > { > try > { > // Short def: > // Run tests from this assembly test classes in parallel > // > // Long def: > // Select classes in this assembly, > // which type name starts with a string 'Test', > // order selected type names in ascending order, > // and then for each selected class > // start parallel thread, which will > // create class instance, > // will cast that instance to ITest interface, > // and if cast returns not null ITest instance > // will call Setup(), Run() and TearDown() methods... > typeof(Program).Assembly.GetTypes() > .Where(x => x.Name.StartsWith("Test")) > .OrderBy(x => x.Name) > .AsParallel() > .ForAll(x => > { > ITest test = Activator.CreateInstance(x) as ITest; > if (test != null) > { > System.Console.WriteLine("{0}: {1} instantiated.", DateTime.Now, test.GetType().Name); > test.Setup(); > test.Run(); > test.TearDown(); > } > }); > } > catch (Exception ex) > { > System.Console.WriteLine("Error = '{0}'", ex.Message); > } > } > } > > // Logger - utility class > public class Logger > { > protected void log(params dynamic[] args) > { > System.Console.WriteLine(args[0], args[1], args[2].Name); > } > } > > // ITest - test setup, run and tear down interface > public interface ITest > { > void Setup(); > void Run(); > void TearDown(); > } > > // Test2 - sample test class > public class Test2: Logger, ITest > { > public void Setup() > { > log("{0}: {1} setup.", DateTime.Now, typeof(Test2)); > } > public void TearDown() > { > log("{0}: {1} tear down.", DateTime.Now, typeof(Test2)); > } > void ITest.Run() > { > log("{0}: {1} run started...", DateTime.Now, this.GetType()); > System.Threading.Thread.Sleep(1000); > log("{0}: {1} run completed.", DateTime.Now, this.GetType()); > } > } > > // Test2 - sample test class > public class Test1: Logger, ITest > { > public void Setup() > { > log("{0}: {1} setup.", DateTime.Now, this.GetType()); > System.Threading.Thread.Sleep(1000); > } > public void TearDown() > { > log("{0}: {1} tear down.", DateTime.Now, this.GetType()); > } > void ITest.Run() > { > log("{0}: {1} run started...", DateTime.Now, this.GetType()); > System.Threading.Thread.Sleep(1000); > log("{0}: {1} run completed.", DateTime.Now, this.GetType()); > } > } > > -- cut here -- > > Thank you. > > -- 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 Tue Jun 19 11:51:47 2012 From: gustav at cactus.dk (Gustav Brock) Date: Tue, 19 Jun 2012 18:51:47 +0200 Subject: [dba-VB] C# programming exercises: Sample 1 - Run parallel tests from this assembly test classes Message-ID: Hi Shamil Yes, I do have a "Pro" license for LINQPad but I had no idea you could use it for this level of code. I've only used it to find out LINQ queries. I've read some free chapters from the previous book - very good - but didn't buy the book. Perhaps it is time now to spend some money. As for the EF code generation: Why not ask the author, Joseph Albahari? As I understand it, he will be happy to answer. /gustav >>> Salakhetdinov Shamil 19-06-12 18:27 >>> Hi Gustav -- Yes, I have run this code in LINQPad 4.42.1, I have got purchased a Premium version to have Intellisense etc. LINQPad is a great C# learning/mastering/"code snippeting"/experimenting tool. But you know that LINQPad is a great tool AFAIK :) I have put .Sleep(1000) in Test1 class Setup method to show that in this case Test2 runs first and in parallel - did you mean that? > That looks clever and tight. Thank you, just a bit maybe - when I'm reading "C# 4.0 in a Nutshell" by Joseph and Ben Albahari I'm feeling myself as a 1st grade pupil - the concepts and techniques of modern C# (functional) parallel programming they present in many parts of heir book are so advanced... BTW, I still can't get how LINQPad dynamically builds ADO.NET EF model/assembly from given MS SQL database connection - have you seen/read anywhere how it's done, what (third party) .NET classlibs they use? Thank you. -- Shamil Tue, 19 Jun 2012 18:18:13 +0200 ?? "Gustav Brock" : > Hi Shamil > > That looks clever and tight. > I guess if you didn't have the Sleep(1000) method, the code would run with one timestamp only. > > But do you really run this from within LINQPad? > > /gustav > > > >>> Salakhetdinov Shamil 19-06-12 17:57 >>> > Hi All - > > I wanted to share some code snippets I'm getting written here while mastering C# programming using LINQPad. > Presented here code snippet will instantiate and run in parallel two sample test classes resulting in an output as the following: > > 19.06.2012 19:49:42: Test1 instantiated. > 19.06.2012 19:49:42: Test2 instantiated. > 19.06.2012 19:49:42: Test1 setup. > 19.06.2012 19:49:42: Test2 setup. > 19.06.2012 19:49:43: Test2 run started... > 19.06.2012 19:49:44: Test1 run started... > 19.06.2012 19:49:44: Test2 run completed. > 19.06.2012 19:49:44: Test2 tear down. > 19.06.2012 19:49:45: Test1 run completed. > 19.06.2012 19:49:45: Test1 tear down. > > All and any comments & remarks are very welcome! > > Thank you. > > -- Shamil From mcp2004 at mail.ru Tue Jun 19 12:34:10 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Tue, 19 Jun 2012 21:34:10 +0400 Subject: [dba-VB] =?utf-8?q?C=23_programming_exercises=3A_Sample_1_-_Run?= =?utf-8?q?=09parallel=09tests_from_this_assembly_test_classes?= In-Reply-To: References: Message-ID: <1340127250.349434606@f229.mail.ru> Hi Gustav -- I have got purchased a LINQPad 4.42.01 Premium edition to use NuGet packages (still to learn how). >From within LINQPad 4.42.01 you can run the following code snippet types: C# Expression C# Statements C# Program VB Expression VB Statements VB Program F# Expression F# Program and do a lot more things, which I, personally, still to discover how to do and to apply for C# programming mastering and for the real life .NET development.. Try e.g. this Util.Image ("http://chart.apis.google.com/chart?cht=p3&chd=s:Uf9a&chs=350x140&chl=January|February|March|April") and you'll get a sample chart image, which you can right click and copy and paste somewhere in your docs... Or you can set a connection to an oData data source and query it via LINQ, e.g.: Set connection to http://data.stackexchange.com/stackoverflow/atom and then run LINQ query in LINQPad: Users .OrderByDescending(n => n.Reputation) .Take (10) .Select(n => new {n.Reputation, n.DisplayName, n.WebsiteUrl}) returns the top 10 (by Reputation) StackOverflow users... > As for the EF code generation: Why not ask the author, Joseph Albahari? As I understand it, he will be happy to answer. OK, but first I will try to read carefully through this web page: http://www.linqpad.net/HowLINQPadWorks.aspx it may happen I will find the answer on referred from that web page other web pages... Thank you. -- Shamil Tue, 19 Jun 2012 18:51:47 +0200 ?? "Gustav Brock" : > Hi Shamil > > Yes, I do have a "Pro" license for LINQPad but I had no idea you could use it for this level of code. I've only used it to find out LINQ queries. > > I've read some free chapters from the previous book - very good - but didn't buy the book. Perhaps it is time now to spend some money. > > As for the EF code generation: Why not ask the author, Joseph Albahari? As I understand it, he will be happy to answer. > > /gustav > > > >>> Salakhetdinov Shamil 19-06-12 18:27 >>> > Hi Gustav -- > > Yes, I have run this code in LINQPad 4.42.1, I have got purchased a Premium version to have Intellisense etc. > LINQPad is a great C# learning/mastering/"code snippeting"/experimenting tool. > But you know that LINQPad is a great tool AFAIK :) > > I have put .Sleep(1000) in Test1 class Setup method to show that in this case Test2 runs first and in parallel - did you mean that? > > > That looks clever and tight. > Thank you, just a bit maybe - when I'm reading "C# 4.0 in a Nutshell" by Joseph and Ben Albahari I'm feeling myself as a 1st grade pupil - the concepts and techniques of modern C# (functional) parallel programming they present in many parts of heir book are so advanced... > > BTW, I still can't get how LINQPad dynamically builds ADO.NET EF model/assembly from given MS SQL database connection - have you seen/read anywhere how it's done, what (third party) .NET classlibs they use? > > Thank you. > > -- Shamil > > Tue, 19 Jun 2012 18:18:13 +0200 ?? "Gustav Brock" : > > Hi Shamil > > > > That looks clever and tight. > > I guess if you didn't have the Sleep(1000) method, the code would run with one timestamp only. > > > > But do you really run this from within LINQPad? > > > > /gustav > > > > > > >>> Salakhetdinov Shamil 19-06-12 17:57 >>> > > Hi All - > > > > I wanted to share some code snippets I'm getting written here while mastering C# programming using LINQPad. > > Presented here code snippet will instantiate and run in parallel two sample test classes resulting in an output as the following: > > > > 19.06.2012 19:49:42: Test1 instantiated. > > 19.06.2012 19:49:42: Test2 instantiated. > > 19.06.2012 19:49:42: Test1 setup. > > 19.06.2012 19:49:42: Test2 setup. > > 19.06.2012 19:49:43: Test2 run started... > > 19.06.2012 19:49:44: Test1 run started... > > 19.06.2012 19:49:44: Test2 run completed. > > 19.06.2012 19:49:44: Test2 tear down. > > 19.06.2012 19:49:45: Test1 run completed. > > 19.06.2012 19:49:45: Test1 tear down. > > > > All and any comments & remarks are very welcome! > > > > Thank you. > > > > -- Shamil > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mcp2004 at mail.ru Tue Jun 19 12:54:38 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Tue, 19 Jun 2012 21:54:38 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_LINQPad_-_you_can_run_=28m=29any_=28typ?= =?utf-8?q?es_of=29_code_snippets=2C_even_WinForms_etc=2E?= Message-ID: <1340128478.827553278@f144.mail.ru> Hi All -- FYI: You can run the following (see P.S.) code snippets in LINQPad to create sample WinForm instance with one button reacting on its clicking by an informational message box dialog: Hello, World! Thank you. -- Shamil static void Main() { Application.Run(new HelloWorldWinForm()); } //namespace My.TestConsole //{ public partial class HelloWorldWinForm : System.Windows.Forms.Form { public HelloWorldWinForm() { InitializeComponent(); } private void cmdClickMe_Click(object sender, EventArgs e) { MessageBox.Show("Hello World!", "Hello", MessageBoxButtons.OK, MessageBoxIcon.Information); } } //} //namespace My.TestConsole //{ public partial class HelloWorldWinForm : System.Windows.Forms.Form { /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.cmdClickMe = new System.Windows.Forms.Button(); this.SuspendLayout(); // // cmdClickMe // this.cmdClickMe.Location = new System.Drawing.Point(93, 48); this.cmdClickMe.Name = "cmdClickMe"; this.cmdClickMe.Size = new System.Drawing.Size(75, 23); this.cmdClickMe.TabIndex = 0; this.cmdClickMe.Text = "Click Me!"; this.cmdClickMe.UseVisualStyleBackColor = true; this.cmdClickMe.Click += new System.EventHandler(this.cmdClickMe_Click); // // HelloWorldWinForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(262, 127); this.Controls.Add(this.cmdClickMe); this.Name = "HelloWorldWinForm"; this.Text = "Hello World WinForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button cmdClickMe; } //} From mcp2004 at mail.ru Tue Jun 19 15:14:56 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Wed, 20 Jun 2012 00:14:56 +0400 Subject: [dba-VB] =?utf-8?q?C=23_programming_exercises_in_LINQPad=3A_Sampl?= =?utf-8?q?e_2_-_looking_for_a_text_string_in_code_files_from_a_directory_?= =?utf-8?q?=28including_subdirectories=29=2E=2E=2E?= Message-ID: <1340136896.619215703@f293.mail.ru> Hi All -- Here is a code snippet from my LINQPad utility code snippets collection to look for a text string in all the files of a directory (including subdirectories) I know there exists a grep (but I can't find it here on my system) utility or windows explorer advanced search but the sample code (see P.S.) seems to be working much quicker(?), also this code snippets is not a bad example of modern C# development techniques - try: Here are the results for my real life case - I have just needed to find a text in 3765 .cs files. 1. first run took 30 seconds start: 19.06.2012 23:36:06 end: 19.06.2012 23:36:34 2. subsequent runs Total files count 3765 Start Time 19.06.2012 23:59:39 e:\projects\code\TestSolution\Test.BLL\Reports Import\TestApiAgent.cs e:\projects\code\TestSolution\Test.Core\Settings\General Settings\GeneralSettings.cs Total files length 39905062 End Time 19.06.2012 23:59:42 Elapsed time (ms) 2483.1421 Processing speed (chars/ms) 16070.3900111073 Thank you. -- Shamil P.S. Code snippet // Search for a text string in all the *.cs files of a directory // including its subdirectories // // folder to search code files in string folderName = @"e:\projects\code"; // search string string searchFor = "test.com"; var folder = new System.IO.DirectoryInfo(folderName); var files = folder.GetFiles("*.cs", SearchOption.AllDirectories); files.Length.Dump("Total files count"); var startTime = DateTime.Now; startTime.Dump("Start Time"); int totalLength = 0; files.AsParallel().ForAll(x => { Interlocked.Add(ref totalLength, (int)(new System.IO.FileInfo(x.FullName)).Length); string code = System.IO.File.ReadAllText(x.FullName, Encoding.UTF8); if (code.IndexOf(searchFor,StringComparison.InvariantCultureIgnoreCase)>-1) System.Console.WriteLine(x.FullName); }); totalLength.Dump("Total files length"); var endTime = DateTime.Now; endTime.Dump("End Time"); (endTime - startTime).TotalMilliseconds.Dump("Elapsed time (ms)"); (totalLength / (endTime - startTime).TotalMilliseconds).Dump("Processing speed (chars/ms)"); From gustav at cactus.dk Sat Jun 23 12:18:49 2012 From: gustav at cactus.dk (Gustav Brock) Date: Sat, 23 Jun 2012 19:18:49 +0200 Subject: [dba-VB] C# programming exercises in LINQPad: Sample 2 - looking for a text string in code files Message-ID: Hi Shamil I just tested this in LINQPad and it runs fine. Could be very useful. /gustav >>> Salakhetdinov Shamil 19-06-12 22:14 >>> Hi All -- Here is a code snippet from my LINQPad utility code snippets collection to look for a text string in all the files of a directory (including subdirectories) I know there exists a grep (but I can't find it here on my system) utility or windows explorer advanced search but the sample code (see P.S.) seems to be working much quicker(?), also this code snippets is not a bad example of modern C# development techniques - try: Here are the results for my real life case - I have just needed to find a text in 3765 .cs files. 1. first run took 30 seconds start: 19.06.2012 23:36:06 end: 19.06.2012 23:36:34 2. subsequent runs Total files count 3765 Start Time 19.06.2012 23:59:39 e:\projects\code\TestSolution\Test.BLL\Reports Import\TestApiAgent.cs e:\projects\code\TestSolution\Test.Core\Settings\General Settings\GeneralSettings.cs Total files length 39905062 End Time 19.06.2012 23:59:42 Elapsed time (ms) 2483.1421 Processing speed (chars/ms) 16070.3900111073 Thank you. -- Shamil P.S. Code snippet // Search for a text string in all the *.cs files of a directory // including its subdirectories // // folder to search code files in string folderName = @"e:\projects\code"; // search string string searchFor = "test.com"; var folder = new System.IO.DirectoryInfo(folderName); var files = folder.GetFiles("*.cs", SearchOption.AllDirectories); files.Length.Dump("Total files count"); var startTime = DateTime.Now; startTime.Dump("Start Time"); int totalLength = 0; files.AsParallel().ForAll(x => { Interlocked.Add(ref totalLength, (int)(new System.IO.FileInfo(x.FullName)).Length); string code = System.IO.File.ReadAllText(x.FullName, Encoding.UTF8); if (code.IndexOf(searchFor,StringComparison.InvariantCultureIgnoreCase)>-1) System.Console.WriteLine(x.FullName); }); totalLength.Dump("Total files length"); var endTime = DateTime.Now; endTime.Dump("End Time"); (endTime - startTime).TotalMilliseconds.Dump("Elapsed time (ms)"); (totalLength / (endTime - startTime).TotalMilliseconds).Dump("Processing speed (chars/ms)"); From mcp2004 at mail.ru Sat Jun 23 12:42:42 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sat, 23 Jun 2012 21:42:42 +0400 Subject: [dba-VB] =?utf-8?q?C=23_programming_exercises_in_LINQPad=3A_Sampl?= =?utf-8?q?e_2_-=09looking_for_a_text_string_in_code_files?= In-Reply-To: References: Message-ID: <1340473362.514923453@f324.mail.ru> Hi Gustav -- Yes, I have used this utility code several times already to quickly find code files... Thank you. -- Shamil Sat, 23 Jun 2012 19:18:49 +0200 ?? "Gustav Brock" : > Hi Shamil > > I just tested this in LINQPad and it runs fine. Could be very useful. > > /gustav > > > >>> Salakhetdinov Shamil 19-06-12 22:14 >>> > Hi All -- > > Here is a code snippet from my LINQPad utility code snippets collection to look for a text string in all the files of a directory (including subdirectories) > I know there exists a grep (but I can't find it here on my system) utility or windows explorer advanced search but the sample code (see P.S.) seems to be working much quicker(?), > also this code snippets is not a bad example of modern C# development techniques - try: > > Here are the results for my real life case - I have just needed to find a text in 3765 .cs files. > > 1. first run took 30 seconds > start: 19.06.2012 23:36:06 > end: 19.06.2012 23:36:34 > > 2. subsequent runs > Total files count > 3765 > > Start Time > 19.06.2012 23:59:39 > > e:\projects\code\TestSolution\Test.BLL\Reports Import\TestApiAgent.cs > e:\projects\code\TestSolution\Test.Core\Settings\General Settings\GeneralSettings.cs > > Total files length > 39905062 > > End Time > 19.06.2012 23:59:42 > > Elapsed time (ms) > 2483.1421 > > Processing speed (chars/ms) > 16070.3900111073 > > Thank you. > > -- Shamil > > P.S. Code snippet > > // Search for a text string in all the *.cs files of a directory > // including its subdirectories > // > > // folder to search code files in > string folderName = @"e:\projects\code"; > // search string > string searchFor = "test.com"; > > var folder = new System.IO.DirectoryInfo(folderName); > var files = folder.GetFiles("*.cs", SearchOption.AllDirectories); > > files.Length.Dump("Total files count"); > > var startTime = DateTime.Now; > startTime.Dump("Start Time"); > > int totalLength = 0; > files.AsParallel().ForAll(x => > { > Interlocked.Add(ref totalLength, > (int)(new System.IO.FileInfo(x.FullName)).Length); > string code = System.IO.File.ReadAllText(x.FullName, Encoding.UTF8); > if (code.IndexOf(searchFor,StringComparison.InvariantCultureIgnoreCase)>-1) > System.Console.WriteLine(x.FullName); > }); > > > totalLength.Dump("Total files length"); > var endTime = DateTime.Now; > endTime.Dump("End Time"); > > (endTime - startTime).TotalMilliseconds.Dump("Elapsed time (ms)"); > (totalLength / (endTime - startTime).TotalMilliseconds).Dump("Processing speed (chars/ms)"); > > _______________________________________________ > dba-VB mailing list > dba-VB at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-vb > http://www.databaseadvisors.com > > From mcp2004 at mail.ru Sat Jun 23 17:03:36 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sun, 24 Jun 2012 02:03:36 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_LINQ=3A_Building_an_IQueryable_provider?= =?utf-8?q?_articles_series_+_MS_Access_LINQ_=28IQueryable=29_provider=2E?= =?utf-8?b?Li4=?= Message-ID: <1340489016.598250646@f219.mail.ru> Hi All -- FYI: I have occasionally get at the subject articles series here: http://blogs.msdn.com/b/mattwar/archive/2008/11/18/linq-links.aspx and from them I have got here LINQ IQueryable Toolkit (http://iqtoolkit.codeplex.com/) and I have got surprised finding that LINQ IQueryable Toolkit is able to handle MS Access backends (as well as SqlCE, SQLLite, MySQL and MS SQL). As you can guess it means that LINQ IQueryable Toolkit allows to have different backend types handled (CRUD and data retrieval) by the same code For example the following code will list ContactName, OrderDate and ProductName for all the orders of a customer with CustomerID = "ALFKI": Northwind db = new Northwind( DbEntityProvider.From(TestConstants.ConnectionString, TestConstants.MappingId)); var list = ( from c in db.Customers from o in db.Orders from d in db.OrderDetails where c.CustomerID == "ALFKI" && o.CustomerID == c.CustomerID && o.OrderID == d.OrderID select new { c.ContactName, o.OrderDate, d.Product.ProductName } ).ToList(); list.ForEach(System.Console.WriteLine); For the case of MS Access backend TestConstants.ConnectionString equals to the path to the test database "C:\Data\\Northwind.mdb", for the case of SqlCE - to the test database "c:\data\Northwind.sdf" etc. (see http://iqtoolkit.codeplex.com/) and TestConstants.MappingId defines the name of ORM attributes class (it has to be prepared manually for a given backend)... LINQ IQueryable Toolkit is not officially supported by Microsoft but developed by an MS employee Matt Warren (http://blogs.msdn.com/b/mattwar/ , http://www.devtopics.com/blogs-from-microsoft-c-development-team/ ) ... As far as I have also found LINQ IQueryable Toolkit is rather mature software and it was recently used for LINQPad - as part of "IQ Driver - for MySQL, SQLite, Oracle" - http://www.linqpad.net/RichClient/DataContextDrivers.aspx ... Thank you. -- Shamil From mcp2004 at mail.ru Sun Jun 24 02:28:43 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sun, 24 Jun 2012 11:28:43 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_and_prop?= =?utf-8?q?erties_are_available_to_instance_methods_of_other_instances_of_?= =?utf-8?q?the_same_class=3F?= Message-ID: <1340522923.277421254@f226.mail.ru> Hi All -- I was surprised this morning - the following code snippet will compile and work in C#: public class TestMe { private string m_someString; //this also works: private string b_someString { get; set; } public TestMe(string someString) { m_someString = someString; } public void RunTest(TestMe other) { if (other.m_someString == this.m_someString) System.Console.WriteLine("this.'{0}' equals other.'{1}", this.m_someString, other.m_someString); else System.Console.WriteLine("this.'{0}' NOT equals other.'{1}", this.m_someString, other.m_someString); } } Compare it to VBA - the following code will not compile: ' class TestMe Private m_someString As String Public Sub Init(ByVal someString As String) m_someString = someString End Sub Public Sub RunTest(ByRef other As TestMe) Dim message As String message = "this.'{0}' {1} other.'{2}'" If (other.m_someString = Me.m_someString) Then message = Replace(message, "{1}", "equals") Else message = Replace(message, "{1}", "not equals") End If message = Replace(message, "{0}", m_someString) message = Replace(message, "{2}", other.m_someString) Debug.Print message End Sub I have then consulted C# docs: http://msdn.microsoft.com/en-us/library/ms173121(v=vs.80).aspx where I have read: "Finally, a class or struct member can be declared as private with the private keyword, indicating that only the class or struct declaring the member is allowed access to that member." I must note I have never thought the above sentence means that private members of a class or struct instance are allowed to be accessed by other instances of the same type of class or struct, have you? Thank you. -- Shamil P.S. I have used m_ prefix in declaring C# private fields or properties only in this sample - I usually use - undescore ('_') prefix for private fields and - lowerCaseCamelCase for private properties, methods, .... From gustav at cactus.dk Sun Jun 24 04:09:02 2012 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Jun 2012 11:09:02 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav >>> Salakhetdinov Shamil 24-06-12 9:28 >>> Hi All -- I was surprised this morning - the following code snippet will compile and work in C#: public class TestMe { private string m_someString; //this also works: private string b_someString { get; set; } public TestMe(string someString) { m_someString = someString; } public void RunTest(TestMe other) { if (other.m_someString == this.m_someString) System.Console.WriteLine("this.'{0}' equals other.'{1}", this.m_someString, other.m_someString); else System.Console.WriteLine("this.'{0}' NOT equals other.'{1}", this.m_someString, other.m_someString); } } Compare it to VBA - the following code will not compile: ' class TestMe Private m_someString As String Public Sub Init(ByVal someString As String) m_someString = someString End Sub Public Sub RunTest(ByRef other As TestMe) Dim message As String message = "this.'{0}' {1} other.'{2}'" If (other.m_someString = Me.m_someString) Then message = Replace(message, "{1}", "equals") Else message = Replace(message, "{1}", "not equals") End If message = Replace(message, "{0}", m_someString) message = Replace(message, "{2}", other.m_someString) Debug.Print message End Sub I have then consulted C# docs: http://msdn.microsoft.com/en-us/library/ms173121(v=vs.80).aspx where I have read: "Finally, a class or struct member can be declared as private with the private keyword, indicating that only the class or struct declaring the member is allowed access to that member." I must note I have never thought the above sentence means that private members of a class or struct instance are allowed to be accessed by other instances of the same type of class or struct, have you? Thank you. -- Shamil P.S. I have used m_ prefix in declaring C# private fields or properties only in this sample - I usually use - undescore ('_') prefix for private fields and - lowerCaseCamelCase for private properties, methods, .... From mcp2004 at mail.ru Sun Jun 24 06:35:50 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sun, 24 Jun 2012 15:35:50 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340537750.105302966@f152.mail.ru> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()? with paramarray object array initialized to an empty but not null array.? Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav >>> Salakhetdinov Shamil 24-06-12 9:28 >>> Hi All -- I was surprised this morning - the following code snippet will compile and work in C#: public class TestMe { ????private string m_someString; ????//this also works: private string b_someString { get; set; } ????public TestMe(string someString) ????{ ????????m_someString = someString; ????} ????public void RunTest(TestMe other) ????{ ????????if (other.m_someString == this.m_someString) ????????????System.Console.WriteLine("this.'{0}' equals other.'{1}", ????????????????this.m_someString, other.m_someString); ????????else ????????????System.Console.WriteLine("this.'{0}' NOT equals other.'{1}", ????????????????this.m_someString, other.m_someString); ????} } Compare it to VBA - the following code will not compile: ' class TestMe Private m_someString As String Public Sub Init(ByVal someString As String) ????m_someString = someString End Sub Public Sub RunTest(ByRef other As TestMe) Dim message As String ????message = "this.'{0}' {1} other.'{2}'" ????If (other.m_someString = Me.m_someString) Then ????????message = Replace(message, "{1}", "equals") ????Else ????????message = Replace(message, "{1}", "not equals") ????End If ????message = Replace(message, "{0}", m_someString) ????message = Replace(message, "{2}", other.m_someString) ????Debug.Print message End Sub I have then consulted C# docs: http://msdn.microsoft.com/en-us/library/ms173121(v=vs.80).aspx where I have read: "Finally, a class or struct member can be declared as private with the private keyword, indicating that only the class or struct declaring the member is allowed access to that member." I must note I have never thought the above sentence means that private members of a class or struct instance are allowed to be accessed by other instances of the same type of class or struct, have you? Thank you. -- Shamil P.S. I have used m_ prefix in declaring C# private fields or properties only in this sample - I usually use - undescore ('_') prefix for private fields and - lowerCaseCamelCase for private properties, methods, .... _______________________________________________ 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 Sun Jun 24 07:45:23 2012 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Jun 2012 14:45:23 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil Thanks for this pointer. I noticed the blog which explains and documents it in full: LINQ: Building an IQueryable provider series http://blogs.msdn.com/mattwar/pages/linq-links.aspx Will have to study this a quiet(!?) day. /gustav >>> Salakhetdinov Shamil 24-06-12 13:35 >>> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()* with paramarray object array initialized to an empty but not null array.* Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav From mcp2004 at mail.ru Sun Jun 24 10:49:18 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sun, 24 Jun 2012 19:49:18 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340552957.590060763@f14.mail.ru> Hi Gustav -- Yes, it's interesting code reading/reviewing, and even more interesting/useful ?isto debug/trace it using many provided samples/testing methods, although its latest version is converted to VS2012 and it does use MS testing framework. So I have had to downgrade it to VS2010 (removing some C# 5.0 async features) and to edit to make it using NUnit Framework. I have also got selected only the sources related to the MS Access backend. And it can be now unit-tested/debugged/traced under VS2010 + NUnit Framework 2.5.10. I can send the result "derivative" work off-line to the interested Access-D/dba-VB devs - and we may try to "code review" it here from time to time, and to exchange opinions...? I suppose such a "derivative work" lays within MS-PL? http://www.opensource.org/licenses/MS-PL Thank you. -- Shamil Sun, 24 Jun 2012 14:45:23 +0200 ?? "Gustav Brock" : Hi Shamil Thanks for this pointer. I noticed the blog which explains and documents it in full: LINQ: Building an IQueryable provider series http://blogs.msdn.com/mattwar/pages/linq-links.aspx Will have to study this a quiet(!?) day. /gustav >>> Salakhetdinov Shamil 24-06-12 13:35 >>> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()* with paramarray object array initialized to an empty but not null array.* Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : ? ?? ?? Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav _______________________________________________ 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 Sun Jun 24 11:37:37 2012 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Jun 2012 18:37:37 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil That would be nice. No hurry though, and I don't know how likely it would be for me to use an Access backend only * SQL Server of some sort would be first choice. /gustav >>> Salakhetdinov Shamil 24-06-12 17:49 >>> Hi Gustav -- Yes, it's interesting code reading/reviewing, and even more interesting/useful *isto debug/trace it using many provided samples/testing methods, although its latest version is converted to VS2012 and it does use MS testing framework. So I have had to downgrade it to VS2010 (removing some C# 5.0 async features) and to edit to make it using NUnit Framework. I have also got selected only the sources related to the MS Access backend. And it can be now unit-tested/debugged/traced under VS2010 + NUnit Framework 2.5.10. I can send the result "derivative" work off-line to the interested Access-D/dba-VB devs - and we may try to "code review" it here from time to time, and to exchange opinions...* I suppose such a "derivative work" lays within MS-PL? http://www.opensource.org/licenses/MS-PL Thank you. -- Shamil Sun, 24 Jun 2012 14:45:23 +0200 ?? "Gustav Brock" : Hi Shamil Thanks for this pointer. I noticed the blog which explains and documents it in full: LINQ: Building an IQueryable provider series http://blogs.msdn.com/mattwar/pages/linq-links.aspx Will have to study this a quiet(!?) day. /gustav >>> Salakhetdinov Shamil 24-06-12 13:35 >>> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()* with paramarray object array initialized to an empty but not null array.* Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : * ** ** Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav From mcp2004 at mail.ru Sun Jun 24 11:43:15 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sun, 24 Jun 2012 20:43:15 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340556195.903934402@f202.mail.ru> Hi Gustav -- AFAIS from IQToolkit sources the most part of its code is generic and "actual back-end independent". So IMO using MS Access would be the most appropriate/easy to study generic programming "tricks & techniques" and IQueryable implementation provided you have MS JET 4.0 OLE DB Provider or Access 2003 or 2007 or 2010 installed. Thank you. -- Shamil Sun, 24 Jun 2012 18:37:37 +0200 ?? "Gustav Brock" : Hi Shamil That would be nice. No hurry though, and I don't know how likely it would be for me to use an Access backend only * SQL Server of some sort would be first choice. /gustav >>> Salakhetdinov Shamil 24-06-12 17:49 >>> Hi Gustav -- Yes, it's interesting code reading/reviewing, and even more interesting/useful *isto debug/trace it using many provided samples/testing methods, although its latest version is converted to VS2012 and it does use MS testing framework. So I have had to downgrade it to VS2010 (removing some C# 5.0 async features) and to edit to make it using NUnit Framework. I have also got selected only the sources related to the MS Access backend. And it can be now unit-tested/debugged/traced under VS2010 + NUnit Framework 2.5.10. I can send the result "derivative" work off-line to the interested Access-D/dba-VB devs - and we may try to "code review" it here from time to time, and to exchange opinions...* I suppose such a "derivative work" lays within MS-PL? http://www.opensource.org/licenses/MS-PL Thank you. -- Shamil Sun, 24 Jun 2012 14:45:23 +0200 ?? "Gustav Brock" : ? ?? ?? Hi Shamil Thanks for this pointer. I noticed the blog which explains and documents it in full: LINQ: Building an IQueryable provider series http://blogs.msdn.com/mattwar/pages/linq-links.aspx Will have to study this a quiet(!?) day. /gustav >>> Salakhetdinov Shamil 24-06-12 13:35 >>> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()* with paramarray object array initialized to an empty but not null array.* Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : * ** ** Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav _______________________________________________ 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 Sun Jun 24 16:27:39 2012 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Jun 2012 23:27:39 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil OK, I see what you mean and, of course, I do have the JET OLEDB provider installed. /gustav >>> Salakhetdinov Shamil 24-06-12 18:43 >>> Hi Gustav -- AFAIS from IQToolkit sources the most part of its code is generic and "actual back-end independent". So IMO using MS Access would be the most appropriate/easy to study generic programming "tricks & techniques" and IQueryable implementation provided you have MS JET 4.0 OLE DB Provider or Access 2003 or 2007 or 2010 installed. Thank you. -- Shamil Sun, 24 Jun 2012 18:37:37 +0200 ?? "Gustav Brock" : Hi Shamil That would be nice. No hurry though, and I don't know how likely it would be for me to use an Access backend only * SQL Server of some sort would be first choice. /gustav From gustav at cactus.dk Wed Jun 27 11:00:43 2012 From: gustav at cactus.dk (Gustav Brock) Date: Wed, 27 Jun 2012 18:00:43 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil OK, I've got the code installed and it delivers to the console window, but I can see that I will not make any progress before I have studied that blog (below). Also, NUnit is installed but I haven't used testing before, and the guide seems to contain code for old versions, not the current version. Further, the "Get started" guide opens with an example it claims is not very good ... very useful(?). So do you - or anyone - know of a good guide to unit testing and NUnit current version? /gustav >>> Salakhetdinov Shamil 24-06-12 17:49 >>> Hi Gustav -- Yes, it's interesting code reading/reviewing, and even more interesting/useful *isto debug/trace it using many provided samples/testing methods, although its latest version is converted to VS2012 and it does use MS testing framework. So I have had to downgrade it to VS2010 (removing some C# 5.0 async features) and to edit to make it using NUnit Framework. I have also got selected only the sources related to the MS Access backend. And it can be now unit-tested/debugged/traced under VS2010 + NUnit Framework 2.5.10. I can send the result "derivative" work off-line to the interested Access-D/dba-VB devs - and we may try to "code review" it here from time to time, and to exchange opinions...* I suppose such a "derivative work" lays within MS-PL? http://www.opensource.org/licenses/MS-PL Thank you. -- Shamil Sun, 24 Jun 2012 14:45:23 +0200 ?? "Gustav Brock" : Hi Shamil Thanks for this pointer. I noticed the blog which explains and documents it in full: LINQ: Building an IQueryable provider series http://blogs.msdn.com/mattwar/pages/linq-links.aspx Will have to study this a quiet(!?) day. /gustav >>> Salakhetdinov Shamil 24-06-12 13:35 >>> Hi Gustav -- I have also never attempted to do so (refer private fields/properties of another instance of the same class) - the subject coding technique is coming from here: http://iqtoolkit.codeplex.com/SourceControl/changeset/view/89802#2219382 It's in CompundKey.cs - CompoundKey class. It's also interesting to note that this class has one public constructor with param array public CompoundKey(params object[] values) and this constructor is also called when CompoundKey class is instantiated this way: CompoundKey key = new CompoundKey()* with paramarray object array initialized to an empty but not null array.* Thank you. -- Shamil Sun, 24 Jun 2012 11:09:02 +0200 ?? "Gustav Brock" : * ** ** Hi Shamil No I didn't. On the other hand, I've never attempted to do so. As you and most others, I use naming conventions to separate local variables and fields from public. /gustav From mcp2004 at mail.ru Thu Jun 28 04:22:08 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Thu, 28 Jun 2012 13:22:08 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340875328.529365979@f45.mail.ru> Hi Gustav -- I have replied to you yesterday here but my message didn't get through - it was waiting of this list moderators approval because of its length. So I have dropped it this afternoon and I'm trying to repost it split into two parts: ---- PART I ----- Hi Gustav -- 1. You can start immediately from tests you can find in: NorthwindTranslationTests.cs NorthwindExecutionTests.cs NorthwindCUDTests.cs For example delete all code from IQToolkit.Data.Access.Tests.Programs.cs.Main(...) method and put in it the following code lines: NorthwindTranslationTests o = new NorthwindTranslationTests(); NorthwindTranslationTests.Initialize(); o.TestWhere(); NorthwindTranslationTests.Cleanup(); (in fact you have that code lines there commented - just comment other stuff and uncomment the code lines as I've written above) Set breakpoint in TestWhere() test method public void TestWhere() { TestQuery(db.Customers.Where(c => c.City == "London")); } run (F5) and then you can drill-down into test helper code and IQToolKit sources usual way using VS' Step-Into (F11) debugging/tracing functionality etc. IOW you don't need to know anything about TDD to start investigating IQToolkit. Please don't make a "religious practice" from TDD (and don't be afraid you'll need a lengthy "religious preparations/introduction" to start using TDD") - TDD is only a development practice - and the way you'll apply it in your own context depends on your preferences (see below references on stuff to read about TDD practices while you can keep investigating IQToolkit sources usual "TDD-free" way) 2. Get and setup NUnit (any version) - in the sample project v. 2.5.10 is used. You can use the latest version but you'll have to change the reference in the test project. Download (all versions): http://www.nunit.org/index.php?p=download Getting Started (2.5.10): http://www.nunit.org/index.php?p=quickStart&r=2.5.10 3. Get & setup the VS add-in/tool from http://www.testdriven.net/ It's free for non-commercail use. When you'll get it installed (I assume you have already NUnut (any version installed)) you'll be able to right-click on any test method (marked with [Test] attribute) and run it getting test output in VS 'Output' window. You can even right-click on the test class (marked with [TestFixture]) attribute and you'll get all the test run and their output written into VS Output window - you can see such an output I have got by running whole test suites and putting all their output in the bottom of their code files,e g.: ------ Test started: Assembly: IQToolkit.Data.Access.Tests.exe ------ Test 'Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync' failed: Expected: True But was: False TestBase.cs(298,0): at Test.TestBase.AssertTrue(Boolean value) NorthwindCUDTests.cs(833,0): at Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync() ... 72 passed, 3 failed, 0 skipped, took 29.71 seconds (NUnit 2.5.5). ---- to be continued ---? Wed, 27 Jun 2012 18:00:43 +0200 ?? "Gustav Brock" : Hi Shamil OK, I've got the code installed and it delivers to the console window, but I can see that I will not make any progress before I have studied that blog (below). Also, NUnit is installed but I haven't used testing before, and the guide seems to contain code for old versions, not the current version. Further, the "Get started" guide opens with an example it claims is not very good ... very useful(?). So do you - or anyone - know of a good guide to unit testing and NUnit current version? /gustav <<< skipped >>> From mcp2004 at mail.ru Thu Jun 28 04:26:06 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Thu, 28 Jun 2012 13:26:06 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340875566.3239828@f73.mail.ru> Hi Gustav -- Here is: ---- PART II ---- 4. Get the best IMO guide to TDD - a book: "Test Driven Development: By Example" by Kent Beck http://www.amazon.com/Test-Driven-Development-By-Example/dp/0321146530 Part I: The Money Example It has Java example. But while reading it you can make C# equivalent (I have done something like that in the past) - and you'll get a real practical experience in doing TDD, and you'll see how it works... 5. Read this blog entry: Programming like Kent Beck http://blog.iterate.no/2012/06/20/programming-like-kent-beck/ and then 6. Read this blog - a bit academic but the best IMO critique on TDD coming from a very experienced developer and excellent blog writer Carlo Pescio. Full throttle http://www.carlopescio.com/2005/10/full-throttle.html (read comments - just the ones in English) On Kent Beck's Responsive Design http://www.carlopescio.com/2010/07/on-kent-becks-responsive-design.html ------ TDD and "unit" tests one creates by applying TDD in their own development context is a "battle-field design tool" as well as a "safety net" and the size of that net meshes depends on a developer/development team experiences, preferences, current development context (size of project, deadlines, budget,...)... Thank you. -- Shamil Wed, 27 Jun 2012 18:00:43 +0200 ?? "Gustav Brock" : Hi Shamil OK, I've got the code installed and it delivers to the console window, but I can see that I will not make any progress before I have studied that blog (below). Also, NUnit is installed but I haven't used testing before, and the guide seems to contain code for old versions, not the current version. Further, the "Get started" guide opens with an example it claims is not very good ... very useful(?). So do you - or anyone - know of a good guide to unit testing and NUnit current version? /gustav <<< skipped >>> From gustav at cactus.dk Thu Jun 28 06:29:56 2012 From: gustav at cactus.dk (Gustav Brock) Date: Thu, 28 Jun 2012 13:29:56 +0200 Subject: [dba-VB] C#: Did you know - private fields ... Message-ID: Hi Shamil That's very kind of you! Once again you can keep me busy for days. Indeed, TestDriven.Net seems what I was looking for without knowing it. /gustav >>> Salakhetdinov Shamil 28-06-12 11:22 >>> Hi Gustav -- I have replied to you yesterday here but my message didn't get through - it was waiting of this list moderators approval because of its length. So I have dropped it this afternoon and I'm trying to repost it split into two parts: ---- PART I ----- Hi Gustav -- 1. You can start immediately from tests you can find in: NorthwindTranslationTests.cs NorthwindExecutionTests.cs NorthwindCUDTests.cs For example delete all code from IQToolkit.Data.Access.Tests.Programs.cs.Main(...) method and put in it the following code lines: NorthwindTranslationTests o = new NorthwindTranslationTests(); NorthwindTranslationTests.Initialize(); o.TestWhere(); NorthwindTranslationTests.Cleanup(); (in fact you have that code lines there commented - just comment other stuff and uncomment the code lines as I've written above) Set breakpoint in TestWhere() test method public void TestWhere() { TestQuery(db.Customers.Where(c => c.City == "London")); } run (F5) and then you can drill-down into test helper code and IQToolKit sources usual way using VS' Step-Into (F11) debugging/tracing functionality etc. IOW you don't need to know anything about TDD to start investigating IQToolkit. Please don't make a "religious practice" from TDD (and don't be afraid you'll need a lengthy "religious preparations/introduction" to start using TDD") - TDD is only a development practice - and the way you'll apply it in your own context depends on your preferences (see below references on stuff to read about TDD practices while you can keep investigating IQToolkit sources usual "TDD-free" way) 2. Get and setup NUnit (any version) - in the sample project v. 2.5.10 is used. You can use the latest version but you'll have to change the reference in the test project. Download (all versions): http://www.nunit.org/index.php?p=download Getting Started (2.5.10): http://www.nunit.org/index.php?p=quickStart&r=2.5.10 3. Get & setup the VS add-in/tool from http://www.testdriven.net/ It's free for non-commercail use. When you'll get it installed (I assume you have already NUnut (any version installed)) you'll be able to right-click on any test method (marked with [Test] attribute) and run it getting test output in VS 'Output' window. You can even right-click on the test class (marked with [TestFixture]) attribute and you'll get all the test run and their output written into VS Output window - you can see such an output I have got by running whole test suites and putting all their output in the bottom of their code files,e g.: ------ Test started: Assembly: IQToolkit.Data.Access.Tests.exe ------ Test 'Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync' failed: Expected: True But was: False TestBase.cs(298,0): at Test.TestBase.AssertTrue(Boolean value) NorthwindCUDTests.cs(833,0): at Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync() ... 72 passed, 3 failed, 0 skipped, took 29.71 seconds (NUnit 2.5.5). ---- to be continued ---* Wed, 27 Jun 2012 18:00:43 +0200 ?? "Gustav Brock" : Hi Shamil OK, I've got the code installed and it delivers to the console window, but I can see that I will not make any progress before I have studied that blog (below). Also, NUnit is installed but I haven't used testing before, and the guide seems to contain code for old versions, not the current version. Further, the "Get started" guide opens with an example it claims is not very good ... very useful(?). So do you - or anyone - know of a good guide to unit testing and NUnit current version? /gustav <<< skipped >>> _______________________________________________ dba-VB mailing list dba-VB at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-vb http://www.databaseadvisors.com From mcp2004 at mail.ru Thu Jun 28 12:01:40 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Thu, 28 Jun 2012 21:01:40 +0400 Subject: [dba-VB] =?utf-8?q?C=23=3A_Did_you_know_-_private_fields_=2E=2E?= =?utf-8?q?=2E?= In-Reply-To: References: Message-ID: <1340902900.978772212@f86.mail.ru> Hi Gustav -- My pleasure! :) -- Shamil Thu, 28 Jun 2012 13:29:56 +0200 ?? "Gustav Brock" : Hi Shamil That's very kind of you! Once again you can keep me busy for days. Indeed, TestDriven.Net seems what I was looking for without knowing it. /gustav >>> Salakhetdinov Shamil 28-06-12 11:22 >>> Hi Gustav -- I have replied to you yesterday here but my message didn't get through - it was waiting of this list moderators approval because of its length. So I have dropped it this afternoon and I'm trying to repost it split into two parts: ---- PART I ----- Hi Gustav -- 1. You can start immediately from tests you can find in: NorthwindTranslationTests.cs NorthwindExecutionTests.cs NorthwindCUDTests.cs For example delete all code from IQToolkit.Data.Access.Tests.Programs.cs.Main(...) method and put in it the following code lines: NorthwindTranslationTests o = new NorthwindTranslationTests(); NorthwindTranslationTests.Initialize(); o.TestWhere(); NorthwindTranslationTests.Cleanup(); (in fact you have that code lines there commented - just comment other stuff and uncomment the code lines as I've written above) Set breakpoint in TestWhere() test method public void TestWhere() { TestQuery(db.Customers.Where(c => c.City == "London")); } run (F5) and then you can drill-down into test helper code and IQToolKit sources usual way using VS' Step-Into (F11) debugging/tracing functionality etc. IOW you don't need to know anything about TDD to start investigating IQToolkit. Please don't make a "religious practice" from TDD (and don't be afraid you'll need a lengthy "religious preparations/introduction" to start using TDD") - TDD is only a development practice - and the way you'll apply it in your own context depends on your preferences (see below references on stuff to read about TDD practices while you can keep investigating IQToolkit sources usual "TDD-free" way) 2. Get and setup NUnit (any version) - in the sample project v. 2.5.10 is used. You can use the latest version but you'll have to change the reference in the test project. Download (all versions): http://www.nunit.org/index.php?p=download Getting Started (2.5.10): http://www.nunit.org/index.php?p=quickStart&r=2.5.10 3. Get & setup the VS add-in/tool from http://www.testdriven.net/ ?It's free for non-commercail use. When you'll get it installed (I assume you have already NUnut (any version installed)) you'll be able to right-click on any test method (marked with [Test] attribute) and run it getting test output in VS 'Output' window. You can even right-click on the test class (marked with [TestFixture]) attribute and you'll get all the test run and their output written into VS Output window - you can see such an output I have got by running whole test suites and putting all their output in the bottom of their code files,e g.: ------ Test started: Assembly: IQToolkit.Data.Access.Tests.exe ------ Test 'Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync' failed: ?Expected: True But was: False TestBase.cs(298,0): at Test.TestBase.AssertTrue(Boolean value) NorthwindCUDTests.cs(833,0): at Test.NorthwindCUDTests.TestBatchUpsertNewCustomersNoResultAsync() ... 72 passed, 3 failed, 0 skipped, took 29.71 seconds (NUnit 2.5.5). ---- to be continued ---* Wed, 27 Jun 2012 18:00:43 +0200 ?? "Gustav Brock" : ? ?? ?? Hi Shamil OK, I've got the code installed and it delivers to the console window, but I can see that I will not make any progress before I have studied that blog (below). Also, NUnit is installed but I haven't used testing before, and the guide seems to contain code for old versions, not the current version. Further, the "Get started" guide opens with an example it claims is not very good ... very useful(?). So do you - or anyone - know of a good guide to unit testing and NUnit current version? /gustav <<< skipped >>> _______________________________________________ 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 mcp2004 at mail.ru Sat Jun 30 06:27:50 2012 From: mcp2004 at mail.ru (=?UTF-8?B?U2FsYWtoZXRkaW5vdiBTaGFtaWw=?=) Date: Sat, 30 Jun 2012 15:27:50 +0400 Subject: [dba-VB] =?utf-8?q?FYI=3A_Finger_tree_in_C=23_-__Efficiency=2C_un?= =?utf-8?q?iversality=2C_simplicity_and_lazyness=2E=2E=2E?= Message-ID: <1341055670.55117378@f266.mail.ru> Hi All -- FYI:?The Swiss Army Knife of Data Structures ? in?C# http://dnovatchev.wordpress.com/2008/07/20/the-swiss-army-knife-of-data-structures-in-c/Thank you. -- Shamil?