Tutorial by Examples: el

Models are typically defined in the models.py file under your application subdirectory. The Model class of django.db.models module is a good starting class to extend your models from. For example: from django.db import models class Book(models.Model): title = models.CharField(max_length=100...
Pseudo-elements are added to selectors but instead of describing a special state, they allow you to style certain parts of a document. The content attribute is required for pseudo-elements to render; however, the attribute can have an empty value (e.g. content: ""). div::after { conte...
MATLAB comes with many built-in scripts and functions which range from simple multiplication to image recognition toolboxes. In order to get information about a function you want to use type: help functionname in the command line. Lets take the help function as an example. Information on how to use...
Elements of the same class can often be concatenated into arrays (with a few rare exceptions, e.g. function handles). Numeric scalars, by default of class double, can be stored in a matrix. >> A = [1, -2, 3.14, 4/5, 5^6; pi, inf, 7/0, nan, log(0)] A = 1.0e+04 * 0.0001 -0.0002 0...
The for and while compound statements (loops) can optionally have an else clause (in practice, this usage is fairly rare). The else clause only executes after a for loop terminates by iterating to completion, or after a while loop terminates by its conditional expression becoming false. for i in r...
In this example, we will look at a method for returning the last non-empty row in a column for a data set. This method will work regardless of empty regions within the data set. However caution should be used if merged cells are involved, as the End method will be "stopped" against a mer...
Any Fortran program has to include end as last statement. Therefore, the simplest Fortran program looks like this: end Here are some examples of "hello, world" programs: print *, "Hello, world" end With write statement: write(*,*) "Hello, world" end For c...
Dart has If Else: if (year >= 2001) { print('21st century'); } else if (year >= 1901) { print('20th century'); } else { print('We Must Go Back!'); } Dart also has a ternary if operator: var foo = true; print(foo ? 'Foo' : 'Bar'); // Displays "Foo".
While loops and do while loops are allowed in Dart: while(peopleAreClapping()) { playSongs(); } and: do { processRequest(); } while(stillRunning()); Loops can be terminated using a break: while (true) { if (shutDownRequested()) break; processIncomingRequests(); } You can s...
SELECT * FROM Employees ORDER BY LName This statement will return all the columns from the table Employees. IdFNameLNamePhoneNumber2JohnJohnson24681012141JamesSmith12345678903MichaelWilliams1357911131 SELECT * FROM Employees ORDER BY LName DESC Or SELECT * FROM Employees ORDER BY LName ASC...
Running the latest Liferay CE is straightforward: Go to https://www.liferay.com/downloads. Choose a bundle among the ones listed. For beginners, the Tomcat bundle is a good choice. Click in "Download." Unzip the download package whenever you find fit. The unzipped directory will...
Content has been moved back to the good 'ol JSF wiki page
Substitutability is a principle in object-oriented programming introduced by Barbara Liskov in a 1987 conference keynote stating that, if class B is a subclass of class A, then wherever A is expected, B can be used instead: class A {...} class B extends A {...} public void method(A obj) {...} ...
Create a new file named hello_world.dart with the following content: void main() { print('Hello, World!'); } In the terminal, navigate to the directory containing the file hello_world.dart and type the following: dart hello_world.dart Hit enter to display Hello, World! in the terminal wi...
To create and run new WPF project in Visual Studio: Click File → New → Project Select template by clicking Templates → Visual C# → Windows → WPF Application and press OK: Open MainWindow.xaml file in Solution Explorer (if you don't see Solution Explorer window, open it by clicking V...
We start with creating an HTML page for the app. There we define the meta tags, a script tag to load the SAPUI5 libraries, and a placeholder for the content of the app. <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"...
This progam uses VCL, the default UI components library of Delphi, to print "Hello World" into a message box. The VCL wrapps most of the commonly used WinAPI components. This way, they can be used much easier, e.g. without the need to work with Window Handles. To include a dependency (lik...
Create hello.py: from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'Hello, World!' Then run it with: export FLASK_APP=hello.py flask run * Running on http://localhost:5000/ Adding the code below will allow running it directly with python hello...
Consider following DOM Structure <ul class="parentUl"> <li> Level 1 <ul class="childUl"> <li>Level 1-1 <span> Item - 1 </span></li> <li>Level 1-1 <span> Item - 2 </span></li&gt...
To delete a branch on the origin remote repository, you can use for Git version 1.5.0 and newer git push origin :<branchName> and as of Git version 1.7.0, you can delete a remote branch using git push origin --delete <branchName> To delete a local remote-tracking branch: git bra...

Page 12 of 145