The API documentation for functions and data structures should take great care to explain the ownership and lifetime semantics of pointers. Ownership determines whose responsibility it is to free the memory referenced by the pointer, and lifetime determines the point at which the memory becomes inaccessible (lest Undefined Behavior occur).
Compile Variables §
Compile variables are accessible by importing the "builtin"
package,
which the compiler makes available to every Zig source file. It contains
compile-time constants such as the current target, endianness, and release mode.
Example of what is imported with @import("builtin")
:
See also:
Root Source File §
TODO: explain how root source file finds other files
TODO: pub fn main
TODO: pub fn panic
TODO: if linking with libc you can use export fn main
TODO: order independent top level declarations
TODO: lazy analysis
TODO: using comptime { _ = @import() }
Zig Build System §
The Zig Build System provides a cross-platform, dependency-free way to declare the logic required to build a project. With this system, the logic to build a project is written in a build.zig file, using the Zig Build System API to declare and configure build artifacts and other tasks.
Some examples of tasks the build system can help with:
- Creating build artifacts by executing the Zig compiler. This includes building Zig source code as well as C and C++ source code.
- Capturing user-configured options and using those options to configure the build.
- Surfacing build configuration as comptime values by providing a file that can be imported by Zig code.
- Caching build artifacts to avoid unnecessarily repeating steps.
- Executing build artifacts or system-installed tools.
- Running tests and verifying the output of executing a build artifact matches the expected value.
- Running
zig fmt
on a codebase or a subset of it. - Custom tasks.
To use the build system, run zig build --help to see a command-line usage help menu. This will include project-specific options that were declared in the build.zig script.
Building an Executable §
This build.zig
file is automatically generated
by zig init-exe.
Building a Library §
This build.zig
file is automatically generated
by zig init-lib.
Compiling C Source Code §
lib.addCSourceFile("src/lib.c", &[_][]const u8{
"-Wall",
"-Wextra",
"-Werror",
});
C §
Although Zig is independent of C, and, unlike most other languages, does not depend on libc, Zig acknowledges the importance of interacting with existing C code.
There are a few ways that Zig facilitates C interop.
C Type Primitives §
These have guaranteed C ABI compatibility and can be used like any other type.
c_short
c_ushort
c_int
c_uint
c_long
c_ulong
c_longlong
c_ulonglong
c_longdouble
To interop with the C void
type, use anyopaque
.
See also:
Import from C Header File §
The @cImport
builtin function can be used
to directly import symbols from .h
files:
The @cImport
function takes an expression as a parameter.
This expression is evaluated at compile-time and is used to control
preprocessor directives and include multiple .h
files:
See also:
C Translation CLI §
Zig's C translation capability is available as a CLI tool via zig translate-c. It requires a single filename as an argument. It may also take a set of optional flags that are forwarded to clang. It writes the translated file to stdout.Command line flags §
- -I: Specify a search directory for include files. May be used multiple times. Equivalent to clang's -I flag. The current directory is not included by default; use -I. to include it.
- -D: Define a preprocessor macro. Equivalent to clang's -D flag.
- -cflags [flags] --: Pass arbitrary additional command line flags to clang. Note: the list of flags must end with --
- -target: The target triple for the translated Zig code. If no target is specified, the current host target will be used.
Using -target and -cflags §
Important! When translating C code with zig translate-c, you must use the same -target triple that you will use when compiling the translated code. In addition, you must ensure that the -cflags used, if any, match the cflags used by code on the target system. Using the incorrect -target or -cflags could result in clang or Zig parse failures, or subtle ABI incompatibilities when linking with C code.
@cImport vs translate-c §
@cImport
and zig translate-c use the same underlying
C translation functionality, so on a technical level they are equivalent. In practice,
@cImport
is useful as a way to quickly and easily access numeric constants, typedefs,
and record types without needing any extra setup. If you need to pass cflags
to clang, or if you would like to edit the translated code, it is recommended to use
zig translate-c and save the results to a file. Common reasons for editing
the generated code include: changing anytype
parameters in function-like macros to more
specific types; changing [*c]T
pointers to [*]T
or
*T
pointers for improved type safety; and
enabling or disabling runtime safety within specific functions.
See also:
- Targets
- C Type Primitives
- Pointers
- C Pointers
- Import from C Header File
- @cInclude
- @cImport
- @setRuntimeSafety
C Translation Caching §
The C translation feature (whether used via zig translate-c or
@cImport
) integrates with the Zig caching system. Subsequent runs with
the same source file, target, and cflags will use the cache instead of repeatedly translating
the same code.
To see where the cached files are stored when compiling code that uses @cImport
,
use the --verbose-cimport flag:
cimport.h
contains the file to translate (constructed from calls to
@cInclude
, @cDefine
, and @cUndef
),
cimport.h.d
is the list of file dependencies, and
cimport.zig
contains the translated output.
See also:
Translation failures §
Some C constructs cannot be translated to Zig - for example, goto, structs with bitfields, and token-pasting macros. Zig employs demotion to allow translation to continue in the face of non-translatable entities.
Demotion comes in three varieties - opaque, extern, and
@compileError
.
C structs and unions that cannot be translated correctly will be translated as opaque{}
.
Functions that contain opaque types or code constructs that cannot be translated will be demoted
to extern
declarations.
Thus, non-translatable types can still be used as pointers, and non-translatable functions
can be called so long as the linker is aware of the compiled function.
@compileError
is used when top-level definitions (global variables,
function prototypes, macros) cannot be translated or demoted. Since Zig uses lazy analysis for
top-level declarations, untranslatable entities will not cause a compile error in your code unless
you actually use them.
See also:
C Macros §
C Translation makes a best-effort attempt to translate function-like macros into equivalent
Zig functions. Since C macros operate at the level of lexical tokens, not all C macros
can be translated to Zig. Macros that cannot be translated will be be demoted to
@compileError
. Note that C code which uses macros will be
translated without any additional issues (since Zig operates on the pre-processed source
with macros expanded). It is merely the macros themselves which may not be translatable to
Zig.
Consider the following example:
Note that foo
was translated correctly despite using a non-translatable
macro. MAKELOCAL
was demoted to @compileError
since
it cannot be expressed as a Zig function; this simply means that you cannot directly use
MAKELOCAL
from Zig.
See also:
C Pointers §
This type is to be avoided whenever possible. The only valid reason for using a C pointer is in auto-generated code from translating C code.
When importing C header files, it is ambiguous whether pointers should be translated as
single-item pointers (*T
) or many-item pointers ([*]T
).
C pointers are a compromise so that Zig code can utilize translated header files directly.
[*c]T
- C pointer.
- Supports all the syntax of the other two pointer types.
- Coerces to other pointer types, as well as Optional Pointers. When a C pointer is coerced to a non-optional pointer, safety-checked Undefined Behavior occurs if the address is 0.
- Allows address 0. On non-freestanding targets, dereferencing address 0 is safety-checked
Undefined Behavior. Optional C pointers introduce another bit to keep track of
null, just like
?usize
. Note that creating an optional C pointer is unnecessary as one can use normal Optional Pointers. - Supports Type Coercion to and from integers.
- Supports comparison with integers.
- Does not support Zig-only pointer attributes such as alignment. Use normal Pointers please!
When a C pointer is pointing to a single struct (not an array), dereference the C pointer to access to the struct's fields or member data. That syntax looks like this:
ptr_to_struct.*.struct_member
This is comparable to doing ->
in C.
When a C pointer is pointing to an array of structs, the syntax reverts to this:
ptr_to_struct_array[index].struct_member
Exporting a C Library §
One of the primary use cases for Zig is exporting a library with the C ABI for other programming languages
to call into. The export
keyword in front of functions, variables, and types causes them to
be part of the library API:
To make a static library:
To make a shared library:
Here is an example with the Zig Build System:
See also:
Mixing Object Files §
You can mix Zig object files with any other object files that respect the C ABI. Example:
See also:
WebAssembly §
Zig supports building for WebAssembly out of the box.
Freestanding §
For host environments like the web browser and nodejs, build as a dynamic library using the freestanding OS target. Here's an example of running Zig code compiled to WebAssembly with nodejs.
WASI §
Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and reading command line arguments:
A more interesting example would be extracting the list of preopens from the runtime.
This is now supported in the standard library via std.fs.wasi.PreopenList
:
Targets §
Zig supports generating code for all targets that LLVM supports. Here is
what it looks like to execute zig targets
on a Linux x86_64
computer:
The Zig Standard Library (@import("std")
) has architecture, environment, and operating system
abstractions, and thus takes additional work to support more platforms.
Not all standard library code requires operating system abstractions, however,
so things such as generic data structures work on all above platforms.
The current list of targets supported by the Zig Standard Library is:
- Linux x86_64
- Windows x86_64
- macOS x86_64
Style Guide §
These coding conventions are not enforced by the compiler, but they are shipped in this documentation along with the compiler in order to provide a point of reference, should anyone wish to point to an authority on agreed upon Zig coding style.
Whitespace §
- 4 space indentation
- Open braces on same line, unless you need to wrap.
- If a list of things is longer than 2, put each item on its own line and exercise the ability to put an extra comma at the end.
- Line length: aim for 100; use common sense.
Names §
Roughly speaking: camelCaseFunctionName
, TitleCaseTypeName
,
snake_case_variable_name
. More precisely:
-
If
x
is atype
thenx
should beTitleCase
, unless it is astruct
with 0 fields and is never meant to be instantiated, in which case it is considered to be a "namespace" and usessnake_case
. -
If
x
is callable, andx
's return type istype
, thenx
should beTitleCase
. -
If
x
is otherwise callable, thenx
should becamelCase
. -
Otherwise,
x
should besnake_case
.
Acronyms, initialisms, proper nouns, or any other word that has capitalization rules in written English are subject to naming conventions just like any other word. Even acronyms that are only 2 letters long are subject to these conventions.
File names fall into two categories: types and namespaces. If the file
(implicitly a struct) has top level fields, it should be named like any
other struct with fields using TitleCase
. Otherwise,
it should use snake_case
. Directory names should be
snake_case
.
These are general rules of thumb; if it makes sense to do something different,
do what makes sense. For example, if there is an established convention such as
ENOENT
, follow the established convention.
Examples §
See the Zig Standard Library for more examples.
Doc Comment Guidance §
- Omit any information that is redundant based on the name of the thing being documented.
- Duplicating information onto multiple similar functions is encouraged because it helps IDEs and other tools provide better help text.
- Use the word assume to indicate invariants that cause Undefined Behavior when violated.
- Use the word assert to indicate invariants that cause safety-checked Undefined Behavior when violated.
Source Encoding §
Zig source code is encoded in UTF-8. An invalid UTF-8 byte sequence results in a compile error.
Throughout all zig source code (including in comments), some code points are never allowed:
- Ascii control characters, except for U+000a (LF), U+000d (CR), and U+0009 (HT): U+0000 - U+0008, U+000b - U+000c, U+000e - U+0001f, U+007f.
- Non-Ascii Unicode line endings: U+0085 (NEL), U+2028 (LS), U+2029 (PS).
LF (byte value 0x0a, code point U+000a, '\n'
) is the line terminator in Zig source code.
This byte value terminates every line of zig source code except the last line of the file.
It is recommended that non-empty source files end with an empty line, which means the last byte would be 0x0a (LF).
Each LF may be immediately preceded by a single CR (byte value 0x0d, code point U+000d, '\r'
)
to form a Windows style line ending, but this is discouraged.
A CR in any other context is not allowed.
HT hard tabs (byte value 0x09, code point U+0009, '\t'
) are interchangeable with
SP spaces (byte value 0x20, code point U+0020, ' '
) as a token separator,
but use of hard tabs is discouraged. See Grammar.
Note that running zig fmt on a source file will implement all recommendations mentioned here. Note also that the stage1 compiler does not yet support CR or HT control characters.
Note that a tool reading Zig source code can make assumptions if the source code is assumed to be correct Zig code.
For example, when identifying the ends of lines, a tool can use a naive search such as /\n/
,
or an advanced
search such as /\r\n?|[\n\u0085\u2028\u2029]/
, and in either case line endings will be correctly identified.
For another example, when identifying the whitespace before the first token on a line,
a tool can either use a naive search such as /[ \t]/
,
or an advanced search such as /\s/
,
and in either case whitespace will be correctly identified.
Keyword Reference §
| Keyword | Description |
|---|---|
|
align can be used to specify the alignment of a pointer.
It can also be used after a variable or function declaration to specify the alignment of pointers to that variable or function.
|
|
The pointer attribute allowzero allows a pointer to have address zero.
|
|
The boolean operator and .
|
|
anyframe can be used as a type for variables which hold pointers to function frames.
|
|
Function parameters and struct fields can be declared with anytype in place of the type.
The type will be inferred where the function is called or the struct is instantiated.
|
|
asm begins an inline assembly expression. This allows for directly controlling the machine code generated on compilation.
|
|
async can be used before a function call to get a pointer to the function's frame when it suspends.
|
|
await can be used to suspend the current function until the frame provided after the await completes.
await copies the value returned from the target function's frame to the caller.
|
|
break can be used with a block label to return a value from the block.
It can also be used to exit a loop before iteration completes naturally.
|
|
catch can be used to evaluate an expression if the expression before it evaluates to an error.
The expression after the catch can optionally capture the error value.
|
|
comptime before a declaration can be used to label variables or function parameters as known at compile time.
It can also be used to guarantee an expression is run at compile time.
|
|
const declares a variable that can not be modified.
Used as a pointer attribute, it denotes the value referenced by the pointer cannot be modified.
|
|
continue can be used in a loop to jump back to the beginning of the loop.
|
|
defer will execute an expression when control flow leaves the current block.
|
|
else can be used to provide an alternate branch for if , switch ,
while , and for expressions.
|
|
enum defines an enum type.
|
|
errdefer will execute an expression when control flow leaves the current block if the function returns an error.
|
|
error defines an error type.
|
|
export makes a function or variable externally visible in the generated object file.
Exported functions default to the C calling convention.
|
|
extern can be used to declare a function or variable that will be resolved at link time, when linking statically
or at runtime, when linking dynamically.
|
|
The boolean value false .
|
|
fn declares a function.
|
|
A for expression can be used to iterate over the elements of a slice, array, or tuple.
|
|
An if expression can test boolean expressions, optional values, or error unions.
For optional values or error unions, the if expression can capture the unwrapped value.
|
|
inline can be used to label a loop expression such that it will be unrolled at compile time.
It can also be used to force a function to be inlined at all call sites.
|
|
The noalias keyword.
|
|
The nosuspend keyword can be used in front of a block, statement or expression, to mark a scope where no suspension points are reached.
In particular, inside a nosuspend scope:
nosuspend scope does not cause the enclosing function to become an async function.
|
|
The optional value null .
|
|
The boolean operator or .
|
|
orelse can be used to evaluate an expression if the expression before it evaluates to null.
|
|
The packed keyword before a struct definition changes the struct's in-memory layout
to the guaranteed packed layout.
|
|
The pub in front of a top level declaration makes the declaration available
to reference from a different file than the one it is declared in.
|
|
resume will continue execution of a function frame after the point the function was suspended.
|
|
return exits a function with a value.
|
|
The linksection keyword.
|
|
struct defines a struct.
|
|
suspend will cause control flow to return to the call site or resumer of the function.
suspend can also be used before a block within a function,
to allow the function access to its frame before control flow returns to the call site.
|
|
A switch expression can be used to test values of a common type.
switch cases can capture field values of a Tagged union.
|
|
The test keyword can be used to denote a top-level block of code
used to make sure behavior meets expectations.
|
|
threadlocal can be used to specify a variable as thread-local.
|
|
The boolean value true .
|
|
try evaluates an error union expression.
If it is an error, it returns from the current function with the same error.
Otherwise, the expression results in the unwrapped value.
|
|
undefined can be used to leave a value uninitialized.
|
|
union defines a union.
|
|
unreachable can be used to assert that control flow will never happen upon a particular location.
Depending on the build mode, unreachable may emit a panic.
|
|
usingnamespace is a top-level declaration that imports all the public declarations of the operand,
which must be a struct, union, or enum, into the current scope.
|
|
var declares a variable that may be modified.
|
|
volatile can be used to denote loads or stores of a pointer have side effects.
It can also modify an inline assembly expression to denote it has side effects.
|
|
A while expression can be used to repeatedly test a boolean, optional, or error union expression,
and cease looping when that expression evaluates to false, null, or an error, respectively.
|
Grammar §
Zen §
- Communicate intent precisely.
- Edge cases matter.
- Favor reading code over writing code.
- Only one obvious way to do things.
- Runtime crashes are better than bugs.
- Compile errors are better than runtime crashes.
- Incremental improvements.
- Avoid local maximums.
- Reduce the amount one must remember.
- Focus on code rather than style.
- Resource allocation may fail; resource deallocation must succeed.
- Memory is a resource.
- Together we serve the users.


