Tutorial by Examples: ect

Creating a separate instance of the WP_Query object is easy: $query_args = array( 'post_type' => 'post', 'post_per_page' => 10 ); $my_query = new WP_Query($query_args); if( $my_query->have_posts() ): while( $my_query->have_posts...
The thing is; you can't connect Ionic to any database (MySQL, Postgres, MSSQL, ...) directly. The keyword here is directly. No, there's no workaround, no magic involved, it's just not the way this is supposed to work. Ionic works on top of Angular and Angular is a frontend framework. However, the ...
The Replace function in SQL is used to update the content of a string. The function call is REPLACE( ) for MySQL, Oracle, and SQL Server. The syntax of the Replace function is: REPLACE (str, find, repl) The following example replaces occurrences of South with Southern in Employees table: FirstN...
HTML: <div id="title"> <h1 data-content="HOVER">HOVER</h1> </div> CSS: *{margin:0;padding:0;} html,body{height:100%;width:100%;overflow:hidden;background:#0099CC;} #title{ position:absolute; top:50%; left:50%; transform:translate(-50%,-...
Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page. Often director...
Express is based on Connect, which is what provides the middleware functionality of Express. To understand what connect is, you can see that it provides the basic app structure that you use when you use express const connect = require('connect') const app = connect() app.listen(3000) This wi...
You can call an instance method using the . special form: (.trim " hello ") ;;=> "hello" You can call instance methods with arguments like this: (.substring "hello" 0 2) ;;=> "he"
You can call an instance field using the .- syntax: (def p (java.awt.Point. 0 1)) (.-x p) ;;=> 0 (.-y p) ;;=> 1
You can create instance of objects in one of two ways: (java.awt.Point. 0 1) ;;=> => #object[java.awt.Point 0x3776d535 "java.awt.Point[x=0,y=1]"] Or (new java.awt.Point 0 1) ;;=> => #object[java.awt.Point 0x3776d535 "java.awt.Point[x=0,y=1]"]
The macro() function allows you to add new functionality to Illuminate\Support\Collection objects Usage: Collection::macro("macro_name", function ($parameters) { // Your macro }); For example: Collection::macro('uppercase', function () { return $this->map(function ($i...
DatabaseTransactions trait allows databases to rollback all the change during the tests. If you want to rollback multiple databases , you need to set $connectionsToTransact properties use Illuminate\Foundation\Testing\DatabaseMigrations; class ExampleTest extends TestCase { use Databas...
Suppose we want to select a word without surrounding white spaces, use the text object iw for inner word using visual mode: Got to normal mode by pressing ESC Type viw at the beginning of a word This will select the inner word
With ASP.NET Core the Microsoft team also introduced the Options pattern, which allows to have strong typed options and once configured the ability to inject the options into your services. First we start with a strong typed class, which will hold our configuration. public class MySettings { ...
If you need to add a property with a null value, you should use the predefined static final JSONObject.NULL and not the standard Java null reference. JSONObject.NULL is a sentinel value used to explicitly define a property with an empty value. JSONObject obj = new JSONObject(); obj.put("some...
--dataset schemas must be identical SELECT 'Data1' as 'Column' UNION ALL SELECT 'Data2' as 'Column' UNION ALL SELECT 'Data3' as 'Column' UNION ALL SELECT 'Data4' as 'Column' UNION ALL SELECT 'Data5' as 'Column' EXCEPT SELECT 'Data3' as 'Column' --Returns Data1, Data2, Data4, and Data5
An example of a RLMObject base model class that uses a primary key and some generic default properties. Subclasses can then set metadata specific to their needs. @interface BaseModel : RLMObject @property NSString *uuid; @property NSString *metadata; @end @implementation BaseModel + (N...
Java provides the instanceof operator to test if an object is of a certain type, or a subclass of that type. The program can then choose to cast or not cast that object accordingly. Object obj = Calendar.getInstance(); long time = 0; if(obj instanceof Calendar) { time = ((Calendar)obj).ge...
In Python 2, writing directly to a file handle returns None: Python 2.x2.3 hi = sys.stdout.write('hello world\n') # Out: hello world type(hi) # Out: <type 'NoneType'> In Python 3, writing to a handle will return the number of characters written when writing text, and the number of by...
public void iterate(final String dirPath) throws IOException { final DirectoryStream<Path> paths = Files.newDirectoryStream(Paths.get(dirPath)); for (final Path path : paths) { if (Files.isDirectory(path)) { System.out.println(path.getFileName()); } } ...
Example: Invoke different constructors by passing relevant parameters import java.lang.reflect.*; class NewInstanceWithReflection{ public NewInstanceWithReflection(){ System.out.println("Default constructor"); } public NewInstanceWithReflection( String a){ ...

Page 40 of 99