Redirecting StandardOutput
Sometimes it is necessary for a main program to invoke other executables during runtime. Continue reading ‘Redirecting StandardOutput’ »
Posts tagged ‘C Sharp (C#)’
Sometimes it is necessary for a main program to invoke other executables during runtime. Continue reading ‘Redirecting StandardOutput’ »
Download readfileviareflection.zip
In .Net, an XML file or even a CSV file can easily be mapped to an object using proper attributes. Using the reflected object type, such XML or CSV files can easily be deserialized into the corresponding object. Continue reading ‘Populating Object from Text Files via Reflection’ »
If you have used System.IO.File.Exists in ASP.Net, you probably have found out that unless the account under which ASP.Net is running (e.g. ASPNET for Windows XP and IIS_WPG for Windows 2003 Server, etc) has access to a networked location (either a unc or a mapped drive, File.Exists will always return a false no matter whether the file actually exists in the location queried or not. This behavior has caused a lot of headaches for Web developers. Continue reading ‘File.Exists and UNC’ »
In a post (Hyper-Threading and Dual Core Performance Comparison for Computational Intensive Applications) I wrote at the end of last year, I compared multi-threaded scientific application performance of a Pentium 4 processor with hyper-threading enabled and a Pentium D processor, and concluded that for multi-threaded scientific applications, hyper-threaded processor helped little in terms of application performance. Continue reading ‘Hyper-Threading and Dual Core Performance Comparison for Computational Intensive Applications – Update’ »
Today I was discussing how to convert date strings MMddyyyy (e.g. 03282007) or ddMMyyyy (e.g. 28032007) back to DateTime object. Continue reading ‘Parsing MMddyyyy or ddMMyyyy Date Format’ »
In production environment, it is not always possible to step through the compiled code using a debugger and thus we rely on error logs to provide insights into the potential causes of bugs. Continue reading ‘ToString() and Error Logging’ »
A couple of days ago, I ran into a mysterious problem when trying to build a web project using MSBuild. Continue reading ‘Understanding “Error MSB6006″ in MSBuild’ »
Background
In .Net, distributed computing can be done in a number of ways. Continue reading ‘Remote Code Execution via Reflection’ »
In many applications, it is often required to generate one time passwords. Continue reading ‘One Time Password Generation’ »
I got a request from my client a couple of weeks ago. For simplicity reasons, I will present it as follows. Continue reading ‘Auto Sizing RichTextBox Based on Content’ »
A few weeks back, I ran into some issues related to tab stops for certain controls on a windows form not behaving as expected (e.g. a TabStop is set to false but the tab seems to still be trapped in the control somewhere). Continue reading ‘Debugging Tabbing Issues with Spy++’ »
Converting from floating point numbers (e.g. double, single) to integers can be tricky. Continue reading ‘Watch Out for Number Conversion Errors’ »
Download UniquePermutation.zip The numbers of permutations on a set of n elements is n! (see definition). Continue reading ‘Generating Unique Permutations Programmatically’ »
Download Trie.zip Trie is a tree like data structure that can be used for fast text search. Continue reading ‘Implementing a Trie in C#’ »
In my post a week ago, I mentioned three ways to reverse a string. OK, I really meant three alternative ways to reverse a string. Continue reading ‘Three Ways to Reverse a String in C# – Update’ »