Working with the rbokeh package I have created a figure p, where I'd like to add some arrows.
I'm able to add lines with the ly_segments command, but I can't seem to find a command to add arrows?
Do I miss something, or does this function not exist in the RBokeh package?
Related
In NetLogo is there a way to treat a text string as a command and execute it?
In the simplest case - is there way to simply generate a text string like "forward " concatenated with a number I don't know till runtime, so i end up with a text variable equal to "forward 8", say, and then execute that command?
My immediate need is probably what LOGO did, namely, have the user click buttons to move a turtle around with the pen down to draw some shape, say a square, saving those commands as they are written to an output window, saving the full text of the output window to some named text like "draw-square", and then have the user able to type "draw-square" in the command center and have the turtle execute those steps and draw a new square.
I could work around this I suppose by exporting the output to a myfile.nls text file, then restarting NetLogo to bring in the new command file using the __includes [ "myfile.nls"] step , but I'd rather not ask them to do that if I can avoid it and in any case that wouldn't work over the web.
Jasper answered the question in the comment above -- "run" and "runresult" do what I wanted.
I have a question about the Meld visual diff and merge tool, which is probably a simple misunderstanding.
But how do I adopt lines that were removed in the $REMOTE?
Please see the screenshot below for an example. I have changed the order of the imports and created a merge conflict, so now I want to pull the first change from the right, but then also the second change that would remove those lines that now already exist at top of the imports. I could remove them manually of course, but surely there is an easier way?
Or am I wrong with my assumption, that the middle pane is the result that gets written to $MERGED?
Edit: In this contrived example, I actually have a Delete action that I can use to remove those lines. But in a real-world merge I'm trying to do with meld the Delete action is greyed out, as is the Pull from Right action.
Any idea why Meld wouldn't allow me to Delete those lines that will be made obsolete by a Pull from Right above them?
I found out that holding the Shift key allows me to remove individual changes.
With sublime text 3, the autocomplete when typing "for" and hitting tab gives you:
for x in xrange(1,10):
pass
However, this is not a valid statement for python 3. I've tried creating a new build system using the following:
{
"cmd": ["c:/Python37/python.exe", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
the auto-complete for for still gives the wrong syntax. any advice?
The short version is that the sublime-build and sublime-snippet files that ship with Sublime in support of Python target Python version 2 and not Python version 3. I don't know if that's just due to that being what was used initially or if it's being done on purpose, though.
In Sublime, resources are generally related to a particular language based on the scope provided by the syntax definition. So for example snippets for Python are associated with source.python, your example build file uses that scope to know that it applies to Python files, and so on. As such, no matter what build you happen to be using, that has no effect on the snippets that are being offered.
By way of example, if you use the View Package File command from the command palette and enter the text python for snippet, the list of package resources will filter to Python/Snippets/for.sublime-snippet; pressing Enter to view that resource shows this:
<snippet>
<tabTrigger>for</tabTrigger>
<scope>source.python</scope>
<description>For Loop</description>
<content><![CDATA[
for ${1:x} in ${2:xrange(1,10)}:
${0:pass}
]]></content>
</snippet>
Here the tabTrigger specifies how the snippet inserts, scope controls where it inserts and content controls what it is inserts. Thus, in order to change it to support Python 3, you need to either create your own snippet or modify the existing one.
An issue with creating your own snippet is that it will be added to the list of snippets including the offending one, which allows it to possibly still trigger when you don't expect it to. There is also no general purposes "easy" way to disable individual snippets.
As such, generally the best course of action would be to use the PackageResourceViewer package. Install it, select PackageResourceViewer: Open Resource from the command palette, then select the same file as outlined above and modify the content of the snippet (e.g. replace xrange with range) and save the file.
That will get Sublime to replace the existing snippet with your edited version, so that it takes the place of the existing one and works the way you want.
When using "change all occurences" in VS Code, it will just search the whole file for matches and change them. Is there a similar feature doing the same thing, but limiting it to function or block scope?
Let's take an example where I would need that: I'm having a React file with several components and want to refactor a class component to a functional component, so I'm changing all occurences of this.props to props. However, I obviously don't want to change all the other class components as well that are supposed to stay class components. :-)
This seems like such a standard use case, but I'm not able to find it anywhere in VS Code. If it's not possible (yet, or for some good reasons) is there another way to achieve what I'm trying to do?
Check out the 'Add Selection To Next Find Match' functionality. It allows you to highlight the first occurrence you'd like to change, then using a keyboard shortcut, highlight the next occurrence and so on until you've selected all the instances you want to change. When all to-be-changed occurrences are selected, you can edit the selected text normally. Just remember to hit the escape key a couple times after editing to return to a single cursor!
Here are the keybindings for the command, it's Cmd+d on Mac:
https://code.visualstudio.com/docs/getstarted/keybindings
I find it very useful when renaming variables, there's also a shortcut to skip occurrences (Cmd+k Cmd+d) in case there is text you don't want to change in between.
I want to modify the existing tool tip text.I have following lines in plugin.xml
<command commandId="org.eclipse.ui.edit.paste"
id="org.eclipse.ui.edit.paste" tooltip="%pasteAction.TIP">
in plugin.properties
pasteAction.TIP=Paste
Existing tool tip appears like following
Paste(Ctrl+V)
I want to modify this existing tool tip to appears like following
Paste(Ctrl+V)
Paste a reference to the object
I am getting three problems to achieve this use case.
(Ctrl+V) added automatically at the end of tool tip text. which is not desired. It should appear where it is expected.
don't know how to Bold the particular string e.g. (Ctrl+V)
don't know how to make tool tip text multiline
we can use \n for multiline. it works but still looking for other two questions.
Thanks
For controls that you create you can use the org.eclipse.jface.window.ToolTip class to define custom tool tips.
For controls that Eclipse creates I don't know of any way to change the position of the key binding text or the font (bold).