Click here to Skip to main content
12,632,477 members (32,710 online)

Articles by Andreas Gieriet (Articles: 8, Tip/Tricks: 23)

Articles: 8, Tip/Tricks: 23

RSS Feed

Average article rating: 4.86

C#
Beginners
Posted: 12 May 2012   Updated: 14 May 2012   Views: 23,288   Rating: 4.97/5    Votes: 17   Popularity: 6.12
Licence: The Code Project Open License (CPOL)      Bookmarked: 25   Downloaded: 0
Make floating point equality and relation operators reliable based on a comparison epsilon value.
Posted: 22 Apr 2012   Updated: 21 Aug 2012   Views: 415,861   Rating: 4.88/5    Votes: 55   Popularity: 8.50
Licence: The Code Project Open License (CPOL)      Bookmarked: 87   Downloaded: 0
Different possibilities to escape literals and names/keywords.
Utilities
Posted: 28 Oct 2010   Updated: 29 Oct 2010   Views: 22,184   Rating: 4.67/5    Votes: 14   Popularity: 5.35
Licence: The Code Project Open License (CPOL)      Bookmarked: 10   Downloaded: 0
Some useful RAII C# helper classes for functionality that does not implement IDisposable
LINQ
General
Posted: 28 Mar 2012   Updated: 14 Oct 2014   Views: 36,414   Rating: 4.95/5    Votes: 25   Popularity: 6.90
Licence: The MIT License      Bookmarked: 55   Downloaded: 229
This is an alternative for "Dynamically generate a LINQ query with a custom property".
Algorithms & Recipes
General
Posted: 20 Jun 2012   Updated: 20 Jun 2012   Views: 9,301   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
This is an alternative for "Converting Postfix Expressions to Infix"
Parsers
Posted: 26 Apr 2012   Updated: 26 Apr 2012   Views: 12,654   Rating: 4.93/5    Votes: 8   Popularity: 4.43
Licence: The Code Project Open License (CPOL)      Bookmarked: 15   Downloaded: 0
This is an alternative for "Mathematical Expression Parser Using Recursive Descent Parsing"
Programming Tips
General
Posted: 26 Sep 2010   Updated: 26 Sep 2010   Views: 19,352   Rating: 4.45/5    Votes: 7   Popularity: 3.80
Licence: The Code Project Open License (CPOL)      Bookmarked: 13   Downloaded: 143
.NET 4 finally allows to define polymorphic extension visitors
Testing and QA
General
Posted: 30 Jan 2012   Updated: 11 Mar 2012   Views: 9,072   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 121
How to define RelationAssert as an extension to the VisualStudio Assert class.
No blogs have been submitted.

Average tips rating: 4.85

