Click here to Skip to main content
12,952,792 members (35,976 online)

Articles by George Swan (Articles: 8, Tip/Tricks: 18)

Articles: 8, Tip/Tricks: 18

RSS Feed

Average article rating: 4.87

ASP.NET
General
Posted: 20 May 2016   Updated: 25 Sep 2016   Views: 17,312   Rating: 4.91/5    Votes: 40   Popularity: 7.86
Licence: The Code Project Open License (CPOL)      Bookmarked: 86   Downloaded: 363
How to use the async/await keywords in .Net4.5
NoSQL
General
Posted: 9 Jan 2013   Updated: 9 Jan 2013   Views: 110,197   Rating: 4.95/5    Votes: 33   Popularity: 7.52
Licence: The Code Project Open License (CPOL)      Bookmarked: 68   Downloaded: 2,902
Highlights the latest developments in both the Mongo open-source document database and the open-source official C# driver.
Posted: 6 Jan 2016   Updated: 6 Jan 2016   Views: 12,387   Rating: 4.76/5    Votes: 9   Popularity: 4.58
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 339
An introduction to Graph Databases
Windows Presentation Foundation
Templates
Posted: 18 Feb 2011   Updated: 18 Feb 2011   Views: 22,283   Rating: 4.83/5    Votes: 5   Popularity: 3.36
Licence: The Code Project Open License (CPOL)      Bookmarked: 27   Downloaded: 1,297
This article explorers how to use WPF’s document viewing and printing classes to inspect, scale, and output mail merge letters produced from a XAML based template.
Utilities
Posted: 29 Sep 2014   Updated: 29 Sep 2014   Views: 16,607   Rating: 4.89/5    Votes: 7   Popularity: 4.23
Licence: The Code Project Open License (CPOL)      Bookmarked: 19   Downloaded: 625
This article discusses how to use the Ninject and Prism frameworks to produce a loosely-coupled modular WPF Application.
Algorithms & Recipes
Algorithms
Posted: 6 Sep 2016   Updated: 6 Sep 2016   Views: 6,210   Rating: 5.00/5    Votes: 14   Popularity: 5.73
Licence: The Code Project Open License (CPOL)      Bookmarked: 11   Downloaded: 352
An articial life algorithm that attempts to solve a problem by flying a swarm of entities through a range of possible solutions where each entity is guided by the performance of other members of the swarm
Parallel Programming
Reactive Extensions for .NET (Rx)
Posted: 29 May 2014   Updated: 2 Jun 2014   Views: 15,623   Rating: 4.69/5    Votes: 6   Popularity: 3.65
Licence: The Code Project Open License (CPOL)      Bookmarked: 24   Downloaded: 157
An alternative to Observer Pattern (C#).
Raspberry Pi
General
Posted: 4 Feb 2017   Updated: 6 Feb 2017   Views: 10,965   Rating: 4.95/5    Votes: 4   Popularity: 2.96
Licence: The Code Project Open License (CPOL)      Bookmarked: 26   Downloaded: 172
How to set up a two-way interface between a remote browser-enabled device and a Raspberry Pi.
No blogs have been submitted.

Average tips rating: 4.72

C#
Date / Time
Posted: 23 Feb 2016   Updated: 24 Feb 2016   Views: 4,971   Rating: 4.50/5    Votes: 4   Popularity: 2.41
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
This is an alternative for "Get a list of Dates for the Nth Desired Day of Week in a Month for a range of dates"
XML
General
Posted: 24 Aug 2011   Updated: 24 Aug 2011   Views: 7,885   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Can't you do the same thing without the need for a select statement?XElement xElement = XElement.Load(path);xElement.Elements ("Node").Remove();xElement.Save(path);
.NET Framework
General
Posted: 11 Jan 2012   Updated: 11 Jan 2012   Views: 4,220   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
How about using the extension method: return s.Count(c => (c == '\n'));
LINQ
General
Posted: 22 Oct 2011   Updated: 22 Oct 2011   Views: 8,985   Rating: 4.38/5    Votes: 5   Popularity: 2.62
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Isn't it possible to remove the from and select statements by using a lambda expression?var bestStudents=students.Where(s=>s.Grade>9);
Win32/64 SDK & OS
General
Posted: 19 Nov 2011   Updated: 19 Nov 2011   Views: 4,591   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
I prefer alternative 3 but this option may save time if multiple files are to be deleted.Disk Cleanup will remove all files stored in a folder named Windows.old in the drive's root if the option Remove Previous Versions of Windows is selected.Create a directory named Windows.old in the...
Algorithms & Recipes
Parsers
Posted: 30 Mar 2013   Updated: 31 Mar 2013   Views: 16,370   Rating: 4.94/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
An easy way to read CSV files.
Date and Time
General
Posted: 11 Nov 2011   Updated: 11 Nov 2011   Views: 4,171   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Is it easier to start from the next targeted day? Subtract that date from the end date. If the result is negative, return 0 otherwise return the quotient of the difference in days between the two dates divided by 7 plus 1.public static int findWeekCount(DateTime startDate, DateTime toDate,...
Programming Tips
General
Posted: 13 Feb 2011   Updated: 13 Feb 2011   Views: 3,751   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
You can use Linq to do the same thing double[] mydouble = str.Split('#').Select(x => double.Parse(x)).ToArray();
Posted: 28 Jun 2011   Updated: 28 Jun 2011   Views: 6,891   Rating: 4.17/5    Votes: 3   Popularity: 2.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Couldn't the class RegEdit be replaced by one simple method?private void SetKey(bool enableTaskManager) { using ( var mKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System")) {...
Posted: 12 Sep 2011   Updated: 12 Sep 2011   Views: 4,503   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
The following method starts by selecting the number 2 and eliminates each multiple of 2 up to N. Then the next valid number is selected and each multiple of it is eliminated. The process is repeated until all valid numbers have been tested. So the first three multiples to be eliminated are...
Posted: 4 Oct 2011   Updated: 4 Oct 2011   Views: 6,652   Rating: 4.71/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Recursion is a neat way of calculating a number's factorial but there is a danger of the stack overflowing when the number is large. The following is a simplified version of the original. It obviates the need for the if else statements within the where loop.int Factorial(int input){ int...
Posted: 18 Oct 2011   Updated: 18 Oct 2011   Views: 4,551   Rating: 5.00/5    Votes: 7   Popularity: 4.23
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
The Regex method uses comma, full stop, hyphen, and apostrophe as word separators. The problem with this is that these characters are not universally used as separators. The hyphen is used to join two words. Could I suggest the following?string input = "Mr O'Brien-Smith arrived at 8.30 and...
String handling
General
Posted: 15 Jun 2011   Updated: 15 Jun 2011   Views: 4,653   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
As it stands, the TryParse method will fail if the string contains commas. E.g., 10,000. To get around this, you can use:bool isnumber=int.TryParse(text,System.Globalization.NumberStyles.Integer | System.Globalization.NumberStyles.AllowThousands, ...
Posted: 30 Jun 2011   Updated: 30 Jun 2011   Views: 3,883   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
You can use the Aggregate method with a StringBuilder. I've modified Eric's alternative in order to save a bit of code. Only one return statement is needed as an empty StringBuilder returns an empty string.public static string Join(this IEnumerable parts, string separator) { ...
Posted: 3 Nov 2011   Updated: 3 Nov 2011   Views: 5,902   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Can't this be done with a simple for loop followed by a single if statement?for(int i=0;i<characters.Length-1;i+=2){ output.Append(characters[i+1]); output.Append(characters[i]);}if (characters.Length % 2 == 1) output.Append(characters[characters.Length - 1]);
Strings
Posted: 3 Feb 2013   Updated: 3 Feb 2013   Views: 7,891   Rating: 0.00/5    Votes:    Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
This is an alternative for "Dictionary.BestMatch"
Testing and QA
UI Testing
Posted: 3 Jan 2016   Updated: 3 Jan 2016   Views: 3,693   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
How to replace the System.Timer with a mock object when testing
Hardware & System
General
Posted: 15 Oct 2011   Updated: 15 Oct 2011   Views: 6,534   Rating: 4.00/5    Votes: 5   Popularity: 3.32
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
The tcpEndPoints array has duplicates and members outside the required range. It may be better to restrict the array members to the required range, sort them, and remove the duplicates. The first free port can then be found by finding the first non-sequential value.using...
No reference articles have been posted.

George Swan
Student
Wales Wales
No Biography provided


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 27 May 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid