scripting

Problem making attribute table of raster in ArcGIS

I have a python script that makes an attribute table of a raster. This runs through all the rasters that I have which are floats, converts them to ints, then makes an attribute table. On the first 3 rasters, I get a warning message, Value range for c:\raster2 exceeds 100000 and number of unique values exceeds 500. Please use BUILDVAT...

How to add a script to a buildout project?

I have setup.py in a buildout project: from distutils.core import setup setup(name='', version='1.0', author='Denis Kolodin', author_email='...', url='...', scripts = ['scripts/myscript.py'], # The script I want to add to 'bin/' dir ) Why buildout don't add that script to 'bin/'? Can I develop scripts (not eggs) with buildou...

How do I make elinks dump the web-page at a URL under cursor in a new vim buffer/tab?

I am trying to make elinks dump the web-page at the URL which starts at the current buffer position in vim (and ends at EOL), by mapping this keyboard shortcut and putting it in my .vimrc: nmap owp :norm yE \| new \| .!elinks -dump @"<CR> This yanks the rest of the line into the " register. Then it's supposed to open a new buffer and ...

Whats wrong with this C shell script?

I am trying to write a C shell equivalent script for the bash script mentioned here. This is what I have : #! /bin/tcsh set now=`date +%Y%m%d%H%M.%S` if (( ! -f "./cache" ) || (-n "`find ./monme -newer ./cache`" )) then touch cache -t "$now" echo "new files added" | mail -s "new build" [email protected] endif and this i...

How do I remove a build configuration from an Xcode project from a script?

I'm currently using AppleScript to clean up an Xcode project. I'd like my script to remove some build configurations that won't be relevant to other developers on my team. For example, if I have "Debug", "DebugTest", and "Release", I would like the script to remove "DebugTest". I'm currently using the following script: tell applicatio...

Do we have short circuit logical operators in C shell script?

I thought C shell script will behave like C and use short circuit evaluation for logical operators. if ((! -e $cache ) || ("`find $monitor -newer $cache`" != "")) then ... endif But in the if statement, even if the first condition is true, the second is checked giving me errors. Do we have a short circuit logical OR in C shell script...

Find the name of Directory Service User via Login Script in Perl

Hi Friends, I made a login script in Perl which has to run on Mac OS X clients and record the Logged in Directory Service user name. I tried using getlogin() , getpwuid($<) respectively. Now the problem is that since the login script runs as root on the system when the client logs in, getpwuid($<) always gives me the username as root....

Using Ant scriptfilter to count lines

I am trying to write an Ant <scriptfilter...> to change occurrences of the string "__LINE__" to the correct line number in Java source files. Does anyone have an example of using JavaScript (or some other embedded scripting language) to do this? In particular, how do I create a "global" variable that is initialized to 1 when the script ...

Accessing my home network using CURL

Hey everyone, This question sort of covers both ServerFault.com and here, but this seems more programming than server. I set up my home computer to run Apache server. It answers to port 5900, which has been port forwarded from my wireless router. I then set up a Dynamic DNS server to continually update what the IP address of my home ...

Do you know any good Perl server scripting tutorials?

Are there any good introductory tutorials for Perl server-side scripting available freely on the internet? I checked perl.org and google searches like perl server scripting, server side script examples in perl, but did not get any good results. Is Perl not that common as a server-side language? It is mentioned here as one. ...

Printing lines from a file where a specific field is matched

Hi, I have many lines of form: A:B:C I want to print those lines(complete) where the 3rd field (fields separated by :) contain a certain pattern. Example: new/old:california/new york:/ms/dist/fx/PROJ/fx/startScript new/old:startScript/new york:/ms/dist/fx/PROJ/fx/stopScript When searching for pattern startScript, the 1st line shoul...

Printing lines from a file where a specific field does not start with something..

Hi, I want to print all the lines where 3rd field (fields separated by : ) DO NOT start with # (to signify that 3rd field is a comment). Please note that there may be space(s) between : and #. Example Input: A:B:#hdfghdfg A:B: #dfdfdfg A:B:C Desired output: A:B:C I tried: awk -F : '$3 ~ /^#/ { print }' run_out5 > run_out6 b...

How do you Include Short Functions in Awk One-Liners/Single Commands?

I know that usually you don't want one-liners/single commands to get too long but it seems like there's occasionally a longish one-liner that would benefit from replacing repetitive elements with a function. Is it possible to use a short function chop down the length of your command? For example there's no ceiling or round function ...

Run script after user event, but without affecting page loading?

I'd like to trigger a script to update some statistics when a user submits a new record, but I don't want the user to have to wait for the script to finish before being redirected. >-- Time --> > redirect User -> User Does Stuff -> more stuff -> etc / User Input -> Submit...

git: stage only new files

Hello, When I have: dirty working directory, dirty staging area, and I copied some new files to the project, how do I stage only the new ones? git alias adduntracked=… ...

How to get the main window handle of a process using JScript?

Is there any method in JScript to get the handle of the main window of a process by providing the process name? The Process.MainWindowHandle property works only in JScript .NET. Is anything similar available in classic JScript? ...

Why does SQL Server Management Scripting ignores the version?

I need to increase the size of a field in a table from VARCHAR(100) to VARCHAR(255). For different reasons, this causes the table to be dropped and recreated (along with relationships, FKs, etc). That is acceptable however, I’m performing this change in a SQL2008R2 (express) (or 2008 Express, same result), but the script doesn’t work in ...

PowerShell UIAutomation script not returning expected result

[I have posted this question earlier in the PowerShell Technet forum, but without a response] I am attempting to change Windows XP Quick Launch settings (enable / disable it using PowerShell). Existing VBScript solutions rely either on Registry or SendKeys, so I thought that this would be feasible in PowerShell through UIAutomation. My ...

Is there a cleaner way to add "else if" to assignment conditional in Awk, etc.?

Certain languages like awk script allow for conditional assignments. For example, say you had a list file in the format: <item name, no spaces> <price as float> e.g. Grape 4.99 JuicyFruitGum 0.45 Candles 5.99 And you wanted to tax everything over $1... you could use the awk script: awk '{a=($2>1.00)?$2*1.06:$2; print a}' prices.d...

exit out of an awk function

How do I exit out of an awk function? "exit" stops entire program? ...