Tutorial by Examples: amp

If there are many version tables, the title of the desired one has to be included in angle brackets. <!-- if version <Micro Framework> [eq 4.4] --> This content is for Micro Framework 4.4 <!-- end version if -->
This example shows you a minimal way to create a Hello World page in Django. This will help you realize that the django-admin startproject example command basically creates a bunch of folders and files and that you don't necessarily need that structure to run your project. Create a file called ...
Visitor pattern allows you to add new operations or methods to a set of classes without modifying the structure of those classes. This pattern is especially useful when you want to centralise a particular operation on an object without extending the object Or without modifying the object. UML diag...
Database connections are set up using the CF Administrator tool. See Database Connections for how to connect a datasource. To execute queries all you need is the <cfquery> tag. The <cfquery> tag connects to and opens the database for you, all you need to do is supply it with the name of...
[TimeStamp] attribute can be applied to only one byte array property in a given Entity class. Entity Framework will create a non-nullable timestamp column in the database table for that property. Entity Framework will automatically use this TimeStamp column in concurrency check. using System.Compon...
Let's see MVP in action using a simple Login Screen. There are two Buttons—one for login action and another for a registration screen; two EditTexts—one for the email and the other for the password. LoginFragment (The View) public class LoginFragment extends Fragment implements LoginContract.Prese...
Interfaces can seem abstract until you seem them in practice. The IComparable and IComparable<T> are great examples of why interfaces can be helpful to us. Let's say that in a program for a online store, we have a variety of items you can buy. Each item has a name, an ID number, and a price. ...
There are two possible ways of including LaTeX preamble commands (e.g. \usepackage) in a RMarkdown document. 1. Using the YAML option header-includes: --- title: "Including LaTeX Preample Commands in RMarkdown" header-includes: - \renewcommand{\familydefault}{cmss} - \usepacka...
Self types can be used in traits and classes to define constraints on the concrete classes it is mixed to. It is also possible to use a different identifier for the this using this syntax (useful when outer object has to be referenced from an inner object). Assume you want to store some objects. Fo...
This technique details how to ensure that your .apk has been signed with your developer certificate, and leverages the fact that the certificate remains consistent and that only you have access to it. We can break this technique into 3 simple steps: Find your developer certificate signature. Em...
This example will call the windows calculator. It's important to notice that the exit code will vary accordingly to the program/script that is being called. package process.example; import java.io.IOException; public class App { public static void main(String[] args) { try { ...
For example: ActiveRecord::Base.transaction do david.withdrawal(100) mary.deposit(100) end This example will only take money from David and give it to Mary if neither withdrawal nor deposit raise an exception. Exceptions will force a ROLLBACK that returns the database to the state before ...
infixr 5 ++ infixl 4 <*>, <*, *>, <**> infixl 8 `shift`, `rotate`, `shiftL`, `shiftR`, `rotateL`, `rotateR` infix 4 ==, /=, <, <=, >=, > infix ??
Window.h #include <QWidget> class Window : public QWidget { Q_OBJECT public: Window(QWidget *parent = Q_NULLPTR) : QWidget(parent) {} } main.cpp #include <QApplication> #include "Window.h" int main() { QApplication app; Window window; wi...
The SUBDIRS ability of qmake can be used to compile a set of libraries, each of which depend on another. The example below is slightly convoluted to show variations with the SUBDIRS ability. Directory Structure Some of the following files will be omitted in the interest of brevity. They can be a...
A simple example to make a library (rather than an executable, which is the default). TEMPLATE variable specifies type of the project you are making. lib option allows makefile to build a library. library.pro HEADERS += library.h SOURCES += library.cpp TEMPLATE = lib # By default, qmake wil...
The following example is a sample Less file which shows how variables are declared and used, how mixins are defined and called in Less. /* Variables */ @color-base: #87ceeb; /* Simple mixin to set border */ .set-border(@width; @style; @color) { border: @width @style darken(@color, 10%); ...
Install symfony correctly as guided above. Start symfony server if you are not installed in www directory. Ensure http://localhost:8000 is working if symfony server is used. Now it is ready to play with simplest example. Add following code in a new file /src/AppBundle/Controller/MyController.p...
To create mixins, simply declare lightweight classes that can be used as "behaviours". class Flies { fly() { alert('Is it a bird? Is it a plane?'); } } class Climbs { climb() { alert('My spider-sense is tingling.'); } } class Bulletproof { ...
import pandas as pd import numpy as np import matplotlib.pyplot as plt # I want 7 days of 24 hours with 60 minutes each periods = 7 * 24 * 60 tidx = pd.date_range('2016-07-01', periods=periods, freq='T') # ^ ^ # | ...

Page 13 of 46