scripting

Save currently running script in Matlab

筅森魡賤 提交于 2019-12-12 18:52:24
问题 Is there a way of saving the currently running script in Matlab? I have a script which automatically takes a backup of a set of scripts although if I have changed the current script then the saved version will be out of date. Perhaps its possible to call some java? Thanks 回答1: Somewhere on Yair Altman's site (see link in my other answer) he also referred to a blog entry about editorservices, which was introduced with MATLAB R2009b. editorservices.getActive().save should do what you want. 回答2:

Best win32 compiled scripting language? [closed]

怎甘沉沦 提交于 2019-12-12 18:25:21
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers

help with subversion (svn) hook script

ぐ巨炮叔叔 提交于 2019-12-12 18:24:41
问题 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 Subversion (svn + tortoiseSvn) commit not locked file 回答1: Use a pre-commit hook. Pre-commit hook receives 2 arguments: # [1] REPOS-PATH (the path to this repository) # [2] TXN-NAME (the name of the txn about to be committed) You need to use svnlook to determine if there are svn:needs

script to move all files from one location to another location

落爺英雄遲暮 提交于 2019-12-12 17:19:05
问题 can someone help me with a dos script to move all files from one location to another location 回答1: move <sourcepath>\*.* <destpath> IE, if you wanted to move all files from c:\test\ to c:\test2 move c:\test\*.* c:\test2 if you want to suppress the prompt to overwrite files move /Y c:\test\*.* c:\test2 If you want to move from the current directory, you can specify just the *.* . Also you can do relative paths. So if you want to move the current directory's files up one directory, you'd do

Wrap an executable to diagnose it's invocations

痴心易碎 提交于 2019-12-12 16:46:15
问题 I have a Windows executable (whoami) which is crashing every so often. It's called from another process to get details about the current user and domain. I'd like to know what parameters are passed when it fails. Does anyone know of an appropriate way to wrap the process and write it's command line arguments to log while still calling the process? Say the command is used like this: 'whoami.exe /all' I'd like a script to exist instead of the whoami.exe (with the same filename) which will write

AJAX and Cross-Site Scripting to Read the Header

我的梦境 提交于 2019-12-12 16:38:00
问题 Help me understand AJAX and cross-site scripting a little better. Writing AJAX is fairly straight forward. If I want to asynchronously read HTTP header of a website, I'd do something like this: var req = new XMLHttpRequest(); req.open('HEAD', 'http://www.stackoverflow.com/', true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) alert(req.responseText); else alert("Error loading page"); } }; req.send(null); However, when I copy and paste this into a

Sorting by value in multivalued field in elasticsearch

本秂侑毒 提交于 2019-12-12 16:21:41
问题 I have a multivalue field with integers in the document, for example { values: [1,2,3,4,5] } I apply range filter, for example from 2 to 4 and get list of document with values, contains 2,3,4. Now I'd like to sort results, and first return documents, which contains 3. I could do it using script sorting: { sort:{ _script: { script: "doc['values'].getValues().contains(3) ? 0 : 1", type: "number" } } } But I don't like it's performance, because getValues() returns a List actually, and contains

Run shell command from child shell

匆匆过客 提交于 2019-12-12 16:15:25
问题 I have a Unix shell script test.sh. Within the script i would like to invoke another shell and then execute the rest of the commands in the shell script from the child shell and exit To make it clear: test.sh #! /bin/bash /bin/bash /* create child shell */ <shell-command1> <shell-command2> ...... <shell-commandN> exit 0 What my intention is to run the shell-commands1 to shell-commandN from the child shell. Kindly tell me how to do this 回答1: You can setup in a group, like. #!/bin/bash (

PowerShell - Add grandparent folder name to file name

半世苍凉 提交于 2019-12-12 16:14:33
问题 I'm still pretty new at PS Scripting, so most of what I do is hacked together from examples. What I'm trying to do right now is search all the folders in a directory for PDFs and then rename them, adding the grandparent folder name to the file name. For example: c:\export\123\notes\abc.pdf would be renamed to c:\export\123\notes\123_abc.pdf The rest of the script, which works fine, uses GhostScript to convert them to TIFs and moves them to another server. The problem is that that all the PDFs

Issues using the tilde ~ in a simple function wrapper around scp

末鹿安然 提交于 2019-12-12 15:24:21
问题 I want place a simple bash function in my .bashrc that wraps around the scp command by accepting a 'source' argument and 'destination' argument, and so far have tried both function send() { eval "scp $1 user@annoyingly-long-server-name:$2" } and function send() { scp $1 user@annoyingly-long-server-name:$2 } ...but when I call either of the above a la send file.txt ~/ I get the error scp: home-directory-on-remote-machine: Operation not supported . After echoing each argument, it seems that the