selfanswer

VB.Net function that returns string only returns single character

The other day I was working on project, and ran into a weird bug. I called a function, and it was only returning the first character from the string which it should have been returning. After trying a hundred different things, refactoring my code, stepping through the code in the debugger many times, and even having a co-worker look into...

Why does my MFC app hang when I throw an exception?

If you throw an exception from inside an MFC dialog, the app hangs, even if you have a catch block in your code. It refuses to respond to the mouse or keyboard, and the only way to shut it down is to use Task Manager. Why I'm posting this question To my shame, there is a popular shrink-wrapped application that hangs every time it enc...

How to close a formless C# application

My application has no forms. It runs by calling Application.Run(); ...

Mantis Roadmap Feature

How do I enable and use the Roadmap feature in the Mantis bugtracker? I am answering this myself and I hope it will be useful to other Mantis users. Here is a discussion on the same topic. Update: As an example, here is the Mantis Roadmap for Mantis itself. ...

How do generics (Vector) work inside the AVM?

Support for generics (currently only Vector.<*>, and called 'postfix type parameters' by Adobe) was added in Flash Player 10, but the only AVM2 documentation does not describe how these objects are accessed. Specifically, I noticed a new opcode (0x53) and a new multiname kind (0x1D) that seem relevant, but their usage is not documented....

How can you make images resized with css look good in IE?

IE6 and IE7 don't scale images nicely in web pages when the images are scaled with css width/height or attribute width/height. I am not sure which algorithm it uses by default, but it's not good. Scaled images display aliasing artifacts when scaled in these browsers. ...

Should I use unsigned integers for count members?

I just spent an hour tracking an integer overflow in my code, so I decided to share that -most people on here will know that of course, but perhaps I can save someone some time. So, here's the question: Should I use unsigned integers for my count class members? Answer For example, assume a class TList <T> = class private FCount : C...

Xcode: Running a script before every build that modifies source code directly

What I did: I have a script that Read some configuration files to generate source code snippets Find relevant Objective-C source files and Replace some portions of the source code with the generated code in step 1. and a Makefile that has a special timestamp file as a make target and the configuration files as target sources: SRC =...

"fatal error U1087: cannot have : and :: dependents for same target"

Using the Microsoft Driver Development Kit (DDK), this error plagued me as I attempted even to build the default drivers included with the DDK. I had a some difficulty in tracking down the cause and solution through Google. In an effort to aid others who may experience this same problem, I am documenting it here. Error: "fatal error U...

Cannot set InetMgr.exe as startup program in VS 2008 on Windows 7

When I try to set "C:\windows\System32\inetsrv\InetMgr.exe" as the startup program for a Visual Studio project (to test an IIS 7.5 extension), it is rejected with the message "The external program cannot be found". If I try to select the EXE manually by clicking the ellipses (...) button, the EXE is not in the folder. But if I access th...

Why doesn't visual studio register environment variables set using windows explorer?

Hi, Newly created environment variables are not passed on to visual studio sometimes. What may be the problem? The environment variables are not visible to VS even when I close and restart it. This is an intermittent problem and thus hard to diagnose. ...

KindError on setting a ReferenceProperty value

This seemingly perfect Google App Engine code fails with a KindError. # in a django project 'stars' from google.appengine.ext import db class User(db.Model): pass class Picture(db.Model): user = db.ReferenceProperty(User) user = User() user.put() picture = Picture() picture.user = user # ===> KindError: Property user must be...

Blackberry - fields layout animation

It's easy to show some animation within one field - BitmapField or Screen: Blackberry - background image/animation RIM OS 4.5.0 But what if you need to move fields, not just images? Like this: May be used: game workflow functionality, like chess, puzzle etc application user-defined layout, like in Google gadgets enhance...

Blackberry - run menu item from dialer Phone App

I'd like to describe one trick I learned at supportforums.blackberry.com There is a native dialer Phone Application in blackberry: The trick is to programmatically run menu items of dialer after incoming call, call fail or any other call event. ...

xslt umbraco.library:FormatDateTime and the use of / (slash)

This may not be a real XSLT question but more of an Umbraco question. This function as written will output another format as expexted: <xsl:value-of select="umbraco.library:FormatDateTime(data [@alias = 'kursusgangTilmeldingsfrist'], 'dd/MM/yyyy')"/> When called with these three "second arguments" on the current date 'dd MM yyyy' 'd...

CompliationLock throws HttpException when registering areas for ASP.NET MVC unit tests

The moment I added a unit test to my ASP.NET MVC application to test some of the area routing, I got an HttpException coming out of the System.Web.Complication.CompilationLock type initializer with the following stack trace. System.Web.HttpException : The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception. ...

Sentence recognition and ability to answer with another sentence

Hi. I'm looking into sentence recognition to make a program that should play voice clips from the game Team Fortress 2. I have .wav files and text files containing the transcription for every sound. What I'd like to make is a system that makes two characters of the game talk to each other (trough playing sound clips), and each one recogn...

Writing a Bazaar plugin - register command?

Hi, I'm having a problem with writing my Bazaar plugin. I've been trying a few different things, and this is the current state of my file: ''' Testing Bzr plugins ''' from bzrlib.commands import Command, register_command version_info = (0,0,1, 'dev') ...