Alois Kraus

blog

  Home  |   Contact  |   Syndication    |   Login
  104 Posts | 8 Stories | 292 Comments | 162 Trackbacks

News



Article Categories

Archives

Post Categories

Image Galleries

Programming

General C# Programming

Strong naming has always been a complicated matter. Sometimes it is even impossible when you get unsigned assemblies from a third party software vendor and you have to build strong named assemblies to install them into the GAC. When you decide to strong name your project it is a all or nothing decision. If your target is strong named then all references must also be strong named. If you do not have the source code and a project for your third party dll you will not be able to sign your project. I ......

All good things have to end even your perfectly working managed executable. But do you know in what circumstances the CLR will terminate your program and much more importantly when do you have a chance to run some finalizers and shutdown code? As always in live it depends. Lets have a look at the reasons why program execution can be terminated.Ways to terminate an application: The last foreground thread of an application ends. The thread which entered the Main function is usually the only foreground ......

.cf { font-family: courier new; font-size: 10pt; color: black; background: white; } .cl { margin: 0px; } .cb1 { color: blue; } .cb2 { color: teal; } Singletons are the easiest programming pattern to learn which seems to be the reason why it is often used in places where it is inappropriate. They are very straightforward to implement and understand. Just create a static field and return the static instance in a public get property. A Logger Singleton is a classic example of this pattern: public class ......

Rules are meant to be bro.. ahem expanded. Especially if everybody tells you not to do so ;-). The Assembly Loader Rules are for example a very strict set of rules. One rule of the loader is that you cannot load assemblies from directories above the directory where the executable is located. This can cause some headaches if you want to share some assemblies across applications which are not installed inside the GAC. You can bypass this restriction by using Assembly.LoadFrom. A very good article ......

After reading Mike Stalls Debugging Blog I was wondering if it is really impossible to pass property values by reference: void PassIntByRef(ref int x) ... PassIntByRef(ref MyProperty); <-- this is illegal in C#.Another restriction which is often annoying is that you cannot have property delegates. class PropertyDelegation { public delegate int ReturnValueDelegate(); ReturnValueDelegate ValueGetter; int x = 0; public int X // This is our beloved property we care so much about. { get { return x; ......

Ron Garet did write about his personal experiences at NASAs JPL and how Lisp did perform in outer world (deep space) AI robotic projects. He was kinda disappointed by the way Lisp was abandoned in favor of C and Java because of C-Lisp integration problems. I think it would be interesting to have a look at todays programming languages and their possible future.The programming languages differ in many aspects such as Used Programming Paradigm Standard Libraries SyntaxToday the most widely used languages ......

This time I wanted to write something about the .NET Framework that is solved not optimal of the .NET Framework. My unsuspecting victim is the well known System.Diagnostics.Trace class. Static classes have the big plus that they are easy to use but they can be very hard to maintain if you want to extend it (no derivation) and have a lifetime problem with the objects that are created inside it. The Trace facade is in my opinion a prominent example of how you should not design a reliable static facade ......

After all this hype around C# 3.0 where we will get .cf { font-family: Courier New; font-size: 10pt; color: black; background: white; } .cl { margin: 0px; } .cb1 { color: blue; } .cb2 { color: teal; } .cb3 { color: maroon; } .cb4 { color: green; } LINQ, lambda expressions and many other thing I thought that it would be useful to have a deeper look at functional programming languages like F#. At Microsoft quite many people are fond of the Functional Programming style which did influence the design ......

Just recently I found a very good post how to create your own live demo video with Windows Media Encoder. John Howard did put on his blog a useful post about the preferred settings for a good encoding experience. The main thing is to get the small videos of your computer screen is that you need to set as resolution 800x600 and 16 bit color depth. This is also a very good choice if you want to share your video in a meeting room with a beamer since most of them do not support more than 800x600. After ......

We want a good performing application but it is hard to get it right. We all know how to format strings in a fast and efficient way don't we? Let me challenge you if anybody can beat my lightning fast fixed string formatting function. The rules are easy: We want to format the content of DateTime structure into a string of the form: "08:44:45.423" The performance measured is the time needed to return the formatted string when the DateTime structure is as input given. .NET 2.0 and C# only. For starters ......

Full General C# Programming Archive