runtime

Find the associated program to open a file using Java

I wish to open a file (lets say, a word document) from a Java application using the associated program installed on the computer (in this example, using MS Word or Open Office Writer). The catch is that I want to wait until this subprocess finishes, which can be done using the waitFor() method in the Process class. String executable = ...

Execute a method from a form created by class reference (Delphi)

Hi, I have a form (form2) and I implemented the following PUBLIC method: function ShowInterface(i:integer):boolean; This form is in a package that will be DYNAMIC LOADED. Now I want to instantiate this form (form2) and execute the method above. Important: I can't reference form2's unit in form1. I tryed this code, but it never find...

2 Runtime Packages: how can I use a unit from each other? (Delphi)

Hi, Lets assume we have 2 runtime packages, with 1 form in each one; Pkg1 -> Unit1 (frm1) Pkg2 -> Unit2 (frm2) Now I want that they "know" each other. When pkg1 needs to know Unit2, we have to "require" Pkg2 in Pkg1. So now I can do a "uses" Unit2 and then do frm2.Show in Unit1 code. But when I do the same thing in Pkg2 (set to requ...

Java - configure Object properties

Hi all, I would like to configure an object's properties at runtime either via a properties file, possibly XML (even though it can be a little more verbose). The properties may be nested, so I think I would use something like Apache's Bean Utils. I was wondering what other formats are out there instead of properties and xml. Thanks, ...

advanced Visual Studio kung-fu test -- Calling functions from the Immediate Window during debugging

I see some related questions have been asked, but they're either too advanced for me to grasp or lacking a step-by-step guide from start to finish (most of them end up being insider talk of their own experiment results). OK here it is, given this simple program: #include <stdio.h> #include <string.h> int main() { FILE * f; char...

Is there a "vim runtime log"?

Sometimes I try a customization/command in my vimrc. Everything seens to be correct, but it just doesn't work. It's difficult to know what's happening when vim starts, and know which command failed or not, so it's really difficult to debug what can be causing a problem in my vimrc. It's a trial-error approach, which is time consuming an...

Java - Runtime.getRuntime().exec() what's going on?

Hi, I have problem with Runtime.exec() in Java My code: String lol = "/home/pc/example.txt"; String[] b = {"touch", lol}; try { Runtime.getRuntime().exec(b); } catch(Exception ex) { doSomething(ex); } It's working good but when I trying changle variable "lol" files doesn't create in hard disk for instance: String...

Another total newbie question: what exactly is a "run-time"?

Hello, here's my question: My company is always having problems with software not working because "run-times" or missing. I hear people say this a lot (you need the 32-bit run times, Microsoft run-times, etc etc). What exactly is being referred to? DLL files? Something different? Can anyone please clarify? Thanks! RKL ...

What causes "java.lang.IncompatibleClassChangeError: vtable stub"?

What causes "java.lang.IncompatibleClassChangeError: vtable stub"? In our application, we have seen this error pop up randomly and very seldom (just twice so far, and we run it a lot). It is not readily reproducible, even when restarting the app, using the same jvm/jars without rebuilding. As for our build process, we clean all classe...

WPF How to add and perform events on those controls generated during Runtime

For example, I have an empty tabControl in my Windows during the compile time, and I have an undetermined amount of images need to be added onto the tabControl, so I used loop + tabControl.Children.Add("image1 to x") to add those images... but after that during runtime, I want to perform events on those image controls, such as dragging t...

The Clocks on USACO

I submitted my code for a question on USACO titled "The Clocks". This is the link to the question: http://ace.delos.com/usacoprob2?a=wj7UqN4l7zk&amp;S=clocks This is the output: Compiling... Compile: OK Executing... Test 1: TEST OK [0.173 secs, 13928 KB] Test 2: TEST OK [0.130 secs, 13928 KB] Test 3: TEST OK [0.583 secs, 13...

Dynamically find the parameter to be passed as <T> to a generic method

A generic method is defined as follows: private static T GetComparisonObject<T>(ComparisonAttribute attribute, object objectToParse) { // Perform a some action return (T)resultObject; } The method is invoked as follows: var srcObjectToCompare = GetComparisonObject<DynamicType>(attributeToCompare, srcObjec...

Can i add a component in jframe in netbeans at runtime?

I am having a form built up in netbeans and want to add or remove a component with an actionperformed event of a button or a combobox is it possible? if yes, how? ...

Java API Method Run Times

Is there a good resource to get run times for standard API functions? It's somewhat confusing when trying to optimize your program. I know Java isn't made to be particularly speedy but I can't seem to find much info on this at all. Example Problem: If I am looking for a certain token in a file is it faster to scan each line using stri...

Junit Dynamically Created Tests Not Working

Hey, so heres my code: public class NewTest extends SeleneseTestCase { public static Test suite() throws Exception { TestSuite suite = new TestSuite(); TestSuite s = new TestSuite("TestCase Name"); GeneratedTest t = new GeneratedTest("testName"); t.setFailure("TestCase Name: testName"); s.addTest(t); t = ...

Controlling output of program

I'm writing a code to output fibonacci series in C++, which is simple enough, but since I'm new to programming, I'm considering ways to control I was wondering if there's a way to control time for when outputs come out without processing time being included (e.g. If it takes .0005 seconds to process my input and I want it to repeat the ...

Update Java code during runtime

Hi, about a year ago I stumbled across a nice feature in Java that I cannot for the life of me find again. Through some magic interface it was apparently possible to declare some classes or functions replaceable during runtime. I found a nice example guide of someone who ran a simple little program that printed a certain message, he the...

Wicket - runtime class reloading

Hi, I have classical complaint - rebuilding and reloading the web app takes too long. I want to compile the classes (preferrably from the IDE) or change a static file and let the server check what changed and act approprietly (reload the class/file). What are my options for Wicket + JDK 1.6 ? I'd prefer Jetty, but Tomcat, JBoss AS or o...

how to validate a textbox programmatically, that is at run time.

i am creating textboxes when a button is clicked and again and again and so on while accpeting input i need to check if the boxes are all full, i know how to do this using design view but how to do this using coding that is add and validation control to the textbox when it created before initializing/adding it to the page.? thanks v...

Rename tabs at run-time

Hi all, I have a tab bar app that has to display in different languages depending on a user's preference but I can't find much info on how to change the tab names at run-time. I need the tabs to show the correct names at startup, not when the tabs are accessed. Best info I could find was running self.tabBarController.selectedIndex = 1...