脚本

shell-script headers (#!/bin/sh vs #!/bin/csh)

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Why do all script files start with #!/bin/sh or with #!/bin/csh Is that required? What's the purpose of this? And what's the difference between the two? 回答1: This is known as a Shebang : http://en.wikipedia.org/wiki/Shebang_(Unix) #!interpreter [optional-arg] A shebang is only relevant when a script has the execute permission (e.g. chmod u+x script.sh). When a shell executes the script it will use the specified interpreter. Example: #!/bin/bash # file: foo.sh echo 1 $ chmod u+x foo.sh $ ./foo.sh 1 回答2: The #! line tells the kernel

How to add breakpoints in your inline javascript in chrome

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to debug my javascript code and able to successfully place breakpoints at required places under sources tab. However, I have run into an issue where I want to debug my inline javascript code. Do we have any chrome debugging tool feature using which I can debug my inline javascript code. I am fine with using Firebug too for debugging purpose. PS: By inline javascript code, I mean JS code inside body tag and in the same file. 回答1: Another way can be using the dynamic script method. Chrome provides simple parser command which can tag

parameter for shell scripts that is started with qsub

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: how can I parametrize a shell script that is executed on a grid (started with qsub) ? I have a shell script, where I use getopts to read the parameters. When I start (qsub script.sh -r firstparam -s secondparam ..) this working script with qsub I receive error messages, qsub: invalid option -- s qsub: illegal -r value as qsub thinks the parameter are for itself. Yet I have not found any solution. Thanks 回答1: Using the qsub -v option is the proper way: qsub -v par_name=par_value[,par_name=par_value...] script.sh par_name can be used as

Cannot execute script: Insufficient memory to continue the execution of the program

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a 123MB sql file which I need to execute in my local PC. But I am getting Cannot execute script: Insufficient memory to continue the execution of the program How to solve this issue? 回答1: use the command-line tool SQLCMD which is much leaner on memory. It is as simple as: SQLCMD -d <database-name> -i filename.sql You need valid credentials to access your SQL Server instance or even to access a database Taken from here . 回答2: It might help you! Please see below steps. sqlcmd -S server-name -d database-name -i script.sql Open cmd.exe as

How can i rerender Pinterest&#039;s Pin It button?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create and manipulate the Pin It button after page load. When i change the button properties with js, it should be rerendered to get the functionality of pinning dynamically loaded images. So, does Pinterest have any method like Facebook's B.XFBML.parse() function? Thanks... 回答1: Just add data-pin-build attribute to the SCRIPT tag: <script defer src="//assets.pinterest.com/js/pinit.js" data-pin-build="parsePinBtns"></script> That causes pinit.js to expose its internal build function to the global window object as parsePinBtns

From Photoshop actions to Photoshop scripting?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like Photoshop to automatically execute the following task for a given folder: Load all PNG files in a given folder. Convert each file's mode to RGB color Add one layer to each file Save the files as PSD in the same folder I have been told that this can be done with Photoshop scripting, but I don't know how to get started since unfortunately I don't have much experience with JavaScript. One thing I know is that I can't run the task above using Actions because when I record the last step (4), Photoshop records the action to save the

ASP.NET MVC 4 jQuery Validation Script Bundle Not Working

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have recentely upgraded a website to use ASP.NET MVC 4 and have the following code to render my jQuery validation bundle. But I get the following error: Microsoft JScript runtime error: Object doesn't support property or method 'live' And this error when clicking in a text box: Unhandled exception at line 1234, column 5 in http://localhost:13112/Scripts/jquery.validate.js 0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'call': object is null or undefined My bundle code: bundles.Add(new ScriptBundle("~

linux script to kill java process

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want linux script to kill java program running on console. Following is the process running as jar. [rapp@s1-dlap0 ~]$ ps -ef |grep java rapp 9473 1 0 15:03 pts/1 00:00:15 java -jar wskInterface-0.0.1-SNAPSHOT-jar-with-dependencies.jar rapp 10177 8995 0 16:00 pts/1 00:00:00 grep java [rapp@s1-dlap0 ~]$ 回答1: You can simply use pkill -f like this: pkill -f 'java -jar' EDIT: To kill a particular java process running your specific jar use this regex based pkill command: pkill -f 'java.*lnwskInterface' 回答2: If you just want to kill any/all java

Google remarketing tag - iframe height issue

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've noticed that Google's remarketing code inserts an iframe at the bottom of my page. The problem is that the iframe messes up my layout (it's 13px high and leaves a blank white vertical space at the bottom). I've tried to hide it with css but it's still visible in IE9: iframe[name='google_conversion_frame'] { height: 0 !important; line-height: 0 !important; font-size: 0 !important; } Therefore I've got two questions: a) how to hide this iframe in IE9 b) most importantly - is it safe or can it somehow affect the functionality of this

Post-install script with Python setuptools

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to specify a post-install Python script file as part of the setuptools setup.py file so that a user can run the command: python setup.py install on a local project file archive, or pip install for a PyPI project and the script will be run at the completion of the standard setuptools install? I am looking to perform post-install tasks that can be coded in a single Python script file (e.g. deliver a custom post-install message to the user, pull additional data files from a different remote source repository). I came across this