runtime

Unable to run SDL program in Eclipse but able to do so in Windows Explorer

五迷三道 提交于 2019-12-11 03:57:10
问题 I have installed and set up SDL and managed to get a tutorial example to build (the tutorial code is from http://zamma.co.uk/setup-sdl2-eclipse-windows/) as a C++ Project in Eclipse. The problem is that when I try to run the application from Eclipse, the window doesn't appear, or perhaps it gets closed soon after appearing. Eclipse doesn't appear to show any errors. When I open the folder containing the executable in Windows Explorer and double-click on the application, it works; a window

Width Specifier for scanf() - Length of characters to consume is not fixed at compilation and only determined at run-time. How to make it variable?

会有一股神秘感。 提交于 2019-12-11 03:55:56
问题 I want to apply the field-width specifier to the scanf()-operation for reading a string due to clearly specify the amount of characters to read/consume and not make the scanf() -operation susceptible for causing buffer overflow. As well as the destination argument points to an already matched char array, which has exactly the size of elements, the desired value of the field width has to be, + 1 for the \0 . The size of this char array is also determined at run-time before. The problem now is

Excel 2007 - 1004 Run-time error Refresh Query Table

江枫思渺然 提交于 2019-12-11 03:43:23
问题 It appears that this error is so generic that many of the existing solutions address different issues. In my case I have created a macro that works in Excel 2010 and does not work in Excel 2007. Here is a summary of the code: cn = "ODBC;Driver={SQL Server Native Client 10.0};Server=serverName;Database=dbName;Trusted_Connection=yes;" sql = "select top 10 * from tableName" Dim S As Worksheet Set S = ActiveWorkbook.Sheets("Medical") With S.QueryTables.Add(Connection:=cn, Destination:=S.Range("B1

Use of eval to load modules

杀马特。学长 韩版系。学妹 提交于 2019-12-11 03:40:55
问题 I'm facing some trouble with Perl and built-in function eval. I have looked around the web but I can't find any answer or sample code. I'd like to load modules dynamically (I don't know them before the execution time) $module_name="Auth_Auth_Test"; my $ret1; ret = eval{ "use ".$module_name; $ret1 = $module_name."::test(".$log.")"; }; $log->debug ($@) if $@; $log->debug ("Ret".$ret1); The return was : RetAuth_Auth_Test::test(Custom::Log=HASH(0x1194468)) The following method worked for me but I

Add a python script at runtime

空扰寡人 提交于 2019-12-11 03:39:53
问题 I am beginning python and working on a project, and one thing I would like to be able to do is download and run a script dynamically at runtime. The general idea is to be able to connect to a server, download a python script on demand, and run that script that was just downloaded without having to restart the program or hard code that specific script in to the program. The program I'm working with uses Python for scripting and execution, and C++ for the other code such as rendering and math.

Init grid row height doesn't work

回眸只為那壹抹淺笑 提交于 2019-12-11 03:25:13
问题 this is my simple try-it application that create a grid with 2 rows. The 1st row's height is bound to a properties. The value I assigned to it only works at run-time. I tried to make it also work when design-time but I failed to do that (I used this thread to write my app). Please help me to see what I miss. Thank you! [Edit] The reason why I do this is that I want to set dynamically the height of the top grid row, ie. Grid.Row="0" , to be the title bar height. Somewhere in my app, the view

java Process stop entire process tree

点点圈 提交于 2019-12-11 03:16:16
问题 I am using Java Runtime to run commands, including certain CVS commands. I use: process = runtime.exec ("cmd /C cvs..."); format for running the Process in Java I need to have the option of stopping it. For this I use the Java Process destroy method process.destroy(); However only the cmd is stopped not the cvs process. It continues to run as a separate process without the cmd process as the parent. There are many references to this on the internet, but I haven't found any satisfactory

Restoring Mysql dump from java: why does it hang the process?

六月ゝ 毕业季﹏ 提交于 2019-12-11 03:06:46
问题 I'm trying to restore a Mysql dump from a Java app. I'm using this code: Runtime rt = Runtime.getRuntime(); try { comando = "mysql -u root -ppass -e \"source " + path + "\\sql\\backup.sql\" legapelis" ; Process proceso = rt.exec(comando); System.out.println("ejecutando"); System.out.println(comando); proceso.getInputStream().close(); proceso.getOutputStream().close(); proceso.getErrorStream().close(); completado = proceso.waitFor(); if (completado != 0) { System.out.println("error");

compile time type at runtime

眉间皱痕 提交于 2019-12-11 02:47:10
问题 Is there any way in Java to get the compile time type of a reference at runtime? Example: private void doSomething(final Object o) { // do somthing } final Number n = 1; doSomething(n); final Object o = 1; doSomething(o); final Integer i = 1; doSomething(i); 1st call --> Number 2nd call --> Object 3rd call --> Integer Edit: This is a very simplified version of the problem. What i am trying to do is to detect(instead of being told) inside a framework metadata about objects being passed. What

“Sigabrt Error” - Codechef

血红的双手。 提交于 2019-12-11 02:20:06
问题 The following code ran perfectly in my DEV-C++ compiler but when I submitted in codechef, after running for 3-4 seconds it shows "SIGABRT ERROR". I have researched on this error and have done everything i could to debug, but even after a week I am not able to. Please Help !! Thanks in advance. For reference question is http://www.codechef.com/problems/LOWSUM enter code here void selsort(long long *ssum,long long len) { long long low; for(long long i=0;i<len;i++) { low = ssum[i]; long long pos