runtime

Java - start another class' main in a different process

a 夏天 提交于 2019-12-04 09:08:33
I need a clean way to start many instances of a Java program with a GUI, and I want to do it programmatically. The "program" i want to run is just a .class file (a compiled .java file with a main method), it should show a GUI and run independently from the others (as its own process). I also need to pass that program some arguments. Check EDIT5 for the complete working solution code. Here's the class that's supposed to start the many processes package startothermain; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class Starter { public

magic_quotes_runtime 的作用

旧城冷巷雨未停 提交于 2019-12-04 09:04:07
在php.ini的配置文件中,有个布尔值的设置,就是magic_quotes_runtime,当它打开时,php的大部分函数自动的给从外部引入的(包括数据库或者文件)数据中的溢出字符加上反斜线。 当然如果重复给溢出字符加反斜线,那么字符串中就会有多个反斜线,所以这时就要用set_magic_quotes_runtime()与 get_magic_quotes_runtime()设置和检测php.ini文件中magic_quotes_runtime状态。 为了使自己的程序不管服务器是什么设置都能正常执行。可以在程序开始用get_magic_quotes_runtime检测设置状态秋决定是否要手工处 理,或者在开始(或不需要自动转义的时候)用set_magic_quotes_runtime(0)关掉。 magic_quotes_gpc设置是否自动为GPC(get,post,cookie)传来的数据中的'"\加上反斜线。可以用 get_magic_quotes_gpc()检测系统设置。如果没有打开这项设置,可以使用addslashes()函数添加,它的功能就是给数据库查 询语句等的需要在某些字符前加上了反斜线。这些字符是单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)。 来源: oschina 链接: https://my.oschina.net/u/1163184

Is there a summary of visual studio 2008 runtime versions?

南笙酒味 提交于 2019-12-04 08:59:23
问题 I've been looking into a strange problem where loading of one of our application's dlls fails on certain systems (using the Global Flags loader snap flag shows it's somewhere within LoadLibraryEx). The logs in windbg show that there seem to be several different versions of MSVCR90.DLL being referenced. It appears that the version referenced in our manifest is different to the redistributable runtime we're installing. I've been trying to find a definitive list of the different runtime versions

Creating TWebBrowser in Runtime with Delphi

人走茶凉 提交于 2019-12-04 08:49:47
I have a TWebBrowser object which is created in runtime and used in background, that is, not visible. The problem is that events like OnDocumentComplete dont work or are not triggered in Delphi2009. Any advice? procedure TfrmMain.FormCreate(Sender: TObject); begin FWebBrowser:= TWebBrowser.Create(Self); FWebBrowser.RegisterAsBrowser:= True; FWebBrowser.OnDocumentComplete:= WhenDocIsCompleted; end; procedure TfrmMain.WhenDocIsCompleted(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant); begin ShowMessage('Doc is completed!'); end; There is any difference important between Navigate

Create function call dynamically in C++

∥☆過路亽.° 提交于 2019-12-04 07:14:27
Hello people I hope you an help me out with this problem: I am currently implementing an interpreter for a scripting language. The language needs a native call interface to C functions, like java has JNI. My problem is, that i want to call the original C functions without writing a wrapper function, which converts the call stack of my scripting language into the C call stack. This means, that I need a way, to generate argument lists of C functions at runtime. Example: void a(int a, int b) { printf("function a called %d", a + b); } void b(double a, int b, double c) { printf("function b called

Current thread not owner exception

泪湿孤枕 提交于 2019-12-04 06:49:24
问题 in my application i am using a code that run a batch file, on executing it i am getting a exception i.e. current thread is not owner. Here i want to mention that my application is based on eclipse plugin development. Following is my code, please have a look and find out what is the problem to help me.. /*.......any code.........*/ try { Runtime runtime = Runtime.getRuntime(); String cmd = new String(C:\\abc.bat); process = runtime.exec("\"" + cmd + "\""); process.wait(); } catch (Exception e)

get the annotation information at runtime

早过忘川 提交于 2019-12-04 06:14:03
I wonder if there is any way I can get the annotation information of a class at runtime? Since I want to get the properties that sepcifily annotated. Example: class TestMain { @Field( store = Store.NO) private String name; private String password; @Field( store = Store.YES) private int age; //..........getter and setter } The annotations come from the hibernate-search,and now what I want is get which property of the "TestMain" is annotated as a 'field'(in the example,they are [name,age] ),and which is 'stored(store=store.yes)'(in the example,they are [ age ]) at runtime. Any ideas? UPDATe:

Adding rows to a WPF datagrid where columns are not known until runtime

[亡魂溺海] 提交于 2019-12-04 06:11:27
I'm trying to add data to a datagrid (in fact, any control that presents data in a grid will do), but the columns (both names and numbers) are not known until runtime. The columns I DO know how to create: E.g DataGridTextColumn textColumn = new DataGridTextColumn(); textColumn.Header = column.DisplayName; MyDataGrid.Columns.Add(textColumn); But how do I add rows? I don't see how I can use binding because my data is not contained in an object with known properties. For example, data for each row might come in as a string[]. So one time I might have three columns, another time I might have five.

Run program.exe from eclipse plugin project

邮差的信 提交于 2019-12-04 05:56:47
问题 I am writing an eclipse-plugin witch run program.exe. I have added program.exe to plugin jar file. How can a execute this program? public class Handler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { Runtime.getRuntime().exec(/*What should I write here*/); return null; } } 回答1: You can't run the program.exe from inside the plugin jar, so it needs to be extracted. In your plugin use: Bundle bundle = Platform.getBundle("plugin id"); URL url =

Adding/modifying annotations in a java project

♀尐吖头ヾ 提交于 2019-12-04 05:46:56
We have a library of Java code that we intend to use across projects. Some of these projects will require having annotations added to the Java objects in this library (i.e. in one project, these objects will be used in a JAX-RS servlet implementation so they need to be annotated with JAXB, JSON etc annotations). The issue I am having is that I could not figure out how to add these annotations without changing the original library. Consider this example: public class MyClass { private String field1; private int field2; } In some projects, I would like the class to behave as if it was public