find

jquery can't get the value from an input element (2)

↘锁芯ラ 提交于 2019-12-24 15:11:34
问题 I am using jquery trying to retrieve the value of a text input but it is not working. can anyone see what I am doing wrong? http://jsfiddle.net/silvajeff/4Sb8K/3/ <table id="oustandingItems"> <tr><th>Category</th></tr> <tr><td><input name="mytest" /></td></tr> <tr><td><input name="mytest" value="123"/></td></tr> <tr><td><input name="mytest" /></td></tr> <tr><td><input name="mytest" /></td></tr> </table> <button id="findRow">Find Row</button> <input type="text" id="myRow" /> $("#findRow")

Replace text in a string using PHP

时光总嘲笑我的痴心妄想 提交于 2019-12-24 14:02:48
问题 I have this string: $my_string = "http://apinmo.com/1/2/3.jpg 4444/8888/7777 http://apinmo.com/4/5/8-1.jpg"; And I need to remove the last two slashs of the urls to get this, all the rest remain the same: $my_NEW_string = "http://apinmo.com/123.jpg 4444/8888/7777 http://apinmo.com/458-1.jpg"; I tried this: $my_NEW_string = preg_replace('/(?<=\d)\/(?=\d)/', '', $my_string); but I get this: $my_NEW_string = "http://apinmo.com/123.jpg 444488887777 http://apinmo.com/458-1.jpg"; The slashes in

Find all files whose names contain a given string, and highlight it

半世苍凉 提交于 2019-12-24 13:53:06
问题 I find myself writing this command a lot: find . -iname "*foo*" | fgrep -i "foo" To find all files and folders that have "foo" in their names, and to highlight the matching part in the results. That's not very convenient. What would be a simpler solution? Do I need to write a custom command for this? 回答1: For convenience you can create a BASH function for this: hlt() { find . -iname '*'"$1"'*' | grep --color "$1"; } and call it as: hlt foo 回答2: if you're using bash take a look at Make a Bash

How to read first n-th files from directory (pleaso NOT a “head -n solution”)?

本小妞迷上赌 提交于 2019-12-24 12:30:43
问题 I have a directory with more then 60000 files. How to get only N of them without using a find | head -n or ls | head -n solutions, since find and ls to read this list of files takes too much time. Are there any configs for ls and find or are there any other programs, which can help to safe the time? 回答1: For what it worth: # Create 60000 files sh$ for i in {0..100}; do for j in {0..600}; do touch $(printf "%05d" $(($i+$j*100))); done; done On Linux Debian Wheezy x86_64 w/ext4 file system: sh$

Java Regex looking a combination of words in any order

≡放荡痞女 提交于 2019-12-24 11:50:17
问题 I'm looking for a way to find two or more words in a sentence that might come in any order. For example I might look for the words "NCAA" and "Basketball" in a sentence that says NCAA Indiana Vs. Purdue Basketball" or it might say "Indiana Vs. Purdue Basketball NCAA". How would I write the regex for the words showing in any order and any location in the string? 回答1: You can use lookahead: (?=.*?NCAA)(?=.*?Basketball) Or else use alternation: NCAA.*?Basketball|Basketball.*?NCAA 来源: https:/

Self-referential find in controller count relations

夙愿已清 提交于 2019-12-24 11:49:15
问题 I'm having real trouble pulling out a set of records that are self-referentially related to a user in order to show these on a user's 'show' page. Here's the idea: Users ( current_user ) rate the compatibility between two other users ( user_a and user_b ). They can rate compatibility either positively or negatively: rating two users "compatible" creates a positive_connection between user_a and user_b, and rating them "incompatible" creates a negative_connection . So there are models for

MS Word VBA Find and Loop (NOT Replace)

我是研究僧i 提交于 2019-12-24 10:36:29
问题 Sorry for the fundamental question but I am a LONGtime Access VBA developer who is getting my butt kicked by Word. I am building a solution for someone who uses a Legal Case Management System with a specific numbering scheme (aaa-aaa-##-##-###). I need to search a document for hyphens and then grab the whole paragraph where a hyphen is found. I then need to send the text from that paragraph to a separate function which parses out the file number from the paragraph (this function already works

Finding an asp:button and asp:textbox in Javascript

无人久伴 提交于 2019-12-24 09:54:06
问题 What I'm trying to do is get an asp:button to click. The only problem is that it is within a few tags. Example: <loginview> <asp:login1> <logintemplate> //asp:textbox and asp:button are located here. </loginview> </asp:login> </logintemplate> So how would I get javascript to point to that location so that I can manipulate it. For example, get the button to click. 回答1: First, you need to figure out which template is being used, since you can only access the active one. (Anonymous or LoggedIn).

Scripting for file management with a very large amount of files

佐手、 提交于 2019-12-24 09:39:33
问题 I have a three OSX machine setup that was using syncthing to keep shared drives synchronized remotely. Someone made some mistakes and a lot of files ended up getting renamed. So all throughout this drive I have situations where there's a file of size 0KB named,for example, file.jpg and another file with real size named file.sync-confilct201705-4528.jpg . I need to search the entire drive recursively and while I find a file with the sync-conflict string in it, check to see if there is the same

Bash: How to tail then copy multiple files (eg using xargs)?

我的梦境 提交于 2019-12-24 09:30:45
问题 I've been trying various combinations of xargs and piping but I just can't get the right result. Previous questions don't quite cover exactly what I want to do: I have a source directory somewhere, lets say /foo/source, with a mix of different files I want to copy just the csv files found in source to a different destination, say /foo/dest But I ALSO at the same time need to remove 232 header rows (eg using tail) I've figured out that I need to pipe the results of find into xargs, which can