Tutorial by Examples: and

Sometimes, you need to output to more than one index in ElasticSearch, or have a custom mapping you want to apply to new indices as they roll in. There are two ways to apply a custom mapping. One way, is to upload an ElasticSearch template. See the ElasticSearch documentation for that. The other ...
Download WordPress core $ wp core download --locale=nl_NL Install WordPress $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword [email protected] Display the WordPress version $ wp core version Transform a single-site i...
This part of development you should serialize the python RDD to the JVM. This process uses the main development of Spark to call the jar function. from pyspark.serializers import PickleSerializer, AutoBatchedSerializer rdd = sc.parallelize(range(10000)) reserialized_rdd = rdd._reserialize(Aut...
Sometimes, the straight forward loop cannot be entirely contained within the loop body. This is because, the loop needs to be primed by some statements B. Then, the iteration begins with some statements A, which are then followed by B again before looping. do_B(); while (condition) { do_A(); ...
Using many ECHO commands to create a batch file: ( echo echo hi, this is the date today echo date /T echo echo created on %DATE% echo pause >nul )>hi.bat The command interpreter treats the whole section in parenthesis as a single command, then saves all the output to hi.bat. ...
Ant provides some built-in properties Property NameValuebasedirthe absolute path of the project's basedirant.filethe absolute path of the buildfile.ant.versionthe version of Antant.project.default-targetthe name of the currently executing project's default targetant.project.namename of the projecta...
One of the major use case when a developer needs to take mutability into account is when passing arguments to a function. This is very important, because this will determine the ability for the function to modify objects that doesn't belong to its scope, or in other words if the function has side ef...
When using d3.request() or one of the convenience constructors (d3.json, d3.csv, d3.tsv, d3.html and d3.xml) there are many sources for error. There may be problems with the issued request or its response due to network errors, or the parsing might fail if the content is not well-formed. Within the...
Decryption Code public static string Decrypt(string cipherText) { if (cipherText == null) return null; byte[] cipherBytes = Convert.FromBase64String(cipherText); using (Aes encryptor = Aes.Create()) { Rfc2898DeriveBytes pdb = ...
This is a jumbotron with a title, a content and a button. Code <div class="jumbotron"> <h1>Title text</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tortor ipsum, convallis sit.</p> <p><a class="btn btn-default&...
IObserver<T> and IObservable<T> interfaces can be used to implement observer pattern in .NET IObservable<T> interface represents the class that sends notifications IObserver<T> interface represents the class that receives them public class Stock { private string Sym...
This example is a very simple Spring Boot application. Maven Dependencies At first add the following dependencies to your project. Spring Initializr is recommended when you create a new project. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr...
Code <?php echo get_option( 'something_bla_bla_bla' ); ?> Output false Code <?php echo get_option( 'something_bla_bla_bla', 'Oh no!' ); ?> Output Oh no!
By using tools like lscpu as lscpu is an easy way to get CPU information. $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 So...
A simple entity: Using Lombok @Getter and @Setter annotations to generate getters and setters for us @Entity @Getter @Setter public class Message { @Id @GeneratedValue(generator = "system-uuid") @GenericGenerator(name = "system-uuid", strategy = "uuid...
In order to expose Thymeleaf templates we need to define controllers. Example: @Controller @RequestMapping("/") public class MessageController { @Autowired private MessageRepository messageRepository; @GetMapping public ModelAndView index() { It...
Html.TextBox() @Html.TextBox("Name", null, new { @class = "form-control" }) output:<input class="form-control" id="Name"name="Name"type="text"value=""/> @Html.TextBox("Name", "Stack Overflow", new { ...
In android, every developer uses Anonymous Class (Runnable) at least once in a project. Any Anonymous Class has a reference to its parent (activity). If we perform a long-running task, the parent activity will not be destroyed until the task is ended. Example uses handler and Anonymous Runnable cla...
Navigate to project's app module and create libs directory. Place your .aar file there. For example myLib.aar. Add the code below to android block of app level's build.gradle file. repositories { flatDir { dirs 'libs' } } This way you defined a new ext...
To get OAuth2 access token simply do curl https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=myclientid" -d "client_secret=myclientsecret" -d "[email protected]" -d "password=mypassword123456" Y...

Page 130 of 153