command

Raise context menu command's CanExcute while open the context menu

浪尽此生 提交于 2019-12-23 23:00:10
问题 Can Execute of a ICommand while a Context menu open With the continuation of the above query, Still its not able to achieve. Is there any way to raise context menu command's CanExcute while open the context menu. This need to be done in the context menu itself and here am not able to access the viewmodel. Any idea on this? public static BaseCommand SaveCommand { get { if (saveCommand == null) saveCommand = new BaseCommand(OnSaveCommandClicked, OnSaveCommandCanExcute); return saveCommand; } }

Java string.replace(old, new) count how many replaced?

限于喜欢 提交于 2019-12-23 19:41:56
问题 I have my console (image down below), and I have a command that will replace all oldstinrg to newstring. But how do I count how many of those were replaced? (If the code replaced only once a to b then it will be 1, but if it replaced a to b twice the value would be 2) (this is just a part of code, but no other part is needed or any how related to this part of code) else if(intext.startsWith("replace ")){ String[] replist = original.split(" +"); String repfrom = replist[1]; String repto =

do not read first line of file in awk command file

无人久伴 提交于 2019-12-23 19:33:57
问题 I am having trouble making it so that my list of awk commands does not read the first line of a data file. It must read each line except for the first, and then concatenate the athlete and year into a string. Later in the program I use an array, I did not list all of the code. The first two lines of the data file are listed below. I need to make it so it does not read the heading line and only starts with the first athlete. Any help on this would be great! Script: BEGIN{ FS="," cnt=0; sum=0;

Change date and time format via command prompt

不打扰是莪最后的温柔 提交于 2019-12-23 17:43:25
问题 I was just wondering, in Windows 7 and above, is it possible to change the way dates and times are displayed via the command prompt? Yes, I'm in the U.S. but I like doing things the European way: (In Clock/Language/Region) Short Date: Set as "d/M/yyyy" Long Date: Set as "dddd, d MMMM yyyy" Short Time: Set as "HH:mm" Long Time: Set as "HH:mm:ss" 回答1: Yes, it's possible e.g. using reg add command. Check the HKEY_CURRENT_USER\Control Panel\International registry key: reg query "HKCU\Control

More than one Superuser command Android

半世苍凉 提交于 2019-12-23 17:39:36
问题 I'm tring to run this: String[] hin1 = { "su", "-c", "mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system" }; try { Runtime.getRuntime().exec(hin1); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } String[] hin2 = { "su", "-c", "m /system/etc/hosts" }; try { Runtime.getRuntime().exec(hin2); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } String[] hin = { "su", "-c", "cp /sdcard/hosts /system/etc/" }; try { Runtime

Is there any way to redirect stderr output from a command run with “start” in the Windows command line?

久未见 提交于 2019-12-23 16:27:12
问题 I have a program that I want to automate runs for, since it takes awhile to complete. For some reason it outputs everything to stderr instead of stdout, and I'd like to check on its progress, so I find myself needing to redirect stderr output within a start command. I tried this: start "My_Program" "C:\Users\Me\my_program.exe" --some --presets --for --my_program.exe --output "C:\Users\Me\output_file_for_my_program" "C:\Users\Me\input_file_for_my_program" 2>"C:\Users\Me\my_program_output.log"

Error with “sudo apt-get”, dictionnary-commons since update to Ubuntu 14.04

﹥>﹥吖頭↗ 提交于 2019-12-23 15:17:35
问题 You can see below the error I encounter. I did search on Google if the question has already been asked (and answered) but nothing works for me. I can't do sudo apt-get install ... Thank you in advance if someone can help me with this situation. Regards, David david@09:25:47 ~$sudo apt-get upgrade [sudo] password for david: Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not

RVM error with Requirements installation failed with status:1

徘徊边缘 提交于 2019-12-23 13:32:18
问题 I tried to install ruby 1.9.3 using command rvm install 1.9.3 --with-gcc=clang . But I got error saying No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p448. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Requirements installation failed with status: 1. While I look into the installing log, I found it's saying config/: Can't update time for config doc/: Can't update time for doc m4/: Can't update time for m4 Mk/: Can't update

How to get java version using single command in Windows command prompt?

痞子三分冷 提交于 2019-12-23 12:26:21
问题 I need to fetch java version 1.6.0_26 from the below java -version output java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) Please help me getting 1.6.0_26 Note: I don't need power shell or any external programs UPDATE I came up with java -version 2>&1 | findstr /i "version" which give me below output java version "1.6.0_22" now even a java way of pattern matching or regex will work for me :) 回答1: You

Set focus to a usercontrol when it is made visible

。_饼干妹妹 提交于 2019-12-23 11:55:29
问题 I am showing a MessageBox and want the user to be able to copy the contents of the message using CTRL + C . The problem is that I can't seem to set focus to the dialog. The MessageBox is implemented in MVVM. To show it I just make a usercontrol visible (centre screen) and disable the main view. The copy command is implemented using a Prism DelegateCommand: <UserControl.InputBindings> <KeyBinding Key="C" Modifiers="Control" Command="{Binding CopyCommand}"/> </UserControl.InputBindings> If I