scripting

Display characters of a variable

Hi all, I am doing a bash script and I want to display the characters of a variable ($VAR). What I want the script to do is (pseudo-code) : String var = "Hello"; for (int i = 0; i < var.length(); i++) { System.out.println(var.substring(i, i+1)); } The size of the variable can change, one time it can be 5 characters and the next tim...

Short PHP page to execute a command and pass an id?

I have a script which, given an ID, kicks off some complex processes and puts an RTF file onto stdout. For example, you might call it with something like foo.exe 27 to point it at ID 27. Now I'd like to write a short PHP page which: accepts a GET id parameter checks that the parameter is an integer number calls shell_exec(...) on the ...

PHP: Schedule scripts without using CRON

I know there are many posts about using CRON to run a php file. But, in the world of shared hosting, and ease of setup for a user, I don't want to have to mess with that. I found another solution online that has to do with sockets. Just wanted to get everyones take on this, and tell me if this is a good or bad idea. Sounds like it wo...

How can I hide a password/username used in a bash script for accessing MySQL?

I am writing a bash script that I plan to execute via cron. In this script, I want to execute a command against a MySQL database, something like this: $ mysql -u username -ppassword -e 'show databases;' For clarity and those not familiar with mysql, the "-u" switch accepts the username for accessing the database and the "-p" is for p...

SVN scripts to automate tasks

Guys, I am really new to svn. I need something(Scripts/app), which will compare my local copy with repository, copy the modified files into a new folder and then update the local copy. I dont know actually, where to start. Please help. Regards Bibhu ...

VBScript to detect today's modified files in a folder (including subfolders inside it)

Hi All I need to get all the modified files inside a folder including the subfolders inside it, and copy them to another folder. How can it be done using VBScript or any other way to achieve this? Thanks in advance, Bibhu ...

php problem with contact form script verification?

I'm trying to edit a php contact form script, but I can't find where to delete a terms and conditions verification part. I've deleted the checkbox in the html and the form no longer works. Is there any way to edit this code to remove it? <?php $adminemail = '[email protected]'; // type your actual email address in place of you@yourdomain....

PHP extracting body and attachments from piped email

I understand there are php IMAP functions to extract certain elements from an email stored in a mailbox. What I am trying to discover is whether this can translate to emails piped to a script. The scripts that I have looked at for extracting the body and attachments are fairly inflexible and bulky. I sent my pipe script a variety of dif...

Simple Shell Scripting Question

Hi, I am a newbie with shell scripting but just wanna quickly do something really simple. I have a testprogram that writes some results into a file "result". I wanna run the program three times and then store the results in an appropriate file with the name result1, result2, etc. I thought something along those lines will do the trick...

bash shell scripting combining *.txt into one file

What is the quickest and most pragmatic way to combine all *.txt file in a directory into one large text file? Currently I'm using windows with cygwin so I have access to BASH. Windows shell command would be nice too but I doubt there is one. ...

SSIS Script Component + Helper Assemblies (.dll's)

I got a script component which does Transformation / DataType conversions / Creating some calculated columns. All the transform validations / datatype conversion methods and for new column generation is put into custom .dll. As this script component would be same for all other tables, only thing is to define input / ouput columns and a...

what does Parse error: syntax error, unexpected '"' in /home/XXX/public_html/feedback2.php on line 180 mean?

and how do I find where line 180 is in the code ? I'm trying to create a PHP feedback form scrip ...

Need help for configuring COM+ Service programmatically using C# or script

Hi All, Is it possible to programmaticaly configure COM+ service. I need to do the following using C# or any script Open Administrative Tools -> Component Services Expand Components Services -> My Computer -> COM+ Applications Right Click HyperV Environment Manager(COM+ service name) andselect Properties. Click on Pooling & Recyclin...

Good guide on VIM Scripting?

I've used VIM for 10+ years, but never really into VIM scripting (always subjectively beliving that this was one area where VIM was weaker than Emacs). Recently, the realization "in a VIM script, I can execute normal mode commands" made my mind og "a-ha" and suddenly start realizing why parts of VIM script is the way it is. normal ma10...

Upload image with Photoshop scripting

Is that possible to upload an image from Photoshop (for example, an open image exported to jpeg) to some web place - REST service, FTP etc by using scripting features of Photoshop? For example - I have an image open in Photoshop and then execute some special script that sends an exported version of it to some place over the web. I saw s...

when i running the below code iam getting handle is invalid it takes a string and pass it to remote batch file

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Security; namespace SampleProject { public partial class Form1 : Form { public Form1() { ...

Indesign scripting create deeper structures by adding tags

I first set out to do this with XSLT, then with PHP. Now i'll have to have a go at it with Indesign scripting (javascript probably) My problem is that i have an indesign file without structure (nothing is tagged, but everything has a paragraph style) Wat i have to do is 1) ad tags to paragraphs based on their styles 2) deepen the stru...

Reading System Variable from Script Component

What is the best way to read system variables from Script Component. Tried as below: Works fine when is User variable base.PreExecute(); IDTSVariables100 variables = null; VariableDispenser.LockForRead("System::ContainerStartTime"); VariableDispenser.GetVariables(out variables); auditTimeStamp = Convert.ToDateTime(v...

Python path in environment.

I want to call a python script from batch script, but I dont want to hard-code path to python executable (python.exe) in my calling script. e.g. c:\python26\python.exe test.py $PYTHONPATH\python.exe test.py Is there any way to have PYTHONPATH like setting ? ...

A scripting language to simply compile

I'm looking for a simple script language which I can compile easily by just putting the .h files under an include folder and the .c/.cpp files under a source directory. Something without any Makefile. Must be written in C/C++ rather C++. ...