Tutorial by Examples: c

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...
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...
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...
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...
The interface Flyable is a class module with the following code: Public Sub Fly() ' No code. End Sub Public Function GetAltitude() As Long ' No code. End Function A class module, Airplane, uses the Implements keyword to tell the compiler to raise an error unless it has two methods...
First, you need to prepare the environment by creating the SQL Server table and the CSV file. Run the script below in SQL Server to create the SQL table either on a new database or an existing one. For this example, I used my ‘TrainingDB’ database. /* Creates table for Students.csv */ CREATE TABL...
' How To Seek Past VBA's 2GB File Limit ' Source: https://support.microsoft.com/en-us/kb/189981 (Archived) ' This must be in a Class Module Option Explicit Public Enum W32F_Errors W32F_UNKNOWN_ERROR = 45600 W32F_FILE_ALREADY_OPEN W32F_PROBLEM_OPENING_FILE W32F_FILE_ALREAD...
Private Const HashTypeMD5 As String = "MD5" ' https://msdn.microsoft.com/en-us/library/system.security.cryptography.md5cryptoserviceprovider(v=vs.110).aspx Private Const HashTypeSHA1 As String = "SHA1" ' https://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1c...
Another variation from the code above gives you more performance when you want to get hash codes of all files from a root folder including all sub folders. Example of Worksheet: Code Option Explicit Private Const HashTypeMD5 As String = "MD5" ' https://msdn.microsoft.com/en-us/libr...
We can create Singleton class in such a way that developers are forced to used the shared instance (singleton object) instead of creating their own instances. @implementation MySingletonClass + (instancetype)sharedInstance { static MySingletonClass *_sharedInstance = nil; static dispa...
Let's say we have the following 4 by 4 grid: Let's assume that this is a maze. There are no walls/obstacles, though. We only have a starting point (the green square), and an ending point (the red square). Let's also assume that in order to get from green to red, we cannot move diagonally. So, s...
Let's say we have the following 4 by 4 grid: Let's assume that this is a maze. There are no walls/obstacles, though. We only have a starting point (the green square), and an ending point (the red square). Let's also assume that in order to get from green to red, we cannot move diagonally. So, s...

Page 685 of 826