Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » random .net   (RSS)

RTS Battle simulation with IronPython

I used Python to simulate Age of Empires archer battles. I wanted to be able to answer questions like: If 12 archers attack 10 archers, what will the margin of victory be? If two armies of the same size attack each other, how do different strategies affect
Posted by jmstall | 7 Comments
Filed under: , ,

Attachment(s): sim3.py

Why is System.Diagnostic.Debugger class compiled in retail?

There's a good reason that methods on a "System.Diagnostics.Debugger" class are still compiled in retail builds, although this occasionally surprises folks. Here's why... Background: The System.Diagnostics.Debugger class provides some useful low-level
Posted by jmstall | 0 Comments

Paradigms around Debugging Memory leaks

In native code, memory is explicitly managed by the program calling Malloc()/Free() (or comparable APIs). In managed code, there's a garbage collector (GC). A GC does not mean that you no longer get memory leaks . It just means that runtime calls Free()
Posted by jmstall | 2 Comments
Filed under:

Foreach codegen

Do you know how the following C# code compiles? foreach ( int i in c) { Console .WriteLine(i); } In addition to the obvious branching opcodes, this can also emit try/finally, a call to IDisposable, unboxing opcodes. It turns out it really depends on the
Posted by jmstall | 5 Comments
Filed under: ,

Setting transparency in an image

Just as Jackie Chan does his own stunts; I do my own image drawing. Some of my "art": (The yellow arrow here ). The shapes in my Silverlight 1.1 app : The astute observer probably noticed that all of my work is very primitive and done in MS Paint (yup,
Posted by jmstall | 7 Comments
Filed under: ,

Building and Debugging Powershell cmdlets in the VS IDE

Here's how you can get a sweet Visual Studio development experience for building and debugging your own PowerShell cmdlet: - It has Wizard support for initially creating the cmdlet, - intellisense - F5 build support which also registers your cmdlet -
Posted by jmstall | 7 Comments
Filed under:

Some tips for P/invoke

Here are some tips I've learned the hard way after wrapping some nasty things into managed code (including wrappers for the native debugging API and reading minidumps): Use resources like Pinvoke.net and Fxcop (which may have some useful marshalling checking
Posted by jmstall | 2 Comments
Filed under:
 
Page view tracker