#include <string_ops.h>
Converts each string in the input Tensor to its hash mod by a number of buckets.
The hash function is deterministic on the content of the string within the process. The hash function is a keyed hash function, where attribute key
defines the key of the hash function. key
is an array of 2 elements.
A strong hash is important when inputs may be malicious, e.g. URLs with additional components. Adversaries could try to make their inputs hash to the same bucket for a denial-of-service attack or to skew the results. A strong hash prevents this by making it difficult, if not infeasible, to compute inputs that hash to the same bucket. This comes at a cost of roughly 4x higher compute time than tf.string_to_hash_bucket_fast
.
Arguments:
Returns:
Constructors and Destructors |
|
|---|---|
StringToHashBucketStrong(const ::tensorflow::Scope & scope, ::tensorflow::Input input, int64 num_buckets, const gtl::ArraySlice< int > & key)
|
Public attributes |
|
|---|---|
operation
|
|
output
|
Public functions |
|
|---|---|
node() const
|
::tensorflow::Node *
|
operator::tensorflow::Input() const
|
|
operator::tensorflow::Output() const
|
|
Operation operation
::tensorflow::Output output
StringToHashBucketStrong( const ::tensorflow::Scope & scope, ::tensorflow::Input input, int64 num_buckets, const gtl::ArraySlice< int > & key )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const


