How to copy class and function name in Blackfire report - blackfire

When I am copy-pasting method name from Blackfire profile, I am getting a reversed string like this:
sgnitsiLredivorPdaol::yrotisopeRresopmoC\yrotisopeR\resopmoC
What is intended way to copy a proper method name (not reversed)?
Why does Blackfire has such behaviour? Is this some kind of stupid joke or copy-paste protection?

This is indeed a UX issue we currently have in Blackfire, let me explain it to you:
We want to display the end of the namespace/classname value in this part of the interface
We want to have a text-overflow ellipsis on the left part of the value.
Unfortunately, using text-overflow: ellipsis on the left of the text is not supported by modern browsers at the moment.
There are two ways to do that: Either know the width of the text, work with a fixed width column and truncate programmatically or use a hack, revert the letters, change the text direction from left-to-right to right-to-left locally and use traditional text-overflow.
As we deal with a resizable UI here, we chose the second option, and this is the one that provide the better experience at the moment. However, as you notice, this issue remains.
We're thinking about a fix for this issue. It might be with the Clipboard API.
In the meantime, here's the way you can copy/paste the value :
Just expand a node and copy from the inner box, see:
Hope it helps you until we find a better solution.

Related

Playwright: Find icon by classname in near range of a defined text

Good evening,
I would like to ask if someone knows, if it's possible in Playwright to check if an icon - under certain conditions - is visible?
The conditions are:
the icon has a specific name, but appears multiple times on the site
it has to be in a certain range (lets say 15 pixel) of a unique text
My first idea was something like this...
await expect(page.locator('icon:near(:text("Specific text"), 15)'))
...but as you can see, I miss the option to declare the icons classname
Thanks in advance and have a nice evening.
finethen
According to the Playwright docs on matching by layout, those matchers “can be combined with regular CSS to pinpoint one of the multiple choices.”
If I’m understanding correctly that any css can be used, then you should be able to use the class name just fine. So basing off your example, you should be able to do something like
.yourclassname:near(:text("Specific text"), 15)
Hope that works for you!

UITextView, with spell checking, how to use `ignoreWord`?

