scripting

Problem with multiple scripts and Lua Threads

When I have two scripts with the same function names and arguments run in different threads with SUPPOSEDLY different environments, the second thread ends up overwriting the definitions of the first and the first thread's state gets garbage collected! // My thread instancing function lua_State* LuaInstance::RunInstance(const std::string...

SQLCMD, when called from Powershell, returns ExitCode == 1, even if successful

Hi everyone. I have a Powershell script that calls sqlcmd to run a sql script that backs up a database: function RunSqlScriptWithErrorMessage { param([string]$sqlServer, [string]$sqlUserName, [string]$sqlPassword, [string]$scriptName, [string]$errorMessage) $commandName = "sqlcmd" $startInfo = New-Object Diagnostics.Proces...

How do web apps do automated updates without breaking config settings?

Let's say I have a mediawiki installation. I mess about with it, add little hacks to make the wikipedia logo change into tigger, and bounce up and down. Now it's time to update to the newest version, so I download it and run the update script. Let say it changed several variables, like $wglogo, the image path to the logo. How does the u...

Debugging .NET dll from script component (SSIS)

Is there a way to debug .Net dll from SSIS Script Component which is being referenced. Thanks ...

Passing Bourne Shell var into cut command

I am trying to do the following. foo="foo:foo1" cc= `$foo | cut -f2 -d:` I understand why this would not work but I am at a loss as to do this. Thanks in advance. ...

Bourne Shell Left Right Justify

I am trying to do some formatting on output data in a script and not positive how to do Left Right justify as well as width. Can anyone point me in the right direction? ...

NANT Script does not always deploy dlls to GAC on dev machine

We have a NANT script that uses msbuild to compile our visual studio solutions and deploys the .dlls into the GAC. This works well on our integration/test servers as part of continuous integration, cruise control uses the NANT scripts and every time the dlls are put into the GAC without problem. On our local development machines, where...

NPAPI plugin inject script

Hi, I'm developing an npapi plugin. I am trying to inject a script into the current webpage of the browser,but am not able to do it. Any hints or suggestions as to how i should proceed with it, would be really helpful. Thanks ...

Can a Ruby script tell what directory it’s in?

Hello, everyone! Inspired by this question, what's the Ruby way to do this? ...

C# code generation tool

I'm looking for a tool that can do scripted code generation for me on the .NET platform. ...

a script to log into webpage

I want to write a script to log in and interact with a web page, and a bit at a loss as to where to start. I can probably figure out the html parsing, but how do I handle the login part? I was planning on using bash, since that is what I know best, but am open to any other suggestions. I'm just looking for some reference materials or ...

Script level login to Grails app using Acegi security

Scenario: I have a Grails app that uses Acegi security for authentication. I'm implementing a REST service endpoint in the app and want to be able to GET and POST to / from the service endpoint using a shell script. I've been trying to use curl to do this, but can't find the right combination of parameters to make the curl command log ...

Safari and Chrome doesn't evaluate dynamically added <script> tag at page load

I am writing small JavaScript code which will load external js files at html page loading. I tested 2 ways. Case 1: Used document.write to add <script> tag. It worked for all browsers (IE, FF, Safari, Chrome, Opera). Case 2: Used DOMElement.appendChild to add <script> tag to the <haed> element. Only worked for IE, FF, and Opera. Did ...

Python recursive folder read

I have a C++/Obj-C background and I am just discovering Python (been writing it for about an hour). I am writing a script to recursively read the contents of text files in a folder structure. The problem I have is the code I have written will only work for one folder deep. I can see why in the code (see #hardcoded path), I just don't kn...

ruby script not being called successfully with svn's post commit hook script

what could be the possible reason that my ruby script is not being called successfully? note that when i manually execute the post-commit script like so: /var/svn/eweds/hooks/post-commit /var/svn/eweds 151 works just fine, the way my ruby sript is called in the post-commit script is like this: ruby /home/pmind/public_html/eweds/scri...

deploy rake task as if it were a common script

I like the rake task structure and rake utilities.. I want to create a script that can do many things, and rake seems the logical choice. I want to know how can I make it look like a regular script: ./myscript.rb cake:bake as opposed to rake -f myscript.rb cake:bake any idea? Of course, rake must still be installed etc.. simply to ...

Concatenating multiple lines with a discriminator

I have the input like this Input: a,b,c d,e,f g,h,i k,l,m n,o,p q,r,s I wan to be able to concatenate the lines with a discriminator like "|" Output: a,b,c|d,e,f|g,h,i k,l,m|n,o.p|q,r,s The file has 1million lines and I want to be able to concatenate lines like the example before. Any ideas about how to approach this? ...

How to make a bash script that creates 40 simultaneous instances of a program?

I am new to bash and Linux. I have a program I have written that I want to create multiple simultaneous instances of. Right now, I do this by opening up 10 new terminals, and then running the program 10 times (the command I run is php /home/calculatedata.php What is the simplest way to do this using a bash script? Also, I need to know ...

Need guidance for HTML-dom designing ..

I have started with the project where I am suppose to use client side scripting @ extreme. this is the scenario : There are two drop-down lists in my form on my web-page ..one is COUNTRY and other is STATE. The drop-down list STATE must be disabled untill One of the values in Country is selected and According to the value selected in dr...

file manipulation : shell script find and increment

#something here port 4444 #something here port 4444 So I have file like above , I would to find the line with word "port" and increment the number(the number can be any number - not necessary it's fixed at 4444) next to it by 1. For example,result file should be of the form #something here port 4444 #something here port 4...