search

R: Insert node into xml tree at specific location

风流意气都作罢 提交于 2020-01-02 05:37:09
问题 Data I have an xml file with a structure like this (large example to show the needed flexibility): <rootnode sth="something" descr="ex"> <tag sth="sth1" descr="ex" anoAttr="sth2"> <tag sth="sth3" descr="ex2" searchA="sth4" anoAttr="sth5"> <tag sth="sth6" descr="ex3" oAttr="sth7" searchA="sth8" anoAttr="sth9"> <tag sth="sth10" descr="ex4" oAttr="sth11" searchA="sth12" anoAttr="sth13"> <someContent/> </tag> <someContent/> </tag> <tag sth="sth14" descr="ex5" oAttr="sth15" searchA="sth16" anoAttr

Regex to search html return, but not actual html jQuery

梦想与她 提交于 2020-01-02 05:14:07
问题 I'm making a highlighting plugin for a client to find things in a page and I decided to test it with a help viewer im still building but I'm having an issue that'll (probably) require some regex. I do not want to parse HTML, and im totally open on how to do this differently, this just seems like the the best/right way. http://oscargodson.com/labs/help-viewer http://oscargodson.com/labs/help-viewer/js/jquery.jhighlight.js Type something in the search... ok, refresh the page, now type, like,

Searching an unsorted array

穿精又带淫゛_ 提交于 2020-01-02 05:08:06
问题 What would be the smallest and largest number of comparisons in an unsorted array that could have duplicate elements as well ? I understand that finding anything in an unsorted array is a O(n) problem. But, is this true if the array contains duplicate elements as well ? By duplicate elements I mean, elements that occur more than once in the given array. 回答1: So the idea here is that you've got to walk the array from front to end because it is unsorted. That means you're looking at O(n) - a

MongoDB: returning rows sequentially before and after a given row?

余生长醉 提交于 2020-01-02 04:51:09
问题 In MongoDB, given a find() operator that returns a cursor for a set of rows, what is an idiomatic and time-efficient manner in which to return "context" rows, i.e. rows sequentially before and/or after each row in the set? For me the easiest way to explain this concept is using ack, which supports context searching. Given a file: line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 This is the output from ack: C:\temp>ack.pl -C 2 "line 4" test.txt line 2 line 3 line 4 line 5 line 6 I am

How does Google determine to index pages as discussion pages? [closed]

跟風遠走 提交于 2020-01-02 04:48:06
问题 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 7 years ago . I am building a question and answering site by myself. I want to make this site indexed as a Q&A site or Forums by Google, which can be retrieved when using the "Discussions" in Google. In my personal experience, Google Discussion Search is a pretty useful function when I want to get others' real opinions or

What would be the most efficient way to find a[i] = i in a sorted array?

隐身守侯 提交于 2020-01-02 03:45:12
问题 Given an array a[] , what would be the most efficient way to determine whether or not at least one element i satisfies the condition a[i] == i ? All the elements in the array are sorted and distinct, but they aren't necessarily integer types (i.e. they might be floating point types). 回答1: Several people have made claims about the relevance of “sorted”, “distinct” and “aren't necessarily integers”. In fact, proper selection of an efficient algorithm to solve this problem hinges on these

LIKE wildcard with multiple fields and spaces in MYSQL

这一生的挚爱 提交于 2020-01-02 03:37:08
问题 I'm having some trouble searching for any similar match in two fields. For example I have a table with the values: CAR MAKE CAR MODEL Ford Mustang (Shelby) Toyota Corolla Seat Leon etc etc. I want to be able to get the result "Ford, Mustang (Shelby)" by searching for any of the following combinations: Ford Mustang Shelby Ford Mustang or any other combination. Is this possible? I've had a good search but it's hard to find the search terms to describe what I mean. 回答1: Split your terms on

Lucene - searching for a numeric value field

你离开我真会死。 提交于 2020-01-02 03:30:30
问题 ok, i have searched for this in the past two hours with results that only give's tips, and not even one complete code to the rescue ( how would noobs learn if they cant see some samples ? ) i have created an index like so: Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo(Server.MapPath("/data/channels/"))); Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_29); IndexWriter writer = new IndexWriter(directory, analyzer, true, Lucene.Net.Index.IndexWriter.MaxFieldLength

How do you configure Lucene in Sitecore to only index the latest version of an item on the master db?

江枫思渺然 提交于 2020-01-02 03:29:27
问题 I recognise this is a moot point on the web database, so this question applies to the master db... I have a custom index set up in Sitecore 6.4.1 as follows: <index id="search_content_US" type="Sitecore.Search.Index, Sitecore.Kernel"> <param desc="name">$(id)</param> <param desc="folder">_search_content_US</param> <Analyzer ref="search/analyzer" /> <locations hint="list:AddCrawler"> <search_content_home type="Sitecore.Search.Crawlers.DatabaseCrawler, Sitecore.Kernel"> <Database>master<

Google Chrome DevTools elements search not working anymore?

放肆的年华 提交于 2020-01-02 03:29:11
问题 Since about a week ago, I haven't been able to search for elements or the contents of an element in Google Chrome DevTools. Did the latest Chrome update break this functionality or has something else changed that I should be aware of? I first thought I had accidentally changed some of the DevTools settings, but now the same thing started happening on my other dev machine as well, so I think it must be a bug in the latest update? Is it just me? :) EDIT: After a few days of wondering what could