Tutorial by Examples

One to Many Lets say that each Post may have one or many comments and each comment belongs to just a single Post. so the comments table will be having post_id. In this case the relationships will be as follows. Post Model public function comments() { return $this->belongsTo(Post::class...
Lets say there is roles and permissions. Each role may belongs to many permissions and each permission may belongs to many role. so there will be 3 tables. two models and one pivot table. a roles, users and permission_role table. Role Model public function permissions() { return $this->bel...
Note: This only works for the built-in keyboard provided by iOS SWIFT: In order for the view of a UIViewController to increase the origin of the frame when it is presented and decrease it when it is hidden, add the following functions to your class: func keyboardWillShow(notification: NSNotificat...
Using an Atomic Group Atomic groups have the format (?>...) with a ?> after the open paren. Consider the following sample text: ABC The regex will attempt to match starting at position 0 of the text, which is before the A in ABC. If a case-insensitive expression (?>a*)abc were used, ...
if and else: it used to check whether the given expression returns true or false and acts as such: if (condition) statement the condition can be any valid C++ expression that returns something that be checked against truth/falsehood for example: if (true) { /* code here */ } // evaluate that ...
The break instruction: Using break we can leave a loop even if the condition for its end is not fulfilled. It can be used to end an infinite loop, or to force it to end before its natural end The syntax is break; Example: we often use break in switch cases,ie once a case i switch is satisfied...
Below example changes the opacity of the image based on the "status" parameter. <img class="img-responsive" ng-src="{{imagesrc}}" ng-style="{'opacity' : (status == 2) ? 1 : 0.5}">
I'll start with a really short explanation what is and why use Model-View-ViewModel (MVVM) design pattern in your iOS apps. When iOS first appeared, Apple suggested to use MVC (Model-View-Controller) as a design pattern. They showed it in all of their examples and all first developers were happy us...
Let's say that inside a resources file, you had a file called /icons/ok.png The full url of this file within code is qrc:/icons/ok.png. In most cases, this can be shortened to :/icons/ok.png For example, if you wanted to create a QIcon and set it as the icon of a button from that file, you could u...
Environment Setup: Download android sdk of API level 17 or more Node.js (https://nodejs.org/) Appium software (http://appium.io/) Selenium jars (http://www.seleniumhq.org/download/) Appium jar (https://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.appium%20a%3Ajava-client) .apk file of the appl...
This example is about changing the form depending on decisions the user did with the form previously. In my special case, I needed to disable a selectbox, if a certain checkbox wasn't set. So we have the FormBuilder, where we'll set the EventListener on the FormEvents::PRE_SUBMIT event. We're usin...
A Reference in C++ is just an Alias or another name of a variable. Just like most of us can be referred using our passport name and nick name. References doesn't exist literally and they don't occupy any memory. If we print the address of reference variable it will print the same address as that of...
SELECT E.EMPLOYEE_ID,E.LAST_NAME,E.MANAGER_ID FROM HR.EMPLOYEES E CONNECT BY PRIOR E.EMPLOYEE_ID = E.MANAGER_ID; The CONNECT BY clause to define the relationship between employees and managers.
SELECT E.LAST_NAME|| ' reports to ' || PRIOR E.LAST_NAME "Walk Top Down" FROM HR.EMPLOYEES E START WITH E.MANAGER_ID IS NULL CONNECT BY PRIOR E.EMPLOYEE_ID = E.MANAGER_ID;
CREATE TABLE myschema.tableNew AS ( SELECT * FROM myschema.tableOld ) WITH DATA
CREATE TABLE myschema.tableNew AS ( SELECT * FROM myschema.tableOld ) WITHOUT DATA
CREATE TABLE myschema.tableNew AS ( SELECT * FROM myschema.tableOld WHERE column1 = 'myCriteria' ) WITH DATA
Concept AsyncTask is a class that allows running operations in the background, with the results being published on the UI thread. The main purpose is to eliminate all the boilerplate code for starting/running a thread by eliminating the handlers and all the stuff that are needed for manipulating t...
Detailed instructions on getting quartz.net set up or installed.
In the following example if someone if someone presses the home button while the task is running, then the task is cancelled. In this particular cancelling it should interrupt if running. public class MainActivity extends AppCompatActivity { private static AtomicBoolean inWork; pri...

Page 1102 of 1336