Source code for torch._jit_internal
"""
The weak_script annotation needs to be here instead of inside torch/jit/ so it
can be used in other places in torch/ (namely torch.nn) without running into
circular dependency problems
"""
import contextlib
import collections
import enum
import inspect
import ast
import weakref
import warnings
from textwrap import dedent
import torch
import sys
import builtins
import typing
import io
import pickle
# This is needed. `torch._jit_internal` is imported before `torch.distributed.__init__`.
# Explicitly ask to import `torch.distributed.__init__` first.
# Otherwise, "AttributeError: module 'torch' has no attribute 'distributed'" is raised.
import torch.distributed.rpc
from torch._C import Future as CFuture
from torch._sources import get_source_lines_and_file, parse_def, fake_range
from torch.futures import Future
import torch.package._mangling as package_mangling
from typing import Any, Callable, Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union # noqa: F401
if sys.version_info[:2] > (3, 7):
from typing import Final
else:
from typing_extensions import Final
LockType: Type
try:
import _thread
LockType = _thread.LockType
except ImportError:
import _dummy_thread
LockType = _dummy_thread.LockType
# Wrapper functions that can call either of 2 functions depending on a boolean
# argument
boolean_dispatched: 'weakref.WeakKeyDictionary[Callable, Dict[str, Callable]]' = weakref.WeakKeyDictionary() # noqa: T484
def createResolutionCallbackFromEnv(lookup_base):
"""
Creates a resolution callback that will look up qualified names in an
environment, starting with `lookup_base` for the base of any qualified
names, then proceeding down the lookup chain with the resolved object.
You should not use this directly, it should only be used from the other
createResolutionCallbackFrom* functions.
"""
def lookupInModule(qualified_name, module):
if '.' in qualified_name:
parts = qualified_name.split('.')
base = parts[0]
remaining_pieces = '.'.join(parts[1:])
module_value = getattr(module, base)
return lookupInModule(remaining_pieces, module_value)
else:
return getattr(module, qualified_name)
def parseNestedExpr(expr, module) -> Tuple[Any, int]:
i = 0
while i < len(expr) and expr[i] not in (',', '[', ']'):
i += 1
# Special case logic for the empty Tuple as a subscript (used
# in the type annotation `Tuple[()]`)
if expr[:i] == '()':
return (), i
base = lookupInModule(expr[:i].strip(), module)
assert base is not None, f"Unresolvable type {expr[:i]}"
if i == len(expr) or expr[i] != '[':
return base, i
assert expr[i] == '['
parts = []
while expr[i] != ']':
part_len = 0
i += 1
part, part_len = parseNestedExpr(expr[i:], module)
parts.append(part)
i += part_len
if len(parts) > 1:
return base[tuple(parts)], i + 1
else:
return base[parts[0]], i + 1
def parseExpr(expr, module):
try:
value, len_parsed = parseNestedExpr(expr, module)
assert len_parsed == len(expr), "whole expression was not parsed, falling back to c++ parser"
return value
except Exception:
"""
The python resolver fails in several cases in known unit tests, and is intended
to fall back gracefully to the c++ resolver in general. For example, python 2 style
annotations which are frequent in our unit tests often fail with types e.g. int not
resolvable from the calling frame.
"""
return None
return lambda expr: parseExpr(expr, lookup_base)
def createResolutionCallbackFromFrame(frames_up: int = 0):
"""
Creates a function which, given a string variable name,
returns the value of the variable in the scope of the caller of
the function which called createResolutionCallbackFromFrame (by default).
This is used to enable access in-scope Python variables inside
TorchScript fragments.
frames_up is number of additional frames to go up on the stack.
The default value is 0, which correspond to the frame of the caller
of createResolutionCallbackFromFrame. Also for example, if frames_up is set
to 1, then the frame of the caller's caller of createResolutionCallbackFromFrame
will be taken.
For example, the following program prints 2::
def bar():
cb = createResolutionCallbackFromFrame(1)
print(cb("foo"))
def baz():
foo = 2
bar()
baz()
"""
frame = inspect.currentframe()
i = 0
while i < frames_up + 1:
assert frame is not None
frame = frame.f_back
i += 1
assert frame is not None
f_locals = frame.f_locals
f_globals = frame.f_globals
class env(object):
def __getattr__(self, key):
if key in f_locals:
return f_locals[key]
elif key in f_globals:
return f_globals[key]
elif key in dir(builtins):
return getattr(builtins, key)
return createResolutionCallbackFromEnv(env())
def get_closure(fn):
"""
Get a dictionary of closed over variables from a function
"""
captures = {}
captures.update(fn.__globals__)
for index, captured_name in enumerate(fn.__code__.co_freevars):
captures[captured_name] = fn.__closure__[index].cell_contents
return captures
# [local resolution in python]
# Depending on where a variable is defined, and where it is used, we may
# or may not be able to recover its value when recursively compiling a
# script function. Remember in the general case, a module or function is
# first defined and then later scripted. This means we do not have a
# chance to capture the active frames when the function is defined. Hence any
# name resolution has to happen later on the created closure. The way
# python captures type annotations restricts what we can recover. The
# follow example illustrates the different cases:
#
# class MyGlobalClass:
# ...
# def my_local_scope():
# @torch.jit.script
# class MyClass:
# ...
# @torch.jit.script
# class MyClassUsedAsVar:
# ...
# def eg(x: MyClass, y: MyGlobalClass):
# a_local_capture : Foo
# return MyClassUsedAsVar(x)
#
# MyGlobalClass is defined in the __globals__ dictionary of function
# 'eg', so it is always recoverable. my_local_scope introduces a new local
# variable scope in the function. Classes defined here are only visible as
# local variables. For the case of MyClassUsedAsVar, it is captured
# because it is used as a variable inside the body of the function, and we
# can resolve it using the captures returned from `get_closure`. However,
# the type annotations are not captured by the closure. In Python
# 3.0--3.9, the _value_ of MyClass and MyGlobalClass will be available as
# annotations on `eg``, but starting in Python 4.0, they will represented as
# strings and no longer present. Furthermore, since the body of `eg` does
# not reference those names, they do not appear in the list of closed over
# variables. In Python 2.x, type annotations are in comments, leading to a
# similar situation where their definitions are not available. We anticipate
# that most users will not run into this issue because their modules and
# functions will be defined at a global scope like MyGlobalClass. In cases
# where they are not, it is possible to work around issues by declaring the
# values global in the function.
# In Python 3.9 declaring class as global will make it invisible to
# `inspect.getsource`, see https://bugs.python.org/issue42666 .
# This could be worked around by manualy adding it to `global()` dictionary.
def createResolutionCallbackFromClosure(fn):
"""
Create a resolutionCallback by introspecting the function instead of
looking up the stack for the enclosing scope
"""
closure = get_closure(fn)
class closure_lookup(object):
# This is a class since `closure` is a dict and it's easier in
# `env_helper` if everything just works with `getattr` calls
def __getattr__(self, key):
if key in closure:
return closure[key]
elif hasattr(typing, key):
return getattr(typing, key)
elif hasattr(builtins, key):
return getattr(builtins, key)
return None
return createResolutionCallbackFromEnv(closure_lookup())
def can_compile_class(cls) -> bool:
# If any of the functions on a type don't have a code object, this type can't
# be compiled and is probably a builtin / bound from C
if is_ignored_fn(cls):
return False
# Ignore the following list of built-in classes.
ignored_builtin_classes = (torch.nn.Module, tuple, list, Exception)
if issubclass(cls, ignored_builtin_classes):
return False
names = cls.__dict__
fns = [getattr(cls, name) for name in names if inspect.isroutine(getattr(cls, name, None))]
has_code = [hasattr(fn, '__code__') for fn in fns]
return all(has_code)
def get_callable_argument_names(fn) -> List[str]:
"""
Gets names of all POSITIONAL_OR_KEYWORD arguments for callable `fn`.
Returns an empty list when other types of arguments are present.
This is used by `torch.jit.trace` to assign meaningful argument names to
traced functions and modules.
Args:
fn: A callable.
Returns:
Argument names: List[str]
"""
# inspect.signature may fail, give up in that case.
try:
callable_signature = inspect.signature(fn)
except Exception:
return []
argument_names = []
for name, param in callable_signature.parameters.items():
# All four other types of arguments do not map to individual values
# with a keyword as name.
if not param.kind == param.POSITIONAL_OR_KEYWORD:
return []
argument_names.append(name)
return argument_names
def get_annotation_str(annotation):
"""
Convert an AST node containing a type annotation to the string present in the source
that represents the same annotation.
"""
if isinstance(annotation, ast.Name):
return annotation.id
elif isinstance(annotation, ast.Attribute):
return '.'.join([get_annotation_str(annotation.value), annotation.attr])
elif isinstance(annotation, ast.Subscript):
# In Python3.9+ subscript indicies are not wrapped in ast.Index
subscript_slice = annotation.slice if sys.version_info >= (3, 9) else annotation.slice.value # type: ignore[attr-defined]
return f"{get_annotation_str(annotation.value)}[{get_annotation_str(subscript_slice)}]"
elif isinstance(annotation, ast.Tuple):
return ','.join([get_annotation_str(elt) for elt in annotation.elts])
elif isinstance(annotation, ast.Constant) or isinstance(annotation, ast.NameConstant):
return f"{annotation.value}"
# If an AST node is not handled here, it's probably handled in ScriptTypeParser.
return None
def get_type_hint_captures(fn):
"""
Get a dictionary containing type resolution mappings necessary to resolve types
for the literal annotations on 'fn'. These are not considered to be closed-over by fn
and must be obtained separately (e.g. using this function).
Args:
fn: A callable.
Returns:
A Dict[str, Any] containing a mapping from the literal annotations used on
fn to the Python objects they refer to.
"""
# Gather a dictionary of parameter name -> type, skipping any parameters whose annotated
# types are strings. These are only understood by TorchScript in the context of a type annotation
# that refers to a class in its own definition, but trying to include a mapping for this in the result
# function would cause infinite recursion because the class is currently being compiled.
# In addition, there is logic in ScriptTypeParser to handle this.
signature = inspect.signature(fn)
name_to_type = {
name: parameter.annotation
for name, parameter in signature.parameters.items()
if parameter.annotation is not inspect.Parameter.empty and not isinstance(parameter.annotation, str)
}
# Then, get the literal type annotations from the function declaration
# by source inspection. This accounts for the case in which aliases are used
# to annotate the arguments (e.g device_t = torch.device, and then d: device_t).
src = inspect.getsource(fn)
# frontend.py cannot be used here because it includes _jit_internal, so use ast instead.
a = ast.parse(dedent(src))
if len(a.body) != 1 or not isinstance(a.body[0], ast.FunctionDef):
raise RuntimeError(f"Expected {fn} to be a function")
f = a.body[0]
# Prepare a dictionary of source annotation -> type, which will be the final result of this function,
# by using the parsed AST (f) to reconstruct source annotations as strings for each parameter and mapping
# them to the type object corresponding to the annotation via name_to_type using the parameter name.
annotation_to_type = {}
for arg in f.args.args:
# Get the source type annotation string for this argument if possible.
arg_annotation_str = get_annotation_str(arg.annotation) if arg.annotation else None
# If the argument has no annotation or get_annotation_str cannot convert it to a string,
# arg_annotation_str will be None. Skip this arg; ScriptTypeParser will probably handle
# this in the latter case.
if arg_annotation_str is None:
continue
# Insert {arg_annotation_str: type} into annotation_to_type if possible. One reason arg_name may not
# be present in name_to_type is that the annotation itself is a string and not a type object
# (common for self-refential annotations in classes). Once again, let ScriptTypeParser handle this.
arg_name = arg.arg
if arg_name in name_to_type:
annotation_to_type[arg_annotation_str] = name_to_type[arg_name]
# If there is a valid return annotation, include it in annotation_to_type. As with argument annotations,
# the literal annotation has to be convertible to a string by get_annotation_str, and the actual type
# of the annotation cannot be a string.
literal_return_annotation = get_annotation_str(f.returns)
valid_literal_annotation = literal_return_annotation is not None
return_annotation = signature.return_annotation
valid_return_annotation_type = return_annotation is not inspect.Parameter.empty and not isinstance(return_annotation, str)
if valid_literal_annotation and valid_return_annotation_type:
annotation_to_type[literal_return_annotation] = return_annotation
return annotation_to_type
def createResolutionCallbackForClassMethods(cls):
"""
This looks at all the methods defined in a class and pulls their closed-over
variables into a dictionary and uses that to resolve variables.
"""
# cls is a type here, so `ismethod` is false since the methods on the type
# aren't bound to anything, so Python treats them as regular functions
fns = [getattr(cls, name) for name in cls.__dict__ if inspect.isroutine(getattr(cls, name))]
captures = {}
for fn in fns:
captures.update(get_closure(fn))
captures.update(get_type_hint_captures(fn))
def lookup_in_class(key):
if key in captures:
return captures[key]
else:
return getattr(builtins, key, None)
return lookup_in_class
def boolean_dispatch(arg_name, arg_index, default, if_true, if_false, module_name, func_name):
"""
Dispatches to either of 2 script functions based on a boolean argument.
In TorchScript, the boolean argument must be constant so that the correct
function to use can be determined at compile time.
"""
def fn(*args, **kwargs):
dispatch_flag = False
if arg_name in kwargs:
dispatch_flag = kwargs[arg_name]
elif arg_index < len(args):
dispatch_flag = args[arg_index]
if dispatch_flag:
return if_true(*args, **kwargs)
else:
return if_false(*args, **kwargs)
if if_true.__doc__ is None and if_false.__doc__ is not None:
doc = if_false.__doc__
if_true.__doc__ = doc
elif if_false.__doc__ is None and if_true.__doc__ is not None:
doc = if_true.__doc__
if_false.__doc__ = doc
elif if_false.__doc__ is None and if_true.__doc__ is None:
# neither function has a docstring
doc = None
else:
raise RuntimeError("only one function can have a docstring")
fn.__doc__ = doc
if module_name is not None:
fn.__module__ = module_name
if func_name is not None:
fn.__name__ = func_name
boolean_dispatched[fn] = {
"if_true": if_true,
"if_false": if_false,
"index": arg_index,
"default": default,
"arg_name": arg_name
}
return fn
class FunctionModifiers(object):
"""
Used to denote the behavior of a function in TorchScript. See export() and
ignore() for details.
"""
UNUSED = "unused (ignored and replaced with raising of an exception)"
IGNORE = "ignore (leave as a call to Python, cannot be torch.jit.save'd)"
EXPORT = "export (compile this function even if nothing calls it)"
DEFAULT = "default (compile if called from a exported function / forward)"
COPY_TO_SCRIPT_WRAPPER = \
"if this method is not scripted, copy the python method onto the scripted model"
[docs]def export(fn):
"""
This decorator indicates that a method on an ``nn.Module`` is used as an entry point into a
:class:`ScriptModule` and should be compiled.
``forward`` implicitly is assumed to be an entry point, so it does not need this decorator.
Functions and methods called from ``forward`` are compiled as they are seen
by the compiler, so they do not need this decorator either.
Example (using<EMAIL_ADDRESS>on a method):
.. testcode::
import torch
import torch.nn as nn
class MyModule(nn.Module):
def implicitly_compiled_method(self, x):
return x + 99
# `forward` is implicitly decorated with<EMAIL_ADDRESS># so adding it here would have no effect
def forward(self, x):
return x + 10
@torch.jit.export
def another_forward(self, x):
# When the compiler sees this call, it will compile
# `implicitly_compiled_method`
return self.implicitly_compiled_method(x)
def unused_method(self, x):
return x - 20
# `m` will contain compiled methods:
# `forward`
# `another_forward`
# `implicitly_compiled_method`
# `unused_method` will not be compiled since it was not called from
# any compiled methods and wasn't decorated with<EMAIL_ADDRESS>m = torch.jit.script(MyModule())
"""
fn._torchscript_modifier = FunctionModifiers.EXPORT
return fn
[docs]def unused(fn):
"""
This decorator indicates to the compiler that a function or method should
be ignored and replaced with the raising of an exception. This allows you
to leave code in your model that is not yet TorchScript compatible and still
export your model.
Example (using<EMAIL_ADDRESS>on a method)::
import torch
import torch.nn as nn
class MyModule(nn.Module):
def __init__(self, use_memory_efficient):
super(MyModule, self).__init__()
self.use_memory_efficient = use_memory_efficient
@torch.jit.unused
def memory_efficient(self, x):
import pdb
pdb.set_trace()
return x + 10
def forward(self, x):
# Use not-yet-scriptable memory efficient mode
if self.use_memory_efficient:
return self.memory_efficient(x)
else:
return x + 10
m = torch.jit.script(MyModule(use_memory_efficient=False))
m.save("m.pt")
m = torch.jit.script(MyModule(use_memory_efficient=True))
# exception raised
m(torch.rand(100))
"""
if isinstance(fn, property):
prop = fn
setattr(prop.fget, "_torchscript_modifier", FunctionModifiers.UNUSED) # noqa: B010
if prop.fset:
setattr(prop.fset, "_torchscript_modifier", FunctionModifiers.UNUSED) # noqa: B010
return prop
fn._torchscript_modifier = FunctionModifiers.UNUSED
return fn
# No op context manager from python side
class _IgnoreContextManager(contextlib.AbstractContextManager):
def __init__(self, **kwargs):
pass
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
pass
def ignore(drop=False, **kwargs):
"""
This decorator indicates to the compiler that a function or method should
be ignored and left as a Python function. This allows you to leave code in
your model that is not yet TorchScript compatible. If called from TorchScript,
ignored functions will dispatch the call to the Python interpreter. Models with ignored
functions cannot be exported; use<EMAIL_ADDRESS><torch.jit.unused>` instead.
Example (using<EMAIL_ADDRESS>on a method)::
import torch
import torch.nn as nn
class MyModule(nn.Module):
@torch.jit.ignore
def debugger(self, x):
import pdb
pdb.set_trace()
def forward(self, x):
x += 10
# The compiler would normally try to compile `debugger`,
# but since it is `@ignore`d, it will be left as a call
# to Python
self.debugger(x)
return x
m = torch.jit.script(MyModule())
# Error! The call `debugger` cannot be saved since it calls into Python
m.save("m.pt")
Example (using ``@torch.jit.ignore(drop=True)`` on a method):
.. testcode::
import torch
import torch.nn as nn
class MyModule(nn.Module):
@torch.jit.ignore(drop=True)
def training_method(self, x):
import pdb
pdb.set_trace()
def forward(self, x):
if self.training:
self.training_method(x)
return x
m = torch.jit.script(MyModule())
# This is OK since `training_method` is not saved, the call is replaced
# with a `raise`.
m.save("m.pt")
.. testcleanup::
import os
os.remove('m.pt')
"""
if callable(drop):
# used without any args, so drop is actually a function
# @torch.jit.ignore
# def fn(...):
fn = drop
fn._torchscript_modifier = FunctionModifiers.IGNORE
return fn
if not isinstance(drop, bool):
raise RuntimeError("Argument to @torch.jit.ignore must be a bool or "
f"a function but got {drop}")
# for backwards compat
drop_on_export = kwargs.pop("drop_on_export", None)
if drop_on_export:
warnings.warn("ignore(drop_on_export=True) has been deprecated. TorchScript will now drop the function "
"call on compilation. Use torch.jit.unused now. {}", category=FutureWarning)
drop = drop_on_export
elif drop:
warnings.warn("ignore(True) has been deprecated. TorchScript will now drop the function "
"call on compilation. Use torch.jit.unused now. {}", category=FutureWarning)
def decorator(fn):
if drop:
fn._torchscript_modifier = FunctionModifiers.UNUSED
else:
fn._torchscript_modifier = FunctionModifiers.IGNORE
return fn
return decorator
def _copy_to_script_wrapper(fn):
fn._torchscript_modifier = FunctionModifiers.COPY_TO_SCRIPT_WRAPPER
return fn
def module_has_exports(mod):
for name in dir(mod):
if hasattr(mod, name):
item = getattr(mod, name)
if callable(item):
if get_torchscript_modifier(item) is FunctionModifiers.EXPORT:
return True
return False
# WARNING: should_drop is currently being used by our JIT code coverage plug-in to mark JIT'd code as covered. If you
# rename this function, please update references in tools/coverage_plugins_package/src/coverage_plugins/jit_plugin.py to
# allow JIT'd code to still be covered.
def should_drop(fn) -> bool:
attr = get_torchscript_modifier(fn)
if attr is None:
return False
return attr is FunctionModifiers.UNUSED
def is_ignored_fn(fn) -> bool:
mod = get_torchscript_modifier(fn)
return mod is FunctionModifiers.UNUSED or mod is FunctionModifiers.IGNORE
def is_static_fn(cls, fn) -> bool:
return isinstance(inspect.getattr_static(cls, fn, default=None), staticmethod)
def get_static_fn(cls, fn):
return inspect.getattr_static(cls, fn).__func__
def get_torchscript_modifier(fn):
if not callable(fn):
return None
if hasattr(fn, '__func__'):
fn = fn.__func__
return getattr(fn, '_torchscript_modifier', FunctionModifiers.DEFAULT)
def copy_torchscript_modifier(orig, new) -> None:
attr = get_torchscript_modifier(orig)
if attr is None:
return
new._torchscript_modifier = attr
# overloading registration
# overloads get registered in this file, and compiled in torch/jit/__init__.py
# so that they can be imported in nn/functional.py without an import cycle
# qualified_name => list[overload_functions]
_overloaded_fns : Dict[str, List[Callable]] = {} # noqa: T484
_OVERLOAD_EXAMPLE = '''
Example usage of overload function:
@torch.jit._overload
def my_function(x: type0) -> type0: # decl 1
pass
@torch.jit._overload
def my_function(x: type1) -> type1: # decl 2
pass
def my_function(x): # implementation
if isinstance(x, type0):
return x
elif isinstance(x, type1):
return x
'''
def get_overload_no_implementation_error_message(kind, obj):
sourcelines, file_lineno, filename = get_source_lines_and_file(obj)
return (
f'Implementation for the {kind} "{_qualified_name(obj)}" is missing. Please make '
f'sure a definition is provided and defined after all overload declarations.\n'
f'File "{filename}", line {file_lineno}:\n' + ''.join(sourcelines) + "\n" + _OVERLOAD_EXAMPLE
)
def _check_overload_body(func):
try:
parsed_def = parse_def(func)
except OSError as e:
# Parsing the function definition can raise an OSError if source is unavailable.
# Since this is just an initial check, just raise a warning if this is the case.
warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
return
body = parsed_def.ast.body[0].body
def is_pass(x):
return isinstance(x, ast.Pass)
def is_ellipsis(x):
return isinstance(x, ast.Expr) and isinstance(x.value, ast.Ellipsis)
if len(body) != 1 or not (is_pass(body[0]) or is_ellipsis(body[0])):
msg = "Only `pass` statement or `...` can be the body of overload declaration:\n"
msg += '\n'.join(parsed_def.source.split("\n")[:3])
msg += " <- Expecting `pass` or `...` here!\n" + _OVERLOAD_EXAMPLE
raise RuntimeError(msg)
def _overload(func):
_check_overload_body(func)
qual_name = _qualified_name(func)
global _overloaded_fns
fn_overload_list = _overloaded_fns.get(qual_name)
if fn_overload_list is None:
fn_overload_list = []
_overloaded_fns[qual_name] = fn_overload_list
fn_overload_list.append(func)
return func
def _get_fn_overloads(qual_name):
return _overloaded_fns.get(qual_name)
def _clear_fn_overloads(qual_name) -> None:
del _overloaded_fns[qual_name]
def get_class_name_lineno(method) -> Tuple[str, int]:
current_frame = inspect.currentframe()
# one for the get_class_name call, one for _overload_method call
for i in range(2):
assert current_frame is not None # assert current frame is not an Optional[FrameType]
current_frame = current_frame.f_back
assert current_frame is not None # same here
class_name = current_frame.f_code.co_name
line_no = current_frame.f_code.co_firstlineno
return class_name, line_no
# At the the point the decorator is applied to class methods the method
# has no reference to its owning class. _qualified_name would not include
# the class it is defined in, so any methods with the same name in the same file
# would have the same _qualified_name, even if they were defined in different
# classes. This problem only exists in python 2.
# We get around this problem by looking at the stack frame and identifying
# the class name, and throwing an error whenever overloads are used
# when modules of the same name are in the same file
# qualified_name => class name => list[overload_functions]
_overloaded_methods : Dict[str, Dict[str, List[Callable]]] = {} # noqa: T484
# (qualified_name, class name) => class_fileno
_overloaded_method_class_fileno = {}
def _overload_method(func):
_check_overload_body(func)
qual_name = _qualified_name(func)
global _overloaded_methods
class_name_map = _overloaded_methods.get(qual_name, None)
if class_name_map is None:
class_name_map = {}
_overloaded_methods[qual_name] = class_name_map
class_name, line_no = get_class_name_lineno(func)
method_overloads = class_name_map.get(class_name, None)
if method_overloads is None:
method_overloads = []
class_name_map[class_name] = method_overloads
_overloaded_method_class_fileno[(qual_name, class_name)] = line_no
else:
existing_lineno = _overloaded_method_class_fileno[(qual_name, class_name)]
if existing_lineno != line_no:
raise RuntimeError("Cannot currently overload the same method name in two different"
" classes with the same name in the same module")
method_overloads.append(func)
return func
def _get_overloaded_methods(method, mod_class):
# TODO: __name__ not set for submodules in recursive script
if not hasattr(method, "__name__"):
return None
qual_name = _qualified_name(method)
class_name_map = _overloaded_methods.get(qual_name, None)
if class_name_map is None:
return None
overloads = class_name_map.get(mod_class.__name__, None)
if overloads is None:
return None
method_line_no = get_source_lines_and_file(method)[1]
mod_class_fileno = get_source_lines_and_file(mod_class)[1]
mod_end_fileno = mod_class_fileno + len(get_source_lines_and_file(mod_class)[0])
if not (method_line_no >= mod_class_fileno and method_line_no <= mod_end_fileno):
raise Exception("Overloads are not useable when a module is redeclared within the same file: " + str(method))
return overloads
def is_tuple(ann) -> bool:
if ann is Tuple:
raise_error_container_parameter_missing("Tuple")
# For some reason Python 3.7 violates the Type[A, B].__origin__ == Type rule
if not hasattr(ann, '__module__'):
return False
return ann.__module__ == 'typing' and \
(getattr(ann, '__origin__', None) is Tuple or
getattr(ann, '__origin__', None) is tuple)
def is_list(ann) -> bool:
if ann is List:
raise_error_container_parameter_missing("List")
if not hasattr(ann, '__module__'):
return False
return ann.__module__ == 'typing' and \
(getattr(ann, '__origin__', None) is List or
getattr(ann, '__origin__', None) is list)
def is_dict(ann) -> bool:
if ann is Dict:
raise_error_container_parameter_missing("Dict")
if not hasattr(ann, '__module__'):
return False
return ann.__module__ == 'typing' and \
(getattr(ann, '__origin__', None) is Dict or
getattr(ann, '__origin__', None) is dict)
def is_union(ann):
if ann is Union:
raise_error_container_parameter_missing("Union")
return (hasattr(ann, '__module__') and
ann.__module__ == 'typing' and
(getattr(ann, '__origin__', None) is Union))
def is_optional(ann):
if ann is Optional:
raise_error_container_parameter_missing("Optional")
def is_optional_as_optional(ann):
return (hasattr(ann, '__module__') and
ann.__module__ == 'typing' and
(getattr(ann, '__origin__', None) is Optional))
def is_union_as_optional(ann):
ann_args = ann.__args__
return len(ann_args) == 2 and None in ann_args
return is_optional_as_optional(ann) or (is_union(ann) and is_union_as_optional(ann))
def is_future(ann) -> bool:
if ann is Future:
raise RuntimeError(
"Attempted to use Future without a "
"contained type. Please add a contained type, e.g. "
"Future[int]"
)
return getattr(ann, "__origin__", None) is Future
if torch.distributed.rpc.is_available():
from torch.distributed.rpc import RRef
from torch._C._distributed_rpc import PyRRef
def is_rref(ann) -> bool:
if ann is RRef:
raise RuntimeError(
"Attempted to use RRef without a "
"contained type. Please add a contained type, e.g. "
"RRef[int]"
)
return getattr(ann, "__origin__", None) is RRef
def is_rref_instance(obj) -> bool:
return isinstance(obj, PyRRef)
else:
def is_rref_instance(obj) -> bool:
# If the RPC module doesn't exist then RRefs don't exist either.
return False
def is_final(ann) -> bool:
return ann.__module__ in {'typing', 'typing_extensions'} and \
(getattr(ann, '__origin__', None) is Final or isinstance(ann, type(Final)))
# allows BroadcastingList instance to be subscriptable
class BroadcastingListCls(object):
def __getitem__(self, types):
return
# mypy doesn't support parameters on types, so we have to explicitly type each
# list size
BroadcastingList1 = BroadcastingListCls()
for i in range(2, 7):
globals()[f"BroadcastingList{i}"] = BroadcastingList1
[docs]def is_scripting() -> bool:
r"""
Function that returns True when in compilation and False otherwise. This
is useful especially with the @unused decorator to leave code in your
model that is not yet TorchScript compatible.
.. testcode::
import torch
@torch.jit.unused
def unsupported_linear_op(x):
return x
def linear(x):
if torch.jit.is_scripting():
return torch.linear(x)
else:
return unsupported_linear_op(x)
"""
return False
# Retrieves a fully-qualified name (module hierarchy + classname) for a given obj.
def _qualified_name(obj) -> str:
# This special case allows us to override the qualified name on a type.
# It's currently used in conjunction with tracing, where we create a
# fake module to filter only supported attributes. However, since this
# new type is defined as a local class, we need a mechanism to override
# its qualname so it appears correctly in the TorchScript system. This,
# we set '_jit_override_qualname' with the original traced module's
# qualified name, which is picked up here
if hasattr(obj, '_jit_override_qualname'):
return obj._jit_override_qualname
# short-circuit in cases where the object already has a known qualified name
if isinstance(obj, torch._C.ScriptFunction):
return obj.qualified_name
if getattr(obj, "__name__", None):
name = obj.__name__
# Enum classes do not have `__name__` attr, instead they have `name`.
elif isinstance(obj, enum.Enum):
name = obj.name
else:
raise RuntimeError("Could not get name of python class object")
if name == '<lambda>':
name = '_lambda' # make name a valid identifier
module_name = obj.__module__
# If the module is actually a torchbind module, then we should short circuit
if module_name == "torch._classes":
return obj.qualified_name
# The Python docs are very clear that `__module__` can be None, but I can't
# figure out when it actually would be.
if module_name is None:
raise RuntimeError(f"Could not get qualified name for class '{name}': "
"__module__ can't be None.")
# if getattr(sys.modules[module_name], name) is not obj:
# raise RuntimeError(f"Could not get qualified name for class '{name}': "
# f"the attr {name} on module {module_name} is not the the class")
# torch.package and TorchScript have separate mangling schemes to avoid
# name collisions from multiple packages. To avoid them interfering with
# each other, remove the package mangling here.
module_name = package_mangling.demangle(module_name)
# __main__ is a builtin module, so rewrite it to "__torch__".
if module_name == "__main__":
module_name = "__torch__"
else:
# Everything else gets a "__torch__" prefix to avoid name collisions
# with the names of user values.
module_name = "__torch__." + module_name
if "." in name:
raise RuntimeError(f"Could not get qualified name for class '{name}': "
f"'{name}' is not a valid identifier")
return module_name + "." + name
def _try_get_dispatched_fn(fn):
if not callable(fn):
return None
return boolean_dispatched.get(fn)
def _get_named_tuple_properties(obj):
assert issubclass(obj, tuple) and hasattr(obj, '_fields')
if hasattr(obj, "_field_defaults"):
defaults = [obj._field_defaults[field]
for field in obj._fields
if field in obj._field_defaults]
else:
defaults = []
annotations = []
has_annotations = hasattr(obj, '__annotations__')
for field in obj._fields:
if has_annotations and field in obj.__annotations__:
the_type = torch.jit.annotations.ann_to_type(obj.__annotations__[field], fake_range())
annotations.append(the_type)
else:
annotations.append(torch._C.TensorType.getInferred())
return type(obj).__name__, obj._fields, annotations, defaults
def _create_named_tuple(t, unqual_name: str, field_names: List[str], defaults: Tuple[Any, ...]):
# mypy: namedtuple() expects a string literal as the first argument
if sys.version_info < (3, 7, 0):
TupleType = collections.namedtuple(unqual_name, field_names) # type: ignore[no-redef, misc]
TupleType.__new__.__defaults__ = defaults # type: ignore[attr-defined]
else:
TupleType = collections.namedtuple(unqual_name, field_names, defaults=defaults) # type: ignore[call-arg, no-redef, misc]
return TupleType(*t)
@contextlib.contextmanager
def _disable_emit_hooks():
hooks = torch._C._jit_get_emit_hooks()
torch._C._jit_set_emit_hooks(None, None)
yield
torch._C._jit_set_emit_hooks(hooks[0], hooks[1])
def _disable_emit_hooks_decorator(_DecoratorContextManager) -> None: # noqa: F811
def __enter__(self) -> None:
self.hooks = torch._C._jit_get_emit_hooks()
torch._C._jit_set_emit_hooks(None, None)
def __exit__(self, *args) -> None:
torch._C._jit_set_emit_hooks(self.hooks[0], self.hooks[1])
def _is_exception(obj) -> bool:
if not inspect.isclass(obj):
return False
return issubclass(obj, Exception)
def raise_error_container_parameter_missing(target_type) -> None:
if target_type == 'Dict':
raise RuntimeError(
"Attempted to use Dict without "
"contained types. Please add contained type, e.g. "
"Dict[int, int]"
)
raise RuntimeError(
f"Attempted to use {target_type} without a "
"contained type. Please add a contained type, e.g. "
f"{target_type}[int]"
)
def get_origin(target_type):
return getattr(target_type, "__origin__", None)
def get_args(target_type):
return getattr(target_type, "__args__", None)
def check_args_exist(target_type) -> None:
if target_type is List or target_type is list:
raise_error_container_parameter_missing("List")
elif target_type is Tuple or target_type is tuple:
raise_error_container_parameter_missing("Tuple")
elif target_type is Dict or target_type is dict:
raise_error_container_parameter_missing("Dict")
elif target_type is None or target_type is Optional:
raise_error_container_parameter_missing("Optional")
def check_empty_containers(obj) -> None:
if obj == [] or obj == {} or obj == ():
warnings.warn("The inner type of a container is lost when "
"calling torch.jit.isinstance in eager mode. For "
"example, List[int] would become list and "
"therefore falsely return True for List[float] or"
" List[str].")
# supports List/Dict/Tuple and Optional types
# TODO support future
def container_checker(obj, target_type) -> bool:
origin_type = get_origin(target_type)
check_args_exist(target_type)
if origin_type is list or origin_type is List:
check_empty_containers(obj)
if not isinstance(obj, list):
return False
arg_type = get_args(target_type)[0]
arg_origin = get_origin(arg_type)
for el in obj:
# check if nested container, ex: List[List[str]]
if arg_origin: # processes nested container, ex: List[List[str]]
if not container_checker(el, arg_type):
return False
elif not isinstance(el, arg_type):
return False
return True
elif origin_type is Dict or origin_type is dict:
check_empty_containers(obj)
if not isinstance(obj, dict):
return False
key_type = get_args(target_type)[0]
val_type = get_args(target_type)[1]
for key, val in obj.items():
# check if keys are of right type
if not isinstance(key, key_type):
return False
val_origin = get_origin(val_type)
if val_origin:
if not container_checker(val, val_type):
return False
elif not isinstance(val, val_type):
return False
return True
elif origin_type is Tuple or origin_type is tuple:
check_empty_containers(obj)
if not isinstance(obj, tuple):
return False
arg_types = get_args(target_type)
if len(obj) != len(arg_types):
return False
for el, el_type in zip(obj, arg_types):
el_origin = get_origin(el_type)
if el_origin:
if not container_checker(el, el_type):
return False
elif not isinstance(el, el_type):
return False
return True
elif origin_type is Union: # also handles Optional
if obj is None: # check before recursion because None is always fine
return True
inner_types = get_args(target_type)
for t in inner_types:
t_origin = get_origin(t)
if (t_origin):
return container_checker(obj, t)
elif isinstance(obj, t):
return True
return False
def _isinstance(obj, target_type) -> bool:
if isinstance(target_type, collections.abc.Container):
if not isinstance(target_type, tuple):
raise RuntimeError("The second argument to "
"`torch.jit.isinstance` must be a type "
"or a tuple of types")
for t_type in target_type:
if _isinstance(obj, t_type):
return True
return False
origin_type = get_origin(target_type)
if origin_type:
return container_checker(obj, target_type)
# Check to handle weird python type behaviors
# 1. python 3.6 returns None for origin of containers without
# contained type (intead of returning outer container type)
# 2. non-typed optional origin returns as none instead
# of as optional in 3.6-3.8
check_args_exist(target_type)
# handle non-containers
return isinstance(obj, target_type)
class _TensorExtractor(pickle.Pickler):
def __init__(self, *args, tensors: List[torch.Tensor], **kwargs):
super().__init__(*args, **kwargs)
self.tensors = tensors
def persistent_id(self, obj):
if isinstance(obj, torch.Tensor):
self.tensors.append(obj)
return ""
# Since we just want to extract tensors, we don't mind if an object is
# unpicklable if it doesn't contain tensors, as we can just ignore/skip
# it. To play it safe, we only do so for common objects that we're sure
# don't contain tensors. Feel free to add new types here. Note also that
# even if a type isn't listed here this won't block users, since thet
# can just add a __getstate__ or __reduce__ method to their class.
if isinstance(obj, LockType):
return ""
# Futures and RRefs don't technically contain a value, they just offer
# the means to access a value.
if isinstance(obj, CFuture) or is_rref_instance(obj):
return ""
if isinstance(obj, torch.cuda.Event):
return ""
return None
def _extract_tensors(obj):
r"""
This function is exclusively called from C++.
See ``torch/csrc/jit/python/python_ivalue.h``.
It extracts the tensors contained in the given object, through pickling.
"""
tensors: List[torch.Tensor] = []
extractor = _TensorExtractor(io.BytesIO(), protocol=-1, tensors=tensors)
extractor.dump(obj)
return tensors


---
layout: post
title: moving on with the momentum from the last batch i
date: '2011-05-25T21:55:00+02:00'
tags:
- kitchen
- bread
tumblr_url: http://dotmr.tumblr.com/post/5852590187/moving-on-with-the-momentum-from-the-last-batch-i
---
Moving on with the momentum from the last batch I baked another loaf right away. I’m disappointed with the flavor of the last loaf - sort of bland. Crust turned out well though. This loaf I let proof for what amounted to 3 hours, which was too long. You can see the loaf kind of fell.
I changed the bake time a bit in response to the super-crustiness of the last loaf. this one was baked for 15 minutes @ 475, then 20 minutes @ 425 and another 15 minutes with the oven off. The inside came out a bit moist though. It needed to be baked for longer.


Welcome to My Blog!
21 Oct 2015
Tools and blogs for entrepreneurs
List of awesome tools and blogs for development applications
14 Oct 2015
Hello World
Awesome
Hello there! Let’s start with Git’s Blog :)


Simple Kafka | Example
Chat
A simple site for posting message to kafka
Text
Search
Email
URL
Telephone
Password
Number
Date and time
Date
Month
Week
Time
PUSH!


Count with ajax auto
Count with ajax, button handler
Count with ajax, button handler and refresh
Count with ajax, cached data
Count with ajax, cached data with button refresh


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @(field: Field, radioOptions: Seq[(String, String)], hints: Map[String, String], hintHtml: Option[Html], args: (Symbol, Any)*)(implicit messages: Messages, formInstance: Option[Form[_]] = None) @import play.api.i18n._ @import views.html.helper._ @elements = @{ FieldElements(field.id, field, Html(""), args.toMap, messages) } @isLegendH1 = @{ elements.args.getOrElse('_isLegendH1, false).asInstanceOf[Boolean] } @legend = @{ elements.args.getOrElse('_legend, "").asInstanceOf[String] } @hasHint = @{ elements.args.contains('_hintText) } @hintId = @{ if(hasHint) s"${field.id}-hint" else "" } @hasHintHtml = @{ hintHtml.isDefined } @hintHtmlId = @{ if(hasHintHtml) s"${field.id}-hintHtml" else "" } @hasErrors = @{ elements.hasErrors } @errorId = @{ if(hasErrors) s"${field.id}-error" else "" } @describedBy = @{ Seq(hintId, hintHtmlId, errorId).filterNot(_.isEmpty).mkString(" ") }


HOME
INSTRUMENTATION
GENOMICS
Next-Generation Sequencing (NGS)
NGS Library Prep
Affymetrix Microarray
Nanostring nCounter
Sanger DNA Sequencing
PROTEOMICS
MALDI-TOF MS
LC-MS/MS
Amino Acid Analysis
Peptide Synthesis
Biacore 3000
ADVANCED TECHNOLOGIES
PEOPLE
LOCATIONS
NEWS
Toggle navigation
Sidebar menu
SERVICE REQUEST GUIDE
DFCI iLAB
iLab Login
Create an iLab Account
MBCF DNALIMS
dnaLIMS Login
Create a dnaLIMS Account
MBCF DATA SERVER
MICROARRAY DATA
ACKNOWLEDGING THE CORES


For AJAX lightboxes, the href should be the link to the page to be displayed,
followed by a hash ID (like the default lightbox). i.e. clicking a lightbox link with the href http://skyglobal.github.io/webtoolkit#!toolkit/show
would AJAX in the page http://skyglobal.github.io/webtoolkit
and give the lightbox the ID toolkit-show
.


THE PEACEMAKER
RATING: *** (out of ****)
Dreamworks SKG / 2:02 / 1997 / R (violence, profanity) Cast: George Clooney; Nicole Kidman; Marcel Iures; Gary Werntz; Holt McCallany; Rene Medvesek; Alexander Baluev; Michael Boatman; Armin Mueller-Stahl Director: Mimi Leder Screenplay: Michael Schiffer
Dreamworks SKG, the high-profile collaborative production team of Steven Spielberg, Jeffery Katzenberg and David Geffen, gets off on the right filmmaking foot with "The Peacemaker." A big, dumb, loud adventure that combines enough tawdry foreign intrigue for 14 James Bond flicks with sparkling star power and enthralling visuals, "The Peacemaker" isn't a particularly strong genre entry, but even its weaknesses don't hinder it from being an entertaining lark.
The only big names in the cast belong to the two leads: Current Batman George Clooney and ex-Batman flame Nicole Kidman. The latter plays Dr. Julia Kelly, a top presidential aid and the acting head of the White House's Nuclear Smuggling Group. Kelly becomes embroiled in an important investigation surrounding the theft of 10 nuclear missiles from a speeding train by Russian terrorists. When one is "accidentally" set off, an entire Middle Eastern countryside is vaporized.
Enter Clooney's gung-ho Colonel Thomas Devoe, who fast becomes Kelly's unlikely ally as they trot around the globe and try to keep track of the missiles throughout various trade-offs and other shifty dealings. It turns out that a potential buyer (Marcel Iures) has vengeance on his mind and would very much like to use one to annihilate the area surrounding our United Nations building, where a treaty is going to be signed involving the very governments he holds responsible for the murder of his wife and child.
When it devotes its time to action movie dynamics, the movie is a great deal of fun. Exhilarating sequences abound -- there's a spectacular round of bumper cars between Devoe and the bad guys in Vienna's exotic locale, as well as a literal bridge-hanger where he attempts to secure some of the remaining nukes. After the faulty send-offs of "Air Force One" and "G.I. Jane," it's refreshing to see "The Peacemaker" save some of its most riveting moments for its climax -- a suspenseful (if over-the-top) chase through New York City, culminating in one of the most effective explosion-countdowns ever put to film.
However, if "The Peacemaker" needs a pacemaker, it's in the plot area. It's a good thing the heros have engaging demeanors, because Iures' villain is about as interesting as burnt toast. The attempts to develop a sympathetic character out of him are dull and ordinary, and as a result, he's low on personality, a big no-no for this type of film. Also disconcerting is "The Peacemaker"'s rather dull setup of events. Only when Clooney and Kidman enter the frame does the movie ever become involving, making the opening segments something of an uncomfortable sit.
Speaking of the performers, they really carry "The Peacemaker" to memorable lengths. With a great turn here, Clooney proves he can carry a dramatic adventure as well as a horror film ("From Dusk Till Dawn"), a comic book adaptation ("Batman & Robin") or a romantic comedy ("One Fine Day"). He's a very agreeable actor, and even gets numerous chances to crack wise amidst the explosions and mass death.  The most beautiful woman working in movies today, Kidman even looks flawless covered in sweat and caked in mud. Also of note is Mimi Leder, whose you-are-there, Emmy-winning directing prowess on "ER" serves her work here well. Maybe filming gurneys and doctors in constant motion is good preparation for an action film.
While "The Peacemaker" fumbles occasionally (more so in its first half), it's always diverting and never unwatchable. Almost every movie has its flaws, and although "The Peacemaker" is never an exception to that rule, it's certainly something special to see a film with enough notable merits to outweigh and overpower its drawbacks.
© 1997 Jamie Peck E-mail<EMAIL_ADDRESS>Visit the Reel Deal Online: http://www.gl.umbc.edu/~jpeck1/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


ConfigurationManager
class ConfigurationManager
-
Get an Alert Notification service configuration by service name
Declaration
Swift
public func getAlertNotificationService(name: String) throws -> AlertNotificationService
Parameters
name
The name of the Alert Notification service
-
Get an AppID service configuration by service name
Declaration
Swift
public func getAppIDService(name: String) throws -> AppIDService
Parameters
name
The name of the AppID service
-
Get an Auto Scaling service configuration by service name
Declaration
Swift
public func getAutoScalingService(name: String) throws -> AutoScalingService
Parameters
name
The name of the Auto Scaling service
-
Get a DB2 service configuration by service name
Declaration
Swift
public func getDB2Service(name: String) throws -> DB2Service
Parameters
name
The name of the DB2 service
-
Get a Cloudant service configuration by service name
Declaration
Swift
public func getCloudantService(name: String) throws -> CloudantService
Parameters
name
The name of the Cloudant service
-
Get a MongoDB service configuration by service name
Declaration
Swift
public func getMongoDBService(name: String) throws -> MongoDBService
Parameters
name
The name of the MongoDB service
-
Get a MySQL service configuration by service name
Declaration
Swift
public func getMySQLService(name: String) throws -> MySQLService
Parameters
name
The name of the MySQL service
-
Get an Object Storage service configuration by service name
Declaration
Swift
public func getObjectStorageService(name: String) throws -> ObjectStorageService
Parameters
name
The name of the Object Storage service
-
Get a PostgreSQL service configuration by service name
Declaration
Swift
public func getPostgreSQLService(name: String) throws -> PostgreSQLService
Parameters
name
The name of the PostgreSQL service
-
Get a Redis service configuration by service name
Declaration
Swift
public func getRedisService(name: String) throws -> RedisService
Parameters
name
The name of the Redis service


bower
A package manager optimized for front-end web development.
A package can be a GitHub user/repo shorthand, a Git endpoint, a URL or a registered package.
More information: home page
- Install a project's dependencies, listed in its bower.json:
bower install
- Install one or more packages to the bower_components directory:
bower install package package
- Uninstall packages locally from the bower_components directory:
bower uninstall package package
- List local packages and possible updates:
bower list
- Display help information about a bower command:
bower help command
- Create a `bower.json` file for your package:
bower init
- Install a specific dependency version, and add it to `bower.json`:
bower install local_name=package#version --save


SWITCHBACK
RATING: *1/2 (out of ****)
Paramount / 2:02 / 1997 / R (violence, language, nudie pics) Cast: Dennis Quaid; Danny Glover; Jared Leto; R. Lee Ermey; Ted Levine; William Fichtner Director: Jeb Stuart Screenplay: Jeb Stuart
This season needs another serial killer movie like Kathie Lee Gifford needs more public devastation. But lo and behold, here comes "SwitchBack," and fast on the heels of such stalker fare as "Kiss the Girls" and "I Know What You Did Last Summer." But "SwitchBack" is an undoubtedly weak genre entry, as the material it covers is old and tired, and the filmmakers rarely sustain enough energy to make any of the proceedings interesting.
"SwitchBack" opens with the murder of a babysitter and the abduction of the young child she's watching. We learn late in the game that the kid belongs to FBI agent Frank LaCrosse (Dennis Quaid), and that the kidnapper/killer is a nameless fiend that LaCrosse has been tracking across the country for quite a while. He is promptly removed from the case, but this conflict of interest doesn't keep him from offering pursuit. LaCrosse's most recent trek takes him to a blood-soaked hotel room in Amarillo, Texas, where the local sheriff (R. Lee Ermey) is torn between his re-election campaign and helping his new ally catch his man.
In a related aside, former railway worker Bob Goodall (Danny Glover) is cruising through the snowbound west in his pinup-plastered (even on the seatbelts) El Dorado. Along the way, he picks up -- and subsequently saves the life of -- hitchhiking loner Lane Dixon (Jared Leto). This tangent isn't a random one, as Bob or Lane will end up either holding a piece of the puzzle or turn out to be the killer himself. Or is the villain in fact LaCrosse, only pretending to be after the cold-hearted murderer he knows so much about.
In a sense, that's half of the basic problem with "SwitchBack." For its first hour, the movie presents evidence that any of these three men could be the perpetrator, so we're given little insight into who they are, likely for fear that we'll learn too much too fast and therefore be able to make the proper deduction. But "SwitchBack" then decides to explicitly reveal the killer's identity at its midpoint, and the following contradictory character motivations muddle both the pacing and the generation of suspense.
Some of the acting is a burdensome area as well, probably because the performers were instructed to build personas that are the exact opposite of their true selves. What is Danny Glover doing here, grinning and yeehawing his way through the messy plot? And Dennis Quaid? (That monotone -- stop it!) Ermey is solid in a supporting role that's more interesting than the two leads thrown together, but the charismatic Leto (Claire Danes' object of affection in "My So-Called Life") is a scene-stealer tried and true.
>From a material standpoint, "SwitchBack" is pretty empty. But even when first-time director Jeb Stuart (who wrote "The Fugitive" and "Die Hard") doesn't know what to do, he knows what he wants it to look like -- the movie provides some great visuals. The set-on-a-train climax looks good (even though the action is illogical), and the beautiful, crisp cinematography captures the Rockies in all of their icy splendor. Still, that's not enough to turn a lump of coal into a diamond, and more than the movie's look will end up leaving you cold.
© 1997 Jamie Peck E-mail<EMAIL_ADDRESS>Visit the Reel Deal Online: http://www.gl.umbc.edu/~jpeck1
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Perfidies Plugindir Tester
Input
plugindir server:
Dev Haskwhal
Staging
Production
Original
Version Available
or
Back to the Debug page
Output
Status:


An evidence-based tool to showcase the efficacy of different design components for HBC in ST.
Go to PAST tool
A standarized framework to evaluate ST technology for sustained
UE.
The PAST component analyzes 117 articles from 2008 to 2020 to identify the most effective persuasive techniques for increasing physical activity across cohort, sample size, and experiment duration, in an effort to facilitate self-tracking technology design. Please adjust the weights and filtering options according to your application’s needs.
Efficacy Weight: {{ weight1 }}
Frequency Weight: {{ weight2 }}
Loading ...
The SELF component extracts all reported metrics from related work in the field of self-tracking technology for health behavior change focusing on physical activity, and organizes them under four aspects of ubiquitous User Engagement (UE), in an effort to facilitate self-tracking technology evaluation..
The Perceived Self Aspect of UE refers to the user’s self-reported image of their life regarding their everyday experiences, as well as psychological, technological, social, and health factors, and is usually measured through qualitative evaluation methods.
The Physical Self Aspect of UE refers to the user’s physical
reaction to the interaction with system, which in ST technology
can be for example interpreted as the PA performed in response to
the system’s intervention. Thus, it includes all PA-related
quantities from the investigated articles.
The Behavioral Self Aspect of UE refers to the user’s behavioral
response to the system, which in ST takes the form of UE metrics,
such as wear-time, and session duration.
The Environmental Aspect of UE refers to external factors that may
affect the user’s interaction with the system, such as weather or
location. Hence, we identified and incorporated in this aspect all
metadata reported in the investigated articles.


Phylogenetic trees of gene families are an essential tool for determining and understanding the functional roles of newly sequenced genes or interpreting reads from large metagenomic samples. Phylogenetic gene trees are typically constructed from protein sequence alignments. The KBase Tree service provides a set of functions to find, manipulate, and visualize phylogenetic trees and multiple sequence alignments. Additionally, the service provides a growing library of methods for analyzing data from metagenomic samples in the context of isolate gene trees.
Trees in KBase are stored by default in Newick format, which is a succinct, text-based format for representing tree structures. Richer meta data associated with particular trees or nodes is stored directly in the CDM so that it is more amenable to search. Most phylogenetic trees are constructed from sequence alignments. When associated alignment data is available, KBase will store the relationship between trees and their alignments in the relationship named 'IsUsedToBuildTree'.
All of the tree service commands provide useful help and usage information if they are run with the '-h' or '--help' options, which may be useful throughout the tutorial. You can also use the autocompletion featue of your command line enviornment to list the available tree commands. On a Linux or Mac environment, simply type 'tree-' followed by tab. In the IRIS environment, type 'tree-' followed by the right arrow key.
KBase has built a large library of precomputed protein sequece alignments and gene trees based on the genomic sequences stored in KBase. The trees and alignments range from large superfamilies with thousands of genes to small trees of a few related genes with conserved sequence but perhaps no known function./
The first step, therefore, is to identifiy the set of trees and alignments that include your gene of interest. If you know the KBase feature ID of a particular gene, you can quickly identify trees that contain your gene of interest using the 'tree-find-tree-ids' command:
> tree-find-tree-ids -f 'kb|g.1870.peg.3915' kb|tree.11259 kb|tree.11314 kb|tree.1242 kb|tree.1639 kb|tree.1640 kb|tree.23396 kb|tree.28891 ....
Calling this command with the '-f' flag indicates that you want to find trees based on a KBase feature ID. If any trees are found, then a list of the trees is displayed in the console. Similarly, we can find the set of alignments that align this gene by calling the 'tree-find-alignment-ids' command:
> tree-find-alignment-ids -f 'kb|g.1870.peg.3915' kb|aln.11259 kb|aln.11314 kb|aln.1242 kb|aln.1639 kb|aln.1640 kb|aln.23396 kb|aln.28891 ....
Although in many cases the alignment id numbers appear to match up with the tree id numbers, as they do here, it is not always safe to make this assumption as multiple trees can be generated from the same alignment.
You can also find trees directly from protein sequence MD5 identifiers, which are also used in KBase as unique protein sequence IDs. You can retrieve the protein sequence MD5 of any protein encoding feature in KBase with the 'fids_to_proteins' command. With a protein sequence MD5, you can then find trees with the 'tree-find-tree-ids' by using the '-p' flag:
> echo 'kb|g.1870.peg.3915' | fids_to_proteins kb|g.1870.peg.3915 ef341e0061e3f93c9c7468f6d9d09ba0 > tree-find-tree-ids -p 'ef341e0061e3f93c9c7468f6d9d09ba0' kb|tree.11259 kb|tree.11314 kb|tree.1242 ....
Additionally, you can search for trees that are based on a particular gene family. A number of gene family models have been used to generate trees, including COG and PFAM. For instance, to search for a specific gene family by name, you can also use the the 'tree-find-tree-ids' with the '-s' options:
> tree-find-tree-ids -s 'COG840' kb|tree.991753 COG840
The '-s' option is flexible since it supports the use of a two wildcard characters to help you search when you aren't entirely sure what the exact ID is. Using an '*' symbol matches any character any number of times. The '.' symbol matches any character exactly once. For instance, to find all trees from gene families with an ID that starts with 'COG' but ends with '840', search with the pattern 'COG*840':
> tree-find-tree-ids -s 'COG*840' kb|tree.987836 COG1840 kb|tree.988589 COG2840 kb|tree.989663 COG3840 kb|tree.990590 COG4840 kb|tree.991753 COG840
After you have identified a list of potential trees to work with, you can query KBase for additional information about each tree using the 'tree-get-tree' command. The simplist usage is to pass a single tree as an argument with the '-m' flag to indicate that meta data should be returned instead of the actual tree.
> tree-get-tree 'kb|tree.991753' -m [tree_id]: kb|tree.991753 [source_id]: COG840 [tree_contruction_method]: FastTree2 [source_db]: MOL:Tree [status]: active [tree_protocol]: MO Pipeline [date_created]:<PHONE_NUMBER> [leaf_count]: 28931 [node_count]: 52017 [tree_construction_parameters]: -fastest [alignment_id]: kb|aln.991753 [type]: sequence_alignment
Like many scripts in KBase, the 'tree-get-tree' command can also accept input through standard-in. This behaviour allows you to chain together commands to construct more complex queries. For instance, to get all meta-data about the trees that include our favorite KBase feature, string together the following commands:
> tree-find-tree-ids -f 'kb|g.1870.peg.3915' | tree-get-tree -m [tree_id]: kb|tree.11259 [source_id]: tree00011265 [tree_contruction_method]: FastTree 2.1.2 SSE3 [source_db]: SEED [status]: active [tree_protocol]: Sequences were identified with PSI-BLAST, trimmed to PSI-BLAST profile, aligned and treed [date_created]:<PHONE_NUMBER> [leaf_count]: 9605 [node_count]: 18203 [tree_construction_parameters]: --spr 4 -cat 20 [alignment_id]: kb|aln.11259 [type]: sequence_alignment [tree_id]: kb|tree.11314 [source_id]: tree00011320 [tree_contruction_method]: FastTree 2.1.2 SSE3 [source_db]: SEED [status]: active [tree_protocol]: Sequences were identified with PSI-BLAST, trimmed to PSI-BLAST profile, aligned and treed [date_created]:<PHONE_NUMBER> [leaf_count]: 12180 [node_count]: 23764 [tree_construction_parameters]: --spr 4 -cat 20 [alignment_id]: kb|aln.11314 [type]: sequence_alignment ....
Powerfully, this command can then be chaned to standard command line tools like 'grep' to retrieve exactly the information you are interested in. For instance, if you only care about how many leaf nodes are in the tree and the source database of the tree, you can execute a query with this command:
> tree-find-tree-ids -f 'kb|g.1870.peg.3915' | tree-get-tree -m | grep 'tree_id\|leaf_count\|source_db' [tree_id]: kb|tree.11259 [source_db]: SEED [leaf_count]: 9605 .... [source_db]: MOL:Tree [leaf_count]: 26227 [tree_id]: kb|tree.993312 [source_db]: MOL:Tree [leaf_count]: 51082 ....
The same approach can be used to retrieve details about a set of alignments:
> tree-find-alignment-ids -f 'kb|g.1870.peg.3915' | tree-get-alignment -m | \ grep 'alignment_id\|alignment_construction_method' [alignment_id]: kb|aln.11259 [alignment_construction_method]: MAFFT v6.818b [alignment_id]: kb|aln.11314 [alignment_construction_method]: MAFFT v6.818b .... [alignment_id]: kb|aln.28891 [alignment_construction_method]: RPS-BLAST [alignment_id]: kb|aln.30419 [alignment_construction_method]: HMMER3 [alignment_id]: kb|aln.30458 [alignment_construction_method]: HMMER3 [alignment_id]: kb|aln.32629 ....
With the same 'get-tree' and 'get-alignment' commands, you can retrieve the actual tree structure in newick format or the actual alignment in fasta format. Run the same command, but omit the '-m' option:
> tree-get-tree 'kb|tree.991753' (((((20604894_1_491_700:0.6297,((17850078_1_500_699:0.05393,20109977_1_501_700:0.0718)0:0.03445, (19471596_1_492_701:1.54275,20480750_1_492_701:0.00541)0.959:1.10426)1:0.83977)0.993:0.99986,(19 514631_1_3_290:1.12331,20800851_1_1_97:3.85784)0.733:1.55142)0.32:0.11495,6396335_1_23_358:2.704 04)0.854:0.32054,(((((8501581_1_263_414:0,20544729_1_221_372:0):1.31674,13411475_1_261_406:1.287 29)0.622:0.38827,((2636527_1_236_543:0,13325328_1_140_447:0,13333732_1_182_489:0):2.45305,((7281 613_1_33_184:0.00016,(3178202_1_194_390:0,13792085_1_179_375:0):0.60306)0.687:0.71617,((20720986 .... > tree-get-alignment 'kb|aln.991753' >100153_1_279_577 ------------------------------------------------------------------------------------VDAVNQIAQ ... >100162_1_219_588 ---------AYMGRLAEGDYSQEPPMRERKDEVGEMAAAVSVFRAAAIERRQAVQLEKDR----EAAAREEAFVAAEAEARGRRSFVVDALDE ... >10122599_1_5_300 --------------------------------------------------------------------------------------------- ... >10122879_1_680_1064 --------------------------RKRQEAINAELEAINRRLEAEMRHAAEAEREKRRALEEAAEHDRRAREQLQQQQQEYLEQSVLRILE ... >10124179_1_205_610 SVVRPVQELEAAAYRISEGDLETTVAVRTEDEVGKLARAFNQMVASMREALDA-----LQEEKAGAEQKVREAVAEIQAQQRYLAESVEHMLT ... ....
Trees and alignments in KBase are stored with each leaf node or alignment row labeled by an ID that is unique only within the given tree or alignment. This is necessary because some leaves in a tree may be mapped to different regions of a single protein sequence, while in other cases a single leaf maybe representative of a set of concatenated protein sequences. Therefore node labels will not directly map to protein or feature IDs in KBase.
For gene trees built from protein sequence alignments that have only a single KBase protein sequence per alignment row, it is possible to retrieve a tree or an alignment with node labels replaced with KBase protein sequence identifiers.
> tree-get-tree -p 'kb|tree.991753' (((((32079382d2a3f6f5f2988f97233c92cd:0.6297,((edf756abf2c4186fc34a9c94de377d20:0.05393,5babb472e d7ae9399f8f5103f51b91ee:0.0718)0:0.03445,(d6369e4d35cdbd6ddf1116d311fd7a59:1.54275,ef323273867b73 b39ab5fedae251f47f:0.00541)0.959:1.10426)1:0.83977)0.993:0.99986,(49cdbb61b099a7cae3b4fc46dd34f44 b:1.12331,98b5ce0f9772ff421f34d6d50bf92323:3.85784)0.733:1.55142)0.32:0.11495,caf6be0a8bf38e96b62 61d382413fb09:2.70404)0.854:0.32054,(((((049c37f0c44a9df0d16ff4bd76737dfd:0,7ac4a6cb10d15f1a2f468 2d89f10f340:0):1.31674,c419f8f2cd68d25ee71d4899e9fe535d:1.28729)0.622:0.38827,((f26b99054a24ecd26 c6d00e695dea3a:0,7527128b4098231d0a8ea0cd188d342e:0,4696ad83733c59849baf1d79cb6134e6:0):2.45305,( .... > tree-get-alignment -p 'kb|aln.991753' >480553824a94dd69d05e2976c1727771 ------------------------------------------------------------------------------------VDAVNQIAQ ... >8cd02ced30b18167e19d9202c58d492a ---------AYMGRLAEGDYSQEPPMRERKDEVGEMAAAVSVFRAAAIERRQAVQLEKDR----EAAAREEAFVAAEAEARGRRSFVVDALDE ... ....
There is not a strict one-to-one mapping between protein sequences and genomic features; some features may share identical protein sequences. Therefore it is not always possible to map an alignment row or leaf node to a single KBase feature. For some trees, however, a cannonical KBase feature was used to identify the protein sequence to align. For these trees, leaf labels can be replaced with feature-ids with the following command.
> tree-get-tree -f 'kb|tree.991753' (((((kb|g.3596.peg.2220:0.6297,((kb|g.2711.peg.128:0.05393,kb|g.3446.peg.2305:0.0718)0:0.03445,(k b|g.3214.peg.1063:1.54275,kb|g.3557.peg.680:0.00541)0.959:1.10426)1:0.83977)0.993:0.99986,(kb|g.3 227.peg.1561:1.12331,kb|g.3666.peg.2259:3.85784)0.733:1.55142)0.32:0.11495,kb|g.2160.peg.2450:2.7 0404)0.854:0.32054,(((((:0,kb|g.3574.peg.1137:0):1.31674,kb|g.1155.peg.3402:1.28729)0.622:0.38827 ,((kb|g.21423.CDS.6883:0,kb|g.1143.peg.6798:0,kb|g.1144.peg.5065:0):2.45305,((kb|g.1465.peg.4094: 0.00016,(:0,kb|g.1297.peg.1348:0):0.60306)0.687:0.71617,((kb|g.3639.peg.5961:0,kb|g.22013.CDS.347 7:0):0.53728,((kb|g.2550.peg.2415:0,kb|g.2551.peg.2233:0):0.43479,(kb|g.2550.peg.1805:0,kb|g.2551 .peg.2376:0):0.32658)0.971:0.42267)0.976:0.59761)0.763:0.60071)0.441:0.14829)0.605:0.13015,(((((k .... > tree-get-alignment -f 'kb|aln.991753' > ------------------------------------------------------------------------------------VDAVNQIAQ ... >kb|g.195.peg.2959 ---------AYMGRLAEGDYSQEPPMRERKDEVGEMAAAVSVFRAAAIERRQAVQLEKDR----EAAAREEAFVAAEAEARGRRSFVVDALDE ... >kb|g.1913.peg.2473 --------------------------------------------------------------------------------------------- ... ....
Note in the output above that if a given tree or alignment does not have a cannonical feature ID, then that ID is left blank. Keep in mind also that these feaures may not be the only features in KBase that map to a particular leaf! Therefore you may have used the 'tree-find-tree-ids' method to identify a tree containing that feature's protein sequnce, but later find that the 'tree-get-tree' with the '-f' option returns a tree that does not include your specific feature id. Therefore it is often safer to work with protein sequence identifiers and only map to feature IDs for display.
The Newick and FASTA representations are convenient for software programs to process, but they are difficult to read by eye. Because these are standard formats, you can use one of the numerous tree and alignment visualization tools publically available to better display your tree. For most simple displays, however, the Tree service provides a simple renderer which can diplay a tree or an alignment as an HTML file with a number of options. To simply view the structure of a tree, pipe the output of the 'tree-get-tree' script to the 'tree-to-html' script, and save the output to an html file named 'myFirstTree.html'. Instead of kb|tree.991753, let's work with kb|tree.994594 which still includes our gene, but has fewer leaf nodes.
> tree-get-tree -p 'kb|tree.994594' | tree-to-html -raw > myFirstTree.html
The -raw option states that we want to visualize the tree in its raw form, without any additional automatically generated links or annotation. MD5s of course are difficult to read, so instead let's try to view the tree wth feature IDs
The tree renderer requires that every leaf node is labeled so that it can be identified. Therefore it is safe practice to include a call to 'tree-remove-nodes', which by default will remove any leaf nodes that are unlabled. By doing this, we can view the same tree with feature IDs. In the command below, we retrieive a tree, replace all IDs with cannonical feature IDs, remove any nodes that didn't have an associated feature ID, and render the tree, all in one line!
> tree-get-tree -f 'kb|tree.994594' | tree-remove-nodes | tree-to-html > myFirstFeatureLabeledTree.html
Although simple, the 'tree-to-html' renderer has several flexible options which allow you to customize how the tree is diplayed. Let's work through a more complicated example to demonstrate how we can fetch a tree, retrieve more details about each node, and display a tree in a way that each leaf node links to a KBase Labs feature browser page.
First, fetch the tree with feature IDs, remove nodes that can't be mapped, and save it to a file.
> tree-get-tree -f 'kb|tree.994594' | tree-remove-nodes > my.tree
Next, get a list of all the leaf nodes, which will be a list of feature IDs, and save the list to a file.
> tree-get-leaf-nodes -i my.tree > feature.list > head feature.list kb|g.963.peg.3789 kb|g.1715.peg.3392 kb|g.3140.peg.4489 kb|g.1798.peg.766 kb|g.1292.peg.1057 kb|g.689.peg.4354 kb|g.2139.peg.920 kb|g.2139.peg.259 kb|g.2986.peg.2975 kb|g.11.peg.2150
OPTIONAL - The tree is fairly large, so for the purposes of this tutorial it may be easier to work with a much smaller tree. This is easily accomplished. In the following steps, we list how many features we have, create a removal list of most of the features using a command named 'shuf' to randomly select the removal list (in IRIS you can also use 'head' or 'tail'), remove those nodes, then get the reduced list of features again.
> cat feature.list | wc -l 4315 > mv my.tree my.tree.original > shuf -n 4000 feature.list > feature.removal.list > tree-remove-nodes -i my.tree.original -r feature.removal.list > my.tree > cat my.tree | tree-get-leaf-nodes > feature.list > cat feature.list | wc -l 315
Now that we have a list of features, we can use the CDMI scripts to get more information about each feature. For instance, we use the relationship IsOwnedBy, which maps features to genome data, to extract the scientific name of each genome that each feature came from.
> cat feature.list | get_relationship_IsOwnedBy --to scientific_name > feature.data
The results of this query are saved to a file named feature.data.
> head feature.data kb|g.11.peg.2150 Bacillus amyloliquefaciens LL3 kb|g.3896.peg.2579 Bacillus amyloliquefaciens TA208 kb|g.3768.peg.651 Bacillus subtilis BSn5 kb|g.3110.peg.2751 Bacillus atrophaeus Detrick-1 kb|g.19732.peg.3387 Bacillus subtilis subsp. subtilis str. SMY kb|g.2873.peg.2120 Bacillus sp. BT1B_CT2 kb|g.3644.peg.2089 Bacillus subtilis gtP20b kb|g.3768.peg.411 Bacillus subtilis BSn5 kb|g.3565.peg.2755 Bacillus atrophaeus str. Dugway kb|g.2130.peg.554 Bacillus subtilis subsp. subtilis str. JH642
We can also use a helpful Tree service command to construct URLs to all the feature pages.
> cat feature.list | tree-create-url-map -u 'http://<IP_ADDRESS>/feature_info/feature.html?id=' > feature.links > head feature.links kb|g.11.peg.2150 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.11.peg.2150 kb|g.3896.peg.2579 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3896.peg.2579 kb|g.3768.peg.651 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3768.peg.651 kb|g.3110.peg.2751 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3110.peg.2751 kb|g.19732.peg.3387 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.19732.peg.3387 kb|g.2873.peg.2120 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.2873.peg.2120 kb|g.3644.peg.2089 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3644.peg.2089 kb|g.3768.peg.411 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3768.peg.411 kb|g.3565.peg.2755 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.3565.peg.2755 kb|g.2130.peg.554 http://<IP_ADDRESS>/feature_info/feature.html?id=kb|g.2130.peg.554
Finally, we can render the tree.
cat my.tree | tree-to-html -a feature.data -l feature.links > niceTreeWithLinks.html
> tree-compute-abundance-profile -t 'kb|tree.991753' -m '4447970.3' -f 'COG0840' -s 'COG'


Noteflight is an online music notation software and social music platform, designed to make traditional music notation accessible to everyone. Noteflight is now owned by Hal Leonard Corporation, the world's largest sheet music distributor.
My first project was to refactor and improve Noteflight's internal reporting system, and create a dashboard for viewing monthly user stats and financial information. The existing reporting system, written in Ruby, generated a CSV with the relevant information. I refactored this reporting system to create a more general data structure with reporting information, and can be used with any sort of formatter. I also created a web formatter for this information with HTML and ERB templating, which generates a user-friendly viewable report of the most relevant information.
My second project (which I, along with another intern, spent most of the internship working on) was developing and implementing a more robust score search experience to replace the current implementation on Noteflight. The goal was to create a richer search experience for users, and allow them to discover new music using a faceted search system through which they could discover pieces by instruments, genres, and other attributes. The system was implemented in concept in various test environments, and eventually refactored and integrated into Noteflight's new content libraries system, due to be released this fall.


Shoplifting, package thefts and other property damage issues are some of the major concerns with retail and homeowners. With our new product, ‘RedEye’, we aim at detecting these issues at the ground level using Artificial Intelligence that requires no or minimum human interaction. It enables you to sleep peacefully without worrying about thefts or property damages. Because what’s the point of having a CCTV camera system if it only records a movie?
Shoplifting, package thefts and other property damage issues are some of the major concerns with retail and homeowners. With our new product, ‘RedEye’, we aim at detecting these issues at the ground level using Artificial Intelligence that requires no or minimum human interaction. It enables you to sleep peacefully without worrying about thefts or property damages. Because what’s the point of having a CCTV camera system if it only records a movie?


Frequentist assisted by Bayes (FAB) confidence interval construction. See 'Adaptive multigroup confidence intervals with constant coverage' by Yu and Hoff <https://arxiv.org/abs/1612.08287>.
| Version: | 0.1 |
| Published: | 2017-01-06 |
| Author: | Peter Hoff and Chaoyu Yu |
| Maintainer: | Peter Hoff <peter.hoff at duke.edu> |
| License: | GPL-3 |
| NeedsCompilation: | no |
| CRAN checks: | fabCI results |
| Reference manual: | fabCI.pdf |
| Package source: | fabCI_0.1.tar.gz |
| Windows binaries: | r-devel: fabCI_0.1.zip, r-release: fabCI_0.1.zip, r-oldrel: fabCI_0.1.zip |
| OS X binaries: | r-release: fabCI_0.1.tgz, r-oldrel: fabCI_0.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=fabCI to link to this page.


Box model, selectors, grid system
Color, layout, typography, contrast
Image sprites, pseudo classes, cool effects
Cross-browser support, boilerplates, CSS tools
Especially important if you want to get the word out, or want journalists to write about you
Even if things work great on the back end, users need a good way to interact with the application


UD for Skolt Sámi
Tokenization and Word Segmentation
- Words are generally delimited by whitespace or punctuation. Exceptions:
- Numerical expressions (including dates) are treated as single words and may contain punctuation or whitespace: 1.1.1970, 11:00, 2 000.
- Abbreviations are treated as single words and may contain punctuation or whitespace.
- Multiword tokens are used in Skolt Sámi in certain fixed phrases subjunctions and adverbials: ouddâl ko (before), čõõđ ääiʹj (in time).
Morphology
Tags
- Skolt Sámi uses 16 of the 17 universal part-of-speech tags: ADJ, ADP, ADV, AUX, CCONJ, CONJ, DET, INTJ, NOUN, NPROP, NUM, PRON, PROPN, PUNCT, SCONJ, VERB .
- There are two copulas leeʹd and iʹlla. The first one means (to be), and the second one means (is not).
- Verbs of negation and negative particles have been labled AUX with an aux:neg relation.
Features
Nominal features
- Case has 9 possible values: Abe, Acc, Com, Ess, Gen, Ill, Loc, Nom, Par. They occur with following word POS: NOUN, PROPN, PRON, NUM, ADJ.
- The cases Ess and Par make no distinction for a singular-to-plural split, and therefore no number category is associated with them.
- Skolt Sámi has possessive suffixes that distinguish three categories of person and two for number.
Degree and Polarity
- The comparative is formed with the suffix -Vb ‘-er’, and the superlative is formed by adding the -mõs, -mmus.
- Polarity in Skolt Sámi is found in the negative verbs and particles.
Verbal features
- Mood has 4 possible values: Ind, Imp, Cnd, Pot.
- Finite verbs are marked for the categories of tense: Prt (past) and Pres (non-past); person: first, second and third in combination with number singular and plural. There is an additional indefinite person conjugation indicated by fourth person singular.
- Verbs have many forms of regular derivation, one specifically is the inchoative -škueʹtted (begin to X), which, when the verb undergoes negation, conveys the meaning (begin not to X).
Syntax
- Word order generally follows an SO, SV and VO strategy, but more research is required to establish what the actual deviations are from this.
- Objects (obj) can be nominals in the accusative case, without preposition.
-
The copula verbs leeʹd (be) and iʹlla (not be) are used in equational, attributional, locative, possessive and benefactory nonverbal clauses.
- The following subtypes are used in Skolt Sámi:
- advmod:tmod for advmod with temporal value
- aux:neg for the negative auxiliary verbs and particles
- flat:name for flat used in person names
- obl:tmod for obl relation with temporal value
Treebanks
There are 1 Skolt Sámi UD treebanks:


Now that we are comfortable zooming around Excel without a mouse, we need to get comfortable entering information (it's kind of the point). In this lesson, we'll cover the basics of entering information quickly.
Before we get started, you'll want to download the files below for this lesson:
Usually, after you are done putting some information in a cell, you will move on to another cell to enter more information. Not surprisingly, the Enter / Return key is what you press when you're done entering information and looking to information in a line below your current line.
Try entering some information in a cell, press return, and see where your cursor moves in Excel. Once this makes makes complete sense, go ahead and complete the exercise.
Now that you can enter as much information going down as you want, you'll want to start moving right. To do this, after you're done with a cell, use the TAB key to move right.
Spend some time putting this in your memory bank and complete the exercise once you're ready.
All right, so I lied a little. As cool as Return and Tab are for entering information, they only move downwards or rightwards respectively. Sometimes, you'll want to move backwards. There are two ways to do this:
An aside on using Up and Left (and just down and right) is that in certain scenarios (e.g. when editing formulas) they do not work. This is the reason to learn Return and Tab, as they always work for completing information entry.
Try these shortcuts out for a little and complete the exercise!
Now that you've created, you must learn to destroy. To do this, we want to use the Delete key. Depending on the version of Excel and what configuration of keyboard you have, there is a difference in functionality between Delete and Backspace, so make sure you try both of them to understand the differences.
For this exercise, we'll revisit some of the multi-select and skipping cell lessons in the previous section to delete information in multiple cells at once. Make sure to keep those shortcuts in mind, so you aren't deleting every cell individually. And to get some repetition, undo your deletes (CTRL + Z on Windows / COMMAND + Z on Mac) a few times to make sure you are have this committed to memory.
Now that we have learned to add and remove data from cells, we will practice a bit more with some math. In this section's challenge, we will build the multiplication table.
Currently, there are letters going across and downwards in the grey cells. We obviously can't multiply letters, so replace the alphabet with the numbers 1 through 9 both horizontally and vertically and see what happens! Remember to only use your keyboard for this exercise.


There are two different attributes that apply only to drop-down lists created created using the <select> tag.
data-lugavalidator-invalidindex prevents selection of an entry on a given position (zero based):
<select name="lady" data-lugavalidator-invalidindex="0">
data-lugavalidator-invalidvalue prevents selection of an entry with a given value.:
<select name="dish" data-lugavalidator-invalidvalue="Crepes">


Description: Add the previous set of elements on the stack to the current set.
As described in the discussion for .end()
, jQuery objects maintain aninternal stack that keeps track of changes to the matched set of elements. When one of the DOM traversal methods is called, the new set of elements is pushed onto the stack. If the previous set of elements is desired as well, .andSelf()
can help.
Consider a page with a simple list on it:

list item 1

list item 2

list item 3

list item 4

list item 5

The result of the following code is a red background behind items 3, 4 and 5:
$('li.third-item').nextAll().andSelf()
.css('background-color', 'red');
First, the initial selector locates item 3, initializing the stack with the set containing just this item. The call to .nextAll()
then pushes the set of items 4 and 5 onto the stack. Finally, the .andSelf()
invocation merges these two sets together, creating a jQuery object that points to all three items in document order: {[
,
,
 ]}
.
<!DOCTYPE html>

First Paragraph

Second Paragraph


EDUCATION
Every child has the right to learn. UNICEF works around the world to support quality learning for every girl and boy, especially
those in greatest danger of being left behind.
Kenya has made significant progress in increasing the accessibility of education, but there are still significant inequities in access,
particularly among marginalized groups in nomadic and informal urban communities.
Click to Learn More


Order Cancelled
Thank you for considering Revolt Hanging wind turbines
Order Form
cancel
return to top


S.C. Chow, H. Wang, and J. Shao, Sample Size Calculations in Clinical Research, Second Edition. CRC Press, 2007, p. 174-179. The sample size formula on page 178 calculates the total sample size.
Sample size of standard group: {{controlGroupSampleSize | number:0}}
Sample size of experimental group: {{experimentalGroupSampleSize | number:0}}
Under the assumptions of proportional hazard and non-informative censoring, a non-inferiority trial is designed to show that a new treatment is non-inferior to the standard treatment within a non-inferiority margin of {{values.niMargin}} in terms of hazard ratio. {{totalSampleSize | number:0}} subjects in total (of which {{experimentalGroupSampleSize | number:0}} are in the new treatment group and {{controlGroupSampleSize | number:0}} are in the standard treatment group) and {{expectedEvents | number:0}} of event are required to achieve {{values.power * 100 | number:0}}% of power at a {{values.significanceLevel}} significance level.


×
Close
Home Loan Application
1
Applicant Details
2
Loan Details
3
Aadhaar eKYC
4
eSign Application form
Applicant Details
Full Name
PAN number (10 character alphanumeric)
Aadhaar number (12 digit)
Mobile number (10 digit)
Next
Loan Details
Loan Amount (in the range 10 to 40 lakhs)
Loan tenure (in the range 5 to 20 years)
Interest rate
Next
Aadhaar eKYC
Aadhaar No.
Get OTP
OTP (6 digit)
CONSENT FOR AADHAAR AUTHENTICATION
I am the holder of above Aadhaar Number. I hereby agree to authenticate myself using Aadhaar through Open Financial Bank, and provide my consent to collect my Aadhaar and OTP, to retrieve my details along with my email ID / mobile number (if available) from UIDAI. I have understood Open Financial Bank's declaration that, my identity information will only be used for subscribing the service. I have understood that, my biometrics / OTP is encrypted and will not be stored / shared and will be submitted to UIDAI (CIDR) only for the purpose of this transaction.
Next
Review Application form and eSign
No Support
Aadhaar No.
Get OTP
OTP (6 digit)
CONSENT FOR AADHAAR AUTHENTICATION
I am the holder of above Aadhaar Number. I hereby agree to authenticate myself using Aadhaar through Open Financial Bank, and provide my consent to collect my Aadhaar and OTP, to retrieve my details along with my email ID / mobile number (if available) from UIDAI. I have understood Open Financial Bank's declaration that, my identity information will only be used for subscribing the service. I have understood that, my biometrics / OTP is encrypted and will not be stored / shared and will be submitted to UIDAI (CIDR) only for the purpose of this transaction.
eSign


Ocean [ak01], ocean, in Crystal Sea ------------------------------------------------------------------------ 1: The Savvy Aardvark [ha5r], ship, 2 hulls, 1 rowing port, 6 sails, 1: 13% damaged, departed for Ocean [aj01]. Routes leaving Ocean: North, to Ocean [aj01], 6 days East, to Ocean [ak02], 6 days South, to Ocean [al01], The Outer Sea, 6 days West, to Ocean [ak00], 6 days


typedef struct bstreenode { char *key; Jval val; struct bstreenode *left; struct bstreenode *right; } BstreeNode;Write a function nnodes, which returns the number of nodes of a binary search tree. The prototype is:
int nnodes(BstreeNode *b);Note -- this is a pointer to the root of the tree (NULL if the tree is empty).


{%extends "confreg/confadmin_base.html" %} {%load dictutil%} {%block title%}Badge scanning status - {{conference}}{%endblock%} {%block layoutblock%}
This list shows the number of unique scans per sponsor and scanner. If the same attendee is scanned by multiple scanners the total number for the sponsor will not match the sum of the individual scans.
| Sponsor | Scanner | Unique scans |
|---|---|---|
| {{sp.sponsorname}} | {%with spid=sp.sponsorid%}{{uniquebysponsor|dictlookup:spid}}{%endwith%} | |
| {{sp.email}} | {{sp.num}} |


C, .NET, C++, Java, Python, JavaScript and Node.js.
under construction...
Started Software Engineering degree at University of Brasília.
Software Engineering Student
Graduating in Software Engineering. Speaks Portuguese, English fluently.


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import helpers.CSRNoErrorFieldConstructor._ @import FieldNameHelpers._ @import helpers.TemplateHelper._ @(field: play.api.data.Field, options: Seq[(String,String)], args: (Symbol,Any)*)(togglePanels:Html)(implicit messages: Messages) @helper.input(field, args:_*) { (id, name, value, htmlArgs) =>
} @togglePanels


Antiviral activities of unripe and ripe pods of Terminalia chebula on influenza virus. The in vitro dose–response curves against influenza A virus (IAV) (red) and cytotoxicity in Madin–Darby canine kidney (MDCK) cells (blue) of unripe (A) and ripe (B) pods of T. chebula. Data are means ± SD from three independent experiments.


Before Change
diseases.update(doid)
dictfile = "data/dicts/ncbi_training_diseases.txt"
terms = [line.strip().split("\t")[0] for line in open(dictfile).readlines()]
terms = {word:1 for word in terms if word.isupper()}
diseases.update(terms)
// filter by char length
After Change
Load a dictionary of disease phrases **as a list**.
NOTE: Eventually we"ll want to pass along IDs
a = set()
// UMLS disorders
dictfile = "data/dicts/umls_disorders_v2.bz2"
diseases = [line.strip().split("\t")[0] for line in bz2.BZ2File(dictfile, "rb").readlines()]


Up First, The Presentation -->
If you wish to participate in a hands on example, please
download and install
chrome canary.
Hands On: The Shadow Dom
Example 1: A Simple Introduction
Example 2: Lets Get Templating!


--- title: Falkenblog -- Review of Taleb's The Black Swan layout: post ---
The Black Swan may popularize the concept of low probability events, what were called 'peso problems' (see Rietz 1988), and that would be a good thing. But ultimately, the bumper sticker "shit happens" is kind of funny, kind of true, but hardly profound.
Completely awesome review of The Black Swan. Its long, but you should read it anyway.


?BOTANICAL
DEN
R
Altitude:
o*
10
ft*
Date:
February
5,
1961
Habitat:
Coastal
thickets,
at
top
of
rocky
seabeaoh.
Notes:
Tree
10
nu
tall;
flowers
cream#
fragrant*
Collector:
George
R*
Prootor
No.
21980
&
Winston
Mulling!
INSTITUTE
OF
JAMAICA
FLORA
OF
JAMAICA
Parish:
WESTMORELAND
Name:
Dipholis
galioifolia
(L*)A.DC*
LocaUty:
l
mile
northwest
of
WHHB9OUSS.
01443836
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


{% extends 'registration/base.html' %} {% load bootstrap4 %} {% load static %} {% block content %} {{block.super}}
Password or Username is incorrect
Are you new here? Create Account


fun getByteSafe(key: String): Byte
Gets a byte from the wrapped UBObject If the value was null, then will return 0


It was a cool night. I was at home hanging with my friend. I took out my cuchhi pipe (a pipe given to me when I was fourteen by my Obi high priest) loaded it up and fired away. I closed my eye only to see a old world. I was in the my past. i saw things that carved me into how i am now. I saw a man dancing to the beat of the ketta drums. His head was wrapt in a red, white, and blue cloth. As the drummer played to movements of the sprits, the man dancing moved with more passion, more vigor, more life. 'Who is this man,' I asked myself. it was then i realized this man was me.
As I opened my eyes, I saw how that spritual dancer carved me into who I am today. I was traveling on the vission of my life. Now i understand why i think and process things the way i do. the joureny was teaching me how to look on things in different perspectives.
With this brief look in the mirror of my life, my journey took me on a mental trip of what is to come. i saw what i will succeed in, and i saw what i would have a hard time accomplisihing. the vision also showed me how to overcome the obstacles in my life in order to accomplish every thing i want and need.
the pipe of visions took me on a trip of my past, present, and future. i saw my tradition put me where i am now, and where i intend to go.
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.


Nathan Watkins-Hoagland
You chose a pizza with topping/s. Your pizza/s will be today and that will cost $. Thank you for your buisness, bon apetite!


Home
Products
Members
Contact
Location
Office address
Department of Computer Science and Engineering
Faculty of Engineering
University Of Moratuwa
Contact us
0718838083
0779386412
0718187375
0728178055
0715756892


I'm TheBitcoin.pub Doge Companion! Just navigate to a topic page and there will a clickable DOGE icon used to "Smash Like" multiple posts! Example url navigate to: https://thebitcoin.pub/t/* If there are no more posts to like, Doge will just say a random quote!


{% extends "layout.html" %}
{% block content %}
{% include "includes/phase_banner_alpha.html" %}
{% include "includes/breadcrumbs.html" %}
{% include "includes/entity_header.html" %}
{% include "includes/sub_nav.html" %}
Case progress
{% endblock %}
{% block page_specific_scripts %}
{% endblock %}


DBFZ.css
A work-in-progress recreation of DBFZ's UI elements in CSS.
Use cases
Websites
Streams
Videos
Thumbnails
Adverts
...And More!
an example
Links
Release (slim)
Source (heavy, includes full UI rip)
Donate


Uglyfing files, bundling js, separating dev and production environments, automting comments and more...
I sometimes struggle to organize my code in a way I know it won't hurt me in the future. This template is an attempt to make many of the "behind the scenes" tasks automated and have a solid starting point for all of my web projects moving forward. Tasks like minifying and combining js files, compiling SCSS into CSS, uglifying and bundling them again should be set up once and used throughout all my projects.
All modules are included through npm. Npm manages our DEV and PROD builds and runs the webpack-dev-server.
Proper JS documentation is created with every Production build of the app so there is no excuse for writing sloppy code.
Your front-end templating apprach might be different, but for me, including bootstrap means building in a very solid foundation.
Once compiled and deployed, your app can be accessible on Github Pages. This one is.
Webpack is used to do all the "Behind The Scenes" work. Minifying, uglifying, building, cleaning, managing and more is done through Webpack plugins and loaders
jQuery is enabled through one of Webpack plugins. I don't remember a project where I didn't want to include this 'Swiss Knife' library in my app.
This is a wildcard I'm experimenting with recently. Still trying to incorporate this neat library into my workflow.
In order to fully understand of what this Webpack template is and what it does, I would suggest heading to the repo page and cloning the code. Once you have it on your machine, read the README.md file to learn how to build the app. If you aren't interested in how this template is set up, you can head directly to the /src folder and start modifying the code. Remember that the /src folder is the only one you should use to write code. All files in the /dist folder are minified and the folder is re-created every time you run the -npm run dev- command.
If your tendency is to try to hack something together and to skip code comments in order to make a dirty mvp, you're like me. In many cases, the reasoning is that comments can be added later- once the project is over. However, if my starting point is already configured to properly read my code comments and turn them into a proper documentation, I'm more likely to put some effort and include commenting in my workflow. With this template, you get proper documentation for free and you can check out an example here You might notice that the README.md file is exactly the same as the index.html file for the documentation. That is intentional, letting you include most important information about your Repo whithin the documentation pages.


THtmlViewer component
function FullDisplaySize(FormatWidth: integer): TSize;
Use the FullDisplaySize method to determine the overall height and width of the current document when it is formatted to a particular width.
FormatWidthThe format width desired. Most text will wrap to this width.
Result.cxThe full width of the formatted document. This may exceed FormatWidth if there are items that can't be compressed or wrapped.
Result.cyThe height of the document for the FormatWidth selected.