command

How to access data from another datatemplate in wpf?

徘徊边缘 提交于 2019-12-02 08:25:38
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" IsSynchronizedWithCurrentItem="True" SelectionUnit="FullRow"></WPFToolKit:DataGrid> </DataTemplate> <DataTemplate x:Key=

Running command line on multiple music files

99封情书 提交于 2019-12-02 08:07:45
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 way for me to simply direct this command to a directory and have it act upon every file in there? This

How to split string using batch file?

丶灬走出姿态 提交于 2019-12-02 08:06:31
问题 How to split string using batch script? SET java_path="C:\Program Files\Java\jdk1.6.0_31" above is my string, i want only "C:\Program Files" from java_path. how to get it? 回答1: You may split strings by character position: ECHO %java_path:~1,16% or by splitting at specific characters: FOR /F "DELIMS=\ TOKENS=1,2" %i IN (%java_path%) DO ECHO %i\%j 回答2: try this: @ECHO OFF &SETLOCAL SET "java_path=C:\Program Files\Java\jdk1.6.0_31" SET "this=%java_path:~3%" SET "this=%this:*\=%" CALL SET "this=%

“fatal error encountered during command execution” when trying to add a view from MySQL DB

烂漫一生 提交于 2019-12-02 07:55:27
I'm trying to add some tables and views from a MySQL database to a project in VS2005. After a lot of looking around I ended using the ADO.NET connector, which works pretty fine, except when trying to add a View with the Data source configuration wizard, where I get the "fatal error encountered during command execution" error message, and when I try adding one with the query builder, where it doesn't show me the name of the columns at the diagram pane. If I add all the SELECT commands by hand, it works like a charm. Any ideas on what might be causing this and how to fix it? Looks like View uses

How to run a java project with vm arguments from command line?

一曲冷凌霜 提交于 2019-12-02 07:27:30
问题 I'm writing a maven plugin which has to initialize another java project with specific VM arguments. according to the exec:java, they only take in arguments but not VMarguments, so my question is how to launch a java project with specific VMarguments from the command line? thanks 回答1: You can't supply extra VM arguments if you use Maven's exec:java plugin because it runs in the same VM (i.e. it's already been initialized). You'll need to use exec:exec, and construct the java command line

Java - execute a program with options, like ls -l

依然范特西╮ 提交于 2019-12-02 07:21:57
问题 In Java, how do I execute a linux program with options, like this: ls -a (the option is -a), and another: ./myscript name=john age=24 I know how to execute a command, but cannot do the option. 回答1: You need to execute an external process, take a look at ProcessBuilder and just because it almost answers your question, Using ProcessBuilder to Make System Calls UPDATED with Example I ripped this straight from the list example and modified it so I could test on my PC and it runs fine private

Bind or Command to get return and button to work

旧时模样 提交于 2019-12-02 07:07:24
I have a simple question about the bind() method and the command argument. Usually, in a program, you can click on a button related to what you are doing to execute something or simply press the return key. In the code below, I tried to do the same and it does actually work. I was just asking myself if the line bttn.bind('<Button-1>', search) isn't a bit strange, as it relates the mouse click inside the button to the function, and not the pressing of the button itself. At the beginning, I didn't want to include pressing the return key to execute the entry, and I had written bttn = Button(wd,

Bind or Command to get return and button to work

谁都会走 提交于 2019-12-02 06:34:31
问题 I have a simple question about the bind() method and the command argument. Usually, in a program, you can click on a button related to what you are doing to execute something or simply press the return key. In the code below, I tried to do the same and it does actually work. I was just asking myself if the line bttn.bind('<Button-1>', search) isn't a bit strange, as it relates the mouse click inside the button to the function, and not the pressing of the button itself. At the beginning, I

How do redirect STDOUT out of XCode compiled Command Line executable?

十年热恋 提交于 2019-12-02 06:20:58
I have a C++ program that writes to stdout that I am trying to compile into a command line utility in XCode. I need the program compiled into a release build (which it seems, XCode calls an Archive - go figure), not run it as debug. I basically want to pipe the output of my program into a textfile like this MyProgram > TextFile.txt I can compile the program into a command line and run it like this via a Bash shell like this: Open MyProgram This spawns a new process (not what I want). However, I could live with that if this worked: Open MyProgram > TextFile.txt ...But it doesnt :-(. If I try to

How to open a command prompt and input different commands from a java program

血红的双手。 提交于 2019-12-02 06:08:56
I need to open a command prompt & execute ij.bat , which will take me to another prompt, where I can give command to connect to DB & later different sql statements. I was able to execute ij.bat from the java program like Process process = Runtime.getRuntime().exec("D:\\ij.bat"); But how to give the furthur set of commands through the java program? Pawan You can use this exec public Process exec(String command) throws IOException Also visit This Link Instead of trying to run ij.bat, and feed it commands to run and parse the output, just have your program use the ij class, and its runScript