WT is a JavaScript QR Code encoding library. It differs from most other libraries in that it provides low-level functionality, rather than abstract data types -- users may select whichever versions, encodings, and headers they feel suit their needs -- or rely on the built-in selection algorithms to choose for them. WT was also written from the ground up in JavaScript, rather than being ported from another language.
Most modes are supported, with the exceptions of Structured Append and Kanji modes.
The current version of WT can always be downloaded in minified form from the project website. Also available from the website is the current git repository for the project. WT does not require any third-party libraries to function.
Installing the WT library in your page is much like installing any
other library. Simply drop the minified wt.js
somewhere
relative to your page, and insert a script tag into your page:
<script type="text/javascript" src="wt.js"></script>
Adjust the src
attribute as necessary.
QR Code objects must be initialized in a certain order. For example:
var qr = new QRCode();
qr.setVersion(0, QR__EC.M);
qr.setData([{ mode: QR__Mode.ECI, data: 26 }, { mode: QR__Mode.smart, data: 'Hello, world!'}]);
qr.drawSymbol();
drawQRToCanvas(qr, document.getElementById("MyCanvas"), 8);
This code will draw a QR Code representing the text "Hello, world!"
with UTF-8 encoding. After the object is created, the
setVersion()
and setData()
methods must
be called first in order to tell the object what kind of symbol it
is drawing. Then, the drawSymbol()
method will generate
the symbol. Finally, the drawQRToCanvas()
function will draw the
QR code to a given HTML5 canvas object. It is also possible to draw to a div,
using the drawQRToDiv()
function.
It is preferrable to use the HTML5 canvas element when it is
available. In order to determine if it is available, one can use the
following code:
if (typeof document.getElementById("MyCanvas").getContext === 'undefined') {
drawQRToDiv(qr, document.getElementById("MyDiv"), 8);
} else {
drawQRToCanvas(qr, document.getElementById("MyCanvas"), 8);
}
Enterprising users will find that after
qr.drawSymbol()
is called, the integer variable
qr.dim
contains the dimension (width/height, both of
which are the same) of the QR code, and the array variable
qr.data
is a linear array of booleans representing the
finalized symbol, such that qr.data[y * qr.dim + x]
will yield the value at position (x, y)
in the symbol,
with true
representing a black module, and
false
representing a white module.
This is the primary class used by the library.
This constructor function creates a QR code object. It takes no
arguments.
var qr = new QRCode();
ver, ec
)This method of the QRCode class sets the version of a QR Code object.
The ver
argument sets the version of the QR
code. This may be set explicitly in the range 1
to
40
. Alternatively, it may be set to 0
,
which will result in the lowest possible version being selected
automatically.
The ec
argument sets the error correction level of the
QR Code. Valid values are:
qr.setVersion(0, QR__EC.M);
data
)This method of the QRCode class sets the data represented by the symbol.
The data
argument is an array containing objects
representing data segments and their encodings:
[
{ mode: QR__Mode.ECI, data: 26 },
{ mode: QR__Mode.eightBit, data: 'Hello, world!' },
{ mode: QR__Mode.num, data: '1234567890' },
...
]
Available data encodings are:
QR__Mode.num
):
Numeric mode encoding. Argument data
is a
string containing only digits 0-9.
QR__Mode.alNum
):
Alphanumeric mode encoding. Argument data
is a
string containing only uppercase letters A-Z, digits 0-9,
space ( ), and symbols $%*+-./:.
QR__Mode.eightBit
):
Eight bit encoding. Argument data
may contain
any data. It is strongly recommended, although not required,
that an ECI encoding header be included when using this mode
(see below). Be advised that most JavaScript implementations
will convert ALL strings to UTF-8, regardless of input encoding.
QR__Mode.ECI
):
Inserts an ECI header, which specifies an encoding type.
Argument data
is an integer ECI code value. It is
recommended that you use one of the following character encodings:
QR__Mode.FNC11
):
Inserts an FNC1 in first position header. The
data
argument is null
. Please see
the QR Code ISO standard for more information.
QR__Mode.FNC12
):
Inserts an FNC1 in second position header. The
data
argument is an FNC1 application code.
Please see the QR Code ISO standard for more information.
QR__Mode.smart
):
Inserts a data segment for which the least costly encoding
has been selected. Argument data
may contain
any data. Encoding is selected from Numeric, Alphanumeric or
8-bit. As with 8-bit encoding, it is strongly recommended,
although not required, that an ECI encoding header be
included when using this mode.
qr.setData([
{ mode: QR__Mode.ECI, data: 26 },
{ mode: QR__Mode.smart, data: 'Hello, world!'}
]);
This method of the QR code class constructs the symbol. It must only be called after QRCode.setVersion() and QRCode.setData() have been called. It takes no arguments.
Please note that the method used by this function to select a mask is not compliant with the ISO standard. A less complex, computationally cheaper method is used. Support for strict masking will be added in the future.
qr.drawSymbol();
This variable defines the method used to select a mask pattern for the QR Code. In brief, this is a potentially very computationally expensive procedure that may or may not make your QR Code more likely to be successfully scanned. Valid values are:
qr.maskMethod = QR__MaskMethod.Canonical;
qr, canvas, scale, bgcolor, fgcolor
)This function draws a QR code to an HTML5 canvas.
Theqr
argument is a QRCode object. This object must
have had the QRCode.drawSymbol() method
previously called, so that the symbol has been constructed.
The canvas
argument is an HTML5 canvas object. This
object must exist -- make sure the window has been fully loaded and
the object has been created before attempting to call this function.
The optional scale
argument is the drawing scale. This value
decides how many pixels wide each module will be, per side.
The optional bgcolor
and fgcolor
arguments
define the background and foreground colors of the QR Code.
drawQRToCanvas(qr, document.getElementById('MyCanvasID'), 8);
qr, div, scale, bgcolor, fgcolor
)This function draws a QR code to an HTML5 canvas.
Theqr
argument is a QRCode object. This object must
have had the QRCode.drawSymbol() method
previously called, so that the symbol has been constructed.
The div
argument is an HTML div object. This
object must exist -- make sure the window has been fully loaded and
the object has been created before attempting to call this function.
The optional scale
argument is the drawing scale. This value
decides how many pixels wide each module will be, per side.
The optional bgcolor
and fgcolor
arguments
define the background and foreground colors of the QR Code.
drawQRToDiv(qr, document.getElementById('MyDivID'), 8);
This section will be written at a later date. For now, please see the (fairly verbose) comments in the source code.
This library would not have been possible without the QR Code ISO standard (ISO/IEC 18004:2000), or the excellent documentation provided by Carolyn Eby.
QR Code is registered trademark of DENSO WAVE INCORPORATED.


