execute

Execute java code on a server

只愿长相守 提交于 2019-12-01 11:40:06
问题 I'm developping a Web app, a sort of an online IDE to write and compile code. The programming language is developped internally at the university and also the compiler. My question is : is it possible to execute a compiler on a server ( the compiler is written in java ), so that it compiles the code and returns a compiled file to be downloaded ? In a simpler fashion, the user uses the online code editor, then clicks on the compile button, the server takes the written code, executes the

Conversion failed when converting the nvarchar value 'Internet Explorer 3 original' to data type int

天大地大妈咪最大 提交于 2019-12-01 11:34:42
In SQL Server 2008 (TSQL), I've created a stored procedure like this: CREATE PROCEDURE SP_1_10_2 AS declare @mostValuableBook nvarchar(255) SELECT @mostValuableBook = Name FROM books WHERE price = ( SELECT MAX(price) FROM books WHERE izd LIKE '%BHV%' ); return @mostValuableBook GO But, when I'm trying to execute it: declare @x nvarchar(255) EXECUTE @x = SP_1_10_2; SELECT 'The most expensive BHV book:', @x AS 'Name' GO I'm getting an error: Conversion failed when converting the nvarchar value 'Internet Explorer 3 original' to data type int. It seems like the problem is in the line EXECUTE @x =

Run Executable In Jar With ProcessBuilder [duplicate]

天涯浪子 提交于 2019-12-01 11:06:42
This question already has an answer here: Is it possible to jar up an executable so that it can be run from Java? 1 answer I have an application I've built that uses a non-Java executable that it calls via ProcessBuilder: ProcessBuilder pb = new ProcessBuilder(invocation); pb.redirectErrorStream(true); Process proc = pb.start(); InputStream is = proc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); However, I'd like to bundle that app neatly into the jar file itself, instead of requiring it be placed outside in the same directory

C++'s “system” without wait (Win32)

时光毁灭记忆、已成空白 提交于 2019-12-01 10:45:28
I have got a program which checks if there's a version update on the server. Now I have to do something like if(update_avail) { system("updater.exe"); exit(0); } but without waiting for "updater.exe" to complete. Otherwise I can't replace my main program because it is running. So how to execute "updater.exe" and immediately exit? I know the *nix way with fork and so on, how to do this in Windows? Use CreateProcess() , it runs asynchronously. Then you would only have to ensure that updater.exe can write to the original EXE, which you can do by waiting or retrying until the original process has

ICommand method execute parameter value

只愿长相守 提交于 2019-12-01 10:06:12
问题 I try to understand the ICommand from wpf. In my Event class I implement the ICommand and their methods. one method is the Execute: public void Execute(object parameter) { //Do something } now is my question: what value contains the parameter parameter from Execute ? 回答1: That value depends on the value you pass to the command. like a sniplet: Command="{Binding CalculateCommand}" CommandParameter="LCM"/> Look here: Command Binding with Parameter Passing for more details. 来源: https:/

Run Executable In Jar With ProcessBuilder [duplicate]

早过忘川 提交于 2019-12-01 09:11:21
问题 This question already has an answer here : Is it possible to jar up an executable so that it can be run from Java? (1 answer) Closed 3 years ago . I have an application I've built that uses a non-Java executable that it calls via ProcessBuilder: ProcessBuilder pb = new ProcessBuilder(invocation); pb.redirectErrorStream(true); Process proc = pb.start(); InputStream is = proc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr);

C++'s “system” without wait (Win32)

痞子三分冷 提交于 2019-12-01 08:10:54
问题 I have got a program which checks if there's a version update on the server. Now I have to do something like if(update_avail) { system("updater.exe"); exit(0); } but without waiting for "updater.exe" to complete. Otherwise I can't replace my main program because it is running. So how to execute "updater.exe" and immediately exit? I know the *nix way with fork and so on, how to do this in Windows? 回答1: Use CreateProcess(), it runs asynchronously. Then you would only have to ensure that updater

Equivalent of source() of R in Python

你离开我真会死。 提交于 2019-12-01 00:06:51
问题 Like we have source() function to execute a R program in another R program in R studio, how do I execute a python program in another python program? 回答1: Given 2 python scripts: first.py and second.py , the usual way to execute the first from the second is something in the lines of: first.py: def func1(): print 'inside func1 in first.py' if __name__ == '__main__': # first.py executed as a script func1() second.py: import first def second_func(): print 'inside second_func in second.py' if _

Sybase, execute string as sql query

痴心易碎 提交于 2019-11-30 20:12:20
In Sybase SQL, I would like to execute a String containing SQL. I would expect something like this to work declare @exec_str char(100) select @exec_str = "select 1" execute @exec_str go from the documentation of the exec command execute | exec is used to execute a stored procedure or an extended stored procedure (ESP). This keyword is necessary if there are multiple statements in the batch. execute is also used to execute a string containing Transact-SQL. However my above example gives an error. Am I doing something wrong? You need bracketing: execute ( @exec_str ) 来源: https://stackoverflow

Executing an SQL statement in C#?

为君一笑 提交于 2019-11-30 20:07:31
问题 Hey guys i want to execute my SQL statement but im having synatx trouble, can someone help me understand what i doin wrong please? Thanks, Ash. public void AddToDatabase(string[] WordArray, int Good, int Bad, int Remove) { for (int WordCount = 0; WordCount < WordArray.Length; WordCount++) { string sSQL = "INSERT INTO WordDef (Word, Good, Bad, Remove) VALUES (" + WordArray[WordCount] + ", " + Good + ", " + Bad + ", " + Remove + ")"; Debug.Print(sSQL); //Private m_recordset As ADODB.Recordset /