command

Check folder is empty using batch command?

泄露秘密 提交于 2019-12-05 09:12:21
for /F %%i in ('dir /b "C:\Program Files\Apache folder\*.*"') do ( echo Folder is NON empty goto launch_app ) How to check a folder is empty? I tried above command, but it didn't work. try this: for /F %%i in ('dir /b /a "C:\Program Files\Apache folder\*"') do ( echo if you see this the folder is NOT empty goto launch_app ) File Not Found @for /f "tokens=*" %%a in ('dir /b /a-d "C:\Progra~1\Apache"') do @... The error that you see when you run this command, comes for the standard error output. But that is only a warning printed to your console. When this case happens, the body of the iteration

Is there a command which will print the path of the file in the repo-browser in the command line?

蹲街弑〆低调 提交于 2019-12-05 07:59:10
Is there a command which will print the path of the file in the repo-browser in the command line? SVN diff only prints the file name. Thank you. svn info path/to/filename will show you several pieces of information. The ones you're looking for are URL and Repository Root: $ svn info mydialog.h [...] URL: http://svn.server.net/my-repo/trunk/ui/mydialog.h Repository Root: http://svn.server.net/my-repo [...] URL is the absolute position of the file, and Repository Root is the base URL of the repository. URL will always start with the address of Repository Root, so if you trim Repository Root from

Auto 'zz' in vim after a jump

旧城冷巷雨未停 提交于 2019-12-05 07:48:50
After I make a jump to anywhere in the world, whether in the current file or a different file, is it possible to make vim automatically run zz (re-center on current line)? I want this after things like search, ctrl-o and ctrl-i ... and pretty much any movement other than hjkl . Thanks. Voila: " Center screen on next/previous selection. nnoremap n nzz nnoremap N Nzz " Last and next jump should center too. nnoremap <C-o> <C-o>zz nnoremap <C-i> <C-i>zz 来源: https://stackoverflow.com/questions/2372584/auto-zz-in-vim-after-a-jump

Vim replace two words with one another

十年热恋 提交于 2019-12-05 07:22:13
How would one replace all instances of 'foo' with 'bar' and 'bar' with 'foo' in vim? Aside from using a temporary word for the change, you could also use abolish plugin like this: :%SubVert/{foo,bar}/{bar,foo}/g kev Take a look at this: how to write only one pattern to exchange two strings in two-ways in vim :s/foo\|bar/\={'foo':'bar','bar':'foo'}[submatch(0)]/g :%s/foo/bbaarr/g :%s/bar/foo/g :%s/bbaarr/foo/g It must exist an smartest way to do it, but this one will work for sure ! You can do it using temp word. Just be sure that it doesn't exists in the current document. /\<asd123\> :%s/\<foo

not able to change java.io.tmpdir

本小妞迷上赌 提交于 2019-12-05 06:27:49
I am trying to change the java.io.tmpdir directory using this command java -Djava.io.tmpdir=/temporary But this doesnot succeed and displays the 'Usage' of the java command. I am doing this in a RHEL machine. Thanks in advance I have deployed an application on WebLogiv which uses axis2 version 1.5. I find that axis2 1.5 using java.io.tmpdir to store its temp files. I want the location where these temp files are stored. Where in the weblogic do I specify the java.io.tmpdir value You need to use that command as part of running a program, not just java -Dkey=value . java -Djava.io.tmpdir=

Binding to a RoutedUICommand that's not in the codebehind

北战南征 提交于 2019-12-05 04:42:11
I have a static class which contains a RoutedUICommand that I would like to use in binding. public static class CommandLibrary { public static ProjectViewModel Project { get; set; } public static RoutedUICommand AddPage { get; private set; } static CommandLibrary() { AddPage = new RoutedUICommand("AddPage", "AddPage", typeof(CommandLibrary)); } public static void AddPage_Executed(object sender, ExecutedRoutedEventArgs args) { Project.AddPage(); } public static void AddPage_CanExecute(object sender, CanExecuteRoutedEventArgs args) { // We need a project before we can add pages. if (Project !=

How do you pass arguments from command line to main in Flutter/Dart?

三世轮回 提交于 2019-12-05 04:17:09
How would you run a command and pass some custom arguments with Flutter/Dart so they can then be accessed in the main() call such as: flutter run -device [my custom arg] So then I can access it with: void main(List<String> args) { print(args.toString()); } Thank you. There is no way to do that, because when you start an app on your device there are also no parameters that are passed. If this is for development, you can pass -t lib/my_alternate_main.dart to flutter run to easily switch between different settings where each alternate entry-point file calls the same application code with

WPF SimpleCommand possible with generics?

て烟熏妆下的殇ゞ 提交于 2019-12-05 04:09:05
问题 I am using this code to make a Simple Command: public class SimpleCommand : ICommand { public Predicate<object> CanExecuteDelegate { get; set; } public Action<object> ExecuteDelegate { get; set; } #region ICommand Members public bool CanExecute(object parameter) { if (CanExecuteDelegate != null) return CanExecuteDelegate(parameter); return true;// if there is no can execute default to true } public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove

ContextMenu Command Binding not updating with the DataSource

眉间皱痕 提交于 2019-12-05 03:31:04
问题 In my WPF application, there is a list to select an item from. The selected item will then be displayed in a ContentControl for further interaction. Depending on the type of the selected item (there can be several), an appropriate DataTemplate is used in the ContentControl. So far, this should be nothing unusual for data processing business applications. In each DataTemplate, there are multiple TextBoxes and other controls that bind their value to a specific property of the ViewModel class.

How to disable a built-in command in vim

烈酒焚心 提交于 2019-12-05 03:21:30
In vim, when I hit :wq it is almost always an accident that occurred when attempting to input :w . I would like to disable :wq . The closest I found is cmap , but it has some odd behavior. If I do something like :cmap wq w I can no longer even input :wq ; it just remaps the keystroke sequence wq to w in command mode. Now I cannot, for example, input a search/replace command on a string containing wq . I would just like to alias the exact command :wq to :w or a no-op. Is there a way to do this? EDIT: clarified why :cmap is not an option for me A better solution can be: :cabbrev wq w But I'm not