--- layout: post status: publish published: true title: Retrieving a phone contacts from Motorola V195 author: display_name: ian login: ian email<EMAIL_ADDRESS>url: http://iancwill.com/blog author_login: ian author_email<EMAIL_ADDRESS>author_url: http://iancwill.com/blog wordpress_id: 75 wordpress_url: http://iancwill.com/blog/?p=75 date: '2011-12-16 10:22:53 -0700' date_gmt: '2011-12-16 15:22:53 -0700' ---
I'm switching carriers, and my old phone was a motorola V195. I want to get my phone contacts off, but there seems to be no good way to do it with my macs at home and free software. I refuse to buy something for a one-time chore of moving contacts between phones. The Wammu/Gammu software might work on linux, but it didn't compile on a first attempt on my mac.
Enter AT commands, which I learned about in my embedded programming class last semester. It was remarkably easy to get in to the v195!
Step 1: Set up a bluetooth connection to the phone.
Edit the serial ports, set up an RS-232 link. I'm not sure what the service field does, but leaving it as a network gateway worked. Change the name to something short and easy to type.
Step 2: Run mini com
Now you can connect to the serial port using minicom, start it with the -s flag to change configuration before trying to connect.
minicom -s
Use baud 9600 with 8N1 and change the name of the serial device to /dev/tty.
Step 3: Go to town!
Test the connection by typing AT, you should see an OK back.
AT
OK
AT+CGMI
+CGMI: "Motorola CE, Copyright 2000"
OK
AT+CGMM
+CGMM: "GSM900","GSM1800","GSM1900","GSM850","MODEL=V195"
OK
There's a good description of motorola AT commands here (pdf). For my purposes the AT+CPBR=# command is what I was looking for.
OK
AT+CPBR=1
+CPBR: 1,"###########",129,"Mom"
The number defines which entry in the phone book you need. Now I just need to write a program that pulls all these down automatically.


Evaluation
- Controlled Experiments
- Natural settings
- Any setting not involving users
Expert reviews
- Design Experts
- Visualization Experts
- Usability Experts
- Domain Experts
Types of expert reviews
- Heuristic evaluation (golden rules)
- Guidelines review
- Consistency inspection
- Cognitive walkthrough
- Metaphors of human thinking
- Formal usability inspection (courtroom style)
- Accesibility inspection
8 golden rules of design
- Strive for consistency
- Cater for universal usability
- Offer informative feedback
- Design dialogs to yield closure
- Prevent errors
- Permit easy reversal of actions
- Support internal locus of control
- Reduce short-term memory load
Controlled Experiments
- Experiments in the lab
- Controlled confounding variables
- Measure one or more quantitative variables
-
- Usability testing
- Living labs
What to measure?
- Time to learn
- Speed of performance
- Rate of errors
- Retention over time
- Subject satisfaction
Usability Testing
Natural settings involving users
- Observation
- Interviews
- Logging
Triangulation
Different researchers observe the same effect
Interviews
- Unstructured
- Structured
- Semi-structured
- Focus group
- Telephone/Online interviews
Questionnaire
Like interviews but without the researcher present
Likert Scale
What do you think?
- Strongly disagree
- disagree
- ok
- agree
- Strongly agree
More about likert scales
- Can be 3, 5, 7 or more responses
- Continuos or Discrete
- Middle response is the balance
Observation
- User's setting
- Can be direct or indirect
Direct Observation in the field
Ethnography
Direct Observation in controlled environments
Direct Observation: tracking users
- Diaries
- Interaction Logs and web analytics
MILCS
- Multi-dimensional
- In-depth
- Long-term
- Case studies
Focus groups
One researcher, many attendees
Prototyping
- Low vs high fidelity?
- Read data
- Build scenarios, tell a story
References
- Shneiderman, B. and Plaisant, C., 1987. Designing the user interface: Strategies for effective human-computer interaction
- Rogers, Y., Sharp, H., Preece, J. and Tepper, M., 2007. Interaction design: beyond human-computer interaction.
- Martin, D.W., 2007. Doing psychology experiments. Cengage Learning.


