Search Results

Search found 26104 results on 1045 pages for 'command pattern'.

Page 1/1045 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Auto-execute command after going to a folder with the CD command

    - by Patrick
    Is it possible to auto-execute a command in a folder if you move to it via the cd command? Of course I can define my own command (e.g. CHD.BAT) doing something like this: @echo off cd %1 if exist init.bat ( init.bat ) else ( color 0F title Command Prompt ) But I wonder if something like this would be possible using the standard CD command.

    Read the article

  • command to show the shell command prompt

    - by LinuxPenseur
    Hi, Is there a shell command to display the command prompt. I will explain what i want through the illustration below. When i execute script.sh, i should get the following output $sh script.sh $ /* command prompt and then print hi */ hi My script.sh is like this #! /bin/bash <command to display the shell command prompt> echo "hi" exit 0 what should the code that has to go in the place of angle brackets to get an output like above? Thanks

    Read the article

  • Run command in command prompt from Ruby application

    - by Julian
    I have a command-line Ruby application that uses Curses to create a GUI. This GUI is absolutely mangled by Windows' command prompt if the command prompt window is too small. The command prompt window can be resized in properties. However, I want to resize it programatically. Running this command in the command prompt (nothing to do with Ruby) will resize the command prompt window to desired variables. mode con:cols=120 lines=40 Can I do this purely in Ruby? Or, failing that (I suspect doing it purely in Ruby may be impossible) can my ruby application actually run that command and 'hit enter', and resize window it's running in?

    Read the article

  • The Command Prompt is Outdated: 2 Command Prompt Replacements for Windows

    - by Chris Hoffman
    The Command Prompt window included with Windows is outdated. The command line itself isn’t outdated – the Command Prompt just lacks modern features like tabs, transparency, support for other shells, easy selection of text, and other modern Windows features. If you spend any time at all with the Command Prompt, you’ll want to check out one of these two open-source Command Prompt replacements that improves on the original Command Prompt. HTG Explains: Does Your Android Phone Need an Antivirus? How To Use USB Drives With the Nexus 7 and Other Android Devices Why Does 64-Bit Windows Need a Separate “Program Files (x86)” Folder?

    Read the article

  • The Template Method Design Pattern using C# .Net

    - by nijhawan.saurabh
    First of all I'll just put this pattern in context and describe its intent as in the GOF book:   Template Method: Define the skeleton of an algorithm in an operation, deferring some steps to Subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the Algorithm's Structure.    Usage: When you are certain about the High Level steps involved in an Algorithm/Work flow you can use the Template Pattern which allows the Base Class to define the Sequence of the Steps but permits the Sub classes to alter the implementation of any/all steps.   Example in the .Net framework: The most common example is the Asp.Net Page Life Cycle. The Page Life Cycle has a few methods which are called in a sequence but we have the liberty to modify the functionality of any of the methods by overriding them.   Sample implementation of Template Method Pattern:   Let's see the class diagram first:            Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt; mso-ligatures:standard;}   And here goes the code:EmailBase.cs     1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5 using System.Threading.Tasks;     6      7 namespace TemplateMethod     8 {     9     public abstract class EmailBase    10     {    11     12         public bool SendEmail()    13         {    14             if (CheckEmailAddress() == true) // Method1 in the sequence    15             {    16                 if (ValidateMessage() == true) // Method2 in the sequence    17                 {    18                     if (SendMail() == true) // Method3 in the sequence    19                     {    20                         return true;    21                     }    22                     else    23                     {    24                         return false;    25                     }    26     27                 }    28                 else    29                 {    30                     return false;    31                 }    32     33             }    34             else    35             {    36                 return false;    37     38             }    39     40     41         }    42     43         protected abstract bool CheckEmailAddress();    44         protected abstract bool ValidateMessage();    45         protected abstract bool SendMail();    46     47     48     }    49 }    50    EmailYahoo.cs      1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5 using System.Threading.Tasks;     6      7 namespace TemplateMethod     8 {     9     public class EmailYahoo:EmailBase    10     {    11     12         protected override bool CheckEmailAddress()    13         {    14             Console.WriteLine("Checking Email Address : YahooEmail");    15             return true;    16         }    17         protected override bool ValidateMessage()    18         {    19             Console.WriteLine("Validating Email Message : YahooEmail");    20             return true;    21         }    22     23     24         protected override bool SendMail()    25         {    26             Console.WriteLine("Semding Email : YahooEmail");    27             return true;    28         }    29     30     31     }    32 }    33   EmailGoogle.cs      1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5 using System.Threading.Tasks;     6      7 namespace TemplateMethod     8 {     9     public class EmailGoogle:EmailBase    10     {    11     12         protected override bool CheckEmailAddress()    13         {    14             Console.WriteLine("Checking Email Address : GoogleEmail");    15             return true;    16         }    17         protected override bool ValidateMessage()    18         {    19             Console.WriteLine("Validating Email Message : GoogleEmail");    20             return true;    21         }    22     23     24         protected override bool SendMail()    25         {    26             Console.WriteLine("Semding Email : GoogleEmail");    27             return true;    28         }    29     30     31     }    32 }    33   Program.cs      1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5 using System.Threading.Tasks;     6      7 namespace TemplateMethod     8 {     9     class Program    10     {    11         static void Main(string[] args)    12         {    13             Console.WriteLine("Please choose an Email Account to send an Email:");    14             Console.WriteLine("Choose 1 for Google");    15             Console.WriteLine("Choose 2 for Yahoo");    16             string choice = Console.ReadLine();    17     18             if (choice == "1")    19             {    20                 EmailBase email = new EmailGoogle(); // Rather than newing it up here, you may use a factory to do so.    21                 email.SendEmail();    22     23             }    24             if (choice == "2")    25             {    26                 EmailBase email = new EmailYahoo(); // Rather than newing it up here, you may use a factory to do so.    27                 email.SendEmail();    28             }    29         }    30     }    31 }    32    Final Words: It's very obvious that why the Template Method Pattern is a popular pattern, everything at last revolves around Algorithms and if you are clear with the steps involved it makes real sense to delegate the duty of implementing the step's functionality to the sub classes. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt; mso-ligatures:standard;}

    Read the article

  • Learning the command line [duplicate]

    - by Billy
    This question already has an answer here: What is the best way to learn how to use Ubuntu with terminal? 3 answers This isn't really a technical question but I am curious as to how long it takes to learn the linux command line. I would like to learn how to be able to do as much as possible easily from the command line. I just bought a book, linux command line and shell scripting bible. I know that this book will be of great help, but i just have no clue how long it will be before i can successfully naviagte the terminal with ease. If you could post and let me know about your experience with the terminal, and the learning process, that would be greatly appreciated. Thank you in advance.

    Read the article

  • Execute command from file in current shell

    - by Pandya
    I want to executed command from file (which is script) in current shell in terminal. Example: I have file ch_dir contains following: #!/bin/bash cd /usr Now if I execute file usually as following then it executes commands in different shell: pandya@pandya-desktop:~$ ./ch_dir pandya@pandya-desktop:~$ Here cd /user is executed in different shell. But I want to execute in Current shell. How do I do that? Note: Here cd is only used to explain. Question's aim is to execute any command in current shell

    Read the article

  • General Overview of Design Pattern Types

    Typically most software engineering design patterns fall into one of three categories in regards to types. Three types of software design patterns include: Creational Type Patterns Structural Type Patterns Behavioral Type Patterns The Creational Pattern type is geared toward defining the preferred methods for creating new instances of objects. An example of this type is the Singleton Pattern. The Singleton Pattern can be used if an application only needs one instance of a class. In addition, this singular instance also needs to be accessible across an application. The benefit of the Singleton Pattern is that you control both instantiation and access using this pattern. The Structural Pattern type is a way to describe the hierarchy of objects and classes so that they can be consolidated into a larger structure. An example of this type is the Façade Pattern.  The Façade Pattern is used to define a base interface so that all other interfaces inherit from the parent interface. This can be used to simplify a number of similar object interactions into one single standard interface. The Behavioral Pattern Type deals with communication between objects. An example of this type is the State Design Pattern. The State Design Pattern enables objects to alter functionality and processing based on the internal state of the object at a given time.

    Read the article

  • How to See What Web Sites Your Computer is Secretly Connecting To

    - by Lori Kaufman
    Has your internet connection become slower than it should be? There may be a chance that you have some malware, spyware, or adware that is using your internet connection in the background without your knowledge. Here’s how to see what’s going on under the hood. Secret Squirrel by akumath HTG Explains: When Do You Need to Update Your Drivers? How to Make the Kindle Fire Silk Browser *Actually* Fast! Amazon’s New Kindle Fire Tablet: the How-To Geek Review

    Read the article

  • Ask the Readers: Do You Use the Command Line?

    - by Jason Fitzpatrick
    Despite over two decades of GUI interfaces many power users still turn to the command prompt. This week we want to hear about when and how you use the command prompt on your computer. Long ago in a time before you could manipulate your computer with a mouse and a series of buttons and windows, the command line ruled all. Even after years of GUI development and refinement many people still turn to the command line to get things done. This week we want to hear all about your command line tips and tricks. Do you use the default command line for your OS? Have you enhanced it? Replaced it? What keeps you coming back to the command line when everyone happily works away in the OS’s GUI? Sound off in the comments and don’t forget to check back in on Friday to see the What You Said roundup. What is a Histogram, and How Can I Use it to Improve My Photos?How To Easily Access Your Home Network From Anywhere With DDNSHow To Recover After Your Email Password Is Compromised

    Read the article

  • What You Said: Do You Use the Command Line?

    - by Jason Fitzpatrick
    Earlier this week we asked you to sound off with your love (or lack there of) for the command line. You sounded off in force and now we’re back with a comment roundup. It turns out you all pretty much love the command line with that love ranging from not even liking Graphic User Interfaces (GUIs) to using the command line to get serious work done but having a long standing affair with your OS’s GUI. Many of you lamented the poor command line implementation in Windows—especially after you’d had experience with other operation systems. Mike writes: Of course. Some things are easier that was. Like ping and ipconfig. With a strong Unix background I still write and use batch files. It would be nice is the command line included more nice things like grep, sleep, touch. Maybe, someday, Windows will mature into a full OS. What is a Histogram, and How Can I Use it to Improve My Photos?How To Easily Access Your Home Network From Anywhere With DDNSHow To Recover After Your Email Password Is Compromised

    Read the article

  • Change Command Prompt width from the Command Line

    - by Starkers
    Don't really know what more I can say really. That window captured below will simply not get any larger. Are there some settings somewhere that will allow me to resize it? See, this limited window thing has left me in a bit of a pickle. Basically I've created an application with a command line GUI (With Ruby's Curses Library), and while everything works beautifully on OSX and Ubuntu Terminals, with Command Prompt, if the Curses Windows are larger than the Command Prompt window as shown below, the whole application crashes with a 'window already closed' error. So, is there a setting that allows users to resize their Command Prompt window, something that I'll have to put in the documentation. Here's what the holy grail answer would, be though: Is there a way to do this from the command line? Could my application detect if the Command Prompt it's running on is of fixed width, and actually programatically run the command to allow the Command Prompt window to be enlarged? Or at least give the user a helpful error message?

    Read the article

  • Every command fails with "command not found" after changing .bash_profile?

    - by Blankman
    I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting: env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory -bash: tar: command not found -bash: grep: command not found -bash: cat: command not found -bash: find: command not found -bash: dirname: command not found -bash: /preexec.sh.lib: No such file or directory -bash: preexec_install: command not found -bash: sed: command not found -bash: git: command not found My bash_profile actually pulls in other .sh files (sources them) so I am not exactly sure which modification may have caused this. Now if I even try and to a list of files, I get: >ls -bash: ls: command not found -bash: sed: command not found -bash: git: command not found Any tips on how to trace the source of the error, and how to be able to use the terminal for basic things like listing files etc?

    Read the article

  • What are the advantages of the delegate pattern over the observer pattern?

    - by JoJo
    In the delegate pattern, only one object can directly listen to another object's events. In the observer pattern, any number of objects can listen to a particular object's events. When designing a class that needs to notify other object(s) of events, why would you ever use the delegate pattern over the observer pattern? I see the observer pattern as more flexible. You may only have one observer now, but a future design may require multiple observers.

    Read the article

  • Command prompt print dialog command

    - by wrongusername
    Is there any way a C++ commandline program on Windows can produce a graphical GUI print dialog for printing to a printer, just like usual GUI programs? I've combed through this webpage and it seems there are only commands that print files in the background to a pre-determined printer.

    Read the article

  • How To Personalize the Windows Command Prompt

    - by Matthew Guay
    Command line interfaces can be downright boring, and always seem to miss out on the fresh coats of paint liberally applied to the rest of Windows.  Here’s how to add a splash of color to Command Prompt and make it unique. By default, Windows Command Prompt is white text on a black background. It get’s the job done, but maybe you want to add some color to it.   To get an overview of what we can do with the color command, let’s enter: color /? So, to get the color you want, enter color then the option for the background color followed by the font color.  For example, let’s make an old-fashioned green on black look by entering: color 02   There are a bunch of different combinations you can do, like this black background with red text. color 04 You can’t mess it up too much.  The color command won’t let you set both the font and the background to the same color, which would make it unreadable.  Also, if you want to get back to the default settings, just enter: color Now we’re back to plain-old black and white. Personalize Command Prompt Without Commands If you’d prefer to change the color without entering commands, just click on the Command Prompt icon in the top left corner of the window and select Properties. Select the Colors tab, and then choose the color you want for the screen text and background.  You can also enter your own RGB color combination if you want.   Here we entered the RGB values to get a purple background color like Ubuntu 10.04. Back in the Properties dialog, you can also change your Command Prompt font from the font tab.  Choose any font you want, as long as the one you want is one of the three listed here. Customizations you make via the Properties dialog are saved and will be used any time you open Command Prompt, but any customizations you make with the Color command are only for that session. Conclusion Whether you want to make your command prompt bright enough to cause a sunburn or old-style enough to scare a mainframe operator, with these settings, you can make Command Prompt a bit more unique.   Similar Articles Productive Geek Tips Use "Command Prompt Here" in Windows VistaVerify the Integrity of Windows Vista System FilesKeyboard Ninja: Scrolling the Windows Command Prompt With Only the KeyboardRun a Command as Administrator from the Windows 7 / Vista Run boxStart an Application Assigned to a Specific CPU in Windows Vista TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 How to Add Exceptions to the Windows Firewall Office 2010 reviewed in depth by Ed Bott FoxClocks adds World Times in your Statusbar (Firefox) Have Fun Editing Photo Editing with Citrify Outlook Connector Upgrade Error Gadfly is a cool Twitter/Silverlight app

    Read the article

  • Unix style command line history in windows

    - by dean20007
    This may be a duplicate so feel free to close and point me in the right direction but is there a way of getting Unix style command line recall in windows. E.g. Opening a new command window and using the up arrow key will recall the last x number of statements. I know this works in the command window per command window session but is there a way to persist across sessions?

    Read the article

  • Command to execute another command while replaying the command on STDOUT

    - by hakre
    It's not easy to formulate the question properly, maybe it helps when I describe what I'd like to do. I want to execute a command and pipe it's output into a tool called pastebinit which uploads the STDOUT output to pastebin. That works very well, however I would like to send the command itself on top of it but w/o typing it a second time. Is there some command I can launch "my command" with that will Print "my command" on STDOUT Executes "my command" I have the feeling that something like that exists but as hard as it is to formulate such a question properly, I was not able to dig it up with google so far.

    Read the article

  • Explanation of command to uppercase the first letter of a filename

    - by hazielquake
    I'm trying to learn to rename files with the command line, and after browsing around a lot of pages I finally found a command that uppercases the first letter of a file, but the problem is that I want to understand the meaning of each command. The command is: for i in *; do new=`echo "$i" | sed -e 's/^./\U&/'`; mv "$i" "$new";done I understand the 'for' kinda... but not the 'echo' or '`' and especially the sed command. if someone has a little patience to explain the meaning of each thing that'd be awesome! Thanks!

    Read the article

  • Sent command-line output as an arguments to other command

    - by pavelartlover
    1) Here is the command to install special package (for example system/header) #pkg install system/header 2) ALso we can install several packages #pkg install system/header network/ssh package/rpm 3) Here is the command to show all available packages from special group #pkg contents -o fmri -H -rt depend -a type=group solaris-desktop How to install all packages from a special group in one command? (How to send output from the third command as an argument to second?)

    Read the article

  • Connect to a network via the command line

    - by justasking
    I want to be able to connect to a network via command line in Windows. My goal is to script out remoting into my work computer. I hate having to always manually connect to the VPN connection and then rdping into my work machine. I want to just have a script which will do both of it for me. I know how to rdp via command line, I just need to know how to connect to my VPN via command line.

    Read the article

  • How do I change the Creation/Mod Date of all folders on a USB drive using Touch command?

    - by Chad--24216
    I've got a USB drive with mp3 music on it that I play in my car. My car has a USB drive port. Problem is that the car sorts the music by Creation/Modification Date (and not alphabetically). This makes it a pain to find what artist I'm looking for. To solve this problem, I need a way to "update" the Creation/Modification Date for all folders on the USB drive every time I add a new folder of music to the USB drive. Anyone know how I can do this? The Touch command works great, but the format touch <filename> would take forever to do on each folder on the drive. Anyway to select all folders on the drive and then touch <all folders>? On my USB drive I have a folder for each album and the songs within each respective folder, like so: Album-1-folder Album-2-folder I need to apply the Touch command to each of the "album" folders on the drive. I stumbled upon a simple solution to solve this issue:touch /media/USB_Drive/*

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >