command

How do you bind a command to a MenuItem (WPF)?

喜欢而已 提交于 2019-11-29 08:56:30
问题 Here is my code from the View.xaml.cs: private RelayCommand _closeCommand; public ICommand CloseCommand { get { if (_closeCommand == null) { _closeCommand = new RelayCommand(param => this.OnClose()); } return _closeCommand; } } public void OnClose() { Close(); } And here is some code from my View.xaml: <Window.ContextMenu> <ContextMenu> <MenuItem Name="menuItem_Close" Header="Close" Command="{Binding CloseCommand}" /> </ContextMenu> </Window.ContextMenu> When I run the program and select the

How to extract expression matching an email address in a text file using R or Command Line?

半腔热情 提交于 2019-11-29 08:21:25
I have a text file that contains email addresses and some information. I would like to know how can I extract those email address using R or the terminal? I've read that I can used some regular expression that would match an email address such as "^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$" But what command or function shall I used to extract those emails? There are no pattern in the text file. The command or function should just do a search on the document and extract the email addresses. Lets take an unstructured example file: this is a test fred is fred@foo.com

How to start a new process in a new window in an existing GNU screen session, from outside the session

好久不见. 提交于 2019-11-29 07:47:14
I asked a similar question here and got pretty close to what I'm looking for How to start a process from another application and then open a terminal to that process in gnu screen ...but, this doesn't quite get to what I'm after, which is starting a process in a new window (not an existing window) in an existing screen session (not a new screen session). If you are at a command prompt in a screen session, you can do this: screen [screen options] command param1 param2 But, how do you do it if you are outside the session? For example, if you want to run this as a cronjob? When you aren't in a

How to update Kendo Grid row from window

China☆狼群 提交于 2019-11-29 07:16:27
The set-up: ASP MVC project Kendo Grid in a view via Razor Column custom command, calls... JavaScript that opens Kendo window with refresh() URL to partial view as custom form The form has an input type=button calling JavaScript The barrier: How to update the row (dataItem?) of Grid with new model (from window/form javascript). I am unable to get a handle to target dataItem. Select() is not applicable here because the row is not selected. Instead, a custom button event opens modal Grid Window having the fields and commands for update, close, etc.. I could use the native Edit of Grid, but what

Launch Outlook to compose a message with subject and attachment by Outlook's command line switches

眉间皱痕 提交于 2019-11-29 07:09:24
The following Outlook's command works well with Outlook 2010: outlook.exe /c ipm.note /m "&subject=abc" /a "c:\attach.txt" But it does not work with Outlook 2007 and 2003. The strange are following commands work well with Outlook 2007 and 2003: outlook.exe /c ipm.note /m "&subject=abc" outlook.exe /c ipm.note /a "c:\attach.txt" How do I use one command line switch to launch Outlook to compose message with both subject and attachment for Outlook 2010/2007/2003? Robb Jones So far from what I've discovered with Outlook 2007 is that in order to achieve this you have to realize that /a implies /c

What is the difference between alias and export (and a function!)[BASH]?

对着背影说爱祢 提交于 2019-11-29 06:52:44
I'm surprised hasn't been asked before, but… What is the difference between alias ⇢ alias EXPORT='alias' function ⇢ function exporter() { echo $EXPORT } and export ⇢ export ALIAS='export' and for that matter... alias export=$(function) (j/k) in bash ( zsh , et al.) Specifically, I'd be most interested in knowing the lexical/practical difference between alias this=that and export that=this I have both forms ... all over the place - and would prefer to stop arbitrarily choosing one, over the other. 😂 I'm sure there is a great reference to a "scopes and use-cases for unix shells", somewhere...

How to prevent InvokeCommandAction from propagating event to parent elements?

守給你的承諾、 提交于 2019-11-29 06:45:45
问题 I realised that when using an InvokeCommandAcction associated to an EventTrigger, the original event was still routing up to the parent elements until it is handled. Well, I guess it is an expected behavior. But my question is how I can mark the event as Handled so it does not propagate up through the whole UI tree? Actually, as you handle this event in a command, everything will be handled in this command, therefore it does not need to propagate. And in one corner case I found, it causes

What does the $ mean when running commands?

青春壹個敷衍的年華 提交于 2019-11-29 06:31:54
I've been learning Python, and I keep running into the $ character in online documentation. Usually it goes something like this: $ python ez_setup.py (Yeah, I've been trying to install setup tools) I'm fairly certain that this command isn't for the python IDE or console, but I've tried windows cmd and it doesn't work. Any help? As of now, Python does not implement $ in its syntax. So, it has nothing to do with Python. Instead, what you are seeing is the terminal prompt of a Unix-based system (Mac, Linux, etc.) When you open up command prompt in Windows, you'll see something like: C:\Users

How to redefine a command in Vim?

∥☆過路亽.° 提交于 2019-11-29 06:22:09
In vim, in my .vimrc, how can I redefine a command (i.e. :e) as something else? I want to redefine :e * as :tabe * . Yktula I figured out a way to do it. See How to disable a built-in command in vim . From that, we can see that we can use cabbrev to change what a command does. For my needs, cabbrev e tabe is perfect. But we can generalize this solution to make commands starting with lower case characters accessible to users for user-defined ones: use cabbrev to (re)define a built-in command as a user-defined one. As such, we are able to redefine built-in commands as well as user-defined ones.

Py.test command not found, but library is installed

夙愿已清 提交于 2019-11-29 06:18:31
There are already two posts on stack overflow on this topic; however, none of them have resolved or addressed my specific situation. I have installed pytest via pip install pytest . I am able to import the library in Python as well. The problem is that when I try to use the py.test command in Terminal, I get py.test: command not found . Does anyone have any insight as to why I am not able to use the command in the terminal? EDIT: It even shows up as an installed package: $ pip list cycler (0.9.0) matplotlib (1.5.1) numpy (1.10.1) pip (8.1.0) py (1.4.31) pyparsing (2.0.7) pytest (2.9.0) python