Some More Advanced Mathematics#
Algebraic Geometry#
You can define arbitrary algebraic varieties in Sage, but sometimes nontrivial functionality is limited to rings over \(\QQ\) or finite fields. For example, we compute the union of two affine plane curves, then recover the curves as the irreducible components of the union.
sage: x, y = AffineSpace(2, QQ, 'xy').gens()
sage: C2 = Curve(x^2 + y^2 - 1)
sage: C3 = Curve(x^3 + y^3 - 1)
sage: D = C2 + C3
sage: D
Affine Plane Curve over Rational Field defined by
x^5 + x^3*y^2 + x^2*y^3 + y^5 - x^3 - y^3 - x^2 - y^2 + 1
sage: D.irreducible_components()
[
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 + y^2 - 1,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^3 + y^3 - 1
]
We can also find all points of intersection of the two curves by intersecting them and computing the irreducible components.
sage: V = C2.intersection(C3)
sage: V.irreducible_components()
[
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
y,
x - 1,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
y - 1,
x,
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x + y + 2,
2*y^2 + 4*y + 3
]
Thus, e.g., \((1,0)\) and \((0,1)\) are on both curves (visibly clear), as are certain (quadratic) points whose \(y\) coordinates satisfy \(2y^2 + 4y + 3=0\).
Sage can compute the toric ideal of the twisted cubic in projective 3 space:
sage: R.<a,b,c,d> = PolynomialRing(QQ, 4)
sage: I = ideal(b^2-a*c, c^2-b*d, a*d-b*c)
sage: F = I.groebner_fan(); F
Groebner fan of the ideal:
Ideal (b^2 - a*c, c^2 - b*d, -b*c + a*d) of Multivariate Polynomial Ring
in a, b, c, d over Rational Field
sage: F.reduced_groebner_bases ()
[[-c^2 + b*d, -b*c + a*d, -b^2 + a*c],
[-b*c + a*d, -c^2 + b*d, b^2 - a*c],
[-c^3 + a*d^2, -c^2 + b*d, b*c - a*d, b^2 - a*c],
[-c^2 + b*d, b^2 - a*c, b*c - a*d, c^3 - a*d^2],
[-b*c + a*d, -b^2 + a*c, c^2 - b*d],
[-b^3 + a^2*d, -b^2 + a*c, c^2 - b*d, b*c - a*d],
[-b^2 + a*c, c^2 - b*d, b*c - a*d, b^3 - a^2*d],
[c^2 - b*d, b*c - a*d, b^2 - a*c]]
sage: F.polyhedralfan()
Polyhedral fan in 4 dimensions of dimension 4
Elliptic Curves#
Elliptic curve functionality includes most of the elliptic curve functionality of PARI, access to the data in Cremona’s online tables (this requires an optional database package), the functionality of mwrank, i.e., 2-descents with computation of the full Mordell-Weil group, the SEA algorithm, computation of all isogenies, much new code for curves over \(\QQ\), and some of Denis Simon’s algebraic descent software.
The command EllipticCurve
for creating an elliptic curve has many
forms:
EllipticCurve([\(a_1\), \(a_2\), \(a_3\), \(a_4\), \(a_6\)]): Returns the elliptic curve
\[y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6,\]where the \(a_i\)’s are coerced into the parent of \(a_1\). If all the \(a_i\) have parent \(\ZZ\), they are coerced into \(\QQ\).
EllipticCurve([\(a_4\), \(a_6\)]): Same as above, but \(a_1=a_2=a_3=0\).
EllipticCurve(label): Returns the elliptic curve over from the Cremona database with the given (new!) Cremona label. The label is a string, such as
"11a"
or"37b2"
. The letter must be lower case (to distinguish it from the old labeling).EllipticCurve(j): Returns an elliptic curve with \(j\)-invariant \(j\).
EllipticCurve(R, [\(a_1\), \(a_2\), \(a_3\), \(a_4\), \(a_6\)]): Create the elliptic curve over a ring \(R\) with given \(a_i\)’s as above.
We illustrate each of these constructors:
sage: EllipticCurve([0,0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
sage: EllipticCurve([GF(5)(0),0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5
sage: EllipticCurve([1,2])
Elliptic Curve defined by y^2 = x^3 + x + 2 over Rational Field
sage: EllipticCurve('37a')
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
sage: EllipticCurve_from_j(1)
Elliptic Curve defined by y^2 + x*y = x^3 + 36*x + 3455 over Rational Field
sage: EllipticCurve(GF(5), [0,0,1,-1,0])
Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite Field of size 5
The pair \((0,0)\) is a point on the elliptic curve
\(E\) defined by \(y^2 +
y = x^3 - x\). To create this
point in Sage type E([0,0])
. Sage can add points on such an
elliptic curve (recall elliptic curves support an additive group
structure where the point at infinity is the zero element and three
co-linear points on the curve add to zero):
sage: E = EllipticCurve([0,0,1,-1,0])
sage: E
Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
sage: P = E([0,0])
sage: P + P
(1 : 0 : 1)
sage: 10*P
(161/16 : -2065/64 : 1)
sage: 20*P
(683916417/264517696 : -18784454671297/4302115807744 : 1)
sage: E.conductor()
37
The elliptic curves over the complex numbers are parameterized by the \(j\)-invariant. Sage computes \(j\)-invariant as follows:
sage: E = EllipticCurve([0,0,0,-4,2]); E
Elliptic Curve defined by y^2 = x^3 - 4*x + 2 over Rational Field
sage: E.conductor()
2368
sage: E.j_invariant()
110592/37
If we make a curve with the same \(j\)-invariant as that of \(E\), it need not be isomorphic to \(E\). In the following example, the curves are not isomorphic because their conductors are different.
sage: F = EllipticCurve_from_j(110592/37)
sage: F.conductor()
37
However, the twist of \(F\) by 2 gives an isomorphic curve.
sage: G = F.quadratic_twist(2); G
Elliptic Curve defined by y^2 = x^3 - 4*x + 2 over Rational Field
sage: G.conductor()
2368
sage: G.j_invariant()
110592/37
We can compute the coefficients \(a_n\) of the \(L\)-series or modular form \(\sum_{n=0}^\infty a_nq^n\) attached to the elliptic curve. This computation uses the PARI C-library:
sage: E = EllipticCurve([0,0,1,-1,0])
sage: E.anlist(30)
[0, 1, -2, -3, 2, -2, 6, -1, 0, 6, 4, -5, -6, -2, 2, 6, -4, 0, -12, 0, -4,
3, 10, 2, 0, -1, 4, -9, -2, 6, -12]
sage: v = E.anlist(10000)
It only takes a second to compute all \(a_n\) for \(n\leq 10^5\):
sage: %time v = E.anlist(100000)
CPU times: user 0.98 s, sys: 0.06 s, total: 1.04 s
Wall time: 1.06
Elliptic curves can be constructed using their Cremona labels. This pre-loads the elliptic curve with information about its rank, Tamagawa numbers, regulator, etc.
sage: E = EllipticCurve("37b2")
sage: E
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 1873*x - 31833 over Rational
Field
sage: E = EllipticCurve("389a")
sage: E
Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
sage: E.rank()
2
sage: E = EllipticCurve("5077a")
sage: E.rank()
3
We can also access the Cremona database directly.
sage: db = sage.databases.cremona.CremonaDatabase()
sage: db.curves(37)
{'a1': [[0, 0, 1, -1, 0], 1, 1], 'b1': [[0, 1, 1, -23, -50], 0, 3]}
sage: db.allcurves(37)
{'a1': [[0, 0, 1, -1, 0], 1, 1],
'b1': [[0, 1, 1, -23, -50], 0, 3],
'b2': [[0, 1, 1, -1873, -31833], 0, 1],
'b3': [[0, 1, 1, -3, 1], 0, 3]}
The objects returned from the database are not of type
EllipticCurve
. They are elements of a database and have a couple
of fields, and that’s it. There is a small version of Cremona’s
database, which is distributed by default with Sage, and contains
limited information about elliptic curves of conductor
\(\leq 10000\). There is also a large optional version, which
contains extensive data about all curves of conductor up to
\(120000\) (as of October 2005). There is also a huge (2GB)
optional database package for Sage that contains the hundreds of
millions of elliptic curves in the Stein-Watkins database.
Dirichlet Characters#
A Dirichlet character is the extension of a homomorphism \((\ZZ/N\ZZ)^* \to R^*\), for some ring \(R\), to the map \(\ZZ \to R\) obtained by sending those integers \(x\) with \(\gcd(N,x)>1\) to 0.
sage: G = DirichletGroup(12)
sage: G.list()
[Dirichlet character modulo 12 of conductor 1 mapping 7 |--> 1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 3 mapping 7 |--> 1, 5 |--> -1,
Dirichlet character modulo 12 of conductor 12 mapping 7 |--> -1, 5 |--> -1]
sage: G.gens()
(Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1,
Dirichlet character modulo 12 of conductor 3 mapping 7 |--> 1, 5 |--> -1)
sage: len(G)
4
Having created the group, we next create an element and compute with it.
sage: G = DirichletGroup(21)
sage: chi = G.1; chi
Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6
sage: chi.values()
[0, 1, zeta6 - 1, 0, -zeta6, -zeta6 + 1, 0, 0, 1, 0, zeta6, -zeta6, 0, -1,
0, 0, zeta6 - 1, zeta6, 0, -zeta6 + 1, -1]
sage: chi.conductor()
7
sage: chi.modulus()
21
sage: chi.order()
6
sage: chi(19)
-zeta6 + 1
sage: chi(40)
-zeta6 + 1
It is also possible to compute the action of the Galois group \(\text{Gal}(\QQ(\zeta_N)/\QQ)\) on these characters, as well as the direct product decomposition corresponding to the factorization of the modulus.
sage: chi.galois_orbit()
[Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> -zeta6 + 1,
Dirichlet character modulo 21 of conductor 7 mapping 8 |--> 1, 10 |--> zeta6]
sage: go = G.galois_orbits()
sage: [len(orbit) for orbit in go]
[1, 2, 2, 1, 1, 2, 2, 1]
sage: G.decomposition()
[
Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2,
Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2
]
Next, we construct the group of Dirichlet characters mod 20, but with values in \(\QQ(i)\):
sage: K.<i> = NumberField(x^2+1)
sage: G = DirichletGroup(20,K)
sage: G
Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1
We next compute several invariants of G
:
sage: G.gens()
(Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1,
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i)
sage: G.unit_gens()
(11, 17)
sage: G.zeta()
i
sage: G.zeta_order()
4
In this example we create a Dirichlet character with values in a
number field. We explicitly specify the choice of root of unity by
the third argument to DirichletGroup
below.
sage: x = polygen(QQ, 'x')
sage: K = NumberField(x^4 + 1, 'a'); a = K.0
sage: b = K.gen(); a == b
True
sage: K
Number Field in a with defining polynomial x^4 + 1
sage: G = DirichletGroup(5, K, a); G
Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1
sage: chi = G.0; chi
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2
sage: [(chi^i)(2) for i in range(4)]
[1, a^2, -1, -a^2]
Here NumberField(x^4 + 1, 'a')
tells Sage to use the symbol “a” in
printing what K
is (a Number Field in a with defining polynomial
\(x^4 + 1\)). The name “a” is undeclared at this point. Once
a = K.0
(or equivalently a = K.gen()
) is evaluated, the symbol
“a” represents a root of the generating polynomial
\(x^4+1\).
Modular Forms#
Sage can do some computations related to modular forms, including dimensions, computing spaces of modular symbols, Hecke operators, and decompositions.
There are several functions available for computing dimensions of spaces of modular forms. For example,
sage: from sage.modular.dims import dimension_cusp_forms
sage: dimension_cusp_forms(Gamma0(11),2)
1
sage: dimension_cusp_forms(Gamma0(1),12)
1
sage: dimension_cusp_forms(Gamma1(389),2)
6112
Next we illustrate computation of Hecke operators on a space of modular symbols of level \(1\) and weight \(12\).
sage: M = ModularSymbols(1,12)
sage: M.basis()
([X^8*Y^2,(0,0)], [X^9*Y,(0,0)], [X^10,(0,0)])
sage: t2 = M.T(2)
sage: t2
Hecke operator T_2 on Modular Symbols space of dimension 3 for Gamma_0(1)
of weight 12 with sign 0 over Rational Field
sage: t2.matrix()
[ -24 0 0]
[ 0 -24 0]
[4860 0 2049]
sage: f = t2.charpoly('x'); f
x^3 - 2001*x^2 - 97776*x - 1180224
sage: factor(f)
(x - 2049) * (x + 24)^2
sage: M.T(11).charpoly('x').factor()
(x -<PHONE_NUMBER>12) * (x - 534612)^2
We can also create spaces for \(\Gamma_0(N)\) and \(\Gamma_1(N)\).
sage: ModularSymbols(11,2)
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign
0 over Rational Field
sage: ModularSymbols(Gamma1(11),2)
Modular Symbols space of dimension 11 for Gamma_1(11) of weight 2 with
sign 0 over Rational Field
Let’s compute some characteristic polynomials and \(q\)-expansions.
sage: M = ModularSymbols(Gamma1(11),2)
sage: M.T(2).charpoly('x')
x^11 - 8*x^10 + 20*x^9 + 10*x^8 - 145*x^7 + 229*x^6 + 58*x^5 - 360*x^4
+ 70*x^3 - 515*x^2 + 1804*x - 1452
sage: M.T(2).charpoly('x').factor()
(x - 3) * (x + 2)^2 * (x^4 - 7*x^3 + 19*x^2 - 23*x + 11)
* (x^4 - 2*x^3 + 4*x^2 + 2*x + 11)
sage: S = M.cuspidal_submodule()
sage: S.T(2).matrix()
[-2 0]
[ 0 -2]
sage: S.q_expansion_basis(10)
[
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 - 2*q^9 + O(q^10)
]
We can even compute spaces of modular symbols with character.
sage: G = DirichletGroup(13)
sage: e = G.0^2
sage: M = ModularSymbols(e,2); M
Modular Symbols space of dimension 4 and level 13, weight 2, character
[zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2
sage: M.T(2).charpoly('x').factor()
(x - zeta6 - 2) * (x - 2*zeta6 - 1) * (x + zeta6 + 1)^2
sage: S = M.cuspidal_submodule(); S
Modular Symbols subspace of dimension 2 of Modular Symbols space of
dimension 4 and level 13, weight 2, character [zeta6], sign 0, over
Cyclotomic Field of order 6 and degree 2
sage: S.T(2).charpoly('x').factor()
(x + zeta6 + 1)^2
sage: S.q_expansion_basis(10)
[
q + (-zeta6 - 1)*q^2 + (2*zeta6 - 2)*q^3 + zeta6*q^4 + (-2*zeta6 + 1)*q^5
+ (-2*zeta6 + 4)*q^6 + (2*zeta6 - 1)*q^8 - zeta6*q^9 + O(q^10)
]
Here is another example of how Sage can compute the action of Hecke operators on a space of modular forms.
sage: T = ModularForms(Gamma0(11),2)
sage: T
Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of
weight 2 over Rational Field
sage: T.degree()
2
sage: T.level()
11
sage: T.group()
Congruence Subgroup Gamma0(11)
sage: T.dimension()
2
sage: T.cuspidal_subspace()
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for
Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
sage: T.eisenstein_subspace()
Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2
for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
sage: M = ModularSymbols(11); M
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign
0 over Rational Field
sage: M.weight()
2
sage: M.basis()
((1,0), (1,8), (1,9))
sage: M.sign()
0
Let \(T_p\) denote the usual Hecke operators (\(p\) prime). How do the Hecke operators \(T_2\), \(T_3\), \(T_5\) act on the space of modular symbols?
sage: M.T(2).matrix()
[ 3 0 -1]
[ 0 -2 0]
[ 0 0 -2]
sage: M.T(3).matrix()
[ 4 0 -1]
[ 0 -1 0]
[ 0 0 -1]
sage: M.T(5).matrix()
[ 6 0 -1]
[ 0 1 0]
[ 0 0 1]


One important tool that supports us when working with statements with quantifiers is the use of Venn Diagrams and set representations. Sets help us have a more clear perspective in forming negations and understanding the truth value of statements. Let’s start with the simple statements that use quantities, and then build to a more complicated statement like the one from the previous section, "If abortions are not a federally protected right, then no one will get an abortion."
in-context


A small DSS service was implemented for the purpose of predicting the risk using three disease risk prediction models.
The code provided is an example of a daily model run and will not be fully operational, due to protection of providers of data (Met Eirean) and one of risk prediction models (Blight Management (DK)).
list.of.packages <-
c(
"tidyverse",
"data.table",
"ggplot2",
"knitr",
"readxl",
"agricolae",
"egg",
"hrbrthemes",
"glmmTMB",
"sjPlot",
"effects",
"lsmeans",
"multcomp",
"car"
)
new.packages <-
list.of.packages[!(list.of.packages %in% installed.packages()[, "Package"])]
#Download packages that are not already present in the library
if (length(new.packages))
install.packages(new.packages)
packages_load <-
lapply(list.of.packages, require, character.only = TRUE)
#Print warning if there is a problem with installing/loading some of packages
if (any(as.numeric(packages_load) == 0)) {
warning(paste("Package/s: ", paste(list.of.packages[packages_load != TRUE], sep = ", "), "not loaded!"))
} else {
print("All packages were successfully loaded.")
}
## [1] "All packages were successfully loaded."
rm(list.of.packages, new.packages, packages_load)
#if instal is not working try
#install.packages("ROCR", repos = c(CRAN="https://cran.r-project.org/"))
sessionInfo()
## R version 3.6.1 (2019-07-05)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18362)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=English_United States.1252
## [2] LC_CTYPE=English_United States.1252
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.1252
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] car_3.0-3 multcomp_1.4-10 TH.data_1.0-10
## [4] MASS_7.3-51.4 survival_2.44-1.1 mvtnorm_1.0-11
## [7] lsmeans_2.30-0 emmeans_1.3.5 effects_4.1-1
## [10] carData_3.0-2 sjPlot_2.6.3 glmmTMB_0.2.3
## [13] hrbrthemes_0.6.0 egg_0.4.2 gridExtra_2.3
## [16] agricolae_1.3-1 readxl_1.3.1 knitr_1.23
## [19] data.table_1.12.2 forcats_0.4.0 stringr_1.4.0
## [22] dplyr_0.8.1 purrr_0.3.2 readr_1.3.1
## [25] tidyr_0.8.3 tibble_2.1.3 ggplot2_3.2.0
## [28] tidyverse_1.2.1
##
## loaded via a namespace (and not attached):
## [1] minqa_1.2.4 colorspace_1.4-1 deldir_0.1-21
## [4] rio_0.5.16 class_7.3-15 sjlabelled_1.1.0
## [7] estimability_1.3 rstudioapi_0.10 lubridate_1.7.4
## [10] xml2_1.2.0 codetools_0.2-16 splines_3.6.1
## [13] extrafont_0.17 mnormt_1.5-5 sjmisc_2.8.1
## [16] jsonlite_1.6 nloptr_1.2.1 ggeffects_0.10.0
## [19] broom_0.5.2 Rttf2pt1_1.3.7 cluster_2.1.0
## [22] shiny_1.3.2 compiler_3.6.1 httr_1.4.0
## [25] sjstats_0.17.5 backports_1.1.4 assertthat_0.2.1
## [28] Matrix_1.2-17 lazyeval_0.2.2 survey_3.36
## [31] cli_1.1.0 later_0.8.0 htmltools_0.3.6
## [34] tools_3.6.1 coda_0.19-2 gtable_0.3.0
## [37] glue_1.3.1 gmodels_2.18.1 Rcpp_1.0.2
## [40] cellranger_1.1.0 spdep_1.1-2 gdata_2.18.0
## [43] nlme_3.1-140 extrafontdb_1.0 psych_1.8.12
## [46] insight_0.3.0 xfun_0.7 openxlsx_<IP_ADDRESS>
## [49] lme4_1.1-21 rvest_0.3.4 mime_0.7
## [52] miniUI_<IP_ADDRESS> gtools_3.8.1 zoo_1.8-6
## [55] LearnBayes_2.15.1 scales_1.0.0 hms_0.4.2
## [58] promises_1.0.1 sandwich_2.5-1 parallel_3.6.1
## [61] expm_0.999-4 TMB_1.7.15 curl_3.3
## [64] yaml_2.2.0 gdtools_0.1.9 stringi_1.4.3
## [67] highr_0.8 bayestestR_0.2.2 klaR_0.6-14
## [70] AlgDesign_1.1-7.3 e1071_1.7-2 zip_2.0.2
## [73] boot_1.3-22 spData_0.3.0 rlang_0.4.0
## [76] pkgconfig_2.0.2 evaluate_0.14 lattice_0.20-38
## [79] sf_0.7-4 tidyselect_0.2.5 magrittr_1.5
## [82] R6_2.4.0 generics_0.0.2 combinat_0.0-8
## [85] DBI_1.0.0 pillar_1.4.1 haven_2.1.0
## [88] foreign_0.8-71 withr_2.1.2 units_0.6-3
## [91] abind_1.4-5 nnet_7.3-12 sp_1.3-1
## [94] performance_0.2.0 modelr_0.1.4 crayon_1.3.4
## [97] questionr_0.7.0 KernSmooth_2.23-15 rmarkdown_1.13
## [100] grid_3.6.1 digest_0.6.19 classInt_0.3-3
## [103] xtable_1.8-4 httpuv_1.5.1 munsell_0.5.0
## [106] mitools_2.4


Chapter 14 Therapists
The term “therapist” is the term used within BASS to designate anyone who administrates part of or the entirety of a database and its participants. This could be an administrator, whose job it is to build treatment content, instruments and assessments. It could also be a licensed therapist who administers treatments to select participants. It could yet again be students who use BASS as part of a university course in web-based CBT, as well as their supervising teacher or professor. The common denominator for all these examples is that they all use a therapist account. What separates them are the differing levels of access (privileges) given to them. In this chapter, we will take a look at the therapist accounts, how to set them up and what levels of privileges can be given to them.
14.1 Creating a therapist account
To create a therapist account, you need three things:
- The name of the person who will use the account
- A working e-mail address for that person, i.e a work e-mail/faculty e-mail
- A working cell phone number for that person
A few notes: The name is not strictly required to be the actual name of the person, but we strongly recommend to use the person’s proper name for ease of supervision/activity tracking should it be necessary. We furthermore strongly recommend the use of work/faculty e-mail or other similarly secure e-mail service backed by your IT department. We generally do not recommend you use publicly available e-mail services such as Gmail, Hotmail, Yahoo and the like. Lastly, the cell phone number is required for two-factor authentication. Without it, you will not be able to log in to BASS as a therapist. There is no option to disable two-factor authentication for therapists, but you can choose to send the authentication message via e-mail rather than via SMS.
14.2 The “Manage Therapists” view
This is the landing page when clicking the Therapists menu option in the main menu. Normally, the first accounts created are admin and any accounts used by the BASS support staff. There’s no tag or icon designating BASS support staff as such, other than the fact that they will always carry the star moniker which indicates that they are database administrators. You therapist account has most likely been set up by the BASS support staff, and as such your account is also shown in the list. But what about creating new accounts? Let’s have a look!
14.2.1 Creating a new therapist account
To create a new therapist account, click the Create new therapist link below the list of existing accounts. This will present you with the information view. Here, in the first small table, you can see last login, login count, total time, and internal id. All of these are superfluous for now, but are self-explanatory in their function (the internal id is used by BASS to identify individual therapists, and may be used to communicate outside of BASS in potentially delicate matters pertaining to specific therapists). Below the first little table is a bigger table, with which we will concern ourselves now.
- Login: in this field, you type the username of the therapist account. We recommend keeping a simple format, such as firstname, firstnamesurname or firstname-surname.
- Full name: in this field, you type the full name of the person who will use the therapist account (i.e Firstname Surname)
- Email: here, you type the e-mail address which you wish to associate with the therapist account. This e-mail will be used by BASS to send daily updates on participant activities that necessitates inspection or taking action. Only the activities of participants for which the therapist is designated as “therapist” will prompt such updates to the therapist.
- SMS number: here, you type the cell phone number you wish to associate with the therapist account. As noted above, unless you’ve changed the delivery method for two-factor authentication messages, this is mandatory.
- Send SMS/email when supervisor send messages: by checking this box, the therapist will be notified by SMS and/or e-mail when their supervisor (if any) sends them a messages within BASS. This is mainly used in educational settings, where students are assigned a supervisor.
- Login allowed: checking/un-checking this box enables/disables logging in for the therapist account.
- Login expiration date: by clicking the empty text box, you will be shown a calender. From this calender you can pick a date up to 182 days in the future to set it as the expiration date for the therapist account allowed login. It is mandatory to set an expiration date, otherwise the therapist will be unable to log in. This date can be extended later on, but no more than 182 days from the current date. This feature is a safeguard to prevent old therapist accounts from being active beyond their intended use.
- Must change password: by checking this box, the therapist will be required to submit their own personal password upon their first time logging in. I.e the password you set when creating the therapist account will be a temporary, one-time use password if you check this box.
- New password: here, you type the password for the therapist account
- Confirm password: here, you confirm the password you’ve typed above.
When you’ve entered the information into the fields listed above, click Save.
14.2.2 The Information Tab
Now that you’ve saved the therapist account you just created, you should be presented with the Information tab for that therapist account. For all intents and purposes, it contains the information you just submitted. From this tab, you can edit the information as well as enable/disable login, extend the expiration date and provide the therapist with a new password if needed.
14.2.3 The Privileges Tab
In this tab, you set the privileges given to the therapist account. At the top of the page, you will see the dropdown menu named Senior therapist. By defauly, admin will be selected. You can leave this as-is.
Beneath the dropdown menu, there is a table named Global privileges. These are privileges pertaining to the entire database. If you want to give the therapist account full access to the databse, chech the box named Administrative privileges.
A more in-depth look at the different privileges follows below:
- Edit answer flag settings: by checking this box, you give the therapist account access to view and edit answer flag settings under Answers flagging in the main menu.
- Administrative privileges: as noted above, checking this box grants the therapist account full access to the database.
- Edit other therapists: by checking this box, you give the therapist account access to view and edit other therapist accounts.
- Groups view: checking this box lets the therapist accounts view the Groups tab under Participants in the main menu.
- Edit note categories: as with “Edit answer flag settings,” checking this box grants access to view and edit note categories under Note categories in the main menu.
- Supervisor: checking this box lets you designate the therapist account as a supervisor to other therapists.


Kubica not happy with results but pleased with how his body has dealt with it
by Joseph TyrrellIt was meant to be the fairy tale return but Robert Kubica's F1 return has been anything but that as he has languished behind the rest of the field for most of the season. Despite this, Kubica is pleased with how his body has dealt with the physical challenge.
Kubica returned to the pinnacle of motorsport after a rally crash in 2011 almost ended his motorsport career altogether. The return was supposed to be the dream return but it quickly turned sour, as Williams and the Pole himself lacked the pace to compete with the rest of the field.
He remains the scorer of the constructors' single point from the German Grand Prix. Despite his struggles, the fact he has returned given his physical disabilities is an impressive accomplishment and something he can take from this season.
“With my limitations, a lot of people did not even think I would be able to race,” said Kubica on the Formula 1 website.
“I heard many stories that in Turn 1, I would not be able to react to situations – and probably the opening lap is one of the things which I managed well this season.
“I’m leaving this season, of course not happy with the general performance, but pretty happy with how my body, my mind and my brain reacted to the difficult challenge I had this year.”


Question
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
- Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)
- The solution set must not contain duplicate triplets.
For example, given array S = {-1 0 1 2 -1 -4}, A solution set is: (-1, 0, 1) (-1, -1, 2)
Stats
| Frequency | 5 |
| Diffficulty | 3 |
| Adjusted Difficulty | 5 |
| Time to use | ---------- |
Ratings/Color = 1(white) 2(lime) 3(yellow) 4/5(red)
Analysis
First of all, the array must be sorted first.
This question is solved with O(n2) time. The idea is, for every integer, try to find a 2-integer pair so that the 3 numbers sum to 0. The method to use is 2-pointer scan.
Solution
Very important point of this question: there might be duplications in the result.
Eg. array = {-5, 2, 2, 3, 3}. When a = -5, we can choose 2, 3 and move pointers both by 1 position. Then we can choose 2, 3 again!
Solution is to increase the pointer to where the value is different. Pay special attention in writing the code. Because there are 3 parts that need duplication avoidance:
The pivot number that we select, must be distinct each time. Why? because this is the smallest of the triplet. It must not be same.
The left pointer and right pointer. They should point to a new value each time.
Note that when sum is too large, move left pointer, and vice versa. However when sum is == 0, we move both left and right pointer.
Point 3 is the reason why we have 2 conditions in seperate if-block:
if (sum >= 0) {...}
if (sum <= 0) {...}
My code
public class Solution {
public List<List<Integer>> threeSum(int[] num) {
List<List<Integer>> ans = new ArrayList<List<Integer>>();
if (num == null || num.length < 3) {
return ans;
}
Arrays.sort(num);
int len = num.length;
int left, right;
for (int i = 0; i < len; i++) {
// duplication avoidance 1
if (i != 0 && num[i] == num[i - 1]) {
continue;
}
left = i + 1;
right = len - 1;
while (left < right) {
int sum = num[i] + num[left] + num[right];
if (sum == 0) {
// now one triplet is found, add it to ans list
List<Integer> triplet = new ArrayList<Integer>();
triplet.add(num[i]);
triplet.add(num[left]);
triplet.add(num[right]);
ans.add(triplet);
}
// shrink the range between left and right pointer
// (until the 2 pointers met)
if (sum >= 0) {
// move right pointer to the left
right--;
// duplication avoidance 2
while (right >= 0 && num[right] == num[right + 1]) {
right--;
}
}
if (sum <= 0) {
// move left pointer to the right
left++;
// duplication avoidance 3
while (left < len && num[left] == num[left - 1]) {
left++;
}
}
}
}
return ans;
}
}


This was not my first time to smoke Salvia and experience the divinity of its' life. Previous experiences left me a bit baffled and were ineffable; however, after this experience I felt as though I could describe the whole experience and I felt more at peace with myself.
I loaded up a metal pipe about half way full of Salvia Divinorum. I lit the bowl and inhaled a deep breath of smoke; I held the smoke in my lungs for 30-45 seconds. I then exhaled and hit it again and held it in for the same amout of time.
I suddenly (within 45 seconds)became part of a whole generating system of minds and souls within this 'machine' that is all connected in a circuitry of all the minds or souls around. Everything was black around me, but I felt connected and united completely. As I drifted out of the experience, my friends were asking, 'How was it, what was it like?' I tried my best to explain, but I don't think they could comprehend. The Salvia didn't affect them in the same ways whenever they smoked it the same night. I heard that it worked very differently on everyone, and many of my friends that have tried it have all received different experiences from the sage.
As I came back to my concious mind, I felt as though my body had no place in the world. It felt as though my emotional and spiritual centre of being in the middle of my chest had been united in this 'circle' of unity.  However, my physical head meant nothing to me; I felt as though it was just an exterior layer to the circuitry of the mind and spirit, which existed peacefully when aligned in unity.
After the short core part of the experience(about 20 seconds), I reflected on the experience for quite a while as I became increasingly more aware of my physical form and as my spirit and mind drifted apart. The whole expereince(including reflection time)lasted about 30 minutes. If you are using this in the presence of someone who shouldn't know that you are under the influence, then wait about 45 minutes before going to interact with them.
This is a very powerful hallucinogen, please use wisely and with good, peaceful intentions. Until next time, the peace and love align the world in beauty...
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


{% from 'host/common.html' import edit_field %} {% from 'share/select_server.html' import select_server %} {% macro make_conform_dialog(cco_lookup_enabled, server, server_directory, server_time, install_actions, software_packages, custom_command_profile, scheduled_time, scheduled_time_UTC) %}


Color Systems International - Millennium Color Collection
Colorcharts.org certification: *** Fandecks scanned on a X-Rite CFS-57 Spectrophotometer


Complaints procedure
If you are unhappy with the service you get from the Ministry of Defence (MOD) or its agencies, there are different ways you can complain.
Our commitment
At the Ministry of Defence (MOD) we are committed to providing a high quality of service to everyone with whom we deal. We continually look at our existing performance and try to improve on it.
You may be in a good position to judge how we are performing, and we need you to tell us if we get things wrong. We will listen to your complaints and treat them seriously and in confidence.
We aim to put things right for you when it is possible and appropriate, learn from where we went wrong and make sure that we do not make the same mistake again.
How to complain
If you have a complaint, you should initially make it to the relevant part of MOD involved in the matter, as they will usually be best placed to put things right. However, if you do not know who is responsible for the matter, then you can write to them via:
The Ministerial Correspondence Unit
Level 5, Zone A
Main Building
Whitehall
London SW1A 2HB
The department aims to issue a full response to your complaint within 20 working days of receiving it.
If we cannot, we will tell you who is handling the complaint, and when they expect to be able to reply in full. It will help us to deal with your complaint if you can provide as much background information as possible.
What to do if you’re not satisfied
If you are not satisfied with the way in which your complaint has been handled, you have the right to ask for an internal review of your case which will be carried out in the division where you made your initial complaint.
You should normally be informed of who to contact to ask for an internal review as part of the response you receive to your initial complaint. If you do not know who to contact, or wish to refer the case to a part of the MOD independent of the area that handled the initial complaint, you should write to:
Defence Business Improvement
Level 3 Zone D
Main Building
Whitehall
London SW1A 2HB
If you remain dissatisfied after the internal review, you have the right to contact the Parliamentary Commissioner for Administration (the Ombudsman) through your Member of Parliament.
The Ombudsman can be contacted at the following address:
The Office of the Parliamentary Commissioner for Administration
Millbank Tower
London SW1P 4QP
Common Law Claims & Policy Division
Processing common-law, non-contractual compensation claims against and on behalf of the Ministry of Defence at home and abroad. More about Common Law Claims & Policy Division.
Other complaints procedures within MOD
Complaints about requests for information made under the Freedom of Information (FOI) Act or the Environmental Information Regulations (EIR) 2004.
Complaints regarding the handling of and response to requests for information FOI Act 2000 or the EIR 2004 should be addressed to:
MOD Information Rights team
1st floor, Zone N
Main Building
Whitehall
London
SW1A 2HB
Email<EMAIL_ADDRESS>Complaints under the Data Protection Act 1998
Details of the complaints procedure relating to the processing of personal data held by MOD are contained in the replies to each subject access request. Complaints to the Departmental Data Protection Officer should be addressed to:
MOD Information Rights team
1st floor, Zone N
Main Building
Whitehall
London SW1A 2HB
Email<EMAIL_ADDRESS>Complaints about military low-flying
These should be addressed to:
Ministry of Defence Air Staff Complaints and Enquiries Unit
RAF Wittering
Peterborough
PE8 6HB
Complaints about MOD Police
Copies of leaflets on how to make a complaint against the MOD Police are available from local MOD Police Units or from:
Ministry of Defence Police HQ Wethersfield
Braintree
Essex
CM7 4AZ
Telephone: 01371 854 648
Complaints about pensions
Separate advice can also be obtained about complaints relating to civilian pensions from:
Senior Pension Manager
PPA Pensions
PO Box 42
Stockport
Complaints about Defence Business Services (DBS)
Guidance for non MOD civilian employees who would like to make a complaint to Defence Business Services (DBS).


An image, loaded from a .png file, which can be used for generating textures.
More...
#include <Image.hpp>
|
| | Image (const std::string fileLocation="") |
| | File-reading constructor. More...
|
| |
| | Image (std::vector< char > &data) |
| | Memory-based constructor. More...
|
| |
|
| ~Image ()=default |
| | Destructor.
|
| |
| void | toColour (glm::vec4 colour) |
| | Convert to a coloured 10 x 10 pixel image. More...
|
| |
| unsigned long | getWidth () const |
| | Get the image width. More...
|
| |
| unsigned long | getHeight () const |
| | Get the image height. More...
|
| |
| unsigned long | getByteSize () const |
| | Get the size of the image, in bytes. More...
|
| |
| const uint8_t * | getData () const |
| | Get the image data. More...
|
| |
|
template<class Archive > |
| void | serialize (Archive &archive) |
| |
|
|
static const std::string | NOTRGBA = "Image format not recognised. Only RGB / RGBA png images are supported." |
| | String saying that the colour encoding of the image being read is not RGB/RGBA.
|
| |
An image, loaded from a .png file, which can be used for generating textures.
◆ Image() [1/2]
| small3d::Image::Image |
( |
const std::string |
fileLocation = "" | ) |
|
File-reading constructor.
- Parameters
-
| fileLocation | Location of the png image file |
◆ Image() [2/2]
| small3d::Image::Image |
( |
std::vector< char > & |
data | ) |
|
Memory-based constructor.
- Parameters
-
| data | PNG bytes already read into memory |
◆ getByteSize()
| unsigned long small3d::Image::getByteSize |
( |
| ) |
const |
Get the size of the image, in bytes.
- Returns
- Size of the image, in bytes
◆ getData()
| const uint8_t * small3d::Image::getData |
( |
| ) |
const |
Get the image data.
- Returns
- The image data
◆ getHeight()
| unsigned long small3d::Image::getHeight |
( |
| ) |
const |
Get the image height.
- Returns
- The image height
◆ getWidth()
| unsigned long small3d::Image::getWidth |
( |
| ) |
const |
Get the image width.
- Returns
- The image width
◆ toColour()
| void small3d::Image::toColour |
( |
glm::vec4 |
colour | ) |
|
Convert to a coloured 10 x 10 pixel image.
- Parameters
-
| colour | The colour of the image |
The documentation for this class was generated from the following files:


Package org.bukkit.block.data.type
package org.bukkit.block.data.type
Specific BlockData classes relevant to only a given block or set of blocks.
-
ClassDescription'leaves' represents the size of the leaves on this bamboo block.Bamboo leaf size.Similar to
Bisected
, 'part' denotes which half of the bed this block corresponds to.Horizontal half of a bed.'honey_level' represents the amount of honey stored in the hive.'attachment' denotes how the bell is attached to its block.What the bell is attached to.'tilt' indicates how far the leaf is tilted.The tilt of a leaf.Interface to the 'has_bottle_0', 'has_bottle_1', 'has_bottle_2' flags on a brewing stand which indicate which bottles are rendered on the outside.'drag' indicates whether a force will be applied on entities moving through this block.'bites' represents the amount of bites which have been taken from this slice of cake.'signal_fire' denotes whether the fire is extra smokey due to having a hay bale placed beneath it.'candles' represents the number of candles which are present.'berries' indicates whether the block has berries.'type' represents which part of a double chest this block is, or if it is a single chest.Type of this chest block.Interface to the 'slot_0_occupied', 'slow_1_occupied' ...'conditional' denotes whether this command block is conditional or not, i.e.'mode' indicates what mode this comparator will operate in.The mode in which a comparator will operate in.'inverted' denotes whether this daylight detector is in the inverted mode, i.e.Similar toPowerable
, 'triggered' indicates whether or not the dispenser is currently activated.'hinge' indicates which hinge this door is attached to and will rotate around when opened.The hinge of a door.'eye' denotes whether this end portal frame has been activated by having an eye of ender placed in it.The 'moisture' level of farmland indicates how close it is to a water source (if any).md_5's mixtape.'in_wall" indicates if the fence gate is attached to a wall, and if true the texture is lowered by a small amount to blend in better.Similar toPowerable
, 'enabled' indicates whether or not the hopper is currently activated.'orientation' is the direction the block is facing.The directions the Jigsaw can be oriented.'has_record' is a quick flag to check whether this jukebox has a record inside it.'persistent' indicates whether or not leaves will be checked by the server to see if they are subject to decay or not.'has_book' is a quick flag to check whether this lectern has a book inside it.'instrument' is the type of sound made when this note block is activated.'extended' denotes whether the piston head is currently extended or not.'short' denotes this piston head is shorter than the usual amount because it is currently retracting.'thickness' represents the dripstone thickness.Represents the thickness of the dripstone, corresponding to its position within a multi-block dripstone formation.A type of minecart rail which interacts with redstone in one way or another.'north', 'east', 'south', 'west' represent the types of connections this redstone wire has to adjacent blocks.The way in which a redstone wire can connect to an adjacent block face.'delay' is the propagation delay of a repeater, i.e.'charges' represents the amount of times the anchor may still be used.'stage' represents the growth stage of a sapling.'bottom' indicates whether the scaffolding is floating or not.'bloom' indicates whether the sculk catalyst is actively spreading the sculk or not.'sculk_sensor_phase' indicates the current operational phase of the sensor.The Phase of the sensor.'can_summon' indicates whether the sculk shrieker can summon the warden.'pickles' indicates the number of pickles in this block.'type' represents what state the slab is in - either top, bottom, or a double slab occupying the full block.The type of the slab.'layers' represents the amount of layers of snow which are present in this block.'shape' represents the texture and bounding box shape of these stairs.The shape of a stair block - used for constructing corners.'mode' represents the different modes in which this structure block may operate.Operating mode of a structure block.Deprecated.'type' represents the type of piston which this (technical) block corresponds to.Different piston variants.'unstable' indicates whether this TNT will explode on punching.'disarmed' denotes that the tripwire was broken with shears and will not subsequently produce a current when destroyed.'hatch' is the number of turtles which may hatch from these eggs.This class encompasses the 'north', 'east', 'south', 'west', height flags which are used to set the height of a wall.The different heights a face of a wall may have.
FaceAttachable.AttachedFace


ADSR Envelope
Click the button to trigger the attack/decay portion of the envelope. Let go of the button to trigger the release.


no point in writing this section, really, since no one will ever read it but there's no harm in having a good introduction. here lies my fears, my desires, and everything in between.
~ first day we met ~
you were looking for a seat in the assembly hall and had tripped on your way to the one right beside mine. i've never met anyone clumsy enough to trip on air. of course, i'm not telling you that, nor will i ever tell you that i'm writing about it.
~ first non-official date ~
given the nature of our platonic relationship, i can't really say that this is a "date," but i'll take what i can get. i'm really not a big fan of coffee, but it's a small price to pay for the great day i had.
note to self: don't order black coffee.
~ first fight ~
today was definitely not the best. whenever something's up, i usually shut my self out from everyone and deal with my emotions. most times, i feel unapologetic for these actions because it's normal, but today is different. i feel awful. i shouldn't have lashed out because you were only trying to help. might've just ruined my already-low chances.
~ first make-up date ~
again, not an actual date. just lack of a better term.
you called at around eight in the evening to ask me if we could meet up and talk. i must've set a record for my fastest prep time because i was already out of the door when the call ended. we sat on a rooftop and laid everything out. i wasn't sure if i was going to be completely comfortable with being vulnerable around anyone, but i guess some people really do make that easy. maybe if...never mind.
~ city stroll ~
it was really weird not seeing you everyday. your trip abroad felt like it lasted literal years, even though you were only gone for a month. i felt so happy seeing you back that i couldn't wait to ask you to hang out. glad i did because i had such a fun time just walking around with you, even if i got chased by a dog and almost got run over by a bike messenger in the process.
note to self: always check sides when walking. also, don't pet guard dogs.
~ maybe i should? ~
today was nothing out of the ordinary. we got tickets to see a movie that was currently out (i'd say the rating was around 7.5/10). after that, we picked up some new books from the store. then we just sat in the park until it got dark. i'm beginning to doubt my initial plans of hiding things from you. it might not have been the best idea i've ever come up with.
~ clueless ~
okay now i'm really confused. logically speaking, it would be best not to bring it up, like, ever. that's just the safest option. right? right. of course. i'm absolutely positive.
though, this "platonic-bouquet-of-flowers weird tradition you have is kind of confusing. pretty, but confusing.
~ end ~
and that brings us here. so, like i said, this wasn't supposed to be for your eyes, so i apologize again for certain details that i may have included that could've possibly weirded you out or offended you. the stuff i wrote here were my most honest, unfiltered thoughts, and i hope that in sharing them, you understand why i act the way i do and why i've done everything i have.
if not, then the answer was on the first line of the letter.


Blog Detail
Tips Minimalism 5 Style to Start Right Now
- posted by Admin
- 11/may/2020
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure Lorem ipsum dolor sit amet.
Maria Hoffan
30/May/2020 - 09:32 PM


|
CmdMessenger
4.0.0
CmdMessenger is a serial port messaging library for the .Net / Mono Platform.
|
Base of general strategy. More...
Public Member Functions | |
| virtual void | OnEnqueue () |
| GenerAdd command (strategy) to command queue. | |
| virtual void | OnDequeue () |
| Remove this command (strategy) from command queue. | |
Properties | |
| ListQueue< CommandStrategy > | CommandQueue [get, set] |
| Gets or sets the command queue. |
Base of general strategy.
| virtual void CommandMessenger.Queue.GeneralStrategy.OnDequeue | ( | ) | [virtual] |
Remove this command (strategy) from command queue.
Reimplemented in CommandMessenger.Queue.StaleGeneralStrategy.
| virtual void CommandMessenger.Queue.GeneralStrategy.OnEnqueue | ( | ) | [virtual] |
GenerAdd command (strategy) to command queue.
Gets or sets the command queue.
A Queue of commands.


SensorBot
Data
Settings
Loading...
Select a
Measurement Station
to begin
X-Axis Step Size:
Seconds
Minutes
Hours
Select a
Measurement Station
to begin
Station Name
Give your measurement station a more human friendly name
Channel
Give your measurement channels a more human friendly name
App Key
Only needed if you set up a secret key
Update


This operation cannot be undone. If uncertain, please double-check you are doing the right thing, otherwise stuff will most likely break.


nlp_architect.nn.torch.layers package¶
Submodules¶
nlp_architect.nn.torch.layers.crf module¶
-
class
nlp_architect.nn.torch.layers.crf.
CRF
(num_tags: int, batch_first: bool = False)[source]¶ Bases:
torch.nn.modules.module.Module
Conditional random field. This module implements a conditional random field [LMP01]. The forward computation of this class computes the log likelihood of the given sequence of tags and emission score tensor. This class also has ~CRF.decode method which finds the best tag sequence given an emission score tensor using Viterbi algorithm. :param num_tags: Number of tags. :param batch_first: Whether the first dimension corresponds to the size of a minibatch.
-
start_transitions
¶ Start transition score tensor of size
(num_tags,)
.Type: ~torch.nn.Parameter
-
end_transitions
¶ End transition score tensor of size
(num_tags,)
.Type: ~torch.nn.Parameter
-
transitions
¶ Transition score tensor of size
(num_tags, num_tags)
.Type: ~torch.nn.Parameter
[LMP01] Lafferty, J., McCallum, A., Pereira, F. (2001). “Conditional random fields: Probabilistic models for segmenting and labeling sequence data”. Proc. 18th International Conf. on Machine Learning. Morgan Kaufmann. pp. 282–289. -
decode
(emissions: torch.Tensor, mask: Optional[torch.ByteTensor] = None) → List[List[int]][source]¶ Find the most likely tag sequence using Viterbi algorithm. :param emissions: Emission score tensor of size
(seq_length, batch_size, num_tags)
ifbatch_first
isFalse
,(batch_size, seq_length, num_tags)
otherwise.Parameters: mask (~torch.ByteTensor) – Mask tensor of size (seq_length, batch_size)
ifbatch_first
isFalse
,(batch_size, seq_length)
otherwise.Returns: List of list containing the best tag sequence for each batch.
-
forward
(emissions: torch.Tensor, tags: torch.LongTensor, mask: Optional[torch.ByteTensor] = None, reduction: str = 'sum') → torch.Tensor[source]¶ Compute the conditional log likelihood of a sequence of tags given emission scores. :param emissions: Emission score tensor of size
(seq_length, batch_size, num_tags)
ifbatch_first
isFalse
,(batch_size, seq_length, num_tags)
otherwise.Parameters: - tags (~torch.LongTensor) – Sequence of tags tensor of size
(seq_length, batch_size)
ifbatch_first
isFalse
,(batch_size, seq_length)
otherwise. - mask (~torch.ByteTensor) – Mask tensor of size
(seq_length, batch_size)
ifbatch_first
isFalse
,(batch_size, seq_length)
otherwise. - reduction – Specifies the reduction to apply to the output:
none|sum|mean|token_mean
.none
: no reduction will be applied.sum
: the output will be summed over batches.mean
: the output will be averaged over batches.token_mean
: the output will be averaged over tokens.
Returns: The log likelihood. This will have size
(batch_size,)
if reduction isnone
,()
otherwise.Return type: ~torch.Tensor
- tags (~torch.LongTensor) – Sequence of tags tensor of size
-


Poster Session
A poster is a poster sized graphical summary of the key points about your project which forms the starting point for a brief and interactive presentation to interested viewers. The presentation space will be at least large enough to display a one meter square poster or equivalent individual pages.
The poster session provides another way of presenting that encourages more one-on-one communication between the presenter and the audience. Poster sessions are particularly suited for topics of interest to a subset of the community, and we anticipate this session will provide an "incubator" for further discussions.
Call for Posters
To submit a poster proposal, visit the Call for Participation and fill out the form.
Posters will be accepted for the poster session on a rolling basis until 1 August or the limit of 20 posters is reached.
If your questions still aren't answered feel free to email Naomi Ceder.
Important Dates
- 4 June, 2015: Call for posters opens.
- 1 August, 2015 or limit of 20 posters accepted: Call for posters closes.
- 19 Sept, 2015: Poster session at PyCon UK.
Poster session questions and answers
Q: What is a poster session?
A: A poster session is a plenary session where each speaker is given space to display their work as a poster. During the session, speakers stand with their posters, and the audience circulate freely, seeking out the particular presentations they are interested in and talking directly to the presenter in small groups. For PyCon UK 2015, we will have a designated plenary poster session and will be providing space for posters on meter square in size. This video will give you an idea of what poster sessions are.
Q: What makes a good poster presentation?
A: First, a good proposal. Poster sessions are intended to give you the chance to present interesting ideas and start conversations with others. Additionally, proposal titles and abstracts are one of the major tools the audience will use to identify posters of interest, so it is important to communicate clearly.
Second, the poster itself. It is important to understand that a poster is neither a paper nor a slideshow. The poster isn't there for the audience to just read, it is a visual aid for you to use in creating a quick engaging impromptu presentation, and to refer to in answering questions and fueling discussion. Use this session as a way to make connections with people that you can continue through the open spaces or informally during the conference.
Q: Can I submit both a poster and a talk proposal?
A: Absolutely! We encourage everyone to submit a poster proposal even if they have also submitted a talk proposal. Even if a talk proposal can not be accommodated by the program committee, it may still be well suited for a poster presentation.


(in-package :cram)
(needs "../src/lib")
(defthing summary thing
(txt "") (pos 0) (n 0) (w 1))
(defmethod add1((x summary) y)
(declare (ignore x y))
(assert nil () "add1 should be implemented by subclass"))
(defmethod norm1((x summary) y)
(declare (ignore x y))
(assert nil () "norm1 should be implemented by subclass"))
(defmethod add ((x summary) y &optional (f #'identity))
(with-slots (n) x
(when (not (eql y #\?))
(incf n)
(add1 (funcall f x) y ))
y))
(defmethod adds ((x summary) (ys cons) &optional (f #'identity))
(dolist (y ys x)
(add x y f)))
(defmethod adds ((x summary) (ys simple-vector) &optional (f #'identity))
(loop for y across ys do
(add x y f)))
(defmethod norm ((x summary) y)
(if (eql y #\?) y (norm1 x y)))