votes
Optimized algorithm runs slower than original
I'm writing a fractal explorer app. The original mandelbrot test func is: [code] public static Complex MandelbrotTest(Complex C) { int iter = 0; double CI = C.Imag; double tr; ...
blah blah blah is here! blah blah » Close
I'm writing a fractal explorer app. The original mandelbrot test func is: [code] public static Complex MandelbrotTest(Complex C) { int iter = 0; double CI = C.Imag; double tr; ...
I've wasted too much time trying to chase down this very strange bug. Simply put, if I say, for example, double a = 1.3; double b = 4.5; double c = a - b; then the result for c will be -3.2. We all know that despite whatever bla ...
I'm just learning how to generate IL code but I keep getting the error "operation could destabilize the runtime." when I call my dynamicmethod. I thought I was doing something wrong with the code, so I generated a sample method ...
I'm working on my first custom control and I want it to redraw the control when the forecolor/backcolor properties are changed. Currently my code looks like: [code] public override Color ForeColor { get { re ...
I have a simple method used for benchmarking: [code] double Ceil(double p) { return Math.Ceil(p); } [/code] and two ways of indirectly accessing it. For the following code, let's assume that "method" is a MethodInfo po ...
I'm trying to find the smallest rectangle that can contain a GDI+ region. But when I say: Graphics WinGrx = Graphics.FromHdc(WinDC); RgnBox = WinRgn.GetBounds(WinGrx); The rectangle it returns is always the rectangle that defines th ...
I have a program that processes a big chunk of data and I want to make use of multiple cores so it tells one core to process one half and the other to process the other half. I couldn't figure out how to pass the data back after processing ...
I have a form and when I say Form1.Top = x; it's not moving. There isn't an error or anything, it just doesn't move. The form is borderless and maximized, but that's never cause problems before. Stepping through the code, I call Form1. ...
So I have a custom control (ok, a class with a picturebox) and I'm drawing to a bufferedgraphics, which is then rendered in the Paint event, or after I draw to it. The issue I'm having is that it works fine when I interact with it, but whe ...
My app relies on a direct3d window which spends most of its time hidden in the background. If I leave it in the background long enough (say, 3 minutes) dwm seems to decide it's not important anymore. Because when I show the window, I noti ...
Threads! They are so frustrating. They are like spoiled children. Especially in VS 2008 where the compiler, like a wicked stepmother, keeps you locked in your thread and doesn't let you play with any of the other threads. My app has got ...
I'm sure my subject line sounded pretty vague. What I'm trying to do is create variables of a type not known until run time. I have an abstract class... <pre> public abstract Class BaseClass { public abstract void Method1(Base ...
This function: <pre> public static Complex operator /(Complex LVal, Complex RVal) { double mod = RVal.Real * RVal.Real + RVal.Imag * RVal.Imag; //(ac + bd) / mod, (bc - ad) / mod ...
My thread is modifying a variable it doesn't have access to before it even starts, and breaking with an error even though it's created inside a try/catch block! But it doesn't do it when I step through the program! Simply put, I have an a ...
So my direct3d app goes invisible when not in use. It pops up on command, shows its graphics and they are nice and smooth, then goes away when you're done. But if you wait more than a minute or so between calls, it will be real jittery fo ...