Tutorial by Examples: sin

First of all, Ensure that the user which will be running this call has the Change backup settings and control backup process privilege. # # TC Backup Launcher # Script to launch a backup on the TeamCity Server # Param( [Parameter(Mandatory=$true)][string]$username, [Parameter(Mandato...
from pymongo import MongoClient uri = "mongodb://localhost:27017/" client = MongoClient(uri) db = client['test_db'] # or # db = client.test_db # collection = db['test_collection'] # or collection = db.test_collection collection.save({"hello":"world"...
First you have to generate public and private keys using OpenSSL(tutorial). var express = require("express"); var http =require ("http"); var https=require ("https"); var fs=require("fs"); var app=express(); var httpsKeys={ key:fs.readFileSync("&l...
public enum Cassandra { DB; private Session session; private Cluster cluster; private static final Logger LOGGER = LoggerFactory.getLogger(Cassandra.class); /** * Connect to the cassandra database based on the connection configuration provided. * Multiple c...
This is really easy. All TIMESTAMP values are stored in universal time, and always converted to the present time_zone setting whenever they are rendered. SET SESSION time_zone='America/Los_Angeles'; SELECT timestamp_sold FROM sales WHERE state_sold = 'CA' Why is this? TIMESTAMP values are...
For a non-main packages as well as main, instead of adding flags inside the code, write benchmarks in the test package , for example: func BenchmarkHello(b *testing.B) { for i := 0; i < b.N; i++ { fmt.Sprintf("hello") } } Then run the test with the profile flag ...
once a prof file has been generated, one can access the prof file using go tools: go tool pprof cpu.prof This will enter into a command line interface for exploring the profile Common commands include: (pprof) top lists top processes in memory (pprof) peek Lists all processes, use reg...
var gulp = require('gulp'); // include plug-ins var uglify = require('gulp-uglify'), concat = require('gulp-concat'); // Minified file gulp.task('packjsMin', function() { return gulp.src('node_modules/angular/*.js') .pipe(concat('script.js')) .pipe(uglify()) .p...
Given an m times n matrix A with n larger than m. The singular value decomposition [U,S,V] = svd(A); computes the matrices U,S,V. The matrix U consists of the left singular eigenvectors which are the eigenvectors of A*A.' while V consists of the right singular eigenvalues which are the eigenvec...
You can also use Laravel Artisan commands from your routes or controllers. To run a command using PHP code: Artisan::call('command-name'); For example, Artisan::call('db:seed');
It is simple to start using Redis using docker: docker pull redis docker run -p 6379:6379 --rm --name redis redis Now you have running instance on port 6397 Attention: All data will be deleted, when Redis will be stopped. To connect the redis-cli, start another docker: docker run -it --link ...
You can find more info about Python Natural Language Toolkit (NLTK) sentence level tokenizer on their wiki. From your command line: $ python >>> import nltk >>> sent_tokenizer = nltk.tokenize.PunktSentenceTokenizer() >>> text = "This is a sentence. This is anothe...
data table; set table; label variable1 = 'label1' variable2 = 'label2' variable3 = 'label3'; run;
/app/services/greeting.service.ts : import { Injectable } from '@angular/core'; import {greetingTypes,request,response} from './greeting.interface' @Injectable() export class Greeting{ private worker; constructor(){ this.worker = new Worker('../workers /gr...
Python allows you to hack list comprehensions to evaluate conditional expressions. For instance, [value_false, value_true][<conditional-test>] Example: >> n = 16 >> print [10, 20][n <= 15] 10 Here n<=15 returns False (which equates to 0 in Python). So what Python i...
SystemJS allows to write and use modular javacsript code that relies on ECMAScript 6 import and export statements. One good example is moment.js library, which started publishing ECMAScript 6 source code on npm since 2.10.0 release of moment.js. Installing prerequisites npm install moment npm ins...
var express = require('express'); var app = express(); var router = express.Router(); app.route('/user') .get(function (req, res) { res.send('Get a random user') }) .post(function (req, res) { res.send('Add a user') }) .put(function (req, res) { res.send...
The recommended approach would be to avoid doing so and rather use IOptions<TOptions> and IServiceCollection.Configure<TOptions>. That said, this is still pretty straightforward to make IConfigurationRootavailable application wide. In the Startup.cs constructor you should have the foll...
Using more than one theme in your Android application, you can add custom colors to every theme, to be like this: First, we have to add our themes to style.xml like this: <style name="OneTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> <!--...
18.0 By default, any function specified in a -callback directive in a behaviour module must be exported by a module that implements that behaviour. Otherwise, you'll get a compiler warning. Sometimes, you want a callback function to be optional: the behaviour would use it if present and exported,...

Page 124 of 161