runtime

How to programatically set or clear the 32BIT flag?

When compiling, I always set it for Any CPU. However there are some customers that do not have a 64 bit version of a required binary, even when running on an x64 system. In these instances I have asked them to modify my binary with the corflags.exe /32BIT+ option: http://msdn.microsoft.com/en-us/library/ms164699(VS.80).aspx I would lik...

How to determine main class at runtime in threaded java application?

I want to determine the class name where my application started, the one with the main() method, at runtime, but I'm in another thread and my stacktrace doesn't go all the way back to the original class. I've searched System properties and everything that ClassLoader has to offer and come up with nothing. Is this information just not a...

problem with loading a jar file which has dependency to another jar file

I have a problem while loading my jar file at run time. My hotel.jar is loaded and a method of it (makeReservation) is invoked using the following code: File file = new File("c:/ComponentFiles/hotel.jar"); URL jarfile = new URL("jar", "", "file:" + file.getAbsolutePath() + "!/"); URLClassLoader cl = URLClassLoader.newInstance(new URL[]{...

.NET on a locked down computer

Might seem like a bizarre request, but is there anyway to run .NET apps on a locked down machine without installing the runtime? If a set of my users is going to working on machines that are totally locked down, no .NET runtime and no way to install it, is there anyway to 'host' the runtime? I was thinking along the lines of portable u...

Python: changing methods and attributes at runtime

I wish to create a class in Python that I can add and remove attributes and methods. How can I acomplish that? Oh, and please don't ask why. ...

Decrease max stacksize at runtime in JAVA?

I'm attempting to write a junit test to guard against a piece of code getting stuck in a endless iteration which will eventually cause a StackOverflow. so i'm looking for a way to decrease the stack size at runtime so the Junittest will fail faster. setting the max stack as a jvm argument is not possible because the test is part of a m...

C#: Instantiate an object with a runtime-determined type

I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. I also need to perform an explicit cast to that type. Something like: static void castTest(myEnum val) { //Call a native function that returns a pointer to a structure IntPtr = someNativeFunction(..params..); //determi...

Flex : Filter operator not supported

<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Label id="lb" text="check" click="init1()"/> <mx:Script> <![CDATA[ public function init1():void { lb.text = this.width.toString().concat("-").concat.(this.height.toString()); ...

Setting value of instance variable dynamically

Hi all, I'm trying to set the value of an instance variable dynamically at runtime in Objective-C. Assume I have a class called stock which has an instance variable float price. I have the following code: stock* s; ...//initialisation etc float newPrice = 12.56; Ivar variable = class_getInstanceVariable(NSClassFromString(@"stock"), "pri...

Creating components at runtime - Delphi

Hi, how can I create a component at runtime and then work with it (changing properties, etc.)? ...

Adding files to java classpath at runtime.

Hi folks, Is it possible to add a file (not necessarily a jar file) to java classpath at runtime. Specifically, the file already is present in the classpath, what I want is whether I can add a modified copy of this file to the classpath. Thanks, ...

Extending or adding new classes at runtime in Java

Hello all, Is there a way to add (or extend existing) classes at runtime in java. I'm stuck on a problem, in which I have to extend an existing class at runtime and add this to the classpath, so that this new class get picked up. thanks, ...

How can I determine mySQL prepared statement result column names in PHP?

That is, with a prepared statement like: select col1,...coln from table where col3 = ? I believe I can use $mysqli->field_count to get the number of columns being returned (haven't tried). But is there a way to link each column name to the values returned in bind_results? I could always try to parse the column names out from the comm...

Unusual std::map runtime error

I'm hacking together an editor for a game I'm working on and as part of that editor, I need to have textures, obviously. I've created a std::map variable as so, std::map<std::string, unsigned int> textures; In my image loading code, I have the following snippet. unsigned int id; glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id)...

ASP.NET - Swap TextBoxes for Labels when Enabled=False

The setup: Web form with lots of TextBox controls. When I set any one of the TextBox control's Enabled property to False, I'd like to "swap" that TextBox out for a label at runtime. The idea here being if it's read only anyway, don't display it in a control designed for editing. I'm thinking this should be pretty simple and reusable, b...

Should I worry about redistributing .NET runtime with my application?

I would like to avoid redistributing .NET runtime if possible with my application since it will increase the size of the application, download time, development time & will possibly introduce many different deployment errors. Does Microsoft force users to update .NET runtime via Windows update? If not, what are some of the options to red...

Unable to understand a statement about compilers' optimization

I am interested in optimization at runtime by a VM and at compile-time. I have had the idea that optimizations are most efficient and easiest at compile-time. However, my thought seems to be false in certain circumstances. This is evident in Steve Yeggie's statement quoted by Daniel [O]ptimization is often easier when performed at r...

How to create a rounded rectangle at runtime in Windows Forms with VB.NET/C#?

Hello, I woud like to create a filled rounded rectangle at run-time and assign it as content of a PictureBox (already created and hidden) in Windows Forms. Do you have an idea how can I implement it? thank you in advance ...

Java reflection: How do I override or generate methods at runtime?

Hello! It is possible in plain Java to override a method of a class programmatically at runtime (or even create a new method)? I want to be able to do this even if I don't know the classes at compile time. What I mean exactly by overriding at runtime: abstract class MyClass{ public void myMethod(); } class Overrider extends MyCla...

Objective-C class time delay?

I was wondering if anyone knows of a class in objective-C that stops/delays the application at a specified amount of time during runtime? I've already looked at the Time Manager and NSTimer and don't see how I could possibly put a delay in there. I've never used these two classes before though, so maybe someone else has and could give me...