4.0
#requires -RunAsAdministrator
After trying to run this script without admin privileges, you will see this error message
.\script.ps1 : The script 'script.ps1' cannot be run because it contains a "#requires" statement for running as Administrator. The current Windows PowerShell s...
Cassandra will not require users to login using the default configuration. Instead password-less, anonymous logins are permitted for anyone able to connect to the native_transport_port. This behaviour can be changed by editing the cassandra.yaml config to use a different authenticator:
# Allow anon...
By default each user will be able to access all data in Cassandra. You'll have to configuring a different authorizer in your cassandra.yaml to grant individual object permissions to your users.
# Grant all permissions to all users
# authorizer: AllowAllAuthorizer
# Use object permissions manage...
RAISERROR with severity (second parameter) less or equal to 10 will not throw exception.
BEGIN TRY
print 'First statement';
RAISERROR( 'Here is a problem!', 10, 15);
print 'Second statement';
END TRY
BEGIN CATCH
print 'Error: ' + ERROR_MESSAGE();
END CATCH
After RAISER...
program typical_loop
use omp_lib
implicit none
integer, parameter :: N = 1000000, kd = kind( 1.d0 )
real( kind = kd ) :: sum, tbegin, wtime
integer :: i
sum = 0
tbegin = omp_get_wtime()
!$omp parallel do reduction( +: sum )
do i = 1, N
sum = ...
Most Common Lisp implementations will try to load an init file on startup:
ImplementationInit fileSite/System Init fileABCL$HOME/.abclrcAllegro CL$HOME/.clinit.clECL$HOME/.eclrcClasp$HOME/.clasprcCLISP$HOME/.clisprc.lispClozure CLhome:ccl-init.lisp or home:ccl-init.fasl or home:.ccl-init.lispCMUCL$...
Here is an example of how to define a different action for each Marker's InfoWindow click event.
Use a HashMap in which the marker ID is the key, and the value is the corresponding action it should take when the InfoWindow is clicked.
Then, use a OnInfoWindowClickListener to handle the event of a ...
zsh loads configuration from the ~/.zshrc file on startup. If you make changes to that file, you can either restart zsh or run the following command to reload the configuration.
. ~/.zshrc
You can alias this useful command in your ~/.zshrc like this:
alias reload=". ~/.zshrc"
In Below sample we are creating one global javascript object dojoConfig which will contain all the configuration values.
Note: dojoConfig is defined in a script block before dojo.js is loaded. This is of paramount importance—if reversed, the configuration properties will be ignored.
<script...
Dojo received a new loader in Dojo 1.7 to accommodate for the toolkit's new AMD module format. This new loader added a few new configuration options that are crucial to defining packages, maps, and more. For details on the loader, see the Advanced AMD Usage tutorial. Important loader configuration p...
This is useful if you use rust in the backend and elm on the front end
enum Complex{
Message(String),
Size(u64)
}
let c1 = Complex::Message("hi");
let c2 = Complex::Size(1024u64);
The encoded Json from rust will be:
c1:
{"variant": "Message",
...
The following configuration options should be called on a Rails::Railtie object
config.after_initialize: Takes a block which will be run after rails has initialized the application.
config.asset_host: This sets the host for the assets. This is useful when using a Content Delivery Network. This i...
The following configuration options can be used for configuring assets
config.assets.enabled: Determines whether the asset pipeline is enabled. This defaults to true
config.assets.raise_runtime_errors: This enables runtime error checking. It's useful for development mode
config.assets.compress:...
Rails allows you to configure what generators are used when running rails generate commands. This method, config.generators takes a block
config.generators do |g|
g.orm :active_record
g.test_framework :test_unit
end
Here are some of the options
OptionDescriptionDefaultassetsCreates asset...
Manage Roles
Global Roles- Create roles with selected set of Jenkins features
e.g. Usually for a development project, 2 roles can be created.
Developer- Global role can be set to only Overall : Read
ProjectOwner- Global role can be set to Overall : Read
This restricts developer and project ...
Generic redirect to https:
# Enable Rewrite engine
RewriteEngine on
# Check if URL does not contain https
RewriteCond %{HTTPS} off [NC]
# If condition is true, redirect to https
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]
Generic redirect to http:
# Enable Rewrite engine
Rewr...
Add the following directive before using any other mod_rewrite directive (RewriteRule, RewriteCond, RewriteBase or RewriteMap).
RewriteEngine on
By default the engine is turned off. mod_rewrite directives found while the engine is turned off are ignored. Enable it from within the virtual host co...
Important: Using the dynamic configuration files (.htaccess) is a big performance hit. When you have access to the static configuration file (httpd.conf or something similar) you should use that instead.
In the static configuration file, allow dynamic configuration files to override "Filei...
JAXB can be used to generate classes from an model defined in XSD. It will then be possible to read XML document made against this XSD directly as java instances and inversly save these instances as XML document.
Take the following XSD saved in a file named SimpleModel.xsd
<?xml version="...
Groups can be configured under Suite and/or Test element of testng.xml. All groups which are marked as included in tesng.xml will be considered for execution, excluded one will be ignored. If a @Test method has multiple groups and from those groups if any single groups is excluded in testng.xml that...