Tutorial by Examples

Yii2 provides efficient ways to retrieve data from the database.Consider an example of a simple employee table having fields emp_id, emp_name and emp_salary. In order to retrieve the employee names and their salaries, we use the query. select emp_name,emp_salary from employee To generate the abo...
Multiple conditions can be written using where() method as given below. // Creates a new \yii\db\Query() object $query = new \yii\db\Query(); $rows = $query->select(['emp_name','emp_salary']) ->from('employee') ->where(['emp_name' => 'Kiran', 'emp_salary' => 2500...
This example intend to be a gentle introduction to the Excel Object Model for beginners. Open the Visual Basic Editor (VBE) Click View --> Immediate Window to open the Immediate Window (or ctrl + G): You should see the following Immediate Window at the bottom on VBE: This wi...
gradlew tasks -- show all tasks Android tasks ------------- androidDependencies - Displays the Android dependencies of the project. signingReport - Displays the signing info for each variant. sourceSets - Prints out all the source sets defined in this project. Build tasks -----------...
Suppose we have a JSON string: ["first","second","third"] We can parse this JSON string into a String array : Gson gson = new Gson(); String jsonArray = "[\"first\",\"second\",\"third\"]"; String[] strings = gson.fromJson(j...
For this example to work you'll need a JDBC driver compatible to the system the database is running on. An opensource one that allows you to connect to DB2 databases on an IBM System i can be found here: JT400 Even though this example is DB2 specific, it works for almost every other system if you e...
Some times you need to debug python code which is executed by another process and and in this cases rpdb comes in handy. rpdb is a wrapper around pdb that re-routes stdin and stdout to a socket handler. By default it opens the debugger on port 4444 Usage: # In the Python file you want to debu...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
@Provider public class IllegalArgumentExceptionMapper implements ExceptionMapper<IllegalArgumentException> { @Override public Response toResponse(IllegalArgumentException exception) { return Response.serverError().entity("Invalid input: " + exception.getMessage(...
add: add the specified files on the next commit addremove: add all new files, delete all missing files backout: reverse effect of earlier changeset commit, ci: commit the specified files or all outstanding changes copy, cp: mark files as copied for the next commit forge...
annotate, blame: show changeset information by line for each file bisect: subdivision search of changesets cat: output the current or given revision of files diff: diff repository (or selected files) grep: search for a pattern in specified files and revisions log, history: show revision histo...
archive: create an unversioned archive of a repository revision bundle: create a changegroup file clone: make a copy of an existing repository export: dump the header and diffs for one or more changesets graft: copy changes from other branches onto the current branch incoming: show new change...
bookmarks, bookmark: create a new bookmark or list existing bookmarks branch: set or show the current branch name branches: list repository named branches config, showconfig, debugconfig: show combined config settings from all hgrc files files: list tracked files help: show help for a given t...
bookmarks, bookmark: create a new bookmark or list existing bookmarks branch: set or show the current branch name tag: add one or more tags for the current or given revision update, up, checkout, co: update working directory (or switch revisions)
FNR contains the number of the input file row being processed. In this example you will see awk starting on 1 again when starting to process the second file. Example with one file $ cat file1 AAAA BBBB CCCC $ awk '{ print FNR }' file1 1 2 3 Example with two files $ cat file1 AAAA BBBB...
If you want to create an instance of an inner nested class you need to provide a class object of the enclosing class as an extra parameter with Class#getDeclaredConstructor. public class Enclosing{ public class Nested{ public Nested(String a){ System.out.println("Constru...
In Scala (in contrast to Java and most other languages), if is an expression instead of a statement. Regardless, the syntax is identical: if(x < 1984) { println("Good times") } else if(x == 1984) { println("The Orwellian Future begins") } else { println("Po...
In case of stackable modification, Scala arranges classes and traits in a linear order to determine method call hierarchy, which is known as linearization. The linearization rule is used only for those methods that involve method invocation via super(). Let's consider this by an example: class Shap...

Page 563 of 1336