Tutorial by Examples: c

Here we can create UUID String with in one line. Represents UUID strings, which can be used to uniquely identify types, interfaces, and other items. Swift 3.0 print(UUID().uuidString) It is very useful for identify multiple devices with unique id.
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/unversioned&...
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() ...
Note : I am assuming that you know about how to use BottomNavigationView. This example I will explain how to add selector for BottomNavigationView. So you can state on UI for icons and texts. Create drawable bottom_navigation_view_selector.xml as <?xml version="1.0" encoding="...
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 ...
Although Catch ex As Exception claims that it can handle all exceptions - there are one exception (no pun intended). Imports System Static Sub StackOverflow() ' Again no pun intended StackOverflow() End Sub Static Sub Main() Try StackOverflow() Catch ex As Exception ...
Generally most of the exceptions are not that critical, but there are some really serious exceptions that you might not be capable to handle, such as the famous System.StackOverflowException. However, there are others that might get hidden by Catch ex As Exception, such as System.OutOfMemoryExceptio...
The basic setup of hybrid coding is a single, fluid column. Since most email clients support max-width, we can use that to set the <table>'s width to 100% (fluid), but not exceed a max width (660px in this case). Just like on the web. However, Windows Desktop Microsoft doesn't support max-wid...
#define kPaperSizeA4 CGSizeMake(595.2,841.8) First of all implement UIPrintPageRenderer protocol @interface UIPrintPageRenderer (PDF) - (NSData*) printToPDF; @end @implementation UIPrintPageRenderer (PDF) - (NSData*) printToPDF { NSMutableData *pdfData = [NSMutableData data]; ...
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 }
@Component({ selector: 'zippy', template: ` <div class="zippy"> <div (click)="toggle()">Toggle</div> <div [hidden]="!visible"> <ng-content></ng-content> </div> </div>`}) export class Zippy...
Create a service- import {EventEmitter} from 'angular2/core'; export class NavService { navchange: EventEmitter<number> = new EventEmitter(); constructor() {} emitNavChangeEvent(number) { this.navchange.emit(number); } getNavChangeEmitter() { return...
As of Jekyll 3.2, you can use the filter where_exp to filter a collection by any of its properties. Say you have the following collection item in an "albums" collection: --- title: My Amazing Album --- ... You can combine the where_exp and first filters to grab just that one item: ...
Given an 'albums' collection, you can loop through and output each item: {% for album in site.albums %} {{ album.content }} {% endfor %} Any custom front matter variables are also available within the loop. {% for album in site.albums %} {{ album.title }} {{ album.content }} {%...
Given an 'albums' collection, an item can be added by creating a file in the <source>/_albums directory. Note that files not including frontmatter will be ignored. For instance, adding a file called my_album.md to the _albums directory would add it to the collection: --- title: "My Alb...

Page 715 of 826