scripting

help with subversion (svn) hook script

How to create a subversion server hook script that prevents people from committing changes if they don't own the lock on the file first? Svn server is on windows. Thanks. P.S. Additional info in this question http://stackoverflow.com/questions/1924780/subversion-svn-tortoisesvn-commit-not-locked-file ...

Passing variable from shell script to sql statement

I was trying to make cat1.txt as a variable ($2) so that it will be inserted in sql select statement. Is there a way to do this? my cat1.txt 1111 2334 2234 3333 4444 .... .... etc. my SQL Statement set echo off linesize 280 pagesize 0 newpage 0 feedback 1 verify off head off trimspool on alter session set sort_area_size=10485760...

Using Apple Scripting Bridge in C

I'm wondering if it is possible to use Scripting Bridge (as discussed here) in C. What I'm trying to do is control and/or get information from Apple applications (such as iTunes, see link listing 2.1 & 2.2 on above link) which is fairly easy using Objective-C. I could write those parts in Objective-C using C, but that would get pretty c...

How to execute a Groovy Script from my Grails app?

Well, it seems a simple task but I didn't manage to make it run. I have a groovy script that runs fine under Windows Vista when calling from prompt: > cd MY_GAILS_PROJECT_DIR > groovy cp src/groovy scripts/myscript.groovy Now, I want to execute this script (and passing to it some input arguments) through my my Maintenance Service Cla...

Can script.readyState be trusted to detect the end of dynamic script loading?

I use dynamic script loading to reduce the duration of the initial page load. To ensure that the functions and objects defined by a script are accessible, I need to ensure that the script has been fully loaded. I have developed my own Javascript library to this end, and thus did quite a lot of research on the subject, studying how it's ...

Can't get MySQL source query to work using Python mysqldb module

I have the following lines of code: sql = "source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql" cursor.execute (sql) When I execute my program, I get the following error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to u...

Linux: How do I delegate exotic commandline arguments using a script?

Hello! I want to write a wrapper bash script, and to pass all arguments to a called program. I was very sure, that this works correctly: #!/bin/sh someProgam $@ But when passing exotic arguments (empty, unescaped, in quotes, ...) this fails. For example: without the wrapper script, someProgram "1 2" 3 results in the arguments [1 2] ...

How to execute python scripts in windows?

I have a simple script blah.py: import sys print sys.argv[1] If I execute my script by: python c:/..../blah.py argument It prints argument but if I execute script by: blah.py argument error occurs: IndexError... So arguments do not pass to script. python.exe in PATH. Folder with blah.py also in PATH. python.exe is default progra...

strange performance behavior when running app from scripting language

Hi, I wrote tcl script as an glue between different apps which are computationally intensive. When I run top command I see that 2 cpu's are 100% utilized. The one is for the tcl and the second is for the application I am running. The question is: why the tcl is utilizing fully one of the processors when the binary application is heavil...

cURL Download Progress in PHP not working ?

Hi, I am a PHP newbie and trying to add a progress-bar to an existing PHP script using the following method : $ch=curl_init() or die("ERROR|<b>Error:</b> cURL Error"); curl_setopt($ch, CURLOPT_URL, $c); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_FILE, $fp); //##############################################...

Simple ,fast script support for a c# application

I have developed an application which can create Xml files from Xml schema with some user defined rules for generating value for each node. I want to give my user the ability to write scripts for generating value for each node and in this scripts user should be able to refer to generated value of other nodes . a simple script will be so...

Storing a lua class with parent in luabind::object (updated)

Using C++, lua 5.1, luabind 0.7-0.81 Trying to create a lua class with parent and store it in a luabind::object. Lua class 'TestClassParent' function TestClassParent:__init() print('parent init\n') end function TestClassParent:__finalize() print('parent finalize\n') end class 'TestClass' (TestClassParent) function TestCla...

Can I use the .NET Framework from JavaScript (JScript) or VBScript?

I want to write a script that can run on a vanilla Windows (XP or later) system and call methods in an installed (GAC'd) .NET assembly. (I need to deliver the script to other people and I don't want to assume that they have anything in particular installed (other than the the assembly in question). Can I use JavaScript (JScript) or VBS...

Automatically Delete Subversion Tags By Date

I'm creating a batch file (on Windows Vista) to deploy my project from development to our staging server. The code I currently have is: :: Copy files from development to staging robocopy \\local\file\path \\staging\file\path /MIR /Z /XD .svn /NFL /NDL /XF *.cs *.sln *.csproj *.suo *.resx *.user *.sln.cache :: Create a new SVN tag in th...

Is there a bash script to parse the output of smaps

I need to parse the output of "proc/pid/smaps" on a linux system. Running a perl/python script on this system is not an option. I was looking to see if there's a bash script to do the same. Alternately, it would also be OK is there's a script (any script) which takes in output from /proc/pid/smaps in text format, and parses the informa...

Luabind class deriving problem (memory 'leak')

Using luabind 0.81 Simple test to illustrate the problem: 1) class 'A' function A:__init() print('A init\n') end function A:__finalize() print('A finalize\n') end do local obj = A() end collectgarbage("collect") Output: A init A finalize 2) class 'A' function A:__init() print('A init\n') end function A:__finaliz...

PHP - Loopless way to split a string into a multidimensional array

How do I split a string into a multidimensional array in PHP without loops? My string is in the format "A,5|B,3|C,8" ...

Checking if a website is up via Python

By using python, how can I check if a website is up? From what I read, I need to check the "HTTP HEAD" and see status code "200 OK", but how to do so ? Cheers Related How do you send a HEAD HTTP request in Python? ...

PHP - How to loop through a associative array and get the key name?

My associative array: $arr = array( 1 => "Value1" 2 => "Value2" 10 => "Value10" ); Using the following code, $v is filled with $arr's values foreach($arr as $v){ echo($v); // Value1, Value2, Value10 } How do I get $arr's keys instead? foreach(.....){ echo($k); // 1, 2, 10 } ...

record script via a direct connection using LoadRunner

Hi, I recently started working in LoadRunner 9.0, and I usually record scripts using a proxy connection. But recently I was asked to test the site using a direct connection. I've changed the proxy settings to No-proxy in run-time settings. But now when I try to record the script, the website takes a long time to load. When the site is b...