scripting

Translating #!/bin/ksh date conversion function into #!/bin/sh

孤者浪人 提交于 2019-12-14 03:19:41
问题 I used this ksh function for converting "1-Jan-2011" format to "1.1.2011." #!/bin/ksh ##---- function to convert 3 char month into numeric value ---------- convertDate() { echo $1 | awk -F"-" '{print $1,$2,$3}' | read day mm yyyy ## split the date arg typeset -u mmm=`echo $mm` ## set month to uppercase typeset -u months=`cal $yyyy | grep "[A-Z][a-z][a-z]"` ## uppercase list of all months i=1 ## starting month for mon in $months; do ## loop thru month list ## if months match, set numeric month

script to read information from other sites

孤街醉人 提交于 2019-12-14 03:19:18
问题 a friend of mine wrote a script, which read information from other sites e.g. number of followers 3 ppl had and displayed them on his website. I was interested in doing such things. I searched for scripting and found out there are many scripting languages. How would I chose which one to learn? are they all the same? which one do u prefer to do my task? and finally any good reference you suggest? where I stand now: im basically starting from zero in scripting but I know how to code C, C++,

luabind did not launch the function i had defined to it

最后都变了- 提交于 2019-12-14 03:17:45
问题 In a class called Test_Class, I have a function : shoot_a_bullet(int damage) { cout << "runned"; // i had #using namespace std } I had defined the code like following luabind::module(myLuaState)[ luabind::def("shoot_a_bullet", &Test_Class::shoot_a_bullet) ]; And follow code didn't give me an output on screen luaL_dostring(myLuaState,"shoot_a_bullet(134)\n"); PS:I did put cin.get() at the end, that's not the problem. edit: My main purpose of doing this is to let my scripted Character/Enemies

@Render.Scripts in plain .html file - not in .cshtml

一个人想着一个人 提交于 2019-12-14 02:58:31
问题 I'm wondering - is it possible to add something like @Scripts.Render("~/bundles/jquery") in plain .html file (not the .cshtml file) 回答1: Yes, it is, you can use: <script src="/Scripts/jquery1.js"></script> <script src="/Scripts/jquery2.js"></script> <script src="/Scripts/jquery3.js"></script> Where jquery1.js, jquery2.js, jquery3.js are the files of the jquery bundle... 来源: https://stackoverflow.com/questions/37362389/render-scripts-in-plain-html-file-not-in-cshtml

WebSphere Scripting : AdminTask.createAuthDataEntry(…) : java.sql.SqlException: Login failed for user ''

£可爱£侵袭症+ 提交于 2019-12-14 02:29:10
问题 I'm having a problem with WebSphere 8.0 I create an ID by typing this into the Jython wsadmin console: AdminTask.createAuthDataEntry(['-alias', 'uni', '-user', 'uni', '-password', 'uni', '-description', 'uni/uni']) AdminConfig.save() I type this: AdminTask.listAuthDataEntries() and notice: '[[alias Unica9100/uni] [userId uni] [description uni] [_Websphere_Config_Data_Id cells/UnicaVMNode03Cell|security.xml#JAASAuthData_1401128477833] [_Websphere_Config_Data_Type JAASAuthData] [password ******

Is there a script available to resize SVG?

非 Y 不嫁゛ 提交于 2019-12-14 02:19:22
问题 Is there a way to script the rescaling of a .SVG from its current size (thousands of pixels) to a much smaller size? I've tried ImageMagick, but its support for SVG gradients is far too weak to be useful. The purpose is to work around a bug in a rendering library that sometimes causes svgs with large pixel sizes to allocate large rasters (before ultimately being rescaled smoothly down for actual display). For example, how can I change this 1024x1024px svg: <?xml version="1.0" encoding="UTF-8"

Re-insertion of <script> tags

ⅰ亾dé卋堺 提交于 2019-12-14 02:06:47
问题 Insertion of a file's tag, thus executing the file's code. Removal of the file's tag. Insertion of the same file's tag. Firebug does not seem to acknowledge and does not show the re inserted tag when the file's has already been inserted before. It does upon new insertions, of course. EDIT: Is this a problem of some kind? (the file still reloads apparently, but my tests only rely on logging some simple stuff) 回答1: Would simply evaling the code be sufficient for your purposes? eval(script

Exit MySQL script if database exists

两盒软妹~` 提交于 2019-12-14 01:30:04
问题 I have a MySQL script that I want to use only if the database doesn't exist to inject some initial demo data for development. If it does exist I just want to break out of the script. The script starts like CREATE DATABASE IF NOT EXISTS `demo-database`; USE `demo-database`; Is there a way to exit here or above the create database if the database exists so that it wont run through all the table setups and inserts? 回答1: Try this. Use INFORMATION_SCHEMA.SCHEMATA to check the existence of Database

Creating folder from file, copy initial file into folder and add prefix

浪尽此生 提交于 2019-12-13 23:47:59
问题 A folder should be created with file names after a torrent is finished. The files should be copied (not moved) and a prefix should be added. This is my actual .bat for /F "Tokens=*" %%i in ('Dir /B *.mp4') do md "%%~ni"|copy "%%i" "%%~ni" This works so far but I was not able to get a prefix added. That prefx should be added to the newly created file in the folder. A kind of progress bar like "xx MB of yy MB at aa MB/s Speed" would be nice but not essential. 回答1: Try this for /f "tokens=*" %%A

Batch script to find files greater than 10MB in D drive in windows xp

蓝咒 提交于 2019-12-13 23:13:51
问题 I would like to have a batch script where I can find files which are greater than 10MB in D: drive. Regards, Orbit. 回答1: Here is a batch script that will list all files that are greater than a given size (in bytes) in a given directory and all its subdirectories: @echo off setlocal enabledelayedexpansion set "SEARCH_DIR=%~1" set "FILE_SIZE=%~2" echo "%FILE_SIZE%" | findstr "\"[0-9][0-9]*\"" > NUL if errorlevel 1 ( echo Usage: %~nx0 directory file_size_in_bytes echo Lists all files in given