Regarding the spell checking in iOS, it's possible to tell the checker to ignore a word (or learn a word),
https://developer.apple.com/documentation/uikit/uitextchecker
func ignoreWord(String)
Tells the receiver to ignore the specified word when spell-checking.
- Apple doco
Say I have a UITextView which opens. I want spell checking On.
I know the user may type "fattie" which would get the red underline.
How do I tell that text view in that instance, to, ignore "fattie" ?
An obvious use case ...
User is typing in "#tag" type friends; in our data of course we know what all the tags are, it's absurd they get marked as spelling errors.
It seems incredible one can't just say "don't underline these words - - list".
Code example ....
So we have
var t: UITextView
and then, there must be "some way" to:
yourTextView.something->something.textChecker.ignoreWord("fattie"
.. some way to get to the text view's textChecker instance! How ?!?!
Partial answer: I just stumbled on to that, bizarrely, you can just call
UITextChecker.learnWord("fattie")
UITextChecker.learnWord("blahdee")
from, apparently, just anywhere in an app.
However this raises many issues,
• How to call the 'ignore' one, which seems better
• That one still makes the user tap the annoying, stupid, "in quotes" OK box in the suggestions bar - it seems to have not really "learned" anything
• Disturbingly, I think this goes for the "WHOLE PHONE". I only want it in that instance of the user using that text view.
A mystery!

Vimscript - Programmatically get colors from colorscheme

I'm trying to create an autocmd in Vimscript which sets a few attributes of the colorscheme as I want them. Specifically, I'm trying to make the NonText background have the same color as the regular background.
The problem is, I have no idea how to get a colorscheme's background color from within vimscript.
Anyone have any ideas?
Edit:
So here's what I'm trying to achieve. Actually a few things:
Originally, I was trying to hide the "~" that's in front of all non-existant lines. Someone suggested setting it as the same color as the background, so I added an autocmd that did this: hi NonText guifg=bg.
After doing that, I realized that some colorschems have a different background color for the regular lines and the "non-existant" part of the buffer. This is a problem, since my autocmd sets the NonText color to be the same as the regular background, not the special "non-existant" background.
Also, I decided that even without the whole "get rid of the ~" issue, I don't like it when the non-existant parts of buffers are a different color.
Lastly, I'm trying to learn about vim colorschemes in general, since I'm planning to write a plugin that will need some other tricks like figuring out the colors from schemes.
There are two approaches here:
Use hi NonText. Not alone, but with :redir, of course. I won’t describe it more verbose because I personally don’t like any solution using :redir for a number of reasons (they are: 1. requires parsing 2. no nested redirections 3. no way to know whether redirection is active).
Use synIDattr() and hlID():
let bgcolor=synIDattr(hlID('NonText'), 'bg#')
will assign something in form "#rrggbb" (just "N" in terminal) to variable bgcolor, or -1 if background was not defined for this group. You can use this to construct :hi command (regular background should be defined in Normal group).
Just use
hi link NonText Ignore
. Works unless your colorscheme has redefined Ignore group so that it actually is shown.
hi NonText guibg=bg
How about that?
EDIT after clarification from the OP:
Okey, let's go from the start. For now I'd put writing of a plugin on hold for a while until you get acquinted with the basic Vim settings and language. The characters, one of which is the ~ you're trying to hide, are so called list characters, and they can be defined in the listchars option. What yours are you can see by set listchars?. They can also be turned on/off (visible or invisible, I mean) by either set list / set nolist, or toggled on/off with set invlist.
The NonText highlighting group is the one that "covers" the display of those characters, but really the way to turn them on/off is via the setting, not via overwriting the background/foreground color of that group. Therefore my original confusion over your intentions. There is also a highlighting group SpecialKey that you might also find interesting, since it cover some cases.

auto_complete_for: prevent the first item from being auto-selected

The auto_complete_for dealio from script.aculo.us is great an all, but is there a way for me to selectively disable the fact that it always auto-selects the first item in the list?
The problem is that, if I want to type my own entry that is new, and novel, I don't want the first item in the list to be auto-selected. The reason is because when I TAB out of the field, it selects, and fills the text box with that first item.
I got around that, somewhat, by making the first item in the list the same as what I'm typing, but that's not perfect either, because the auto_complete list doesn't always update with every keystroke, depending on how fast I type. I've tried setting the list refresh rate to the lowest value (1 millisecond) but no go.
What I really want is an option in "auto_complete_for" that doesn't select that first item at all - the same way that Google Instant doesn't automatically select the first suggested search phrase - you have to arrow-down to select one.
Maybe I can do this via an HTML option that I'm missing?
Looking at the source, there doesn't appear to be an option for that, but I bet if you changed line 284 of controls.js to this.index = -1; it would do what you want.
Otherwise, it might be time to look for a different autocomplete widget.
If your requirements are too far away from the available plugin, then I guess there is no point in tinkering around. Its best to write your own JS code.
You might want to consider this: https://github.com/laktek/jQuery-Smart-Auto-Complete
or this : https://github.com/reinh/jquery-autocomplete
I'll add another alternative that works great with Rails 3:
http://github.com/crowdint/rails3-jquery-autocomplete
I recently implemented auto complete for more than a field for Rails 2.0.2.
The plugin I used is:- https://github.com/david-kerins/auto_complete . Not sure if it supports Rails 3.
I have also encountered issues on implementing the above scenario and have posted questions( Implementing auto complete for more than one field in Rails ; Implementing a OnClick kind of functionality and formatting wrt Rails Partial-Views ) on stackoverflow for the same, I have been lucky on getting things working for me based on my requirement.
Kindly refer to these questions, they might have relevance to your requirement.

Making tagsoup markup cleansing optional

Tagsoup is interfering with input and formatting it incorrectly. For instance when we have the following markup
Text outside anchor
It is formatted as follows
Text outside anchor
This is a simple example but we have other issues as well. So we made tagsoup cleanup/formatting optional by adding an extra attribute to textarea control.
Here is the diff(https://github.com/binnyg/orbeon-forms/commit/044c29e32ce36e5b391abfc782ee44f0354bddd3).
Textarea would now look like this
<textarea skip-cleanmarkup="true" mediatype="text/html" />
Two questions
Is this the right approach?
If I provide a patch can it make it to orbeon codebase?
Thanks
BinnyG
Erik, Alex, et al
I think there are two questions here:
The first Concern is a question of Tag Soup and the clean up that happens OOTB: Empty tags are converted to singleton tags which when consumed/sent to the client browser as markup gets "fixed" by browsers like firefox but because of the loss of precision they do the wrong thing.
Turning off this clean up helps in this case but for this issue alone is not really the right answer because we it takes away a security feature and a well-formed markup feature... so there may need to be some adjustment to the handling of at least certain empty tags (other than turning them in to invalid singleton tags.)
All this brings us to the second concern which is do we always want those features in play? Our use-case says no. We want the user to be able to spit out whatever markup they want, invalid or not. We're not putting the form in an app that needs to protect the user from cross script coding, we're building a tool that lets users edit web pages -- hence we have turned off the clean-up.
But turning off cleanup wholesale? Well it's important that we can do it if that's what our usecase calls for but the implementation we have is all or nothing. It would be nice to be able to define strategies for cleanup. Make that function plug-able. For example:
* In the XML Config of the system define a "map" of config names to class names which implement the a given strategy. In the XForm Def the author would specify the name from the map.
If TagSoup transforms:
Text outside anchor
Into:
Text outside anchor
Wouldn't that be bug in TagSoup? If that was the case, then I'd say that it is better to fix this issue rather than disable TagSoup. But, it isn't a bug in TagSoup; here is what seems to be happening. Say the browsers sends the following to the client:
<a shape="rect"></a>After<br clear="none">
This goes through TagSoup, the result goes through the XSLT clean-up code, and the following is sent to the browser:
<a shape="rect"/>After<br clear="none"/>
The issue is on the browser, which transforms this into:
<a shape="rect">After</a><br clear="none"/>
The problem is that we serialize this as XML with Dom4jUtils.domToString(cleanedDocument), while it would be more prudent to serialize it as HTML. Here we could use the Saxon serializer. It is also used from HTMLSerializer. Maybe you can try changing this code to use it instead of using Dom4jUtils.domToString(). You'll let us know what you find when a get a chance to do that.
Binesh and I agree, if there is a bug it would be a good idea to address the issue closer to the root. But I think the specific issue he is only part of the matter.
We're thinking it would be best to have some kind of name-to-strategy mapping so that RTEs can call in the server-side processing that is right for them or the default if it's not specified.

Resources