|
masscalculator-core
|
The test fixture for testing class Zinc. More...
#include <zinc_test.h>
Protected Member Functions | |
| ZincTest () | |
| Construct a new ZincTest object. | |
| ~ZincTest ()=default | |
| Destroy the ZincTest object. | |
Protected Attributes | |
| MassCalculator::Materials::Zinc | material_Z_190 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_310 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_320 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_500 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_700 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_720 |
| Member objects for class Titanium for each Titanium type. | |
| MassCalculator::Materials::Zinc | material_Z_750 |
| Member objects for class Titanium for each Titanium type. | |
The test fixture for testing class Zinc.


LEVEL:
Category:
| Muscle Group | Test Exercise | Type of exercise | Exercises | Volume | Intensity | Frequency (muscle group per week) | Progression model | Rest periods | Tempo | ||
| Sets | Reps | % of 1RM | Reps to failure | ||||||||
| Chest | Bench Press | Multi joint exercises | |||||||||
| Single joint exercises | |||||||||||
| Back | Deadlift | Multi joint exercises | |||||||||
| Single joint exercises | |||||||||||
| Quads | Squat | Multi joint exercises | |||||||||
| Single joint exercises | |||||||||||
| Shoulders | Multi joint exercises | ||||||||||
| Single joint exercises | |||||||||||
| Hamstrings | Multi joint exercises | ||||||||||
| Single joint exercises | |||||||||||
| Calves | Multi joint exercises | ||||||||||
| Single joint exercises | |||||||||||
| Triceps | Multi joint exercises | ||||||||||
| Single joint exercises | |||||||||||
| Biceps | Multi joint exercises | ||||||||||
| Single joint exercises |


