command

Command, CommandHandler and CommandInvoker

白昼怎懂夜的黑 提交于 2019-12-20 09:40:04
问题 I recently saw a new pattern (new to me) in an open source ASP.NET MVC 3 project that hase many Command , CommandHandler , and CommandInvoker -with their interfaces- and I can't understand the pattern! Can you tell me what is this pattern's name and where can I learn about it? And what is its benefits please? Thanks in advance. Update: I'm talking about this project: An image gallery with RavenDB 回答1: Take a look at this article: Meanwhile… on the command side of my architecture It contains a

Extracting jar to specified directory

喜夏-厌秋 提交于 2019-12-20 09:08:55
问题 I wanted to extract one of my jars to specified directory using jar command line utility. If I understand this right -C option should to the trick but when I try jar xvf myJar.jar -C ./directoryToExtractTo I am getting usage information from my jar utility, so I am doing something wrong. Is the thing I want achievable with jar or do I need to manually move my jar and there invoke jar xvf myJar.jar 回答1: It's better to do this. Navigate to the folder structure you require Use the command jar

Looking for example of Command pattern for UI [closed]

佐手、 提交于 2019-12-20 09:02:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm working on a WinForm .Net application with the basic UI that includes toolbar buttons, menu items and keystrokes that all initiate the same underlying code. Right now the event handlers for each of these call a common method to perform the function. From what I've read this type of action could be handled by

Run a command at a specific time

限于喜欢 提交于 2019-12-20 08:59:46
问题 I'm trying to run a command at a specific time. I've looked at the "at" command, but I don't know how to get it working... Here's what I do: at 1843 (Enter) php /run/this/script.php (Ctrl+D) But how do I do this in a bash script? I mean, I need to press enter and "Ctrl+D" to set up the delay... How to do this in a script? Any suggestions most welcome. Thanks in advance, 回答1: You could try this: at 1843 <<_EOF_ php /run/this/script.php _EOF_ edit if what you want to do is run Firefox, try this

How to stop a running R command in linux other than ctrl+c?

馋奶兔 提交于 2019-12-20 08:56:39
问题 I'm running R in interactive mode under linux, and mistakenly typed in a command that takes forever to run. I usually stop it using ctrl+c. But it doesn't work all the time. When it doesn't work, is there another way? I don't want to kill the R session to start over either. Thanks. 回答1: I have had the problem you mention. ctrl+c will work when R is able to realize "oh this guy wants me to stop running that particular command." However, often R cannot do that. So you have to run ctrl+\ (note

Unix Command to List files containing string but *NOT* containing another string

£可爱£侵袭症+ 提交于 2019-12-20 08:49:57
问题 How do I recursively view a list of files that has one string and specifically doesn't have another string? Also, I mean to evaluate the text of the files, not the filenames. Conclusion: As per comments, I ended up using: find . -name "*.html" -exec grep -lR 'base\-maps' {} \; | xargs grep -L 'base\-maps\-bot' This returned files with "base-maps" and not "base-maps-bot". Thank you!! 回答1: Try this: grep -rl <string-to-match> | xargs grep -L <string-not-to-match> Explanation: grep -lr makes

Using find command in bash script

為{幸葍}努か 提交于 2019-12-20 08:41:43
问题 I just start to use bash script and i need to use find command with more than one file type. list=$(find /home/user/Desktop -name '*.pdf') this code work for pdf type but i want to search more than one file type like .txt or .bmp together.Have you any idea ? 回答1: Welcome to bash. It's an old, dark and mysterious thing, capable of great magic. :-) The option you're asking about is for the find command though, not for bash. From your command line, you can man find to see the options. The one

How to debug “exit status 1” error when running exec.Command in Golang

微笑、不失礼 提交于 2019-12-20 08:26:03
问题 When I run the code below: cmd := exec.Command("find", "/", "-maxdepth", "1", "-exec", "wc", "-c", "{}", "\\") var out bytes.Buffer cmd.Stdout = &out err := cmd.Run() if err != nil { fmt.Println(err) return } fmt.Println("Result: " + out.String()) I am getting this error: exit status 1 However this is not helpful to debug the exact cause of the error. How to get more detailed information? 回答1: The solution is to use the Stderr property of the Command object. This can be done like this: cmd :=

Running command line on multiple music files

夙愿已清 提交于 2019-12-20 07:19:07
问题 I am using a CLI program called metaflac (http://flac.sourceforge.net/documentation_tools_metaflac.html) to remove padding from various FLAC music files on my computer. Using the following command in a batch file (with metaflac.exe in the same folder) successfully completes this task for an individual file: metaflac --dont-use-padding --remove --block-type=PADDING "filename.flac" I have to do this for several thousand files and don't want to do it all manually/individually. Is there an easy

How to access data from another datatemplate in wpf?

旧巷老猫 提交于 2019-12-20 06:37:21
问题 I have 2 Datatemplates. One contain a grid , second one contain a button. I need to send command parameters of button as selected grid items. How can i do this ? <ObjectDataProvider x:Key="Datas" ObjectType="{x:Type ViewModel:UserControlViewModel}"></ObjectDataProvider> <DataTemplate x:Key="SourceGrid"> <WPFToolKit:DataGrid x:Name="SourceDataGrid" ItemsSource="{Binding Source={StaticResource Datas},Path=SourceGridData}" CanUserSortColumns="True" GridLinesVisibility="None"