scripting

While Do loop and variables in a bash script?

ぐ巨炮叔叔 提交于 2019-12-23 06:00:10
问题 I'm a PHP programmer doing some BASH scripting and I'm not sure how global variables are working. I want to increment the 3 variables for each line in a supplied file. However, when I get to the bottom, the variables are still set at 0. How do I access the variables that are incremented within the WHILE DO loop? I just want to echo them out at the end.. From what I understand we're in kornshell #!/bin/bash typeset -i i=0 typeset -i t1=0 typeset -i t2=0 sed 1d $1 | \ while read word1 word2

Auto Restart/Reset countdown timer

↘锁芯ラ 提交于 2019-12-23 05:34:18
问题 What i want is that when the timer has reached the end-date and time it automatically start over but by counting down from 60 seconds. Im new to jquery and im strungling with this problem for almost 3 days and i cant get it running. My countdown is working perfectly with the end-data inserted from the database but when it reaches the end-date and time (eg: 0 days 0 hours 0 minutes 0 seconds) it should start by counting down from 60 seconds to zero. Can someone please help with this problem?

Xcode 6 running custom shell scripts

别等时光非礼了梦想. 提交于 2019-12-23 05:34:16
问题 When I build my target, in the information tab I can see the scheme building and the target building. At the end of the process it runs 2 custom shell scripts. I can't find where the target or project is running these 2 custom shell scrips. I've looked at target > build phases and it's not being set to run there. I also looked at project > build settings but I can't locate it there. I don't want to run these scripts but I don' know how to remove them! Any help would be great! Thanks 回答1: yup

which form of encryption is used in this asp function

妖精的绣舞 提交于 2019-12-23 05:29:21
问题 Below asp function is used to encrypt passwords. Function EncryptPassword(vPwd) vTempPwd = "" EncryptPassword = "" For i = 1 To Len(vPwd) vTempPwd = vTempPwd & Chr((255 - Asc(Mid(vPwd, i, i))) / 2) Next For i = Len(vPwd) + 1 To 10 vTempPwd = vTempPwd & CStr(i - Len(vPwd)) Next EncryptPassword = vTempPwd End Function Can anyone just tell me which method of encryption is this? I want to use the same method of encryption is asp.net. 来源: https://stackoverflow.com/questions/38127127/which-form-of

Unexpected result comparing values of rows and columns in two text files

南笙酒味 提交于 2019-12-23 05:23:10
问题 This is related to one of my previous question: How to compare values of rows and columns of two text files in bash? file1.txt (with special characters: cat -vet file1.txt) Name Col1 Col2 Col3^M$ -----------------------^M$ row1 1 4 7^M$ row2 2 5 8^M$ row3 3 6 9$ file2.txt (with special characters: cat -vet file2.txt) Name Col1 Col2 Col3^M$ -----------------------^M$ row1 1 4 7^M$ row2 2 5 999$ I have somewhat figured out a way to compare two files. But for some reason it is not giving me the

Is it possible to find files by the exact date then execute tar command on the results files?

女生的网名这么多〃 提交于 2019-12-23 05:06:16
问题 I want to search for files by the exact date and then execute tar command on the results files. Example: -rw-rw-r-- 1 0 Dec 4 08:07 file-1 -rw-rw-r-- 1 0 Dec 4 08:07 file-2 -rw-rw-r-- 1 0 Dec 5 08:07 file-3 I want to get only files with Dec 4 date and passing them to the tar command. The archive should contain: tar -ztvf dec4.tar.gz Output: -rw-rw-r-- 1 0 Dec 4 08:07 file-1 -rw-rw-r-- 1 0 Dec 4 08:07 file-2 This is my script it is still copying those Dec 5. ls -ltr ./ | grep "Dec 4" | tar

PowerShell and MS Access database

余生颓废 提交于 2019-12-23 04:53:43
问题 We would like to create AD users with PowerShell. With CSV it's not a problem, it's easy with scripts. Next level we would like to create AD users with PowerShell and MS Access database. Now we have the following problem: we can read the Access database, we load it in an object, but when we start our script, it says it is a object and not a string. So when we convert the object into a string, it loads all lines in the string and it creates one user with all names. The PowerShell script is:

PHP - Loopless way to split a string into a multidimensional array

时光怂恿深爱的人放手 提交于 2019-12-23 04:53:05
问题 How do I split a string into a multidimensional array in PHP without loops? My string is in the format "A,5|B,3|C,8" 回答1: Without you actually doing the looping part, something based on array_map + explode should do the trick ; for instance, considering you are using PHP 5.3 : $str = "A,5|B,3|C,8"; $a = array_map( function ($substr) { return explode(',', $substr); }, explode('|', $str) ); var_dump($a); Will get you : array 0 => array 0 => string 'A' (length=1) 1 => string '5' (length=1) 1 =>

scripting in java - javascript from a server-side class file in Java 1.5

ぃ、小莉子 提交于 2019-12-23 04:47:45
问题 I have three types of get requests that are delivered to a class file on web application from a mobile device. Because the mobile device provides no cookies, the log file hit only has in.ter.nal.ip ser.ver.i.p:port 2009-06-05 09:14:44 GET /applicationname/mobiledevicexml reqtype=login&userid=xx### 200 87 - MercuryMobile/1.0 CFNetwork/342.1 Darwin/9.4.1 cookieArrayLength=0; If I can instantiate javascript in my class file, and generate a javascript function call to urchinTracker() from inside

How to detect when a page gets updated with PHP [closed]

我的梦境 提交于 2019-12-23 04:45:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I was wondering how to detect when a page gets updated with PHP. I've researched things on Google, but came across nothing. What I want to do is call a specific function when a page gets updated. I will be running a cron job in order to run the code. I want something like this: if (page updated) { //functions }