Tutorial by Examples: al

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...
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,...
Creating a Scala function that receives an python RDD is easy. What you need to build is a function that get a JavaRDD[Any] import org.apache.spark.api.java.JavaRDD def doSomethingByPythonRDD(rdd :JavaRDD[Any]) = { //do something rdd.map { x => ??? } }
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...
To call this code you should create the jar of your scala code. Than you have to call your spark submit like this: spark-submit --master yarn-client --jars ./my-scala-code.jar --driver-class-path ./my-scala-code.jar main.py This will allow you to call any kind of scala code that you need in your...
Passing by value When a value is passed ByVal, the procedure receives a copy of the value. Public Sub Test() Dim foo As Long foo = 42 DoSomething foo Debug.Print foo End Sub Private Sub DoSomething(ByVal foo As Long) foo = foo * 2 End Sub Calling the above Test...
First, complete the installation and setup to connect your app to Firebase. Then from anywhere in your class, you can write: // Write a message to the database FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("message"); myRe...
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...
Let's initially understand basic types of custom validators: Inline Validator Standalone Validator Inline Validator: It is the type of the validator we create inside the class which is basically a method we define just like other methods but with extra parameters which is passed in by Yii2. ...
Sometimes we'd like to pause code execution to inspect the state of the application (see Debugging). When running code through the MATLAB editor, this can be done using the "Pause" button in the UI or by pressing Ctrl+c (on Windows). However, when a computation was initiated from a GUI (vi...
It is a common practice to name files using the date as prefix in the following format: YYYYMMDD, for example: 20170101_results.csv. A date in such string format can be verified using the following regular expression: \\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]) The above expression considers d...
Objectives: Using the Spring CLI, we will create a new Spring Boot application to be deployed to Elastic Beanstalk. We will edit the generated Spring Boot application so that it will: Create a jar named aws-eb-demo.jar. Listen on port 5000. Include a single web page named index.html. ...
Code echo get_permalink(); Output The link of the current page, for example: http://website.com/category/name-of-post/
Code $categories = get_the_category(); foreach( $categories as $category ) { echo $category->name . '<br />'; } Output All names of categories of the current page, one on each line.
Code $categories = get_the_category(); foreach( $categories as $category ) { echo $category->term_id . '<br />'; } Output All ids of categories of the current page, one on each line.
In mathematics, especially Set Theory, we have a collection of things which is called set and we name those things as elements. We show a set with its name like A, B, C, ... or explicitly with putting its member on brace notation: {a, b, c, d, e}. Suppose we have an arbitrary element x and a set Z, ...
After you have set a few data to database and have get a structure consisting of several nodes like this; "user" : { "-KdbKcU2ptfYF2xKb5aO" : { "firstName" : "Arthur", "lastName" : "Schopenhauer", "userName&q...
Create enum of custom errors enum RegistrationError: Error { case invalidEmail case invalidPassword case invalidPhoneNumber } Create extension of RegistrationError to handle the Localized description. extension RegistrationError: LocalizedError { public var errorDescription...

Page 230 of 269