It is possible to define one's own general entities. The declaration occurs in the DTD subset, with a name and the associated replacement text.
It can then be used in the document using the entity reference syntax &...;, either in text, or in attribute values.
<?xml version="1.0"?...
1. URLByDeletingPathExtension:
If the receiver represents the root path, this property contains a copy of the original URL. If the URL has multiple path extensions, only the last one is removed.
2. URLByAppendingPathExtension:
Returns a new URL made by appending a path extension to the original U...
To create a JAR containing all of its dependencies, it is possible to use the built-in descriptor format jar-with-dependencies. The following example configures an execution of the Assembly Plugin bound to the package phase, using this built-in descriptor and declaring a main class of com.example:
...
Creates a image representing a linear gradient of colors.
linear-gradient( 0deg, red, yellow 50%, blue);
This creates a gradient going from bottom to top, with colors starting at red, then yellow at 50%, and finishing in blue.
You can take advantage of Apache Maven's powerful features in Eclipse by installing the M2Eclipse feature. Follow these steps to install Maven in Eclipse:
Open Eclipse and select Help → Install New Software…
In the opened dialog, select the Add... button to add a new repository.
Fill ...
Ring is de-facto standard API for clojure HTTP applications, similar to Ruby's Rack and Python's WSGI.
We're going to use it with http-kit webserver.
Create new Leiningen project:
lein new app myapp
Add http-kit dependency to project.clj:
:dependencies [[org.clojure/clojure "1.8.0"...
The following method computes the value of num raised to the power of exp using recursion:
public long power(final int num, final int exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return num;
}
return num * power(num, exp - 1);
}
This illustrates ...
Suppose we have an interface:
interface IPerson {
name: string;
age: number;
breath(): void;
}
And we want to create more specific interface that has the same properties of the person, we can do it using the extends keyword:
interface IManager extends IPerson {
managerId:...
The following terms describe different ways to case identifiers.
Pascal Casing
The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. You can use Pascal case for identifiers of three or more characters. For example: BackColor
Camel Casing
Th...
$(window).load() was deprecated in jQuery version 1.8 (and completely removed from jQuery 3.0) and as such should not be used anymore. The reasons for the deprecation are noted on the jQuery page about this event
Caveats of the load event when used with images
A common challenge developers attem...
An explicit intent is used for starting an activity or service within the same application package. In this case the name of the intended class is explicitly mentioned:
Intent intent = new Intent(this, MyComponent.class);
startActivity(intent);
However, an implicit intent is sent across the sys...
Attach an Event Handler
Since version 1.7 jQuery has the event API .on(). This way any standard javascript event or custom event can be bound on the currently selected jQuery element. There are shortcuts such as .click(), but .on() gives you more options.
HTML
<button id="foo">b...
Let's start with example.
Here is a very simple example HTML.
Example HTML
<html>
<head>
</head>
<body>
<ul>
<li>
<a href="some_url/">Link 1</a>
</li>
&l...
If you want your script to wait until a certain resource was loaded, such as an image or a PDF you can use .load(), which is a shortcut for shortcut for .on( "load", handler).
HTML
<img src="image.jpeg" alt="image" id="image">
jQuery
$( "#imag...
When you need to iterate over the list of jQuery elements.
Consider this DOM structure:
<div class="container">
<div class="red one">RED 1 Info</div>
<div class="red two">RED 2 Info</div>
<div class="red three"...
The complex entity
complex, parameter :: x = (1., 4.)
has real part 1. and complex part 4.. We can access these individual components as
real(x) ! The real component
aimag(x) ! The complex component
x%re ! The real component
y%im ! The complex component
The x%.. form is new to F...
There are three types of comment:
# This comment continues to the end of line
-- This comment continues to the end of line
/* This is an in-line comment */
/*
This is a
multiple-line comment
*/
Example:
SELECT * FROM t1; -- this is comment
CREATE TABLE stack(
/*id_user int...