command

Laravel 5 Command Scheduler, How to Pass in Options

痴心易碎 提交于 2020-01-02 02:21:10
问题 I have a command that takes in a number of days as an option. I did not see anywhere in the scheduler docs how to pass in options. Is it possible to pass options in to the command scheduler? Here is my command with a days option: php artisan users:daysInactiveInvitation --days=30 Scheduled it would be: $schedule->command('users:daysInactiveInvitation')->daily(); Preferably I could pass in the option something along the lines of: $schedule->command('users:daysInactiveInvitation')->daily()-

Copying a Folder and renaming it using command prompt

[亡魂溺海] 提交于 2020-01-01 15:42:35
问题 I am trying to copy a folder and paste it in the same directory it was copied from. For example C:\Test is the main directory which consists of a folder ACDM, I would like to copy ACDM in the same directory and rename the new folder to ACDM1 which will have all the same files as ACDM has I would like to do it using command prompt I tried the following C:>Xcopy C:\Test C:\Test\ACDM1 /E /U Cannot perform a cyclic copy 0 File(s) copied which fails, not sure hoe to add REN command with XCOPY

Eclipse RCP: org.eclipse.ui.views.showView Parameters

…衆ロ難τιáo~ 提交于 2020-01-01 15:34:14
问题 I want to show a specific view in my RCP application using a command. Using showView opens a dialog to select view. Is there any way to do without selection dialog? I tried parameters but didn't help. Related part of plugin.xml is below. com.dbtek.hyperbola.views.contactsView is my view ID 回答1: You need to add a command parameter with the id of the view to show. E.g. <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="menu:org.eclipse.ui.main.menu"> <menu id="window" label

MVVM Light : RelayCommand : define it lazy or in constructor?

限于喜欢 提交于 2020-01-01 12:16:35
问题 There are several examples on how to define a RelayCommand in the ViewModel : Option 1 ( lazy ): /// <summary> /// Gets the LogOnCommand. /// </summary> /// <value>The LogOnCommand.</value> public RelayCommand<LogOnUser> LogOnCommand { get { if (this.logOnCommand == null) { this.logOnCommand = new RelayCommand<LogOnUser>( action => { // Action code... }, g => g != null); } return this.logOnCommand; } } Option 2 (in constructor) /// <summary> /// Initializes a new instance of the <see cref=

MVVM Light : RelayCommand : define it lazy or in constructor?

試著忘記壹切 提交于 2020-01-01 12:16:25
问题 There are several examples on how to define a RelayCommand in the ViewModel : Option 1 ( lazy ): /// <summary> /// Gets the LogOnCommand. /// </summary> /// <value>The LogOnCommand.</value> public RelayCommand<LogOnUser> LogOnCommand { get { if (this.logOnCommand == null) { this.logOnCommand = new RelayCommand<LogOnUser>( action => { // Action code... }, g => g != null); } return this.logOnCommand; } } Option 2 (in constructor) /// <summary> /// Initializes a new instance of the <see cref=

Use a Command with TabItem

我怕爱的太早我们不能终老 提交于 2020-01-01 10:28:45
问题 I would like to call a Command when a TabItem of my TabControl is selected. Is there a way to do it without breaking the MVVM pattern ? 回答1: Use an AttachedCommand Behavior, which will let you bind a Command to WPF events <TabControl ... local:CommandBehavior.Event="SelectionChanged" local:CommandBehavior.Command="{Binding TabChangedCommand}" /> Of course, if you're using the MVVM design pattern and binding SelectedItem or SelectedIndex , you could also run the command in the PropertyChanged

Use a Command with TabItem

房东的猫 提交于 2020-01-01 10:28:05
问题 I would like to call a Command when a TabItem of my TabControl is selected. Is there a way to do it without breaking the MVVM pattern ? 回答1: Use an AttachedCommand Behavior, which will let you bind a Command to WPF events <TabControl ... local:CommandBehavior.Event="SelectionChanged" local:CommandBehavior.Command="{Binding TabChangedCommand}" /> Of course, if you're using the MVVM design pattern and binding SelectedItem or SelectedIndex , you could also run the command in the PropertyChanged

Python client / server question

孤者浪人 提交于 2020-01-01 09:56:10
问题 I'm working on a bit of a project in python. I have a client and a server. The server listens for connections and once a connection is received it waits for input from the client. The idea is that the client can connect to the server and execute system commands such as ls and cat. This is my server code: import sys, os, socket host = '' port = 50105 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host, port)) print("Server started on port: ", port) s.listen(5) print("Server

Is there a way to run a command line command from JScript (not javascript) in Windows Scripting Host (WSH) cscript.exe?

孤人 提交于 2020-01-01 05:36:47
问题 I'm writing a JScript program which is run in cscript.exe. Is it possible to run a commnad line command from within the script. It would really make the job easy, as I can run certain commands instead of writing more code in jscript to do the same thing. For example: In order to wait for a keypress for 10 seconds, I could straight away use the timeout command timeout /t 10 Implementing this in jscript means more work. btw, I'm on Vista and WSH v5.7 any ideas? thanx! 回答1: You can execute DOS

Color ouput with Swift command line tool

淺唱寂寞╮ 提交于 2019-12-31 10:36:33
问题 I'm writing a command line tool with Swift and I'm having trouble displaying colors in my shell. I'm using the following code: println("\033[31;32mhey\033[39;39m") or even NSFileHandle.fileHandleWithStandardOutput().writeData("\033[31;32mhey\033[39;39m".dataUsingEncoding(NSASCIIStringEncoding, allowLossyConversion: true)!) It works when I use a simple echo in php (the text is displayed in green) but is there a reason it doesn't work in a Swift command line tool? Thanks! 回答1: Swift has built