scripting

Present a default window layout on startup in Windows 7

Hello, I have a Win7 PC in use as part of an experiment control system. The experiment in question uses 4 windows simultaneously, and I would like to find away to open, position and size these 4 windows with a script. The script would run at start up, so that the newly booted PC presents the user with the four windows as default. Obvi...

Writing a script in Java?

I am working with telecom company. I am familiar with Java programming language. But now I have a task to write a script, with Linux operating systems. I have to write a script for fetching data from other computer and check some conditions. How can I do that using Java? ...

BASH if conditions

Hi, I did ask a question before. The answer made sense, but I could never get it to work. And now I gotta get it working. But I cannot figure out BASH's if statements. What am I doing wrong below: START_TIME=9 STOP_TIME=17 HOUR=$((`date +"%k"`)) if [[ "$HOUR" -ge "9" ]] && [[ "$HOUR" -le "17" ]] && [[ "$2" != "-force" ]] ; then echo...

Is it possible to call on a Java-method from JavaScript in Java6 1.6 script-engine?

I would like to call on an own Java-method from a JavaScript-file via the ScriptEngineManager provided in Java 1.6. Is that possible? ...

Does OOP make sense for small scripts?

I mostly write small scripts in python, about 50 - 250 lines of code. I usually don't use any objects, just straightforward procedural programming. I know OOP basics and I have used object in other programming languages before, but for small scripts I don't see how objects would improve them. But maybe that is just my limited experienc...

How to get Command history by cursor key in Linux tclsh : TCL

I am new to TCL and I wanted to know, if I can get the command history by using cursor key (like up arrow key) in TCL shell (tclsh). I am running tclsh on fedora with linux version 2.6.21. ...

OO Design / Patterns - Fat Model Vs Transaction Script?

Ok, 'Fat' Model and Transaction Script both solve design problems associated with where to keep business logic. I've done some research and popular thought says having all business logic encapsulated within the model is the way to go (mainly since Transaction Script can become really complex and often results in code duplication). Howeve...

What is difference between scripting languages and other languages

Possible Duplicate: When is a language considered a scripting language? I am really confused between different types of languages. Can any one guide what are diff types of languages or diff categories. Like some saying python is scripting langauge. Now what does that mean. Are other langueages like php , asp , java not script...

PHP - Redirect and send data via POST

I have an online gateway which requires an HTML form to be submitted with hidden fields. I need to do this via a PHP script without any HTML forms (I have the data for the hidden fields in a DB) To do this sending data via GET: header('Location: http://www.provider.com/process.jsp?id=12345&name=John'); And to do this sending data...

echo POST array.. or other ideas?

Update: As seen in the Original Questions below, I am looking to echo an array. The problem is that when I send the Moneris gateway to return a POST array to my new file (cart.php) it gets a 500 Internal Server Error. This is the same error I received when it send to the script, which should have worked. Is there any reason that it wou...

Restrict characters used in a string

How do I restrict a string to whitelisted characters? // "HOW am I to understand; this is, BAD" $str = restrictTo($str,"0-9a-z,. "); // " am I to understand this is, " Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :( ...

build.xml in ant

Can anybody help me know what these tags do in build.xml file? 1)<property file="" location="."/> 2)<property environment=""/> 3)<property name="" value=""/> 4)<path> id="classpath.base" 5)<pathelement> location="$some.jar"/> 6)<path> id="classpath.build"> 7)<path> id="classpath.test"> 8)<target></target> Thank You ...

How to get a changeset SQL query using DB Pro for .net and SQl Server when usinga Team build?

Hi all, I am working on Build Automation via Team Build (TFS 2008). We are using DB Pro with our Web project. I want to get the SQL script for database change-set ,(that has occurred till the nightly build), automatically using MSBuild Script . This script has to bundled in a zip file along with Web Application binaries and pages. Ho...

Auto completion by typing TAB in TCL

hi all, How can I achieve auto-completion of key words and directories by typing TAB (or something else) in TCL shell , tclsh. Thanks in advance aditya ...

Make a mouse pointer do a hyper-jump?

I run a dual monitor setup. To get from monitor 1 to 2 (or vice-versa) requires lots of unnecessary mouse movement. My thought was to leverage a extra mouse button (I have two) and have the mouse hyper-jump (apologies to Star Trek) from the XY coordinates on monitor 1 to the same XY coordinates on monitor 2. How would I go about doing...

Site works perfect in Mozilla but not in IE. Is my js file not compatible with IE

I'm working on a site written in PHP/MySQL. We have a form to reserve time on a calendar and it works great in Mozilla and stores the reservation to our database, but in IE you fill out the form and when you click the "Reserve" button to submit it and nothing happens. All I can think of is that my javascript is not working with IE. I hav...

Unwanted Shell expansion when assigning the output of a shell command to a variable

I am exporting a portion of a local prototypte svn repository to import into a different repo. We have a number of svn properties set throughout the repo so I figured I would write a script to list the file elements and their corresponding properties. How hard can that be right. So I write started writing a bash script that would assi...

Get Json and output to text file undecoded

Hi, I want to fetch json script and write it to a txt file undecoded, exactly how it was originally. I do have a script that I use that I am modifying but unsure what to commands to use. This script decodes, which is what I want to advoid. //Get Age list($bstat,$bage,$bdata) = explode("\t",check_file('./advise/roadsnow.txt',60*2+15))...

Looking for a script to convert multiline "block" comments in C/C++ to single line comments.

A simple find/replace will not work for code commented out like this: ex: /* templine1 templine2 templine3 */ Got any ideas? ...

Conditional Batch file renaming with mysql data

Hello, I wonder if anyone knows how could I rename multiple files, all of them originally named with same structure, and add some data extracted from a mysql DB according to specifics rules. For example I have 500 files named with this vars: ID NAME ADDRESS PHONE.wav => 1234567 PAULSIMON WESTDR122 9942213456.wav Now I need to rename ...