Tutorial by Examples

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
This one-liner illustrates some of the basic series operations. Before analysing, we'll initiate a block to be manipulated: stuff: [chair lamp table book carpet] Now our one-liner: head insert stuff take back tail stuff There are five operations within this example, and with each of them it...
You should go to Xcode -> Open Developer Tool: Using "Simulator", you could run iOS and tvOS, but "Simulator (Watch)" will only run watchOS.
Go to Hardware -> Touch Pressure: To simulate a normal press, use Shift-Command-1 and a deep one, Shift-Command-2. If your MacBook has a Force Touch trackpad, you could use your trackpad force to simulate 3D / Force Touch.
Go to Hardware -> Device:
Home button You should use Shift-Command-H to have an animation when closing an app. Lock To lock the device, use Command-L. Rotation Use Command with arrow keys.
Go to Xcode and open your project. In your app target, navigate to Capabilities tab. Turn on Background Modes.
Background fetch is a new mode that lets your app appear always up-to-date with the latest information while minimizing the impact on battery. You could download feeds within fixed time intervals with this capability. To get started: 1- Check Background Fetch in capabilities screen in Xcode. 2- I...
1- Run the app on a real device and attach it to Xcode debugger. 2- From Debug menu, select Simulate Background Fetch: 3- Now Xcode will pause the app with SIGSTOP signal. Just tap the continue button to let the app do the background fetch. Now you will see that data is fetched and ready for ...
By default, when you are streaming an audio, by exiting the app it will stop, but you can prevent this by turning on the first check box in Background capability page in Xcode. iOS will automatically handle this for you, and you don't need to write any code!
Swift Playgrounds app is a great way to get started coding Swift on the go. To use it: 1- Download Swift Playgrounds for iPad from App Store. 2- Open the app. 3- In the My Playgrounds tab, tap + on the top left corner and then select Blank template. 4- Enter your code. 5- Tap Run My Code to r...
To avoid unsightly #DIV/0 errors in a spreadsheet, a custom function can be used. /** * Divides n by d unless d is zero, in which case, it returns * the given symbol. * * @param {n} number The numerator * @param {d} number The divisor * @param {symbol} string The symbol to display...
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...
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. ...

Page 1154 of 1336