Start a Script Block as background job:
$job = Start-Job -ScriptBlock {Get-Process}
Start a script as background job:
$job = Start-Job -FilePath "C:\YourFolder\Script.ps1"
Start a job using Invoke-Command on a remote machine:
$job = Invoke-Command -ComputerName "ComputerName&...
Customizing the Shell prompt
Default command prompt can be changed to look different and short. In case the current directory is long default command prompt becomes too large. Using PS1 becomes useful in these cases. A short and customized command pretty and elegant. In the table below PS1 has be...
One of Angular's strength's is client-side form validation.
Dealing with traditional form inputs and having to use interrogative jQuery-style processing can be time-consuming and finicky. Angular allows you to produce professional interactive forms relatively easily.
The ng-model directive provide...
At its most basic level, Unit Testing in any language provides assertions against some known or expected output.
function assert( outcome, description ) {
var passFail = outcome ? 'pass' : 'fail';
console.log(passFail, ': ', description);
return outcome;
};
The popular assertio...
Back references are used to match the same text previously matched by a capturing group. This both helps in reusing previous parts of your pattern and in ensuring two pieces of a string match.
For example, if you are trying to verify that a string has a digit from zero to nine, a separator, such as...
Interface:
public interface FooService {
public int doSomething();
}
Class:
@Service
public class FooServiceImpl implements FooService {
@Override
public int doSomething() {
//Do some stuff here
return 0;
}
}
It should be noted that a class must imple...
The way to do a JAX-WS call with basic authentication is a little unobvious.
Here is an example where Service is the service class representation and Port is the service port you want to access.
Service s = new Service();
Port port = s.getPort();
BindingProvider prov = (BindingProvider)port;
...
PHP's source code is hosted on GitHub. To build from source you will first need to check out a working copy of the code.
mkdir /usr/local/src/php-7.0/
cd /usr/local/src/php-7.0/
git clone -b PHP-7.0 https://github.com/php/php-src .
If you want to add a feature, it's best to create your own bra...
This example goes over how to set up CoreNLP from the latest official release. This example will take you through downloading the package, and running a simple command-line invocation of CoreNLP.
Prerequisites:
Java JVM 8. The command java -version should complete successfully with a line like: ...
You need to add Gem and PDF MIME:Type inside mime_types.rb as we need to notify rails about PDF mime type.
After that we can generate Pdf with Prawn in following basic ways
This is the basic assignment
pdf = Prawn::Document.new
pdf.text "Hello World"
pdf.render_file "assignment.p...
In Scala (in contrast to Java and most other languages), if is an expression instead of a statement. Regardless, the syntax is identical:
if(x < 1984) {
println("Good times")
} else if(x == 1984) {
println("The Orwellian Future begins")
} else {
println("Po...
# the usual boilerplate setup
cmake_minimum_required(2.8)
project(my_test_project
LANGUAGES CXX)
# tell CMake to use CTest extension
enable_testing()
# create an executable, which instantiates a runner from
# GoogleTest, Boost.Test, QtTest or whatever framework you use
add_execut...
The idea is that a distro maintainer wants to run something like the following command:
meteor publish-release clinical.meteor.rc6.json
Which will then allow users of the distro to run this:
meteor run --release clinical:[email protected]
HVFL is a language designed to constrain UI elements in a simple and quick fashion.
Generally, VFL has an advantage over traditional UI customization in the Interface Builder because it's much more readable, accessible and compact.
Here's an example of VFL, in which three UIViews are constrained f...
Swift
class PickerViewExampleViewController : UIViewController, UIPickerViewDelegate, UIPickerViewDataSource {
@IBOutlet weak var btnFolder: UIButton!
let pickerView = UIPickerView()
let pickerViewRows = ["First row,", "Secound row,","Third row,","F...
Basic assembly support with gcc has the following syntax:
asm [ volatile ] ( AssemblerInstructions )
where AssemblerInstructions is the direct assembly code for the given processor. The volatile keyword is optional and has no effect as gcc does not optimize code within a basic asm statement. A...
It might be easier if you think of GROUP BY as "for each" for the sake of explanation. The query below:
SELECT EmpID, SUM (MonthlySalary)
FROM Employee
GROUP BY EmpID
is saying:
"Give me the sum of MonthlySalary's for each EmpID"
So if your table looked like this:
+----...