s6
Software
skarnet.org
The s6-accessrules-cdb-from-fs program
s6-accessrules-cdb-from-fs compiles a directory
containing a ruleset suitable for
s6-ipcserver-access or
s6-tcpserver-access into a
CDB file.
Interface
s6-accessrules-cdb-from-fs cdbfile dir
- s6-accessrules-cdb-from-fs compiles the dir
directory containing a ruleset into a
CDB file
cdbfile then exits 0.
Ruleset directory format
To be understood by s6-accessrules-cdb-from-fs,
s6-ipcserver-access, or
s6-tcpserver-access,
dir must have a specific format.
dir contains a series of directories:
- ip4 for rules on IPv4 addresses
- ip6 for rules on IPv6 addresses
- reversedns for rules on host names
- uid for rules on user IDs
- gid for rules on group IDs
Depending on the application, other directories can appear in dir
and be compiled into cdbfile, but
s6-tcpserver-access only
uses the first three, and
s6-ipcserver-access only
uses the last two.
Each of those directories contains a set of rules. A rule is
a subdirectory named after the set of keys it matches, and containing
actions that will be executed if the rule is the first matching rule
for the tested key.
The syntax for the rule name is dependent on the nature of keys, and
fully documented on the
accessrules
library page. For instance, a subdirectory named <IP_ADDRESS>_27
in the ip4 directory will match every IPv4 address in the
<IP_ADDRESS>/27 network that does not match a more precise rule.
The syntax for the actions, however, is the same for every type of key.
A rule subdirectory can contain the following elements:
- a file (that can be empty) named allow. If such a file exists,
a key matching this rule will be immediately accepted.
- a file (that can be empty) named deny. If such a file exists and
no allow file exists, a key matching this rule will be immediately
denied.
- a subdirectory named env. If such a directory exists along
with an allow file, then its contents represent environment
modifications that will be applied after accepting the connection and
before executing the next program in the chain, as if the
s6-envdir
program, without options, was applied to env. env
has exactly the same format as a directory suitable for s6-envdir;
however, if the modifications take up more than 4096 bytes when
compiled into cdbfile, then s6-accessrules-cdb-from-fs will
complain and exit 100.
- a file named exec. If such a file exists along with an
allow file, then its contents represent a command line that,
interpreted by the
execlineb
launcher, will be executed after accepting the connection, totally bypassing the
original command line. s6-accessrules-cdb-from-fs truncates the exec
file to 4096 bytes max when embedding it into cdbfile, so make
sure it is not larger than that.
Notes
- cdbfile can exist prior to, and during, the compilation,
which actually works in a temporary file in the same directory as
cdbfile and performs an atomic replacement when it is done.
So it is not necessary to interrupt a running service during the
compilation.
- If s6-accessrules-cdb-from-fs fails at some point, the temporary
file is removed. However, this doesn't happen if
s6-accessrules-cdb-from-fs is interrupted by a signal.
- After the program successfully completes, if dir
was a suitable candidate for the -i option of
s6-ipcserver-access or
s6-tcpserver-access, then
cdbfile will be a suitable candidate for the -x option
of the same program, implementing the same ruleset.
- cdbfile can be decompiled by the
s6-accessrules-fs-from-cdb
program.


Denis Shapovalov, Vasek Pospisil give Canada Davis Cup win over favoured Italy
MADRID - Denis Shapovalov and Vasek Pospisil kept rolling on Monday, notching a pair of upsets to lead Canada to a win over Italy on the opening day of the inaugural Davis Cup Finals.
Shapovalov, ranked 15th in the world, gave Canada an insurmountable 2-0 lead when he beat world No. 8 Matteo Berrettini 7-6 (5), 6-7 (3), 7-6 (5) in a match that lasted 2 hours 51 minutes.
Vancouver's Pospisil and Shapovalov, from Richmond Hill, Ont., were scheduled to team up in doubles to meet Berrettini and Fabio Fognini later Monday in the finale of the best-of-three tie.
Italy made a late change to use their top two players in doubles instead of Simone Bolelli and Lorenzo Sonego in a bid to record a valuable match win in the new Davis Cup format.
The winners of each of the six three-team groups and the next two best teams advance to quarterfinals.
Earlier Monday, Pospisil recorded the biggest upset of the day.
Pospisil, a late replacement for Felix Auger-Aliassime (recovering from an ankle injury), beat Italy's Fabio Fognini 7-6 (5), 7-5.
Ranked 150th in the world after missing half the season while recovering from back surgery, Pospisil was a big underdog against world No. 12 Fognini.
Shapovalov and Pospisil both came into the Davis Cup Finals with momentum.
Pospisil, whose ranking tumbled while missing the first half of the year following back surgery, won a pair of Challengers in the U.S., this fall. That came after the former world No. 25 made a run to the round of 16 at the Shanghai Masters and notched first-round upset of then-No. 9 Karen Khachanov of Russia at the U.S. Open.
Shapovalov, 20, captured his first career ATP Tour title at the Stockholm Open last month before reaching the final at the Paris Masters.
Shapovalov fought off three set points in the first set against Berrettini, a semifinalist at this year's U.S. Open.

It was Shapovalov's fourth career win against a top-10 opponent, with three coming this year.
Pospisil, 29, improved to 18-17 in Davis Cup play.
Tennis Canada says Auger-Aliassime could return later this week. The world No. 21 was in the stands for the matches on Monday.
Canada is without world No. 31 Milos Raonic (back).
It is the first year of the Davis Cup Finals, a week-long event in a neutral venue.
The old format had the competition run over several weekends during a full-year cycle. Previously, ties were best-of-five contests played at the home of one of the competing teams.
Canada, the United States and Italy are in Group F.
Canada faces the U.S., on Tuesday.
This report by The Canadian Press was first published Nov. 18, 2019.