I am trying to create an AppleScript that does a google search.
Without a script I would simply enter
Site:help.apple.com/ "iPhone" User Guide
into the URL bar to do a search. Naturally the quote iPhone quote is for an exact match and the User Guide is a search for either word.
I have tried using escape codes, and I have tried leaving them out.
open location "site:help.apple.com/ " & "\"" & "iPhone" & "\"" & "User Guide"
open location "site:help.apple.com/ iPhone User Guide"
The result looks like site:help.apple.com/%20"iPhone"User%20Guide
It seems to be reading the whole thing as a single URL.
Is there a way to get google to do a search based on the Site: string?
Try using a full google search url:
open location "https://www.google.com/search?q=iphone+user+guide+site%3Ahelp.apple.com"
Things to note:
Escape spaces with +
Url encoded the : character (%3A)
Putting the 'site:' part at end
Related
=HYPERLINK("file:///C:/Users/dholstei/projects/xmtr%20DB/data_sheet-Instructions.htm#TestDataSheet", "help")
in Excel resolves to
file:///C:/Users/dholstei/projects/xmtr%20DB/data_sheet-Instructions.htm
in the web browser
Interestingly, hovering over the link gives a small pop-up that shows the correct, full target. Variations on that, like concatenating the subsection to the path of a root document don't work either, the subsection is stripped.
The pound sign is a valid character to use in a file name but is not accepted in hyperlinks in Office documents.
Editor : Sublime Text 3
Does anyone knows what is that red highlight in the image above?
PHP error? editor(Sublime) error? or something else?
I'm working on a PHP project.
This is a known bug in the way Sublime Text currently highlights & characters that are part of a URL. See https://github.com/sublimehq/Packages/issues/428 for a discussion about it.
Basically, the problem is that, in HTML, & characters can't normally be used on their own, they are supposed to begin a reference to an "entity"/character. In HTML & is represented by & which stands for "ampersand", the name of this character. However, as per the above discussion, it seems to be valid in some circumstances inside URLs.
There are a couple of ways to "fix" the problem yourself.
One would be to modify your color scheme to not highlight scope invalid.illegal.bad-ampersand.html, but this would affect legitimate invalid uses.
Another would be to override the HTML syntax definition that ST uses to not mark the ampersand as invalid when inside a href etc. (this is the offending line.)
Probably the easiest solution is just to use & in place of & in your hrefs for now.
I have a document that contains long filenames, followed by a hyphen, followed by a description of the contents of the file. The files are all PDFs. I am converting this document into a page on our website, so that it has the filename, which should be a link to the file, followed by the description of the file contents.
I'm fairly versed in the basics of VIM, but advanced search/replace is something I'm lacking in. What I'd like to do is convert each filename into a link to that filename. For example:
WebAdapt_Prod_Int_10.1_Install.IIS7.2008R2.pdf - Step by step instructions for installing ArcSDE 10.1 for Oracle on the ‘Test’ environment, including configuration notes.
Should convert to:
WebAdapt_Prod_Int_10.1_Install.IIS7.2008R2.pdf - Step by step instructions for installing ArcSDE 10.1 for Oracle on the ‘Test’ environment, including configuration notes.
There are roughly 30 of these documents, so going line-by-line would be time consuming (though by the time I get a response I'll probably already have done it). I'd just like to know how to do this for the next time I'm given a big text file that needs formatting.
Thanks in advance!
Try this:
:%s!\v^\S+\.pdf!&!
Please note that the above doesn't try to do anything with HTML entities though. See the Vim Tips wiki for a possible solution if that's a concern.
Edit: The way this works:
:% - filter the entire file
s!...!...! - substitute
\v - set "very magic" syntax for regexps
^\S+\.pdf - match one or more non-spaces at the begging of line, followed by .pdf
& - replace with the link: & is the matched string (that is, the filename).
I am using hit-highlighting in azure search. It works fine but I want to fine tune it a bit.
Say, a field has the following value:
"It uses period as the delimiter. If not, please clarify"
If I search for "please" I will get a highlight hit on that field, e.g.:
"If not, <em>please</em> clarify"
If I search for "period" I will get a highlight hit on that field, e.g.:
"It uses <em>period</em> as the delimiter."
After trying it with several examples it seems that it uses period (".") as a delimiter so that it doesn't return the whole field.
From another SO question (Hit Highlighting in Azure Search Service) it seems that I cannot configure azure search to return the whole field with all terms highlighted.
I want to ask:
if this is really the case or more complex rules apply
do I have any control of how the field is split for hit highlighting, e.g. change the delimiter to say "," or "\n"
Thanks in advance
Unfortunately there is no way to customize how documents are split for hit highlighting. Feel free to use Azure Search User Voice website to post improvements ideas giving other users opportunity to vote for them and helping us prioritize: http://feedback.azure.com/forums/263029-azure-search
The hit highlighter splits documents into sentences. In general it's fair to assume it breaks on dots but it also handles abbreviations etc.
I know the topic of removing www.experts-echange.com has been beaten to death but having to type -site:www.experts-exchange.com is tedious. Even the ability to auto add strings to a query would solve this problem. I can probably wrap this into some wget mess but this seems like basic functionality many users would base their search engine of choice on. If you have discovered some easy method to do this for yourself please let me know.
I imagine there is a really slick toolbar that feeds google your text plus the additional strings you choose. There is some internal limit to the number of words and or operators Google searches process (with good reason I suppose).
The Google Custom Search API allows you to include or exclude sites from your search. You can add a custom search engine to your iGoogle home page.
Google custom search: http://www.google.com/coop/cse/
2 easy ways in Firefox:
Write a Grease Monkey script.
Use a search keyword. You type the keyword plus a string in the address bar to trigger a search. In this case the URL is http://www.google.com/search?q=-site:expertsexchange.com%20%s. To search on the site your tab is currently in, use javascript:location='http://www.google.com/search?num=100&q=site:'%20+%20escape(location.hostname)%20+%20'%20%S'%20;%20void%200
As an alternative to excluding results, I have a greasemonkey script that highlights google search results by domain. I configure subtle colors for a few sites of interest to me, like wikipedia & stackoverflow. But I use red for expertsexchange, which allows me to visually skip right over it.
I can publish my script if there is interest...
If you want to whip up your own script, you need to operate on two kinds of elements. Here are the two XPath expressions that I use:
//cite[contains(., '" + domain + "')]/ancestor::li[1]
//span[#class='a'][contains(., '" + domain + "')]/ancestor::div[#class='g']
Then I just apply background-color styles to matching elements. Pretty straight forward.