Tutorial by Examples: er

package main import ( //"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/client/restclient" "log" "os" // unver "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client &...
package main import ( // "k8s.io/kubernetes/pkg/api" // unver "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/restclient" client "k8s.io/kubernetes/pkg/client/unv...
Dockerize zookeeper-3.4.6 Create a Dockerfile: ####################################################### # Image: img.reg.3g:15000/zookeeper:3.4.6 ####################################################### FROM img.reg.3g:15000/jdk:1.7.0_67 MAINTAINER [email protected] USER root ENV ZO...
You can use Try..Catch to rollback database operation by placing the rollback statement at the Catch Segment. Try 'Do the database operation... xCmd.CommandText = "INSERT into ...." xCmd.ExecuteNonQuery() objTrans.Commit() ...
Repository interface; public interface IRepository<T> { void Insert(T entity); void Insert(ICollection<T> entities); void Delete(T entity); void Delete(ICollection<T> entity); IQueryable<T> SearchFor(Expression<Func<T, bool>> predicate);...
To play a sound of with a specific tone,we first have to create a sine wave sound.This is done in the following way. final int duration = 10; // duration of sound final int sampleRate = 22050; // Hz (maximum frequency is 7902.13Hz (B8)) final int numSamples = duration * sampleRate; final double ...
To enable rerere run the following command: $ git config --global rerere.enabled true This can be done in a specific repository as well as globally.
import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; class test_webdriver{ public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("http://stackoverflow.com/"); driver.close(); } }...
class EventEmitter extends Subject { constructor(isAsync?: boolean) emit(value?: T) subscribe(generatorOrNext?: any, error?: any, complete?: any) : any }
The code snippet below shows the various ways you can filter on an array of objects using lodash. let lodash = require('lodash'); var countries = [ {"key": "DE", "name": "Deutschland", "active": false}, {"key": "ZA&qu...
Inserting a row at the bottom of a spreadsheet is easy: var someSheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; someSheet.appendRow(["Frodo", "Baggins", "Hobbit", "The Shire", 33]); Note this will add the row after the last non-empty row. I...
A thread terminates if it reaches the end of its code block. The best way to terminate a thread early is to convince it to reach the end of its code block. This way, the thread can run cleanup code before dying. This thread runs a loop while the instance variable continue is true. Set this variable...
Always use Named Arguments to optional parameters, to avoid potential bugs when the method is modified. class Employee { public string Name { get; private set; } public string Title { get; set; } public Employee(string name = "<No Name>", string title = "&lt...
if ( ! function_exists('products_post_type') ) { function products_post_type() { $labels = array( 'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain'...
You can load AngularJS services in vanilla JavaScript using AngularJS injector() method. Every jqLite element retrieved calling angular.element() has a method injector() that can be used to retrieve the injector. var service; var serviceName = 'myService'; var ngAppElement = angular.element(do...
In many examples, you will find a service id like 'acme.demo.service.id' (a string with dots). You services.yml will look like this: services: acme.demo.service.id: class: Acme\DemoBundle\Services\DemoService arguments: ["@doctrine.orm.default_entity_manager", &quot...
List user IDs $ wp user list --field=ID Create a new user. $ wp user create bob [email protected] --role=author Update an existing user. $ wp user update 123 --display_name=Mary --user_pass=marypass Delete user 123 and reassign posts to user 567 $ wp user delete 123 --reassign=567
Create a new database. $ wp db create Drop an existing database. $ wp db drop --yes Reset the current database. $ wp db reset --yes Execute a SQL query stored in a file. $ wp db query < debug.sql
Django's signals are restricted to precise class signatures upon registration, and thus subclassed models are not immediately registered onto the same signal. Take this model and signal for example class Event(models.Model): user = models.ForeignKey(User) class StatusChange(Event): ...
As per the Go blog: Arrays do not need to be initialized explicitly; the zero value of an array is a ready-to-use array whose elements are themselves zeroed For example, myIntArray is initialized with the zero value of int, which is 0: var myIntArray [5]int // an array of five 0's: [0, 0,...

Page 361 of 417