C / C++ Language
General
Posted: 7 Feb 2012   Updated: 12 Feb 2012   Views: 16,563   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 7   Downloaded: 0
HTML page with all syntax/grammar productions of C++98/C++11
C#
Beginners
Posted: 1 Jun 2012   Updated: 1 Jun 2012   Views: 10,200   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
This is an alternative for "How to split an array into multiple arrays"
Posted: 12 Jan 2013   Updated: 12 Jan 2013   Views: 8,321   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
Short tip to show a convenient use of the lesser known xor operator
General
Posted: 3 Apr 2012   Updated: 9 Apr 2012   Views: 48,796   Rating: 4.96/5    Votes: 16   Popularity: 5.97
Licence: The Code Project Open License (CPOL)      Bookmarked: 31   Downloaded: 0
This is an alternative for "How to use the IEnumerable/IEnumerator interfaces"
Posted: 21 May 2012   Updated: 22 May 2012   Views: 20,076   Rating: 4.00/5    Votes: 3   Popularity: 1.91
Licence: The Code Project Open License (CPOL)      Bookmarked: 7   Downloaded: 0
How Linq extension methods benefit from interfaces inheriting from interfaces
Posted: 27 Jan 2013   Updated: 28 Jan 2013   Views: 13,752   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 8   Downloaded: 0
This is an alternative for "Sorting using C# Lists"
Generics
Posted: 23 Apr 2012   Updated: 23 Apr 2012   Views: 7,342   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
This is an alternative for "Converting InFix to PostFix using C#"
Utilities
Posted: 18 Jun 2015   Updated: 18 Jun 2015   Views: 2,493   Rating: 4.75/5    Votes: 3   Popularity: 2.23
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
A generic fluent implementation for a prioritized IComparer class
.NET Framework
General
Posted: 26 Feb 2012   Updated: 28 Feb 2012   Views: 11,671   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
Great analysis!I found out that Regex can be accelerated by a factor of about two.Instead of new Regex(@"\n", RegexOptions.Compiled|RegexOptions.Multiline);you can speed up by using:new Regex(@"^.*?$", RegexOptions.Compiled|RegexOptions.Multiline);But admittedly, nothing beats...
Algorithms & Recipes
General
Posted: 21 Dec 2010   Updated: 21 Dec 2010   Views: 3,320   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
For those who like dense code, here is a sample :) - Make the dictionary static readonly, init directly- Swap the arguments in the lambda expressions and call by direct pop from the stack- Make the regex simpler and put the logic of parsing into the Exec (the regex only tokenizes the...
Date and Time
General
Posted: 13 Mar 2012   Updated: 15 Mar 2012   Views: 6,390   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 4   Downloaded: 0
This is an alternative for "Partial DateTime Object Equality"
Programming Tips
General
Posted: 27 Dec 2010   Updated: 5 Jan 2011   Views: 8,854   Rating: 4.40/5    Votes: 4   Popularity: 2.65
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
This topic is also covered by the RAII topic as described in RAII (Resource Acquisition Is Initialization) C# Helper Classes[^].Applying the RAII pattern results in more expressive code:using (new RAIIGuard(()=>owner.Cursor, c=>owner.Cursor = c)){ owner.Cursor =...
Posted: 15 Feb 2012   Updated: 15 Feb 2012   Views: 6,530   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
I think the following Regex and HtmlDecode would do:string html = ...;string textonly = HttpUtility.HtmlDecode( Regex.Replace(html, @"|", ""));Any HTML construct that would not be stripped off properly by this?
Posted: 24 Feb 2012   Updated: 25 Feb 2012   Views: 6,671   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
I prefer the [Conditional("DEBUG")] attribute over #if DEBUG.This is especially advised for your logging example.E.g.[System.Diagnostics.Conditional("DEBUG")]private void Validate() { /* check instance integrity */ }or[System.Diagnostics.Conditional("DEBUG")]public static...
Posted: 14 Jun 2012   Updated: 14 Jun 2012   Views: 5,670   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
This is an alternative for "How to Toggle String Case in .NET"
Posted: 19 Jun 2012   Updated: 19 Jun 2012   Views: 5,760   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 3   Downloaded: 0
This is an alternative for "Call Functions Until One Meets Condition"
Testing and Quality Assurance
Posted: 18 Apr 2012   Updated: 14 Apr 2013   Views: 31,885   Rating: 4.97/5    Votes: 13   Popularity: 5.57
Licence: The Code Project Open License (CPOL)      Bookmarked: 18   Downloaded: 0
Make loops behave deterministic-by-construction
String handling
General
Posted: 13 Feb 2012   Updated: 14 Feb 2012   Views: 10,792   Rating: 4.50/5    Votes: 4   Popularity: 3.01
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
A "single-liner" to decode quoted-printable data.
Posted: 20 Feb 2012   Updated: 20 Feb 2012   Views: 5,170   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
How about transforming first into a Regex and then letting the Regex do the work? E.g.:public static Regex GetRegex(string wildcard){ string pattern = Regex.Replace(wildcard, @"([^?*]+)?([?*])?", m => Regex.Escape(m.Groups[1].Value) +...
Posted: 24 Feb 2012   Updated: 24 Feb 2012   Views: 4,980   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
This alternative is not substantially different, it simply splits the function into two:one for clippingone for comparingpublic static string ExtClipRight(this string a, int n){ return (n < 0 || a.Length <= n) ? a : a.Substring(0, n);}...public static bool...
Posted: 5 Jun 2012   Updated: 5 Jun 2012   Views: 9,071   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 7   Downloaded: 0
This is an alternative for "Sorting Strings based on the position of the block letter"
Threads, Processes & IPC
Multi-threading
Posted: 30 Apr 2012   Updated: 4 Dec 2013   Views: 34,514   Rating: 4.83/5    Votes: 4   Popularity: 2.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 7   Downloaded: 0
Wrapping Interlocked.Exchange to mimic a thread safe one-shot bool flag
Debug Tips
General
Posted: 25 Feb 2012   Updated: 25 Feb 2012   Views: 3,250   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
To not having spoiled the client code with #if DEBUG, you might use the following:[STAThread]static void Main(){ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Debugging.DebugSetupConsole(); ...
No reference articles have been posted.

Andreas Gieriet
Founder eXternSoft GmbH
Switzerland Switzerland
I feel comfortable on a variety of systems (UNIX, Windows, cross-compiled embedded systems, etc.) in a variety of languages, environments, and tools.
I have a particular affinity to computer language analysis, testing, as well as quality management.

More information about what I do for a living can be found at my LinkedIn Profile and on my company's web page (German only).


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 9 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid