Why doesn't the kitten example in the Chrome extension development tutorial load any images? - google-chrome-extension

In the Getting Started page, we're promised kittenish goodness from Flickr. Putting the extension together according to the instructions, no kittenish goodness materializes. Instead, the popup window shows a small blank rectangular bar, devoid of anything fuzzy or cute.
Why?
(I'm asking this question with the intent to answer it, because I couldn't find any other way to report the mistake.)

As on 18-Jun-2014, the fix mentioned by Emerson seems to be taken care of in the sample downloads.
If you are still not able to see the images in the popup, you should consider applying for a Flickr API Key
And replace the existing key with the key that you generated in line number 25 of poupup.js file.

There's a bug in the popup.js file on line 40. The reference to kittensOnFlickr_ should be searchOnFlickr_ instead. Fix and reload, and tada, kitteh.

8/1/2014 - The code on line has indeed been fixed, but this tutorial still wouldn't work for me until I pasted my own API key.
HOWEVER
Make sure you don't remove the trailing ampersand (the &) at the end of the pasted api key. The ampersand needs to be there or your code still won't work!

Related

How can I make lines wrapped in css, html or js

I'm using Arabic language while designing my website and I want to wrap lines like it displays in Microsoft word (in that there is no line wider/smaller than another)
http://c.top4top.net/p_432s7e8u0.png
Without any example of your code, it's hard to say based on your personal situation but you may be looking for the following CSS property:
word-wrap: break-word
This should wrap your text in an element where this property is applied.
See the following link from W3Schools.
https://www.w3schools.com/cssref/css3_pr_word-wrap.asp
If this isn't what you're looking for, post an example of your code and we can try again!! :)
I'm not too sure whether you're talking about your actual website content or your IDE / Developer Tool. I'd assume the latter as you're talking about javascript and css (which the user wouldn't see on the page) but hey, here's a reference to how to show users it like that (on a website) anyway
"how do you change spacing of words to fit the whole line?"
https://www.cnet.com/forums/discussions/how-do-you-change-spacing-of-words-to-fit-the-whole-line-248002/
For line wrap, I suggest Googling "line wrap " + the tool you're using
For justify, it's likely not supported in the tool you're using, but you can still throw an attempt at Googling "justify text in " + the tool you're using
Note: I'd give more information, but your question lacks detail

Azure Search result highlight snippets

I am using the Hit Highlighting feature in Azure Search and noticed a discrepancy in the way it behaves from the documentation. In the documentation it says that when you use hit highlighting it will return a snippet of the field with the highlight, but it always returns the entire field (with proper highlighting).
Is there a way to have Azure Search instead return just a snippet (say of about 200 characters) that includes the highlight?
Currently, the answer is no, you cannot. The field breaks according to (English) sentence rules, ie. it breaks on ".", "!", "?".
Also see this question for an example on breaking and some more info relating to the delimiters.
Depending on the nature of the field you might be able to add one of the above delimiters to 'emulate' what you want to accomplish (as suggested by Nate Ko).
I want to suggest something else on top of what Nate spoke to. When you look at the document response, also take a look at the Highlights part of the results (as opposed to the Document). For example, you might be currently getting the field results by retrieving something like this:
Results[i].Document.DESCRIPTION
If there is a highlight found for that field, the snipped will be found here:
Results[i].Highlights.DESCRIPTION
What I like to do is to first check if there is a valid Highlight and if so display it. If not, I show the actual field content.
Liam
We recently introduced a change that improves the highlighter performance on large fields and NLP experience. One side effect of the change was that the new highlighter generates snippets based on sentences, breaking the text field on '.' (period).
One way to workaround the issue is to put '.'s in the field. We are working to enforce the snippet size and let you know when it is available.

Exclude comments from search results in IntelliJ global search?

I found the grammar error "it's" as a possessive on one page of a large project. I'm trying to search for any other usages of this on pages to correct it, but I'm getting results containing hundreds of comments. I just want to filter for the important user-facing portions of the project. Is there a way to exclude comments from the results of a global search?
In more recent versions, at least in PyCharm 2018 (similar to IntelliJ), there is a filter option "Except comments," as shown here:
(Click the small filter icon to show the dropdown.)
Note: The selected filter option persists during a session, and the active filter option is not immediately apparent unless you open the dropdown. To prevent accidentally limiting subsequent searches, it may be a good idea to switch back to "Anywhere" afterward.
Another approach would be to enable the "Regular expression" (or "Regex") checkbox in the search dialog, then use some kind of negative lookaround to exclude comments.
In one case, I needed to exclude lines with single-line comments (e.g. # this is a comment) from a search, but not lines with inline comments (e.g. a=b+1 # this is an inline comment). The following did the trick, searching for something (for Python comments, starting with #):
^((?!#).)*something.*$
Please note I'm not a regex-expert, so this regex pattern can probably be improved upon greatly, but it illustrates the idea. You can play around with this on regex101. Any comments to improve the pattern are most welcome, of course.
Note sure if this approach could be extended to multiline comments though. (as in """ several lines here """).
It's difficult to suggest something without really looking at the code, but since it seems like a one-off thing, I would use global search just in comments to temporary replace "it's" with some #temporary-token#, then use global search everywhere, you should everything what's left. Then rollback temporary token for comments. Should be easy to try with VCS. Just an idea.
As you can see, with "Comments only" option, only one #token is found.

TYPO3: indexed_search and title tag

Is there a way to get a title tag in the search results of indexed_search?
Instead of
Text
there should be
Text
Not a real solution but best I could do:
I think this won't be possible without changing the extension's PHP code. If you do so, copy the extension folder from the systext folder to your typo3conf/ext folder, otherwise you will get in trouble when updating Typo3.
indexed_search seems to have only hardcoded -Tags. You can check this by looking first at the actual HTML output (your search results). Then compare this with the HTML template used. If you have shell access to your server, a grep command might help to locate the correct template. Then try to find the marker. I suppose in your case it's ###TITLE###. Then you have to figure out how the marker is filled. Again a grep command for '###TITLE###' in the folder's extension might help you. Then you will see if the tag is hardcoded or not and how you can change it.
Often the faster solution is to use the template object browser and to try to find a piece of TypoScript below plugin.indexed_search which could be responsible what you want to change.
Unfortunately in your case both didn't help. For some strange reason, '###TITLE###' isn't contained anywhere in the the indexed_search extension.
A very ugly workaround would be to use javascript or jquery to insert the attribute.

CKEditor and Font Color saved but not working

I've just installed CKEditor and call it with JS tag.
When I save the text, all the font attributes (indentation, space, size, decoration,etc.) are correctly saved .
The problem is that when I want to edit the data, with CKEditor, all these attributes are well loaded but the COLOR even if, in the example below, it's set to "BLUE"!
Which is very bizarre because when I can see the color style property in my database:
<h3 style=\"\\"color:blue\\"\">
<strong>aulne </strong>kjhqsdf <span style=\"\\"color:#008000;\\"\"><u>kjhkjsdfh </u></span>j'<span style=\"\\"\\\\"\\\\"\\"\"><em>espère </em></span><span style=\"\\"\\\\"\\\\"\\"\">bien<sup>2</sup></span></h3>
I found this old bug post http://dev.fckeditor.net/ticket/116
where no solution is found.
Thank very much,
regards.
I found the problem:
on the php side, before inserting, I was using the "addslash" function I forgot to remove.
Thanks again.
It stopped working when I commented out the stripslashes from the php code. So I was doing the opposite and not stripping the slashes. Once I read the other answer I thought dah, I commented the following out yesterday. Now works fine! Certain PHP modes like safe mode will generate extra slashes to lessen hack attempts so moving code from servers with different modes can cause issues. So this answer is the same but opposite reason. My server is in safe mode so it automatically adds the slashes and I must remove them.
$a10 = stripslashes($a10);

Resources