Standard output
GoateDescription:
description: Add a description of what ever is being annotated.
related topics: {}
method of look up:
com.thegoate.annotations.GoateDescription
IsDefault:
description: Marks the class the default choice, used by unknown utilities if a more specific match cannot be found.
related topics: {}
method of look up:
com.thegoate.annotations.IsDefault
GoateDLP:
description: Identifies a data loader provider.
related topics: {}
method of look up: name
com.thegoate.data.GoateDLP
GoateDataModeler:
description: Identifies a GoaTE data modeler.
related topics: {}
method of look up: name
com.thegoate.data.GoateDataModeler
GoateProvider:
description: Identifies a provider definition.
related topics: {}
method of look up: name
com.thegoate.data.GoateProvider
GoateDSL:
description: Used to define a new word in the GoaTE DSL.
related topics: {}
method of look up: word
com.thegoate.dsl.GoateDSL
Validator:
description: Used to identify a new validator.
related topics: {}
method of look up:
com.thegoate.expect.validate.Validator
Info:
description: Annotate GoaTE annotation with @Info to automatically pick it up in the encyclopedia.
related topics: {}
method of look up: classifier
com.thegoate.info.Info
ToJsonUtil:
description: Identifies a ToJson utility
related topics: {}
method of look up:
com.thegoate.json.utils.tojson.ToJsonUtil
Bleat:
description: Add this annotation to your BleatBox implementation. There should only be one bleatbox implementation in your class path. Otherwise there is no guarantee which one will be used.
related topics: {}
method of look up:
com.thegoate.logging.Bleat
GoateAmplifier:
description: Add this annotation to your amplifier implementation
related topics: {}
method of look up:
com.thegoate.logging.volume.amp.GoateAmplifier
GoateSheet:
description: Used to indicate supported file type.
related topics: {}
method of look up:
com.thegoate.spreadsheets.utils.GoateSheet
GoateJob:
description: Identifies a job.
related topics: {}
method of look up: jobs
com.thegoate.staff.GoateJob
GoateTask:
description: Identifies a method as a task that can be executed by the goate framework.
related topics: {}
method of look up: task
com.thegoate.staff.GoateTask
GoateTaskContainer:
description: Identifies classes that contain GoaTE tasks.
related topics: {}
method of look up:
com.thegoate.staff.GoateTaskContainer
ResetStatics:
description: Used to indicate if there are any static variables that have to be reset, especially between test execution.
related topics: {}
method of look up:
com.thegoate.statics.ResetStatics
UtilCache:
description: Identifies get utilities.
related topics: {}
method of look up:
com.thegoate.utils.UtilCache
CompareUtil:
description: Identifies a compare implementation.
related topics: {}
method of look up: operator
com.thegoate.utils.compare.CompareUtil
FillUtil:
description: Identifies fill utilities.
related topics: {}
method of look up:
com.thegoate.utils.fill.FillUtil
CastUtil:
description: Used to identify cast utility implementations.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.CastUtil
GoateIgnore:
description: Identifies a pojo class as being consumable by GoaTE.
related topics: {}
method of look up: id
com.thegoate.utils.fill.serialize.GoateIgnore
GoatePojo:
description: Identifies a pojo class as being consumable by GoaTE.
related topics: {}
method of look up: id
com.thegoate.utils.fill.serialize.GoatePojo
GoateSource:
description: Used to define a mapping from a source to the field in the pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.GoateSource
GoateSourceDef:
description: Identifies a pojo source definition.
related topics: {}
method of look up: id
com.thegoate.utils.fill.serialize.GoateSourceDef
GoateSources:
description: Allows for staking of GoateSource annotations to specify more than one source mapping for a field in a pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.GoateSources
ListType:
description: Used for identifying a more explicit list implementation in a pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.collections.ListType
ListTypes:
description: Used to set the type of object in the list in a pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.collections.ListTypes
MapKeyType:
description: Defines the object type for the key of a map in a pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.collections.MapKeyType
MapType:
description: Defines the object type for the value of a map in a pojo.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.collections.MapType
StringConverterUtil:
description: Used to identify string converter implementations.
related topics: {}
method of look up:
com.thegoate.utils.fill.serialize.string.StringConverterUtil
GetUtil:
description: Identifies get utilities.
related topics: {}
method of look up:
com.thegoate.utils.get.GetUtil
InsertUtil:
description: Identifies insert utilities.
related topics: {}
method of look up:
com.thegoate.utils.insert.InsertUtil
ToGoateUtil:
description: Identifies a ToGoate utility
related topics: {}
method of look up:
com.thegoate.utils.togoate.ToGoateUtil
ToListUtil:
description: Identifies a ToList utility
related topics: {}
method of look up:
com.thegoate.utils.tolist.ToListUtil
IsNullRepresentation:
description: Identifies a null Representation
related topics: {}
method of look up:
com.thegoate.utils.type.IsNullRepresentation
IsType:
description: Identifies a Type utility
related topics: {}
method of look up:
com.thegoate.utils.type.IsType


Class Foundation.UI
Defined in: Foundation.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Provides interaction with tabs and windows.
|
| Method Attributes | Method Name and Description |
|---|---|
|
createTab(name, tabOptions, winOptions)
Creates a new tab and appends it to the tab group.
|
|
|
createTabGroup(tabGroupId, params)
Creates a tab group.
|
|
|
createWindow(name, params)
Creates a new window as you would expect Titanium to do, but appends Foundation and the app namespace
to it.
|
|
|
getWindow(name, withConfig)
Returns the specified window, if exists.
|
|
|
Returns the current window template, if set.
|
|
|
openTabGroup(tabGroupId)
Closes the current active tabgroup and opens the specified tabgroup.
|
|
|
openWindow(name, context, windowOptions, options)
Opens a new window and creates it if needed.
|
|
|
setWindowTemplate(template)
Applies and stores a window template.
|
|
|
tabGroup(tabGroupId)
Return the specifies tab group.
|
Method Detail
{Ti.UI.Tab}
createTab(name, tabOptions, winOptions)
Creates a new tab and appends it to the tab group. For the moment only one tab group is allowed in a
Foundation application, so it will be automatically created if needed.
Foundation will use the window name to get the right view and apply the tab icon so, if you name a window “Apples and oranges”, Foundation will look for ApplesAndOranges.js and ApplesAndOranges.png.
Foundation will use the window name to get the right view and apply the tab icon so, if you name a window “Apples and oranges”, Foundation will look for ApplesAndOranges.js and ApplesAndOranges.png.
- Parameters:
- {string} name
- The name to assign to the window. It will be used for internal reference and to fetch the file that contains the views's code.
- {object} tabOptions Optional
- A dictionary of properties as Ti.UI.createTab would expect
- {string} tabOptions.icon Optional
- Path to the tab's icon, in case its name does not match the window's name
- {object} winOptions Optional
- A dictionary of properties as Foundation.UI.createWindow would expect
- Returns:
- {Ti.UI.Tab} The tab
{Ti.UI.tabGroup}
createTabGroup(tabGroupId, params)
Creates a tab group.
- Parameters:
- {string} tabGroupId Optional
- The tab group identifier.
- {object} params Optional
- The params to give to the tab group, as Ti.UI.createTabGroup would expect.
- Returns:
- {Ti.UI.tabGroup} A Ti.UI.tabGroup instance
{Ti.UI.Window}
createWindow(name, params)
Creates a new window as you would expect Titanium to do, but appends Foundation and the app namespace
to it. Also, this method will choose the right view to use for the window, provided that you have custom views.
If you want to use a custom view (sometimes referred as platform-specific views), create the path Resources/iphone/Views
and/or Resources/android/Views. Those paths will be checked first. If no custom view is found there, Foundation will use
the default path (Resources/Views).
- Parameters:
- {string} name
- The window name. It will be used for internal reference, as well to fetch the file that contains the view's code. To comply to Foundation's naming conventions, any space will be trimmed. So, if your window title is “Apples and oranges”, this method will fetch the file ApplesAndOranges.js (with a space-to-camelCase conversion).
- {object} params
- The configuration options, same as Titanium's parameters.
- {boolean} params.viewless Optional
- true to create a window without loading its relative file
- {string} params.file Optional
- the file name without path (must be under Resources/Views, Resources/iphone/Android and/or Resources/iphone/Views) that contains the code for this window
- Returns:
- {Ti.UI.Window} A Window instance
{mixed}
getWindow(name, withConfig)
Returns the specified window, if exists.
- Parameters:
- {string} name
- The window name.
- {boolean} withConfig Optional, Default: false
- to return a dictionary with the window's current parameters.
- Returns:
- {mixed} a Ti.UI.Window object or, if withConfig set to true, a dictionary with the properties win (the window instance) and config (the window configuration).
{object}
getWindowTemplate()
Returns the current window template, if set.
- Returns:
- {object} The window template. An empty object literal will be returned if no template is set.
openTabGroup(tabGroupId)
Closes the current active tabgroup and opens the specified tabgroup.
- Parameters:
- {string} tabGroupId Optional
- The tab group identifier. Leave empty to close and reopen the current active tabgroup;
openWindow(name, context, windowOptions, options)
Opens a new window and creates it if needed. Internally calls Foundation.UI.createWindow, so it works
in a similar way. You should always prefer this method over createwindow, unless you don't need to open
the window right away.
- Parameters:
- {string} name
- The name to assign to the window. It will be used for internal reference and to fetch the file that contains the views's code.
- {mixed} context
- A Ti.UI.TabbedBar or Ti.UI.iPhone.NavigationGroup object in which the window should be open
- {object} windowOptions Optional
- A dictionary of properties as Ti.UI.createWindow would expect
- {object} options Optional
- A dictionary of properties as Ti.UI.TabbedBar or Ti.UI.iPhone.NavigationGroup would expect.
setWindowTemplate(template)
Applies and stores a window template.
- Parameters:
- {object} template
- The template to apply.
{Ti.UI.TabGroup}
tabGroup(tabGroupId)
Return the specifies tab group.
- Parameters:
- {string} tabGroupId Optional
- The tab group identifier. Leave empty to return the current active tabgroup.
- Returns:
- {Ti.UI.TabGroup} The current TabGroup or null of the specified tabgroup is not present.


Dean Joseph
AJAX | Film Directory
Auto-complete and Film Directory API
Search for your film
Get Film Info
Title
Year
Release Date
Genre
Director


--- title: Installation reference description: Installation API reference layout: docwithnav --- The Kubernetes resources below configure {{site.prodname}} installation when using the operator (currently, only on Openshift). Each resource is responsible for installing and configuring a different subsystem of {{site.prodname}} during installation. Most options can be modified on a running cluster using `kubectl`.
Packages:
API Schema definitions for configuring the installation of Calico and Calico Enterprise
Resource Types:Installation configures an installation of Calico or Calico Enterprise. Only one instance of this resource is supported, and it must be named, “default”. The Installation API installs core networking and network policy components, and provides general install-time configuration.
| Field | Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersion string |
operator.tigera.io/v1
|
||||||||||||||
kind string |
Installation |
||||||||||||||
metadata Kubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||
spec InstallationSpec |
Specification of the desired state for the Calico or Calico Enterprise installation.
|
||||||||||||||
status InstallationStatus |
Most recently observed state for the Calico or Calico Enterprise installation. |
TigeraStatus represents the most recently observed status for Calico or a Calico Enterprise functional area.
| Field | Description |
|---|---|
apiVersion string |
operator.tigera.io/v1
|
kind string |
TigeraStatus |
metadata Kubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
spec TigeraStatusSpec |
|
status TigeraStatusStatus |
(Appears on: InstallationSpec)
CalicoNetwork specifies configuration options for Calico provided pod networking.
| Field | Description |
|---|---|
ipPools []IPPool |
(Optional)
IPPools contains a list of IP pools to use for allocating pod IP addresses. At most one IP pool may be specified. If omitted, a single pool will be configured when needed. |
mtu int32 |
(Optional)
MTU specifies the maximum transmission unit to use for pods on the Calico network. Default: 1410 |
nodeAddressAutodetectionV4 NodeAddressAutodetection |
(Optional)
NodeAddressAutodetectionV4 specifies an approach to automatically detect node IPv4 addresses. If not specified, will use default auto-detection settings to acquire an IPv4 address for each node. |
nodeAddressAutodetectionV6 NodeAddressAutodetection |
(Optional)
NodeAddressAutodetectionV6 specifies an approach to automatically detect node IPv4 addresses. If not specified, IPv6 addresses will not be auto-detected. |
string
alias)(Appears on: InstallationSpec)
ClusterManagementType represents the type of multicluster management to use. Valid options for this field are: “Standalone”, “Management”, “Managed”.
string
alias)(Appears on: TigeraStatusCondition)
ConditionStatus represents the status of a particular condition. A condition may be one of: True, False, Unknown.
string
alias)(Appears on: IPPool)
EncapsulationType is the type of encapsulation to use on an IP pool. Valid options are: IPIP, VXLAN, IPIPCrossSubnet, VXLANCrossSubnet, None.
(Appears on: CalicoNetworkSpec)
| Field | Description |
|---|---|
cidr string |
CIDR contains the address range for the IP Pool in classless inter-domain routing format. |
encapsulation EncapsulationType |
(Optional)
Encapsulation specifies the encapsulation type that will be used with the IP Pool. Default: IPIP |
natOutgoing NATOutgoingType |
(Optional)
NATOutgoing specifies if NAT will be enabled or disabled for outgoing traffic. Default: Enabled |
nodeSelector string |
(Optional)
NodeSelector specifies the node selector that will be set for the IP Pool. Default: ‘all()’ |
blockSize int32 |
(Optional)
BlockSize specifies the CIDR prefex length to use when allocating per-node IP blocks from the main IP pool CIDR. Default: 26 (IPv4), 122 (IPv6) |
(Appears on: Installation)
InstallationSpec defines configuration for a Calico or Calico Enterprise installation.
| Field | Description |
|---|---|
variant ProductVariant |
(Optional)
Variant is the product to install - one of Calico or TigeraSecureEnterprise Default: Calico |
registry string |
(Optional)
Registry is the default Docker registry used for component Docker images. If specified, all images will be pulled from this registry. If not specified then the default registries will be used. Image format:
This option allows configuring the |
imagePath string |
(Optional)
ImagePath allows for the path part of an image to be specified. If specified then the specified value will be used as the image path for each image. If not specified or empty, the default for each image will be used. Image format:
This option allows configuring the |
imagePullSecrets []Kubernetes core/v1.LocalObjectReference |
(Optional)
ImagePullSecrets is an array of references to container registry pull secrets to use. These are applied to all images to be pulled. |
kubernetesProvider Provider |
(Optional)
KubernetesProvider specifies a particular provider of the Kubernetes platform. This is often auto-detected. If specified, this enables provider-specific configuration and must match the auto-detected value (if any). |
calicoNetwork CalicoNetworkSpec |
(Optional)
CalicoNetwork specifies configuration options for Calico provided pod networking. |
clusterManagementType ClusterManagementType |
(Optional)
How the cluster is managed. Valid values for this field are: Standalone, Management, Managed. Standalone clusters are fully self-contained installations of Calico Enterprise. Management clusters provide a single view to manage any number of Managed clusters, which are a lighter weight installation. Default: Standalone |
(Appears on: Installation)
InstallationStatus defines the observed state of the Calico or Calico Enterprise installation.
| Field | Description |
|---|---|
variant ProductVariant |
Variant is the most recently observed installed variant - one of Calico or TigeraSecureEnterprise |
string
alias)(Appears on: IPPool)
NATOutgoingType describe the type of outgoing NAT to use.
(Appears on: CalicoNetworkSpec)
NodeAddressAutodetection provides configuration options for auto-detecting node addresses. At most one option can be used. If no detection option is specified, then IP auto detection will be disabled for this address family and IPs must be specified directly on the Node resource.
| Field | Description |
|---|---|
firstFound bool |
(Optional)
FirstFound uses default interface matching parameters to select an interface, performing best-effort filtering based on well-known interface names. |
interface string |
(Optional)
Interface enables IP auto-detection based on interfaces that match the given regex. |
skipInterface string |
(Optional)
SkipInterface enables IP auto-detection based on interfaces that do not match the given regex. |
canReach string |
(Optional)
CanReach enables IP auto-detection based on which source address on the node is used to reach the specified IP or domain. |
(Appears on:
string
alias)(Appears on: InstallationSpec, InstallationStatus)
ProductVariant represents the variant of the product. Valid options are: Calico, TigeraSecureEnterprise.
string
alias)(Appears on: InstallationSpec)
Provider represents a particular provider or flavor of Kubernetes. Valid options are: EKS, GKE, AKS, OpenShift, DockerEnterprise.
string
alias)(Appears on: TigeraStatusCondition)
StatusConditionType is a type of condition that may apply to a particular component.
(Appears on: TigeraStatusStatus)
TigeraStatusCondition represents a condition attached to a particular component.
| Field | Description |
|---|---|
type StatusConditionType |
The type of condition. May be Available, Progressing, or Degraded. |
status ConditionStatus |
The status of the condition. May be True, False, or Unknown. |
lastTransitionTime Kubernetes meta/v1.Time |
The timestamp representing the start time for the current status. |
reason string |
A brief reason explaining the condition. |
message string |
Optionally, a detailed message providing additional context. |
(Appears on: TigeraStatus)
(Appears on: TigeraStatus)
TigeraStatusStatus defines the observed state of TigeraStatus
| Field | Description |
|---|---|
conditions []TigeraStatusCondition |
Conditions represents the latest observed set of conditions for this component. A component may be one or more of Available, Progressing, or Degraded. |


Govt formation in Maharashtra: Sharad Pawar, Sonia Gandhi may meet on November 17
Congress and NCP would work out a common minimum programme (CMP) with the Sena, which would then be discussed in the meeting between Gandhi and Pawar, sources said on Thursday.
To discuss possible alliance with the Shiv Sena for forming government in Maharashtra, sources said, Congress president Sonia Gandhi and NCP supremo Sharad Pawar are likely to meet in Delhi on November 17.
Congress and NCP would work out a common minimum programme (CMP) with the Sena, which would then be discussed in the meeting between Gandhi and Pawar, sources said on Thursday.
It was, however, not clear whether and when Sena president Uddhav Thackeray will meet the two leaders after the CMP is finalised.
A 10-member coordination committee of the Congress and NCP met here on Wednesday to hold preliminary discussions on the CMP.
According to sources, Maharashtra Congress chief Balasaheb Thorat and state NCP president Jayant Patil met Thackeray here on Thursday morning, as decided in the meeting of the coordination committee.
"They (Thorat and Patil) held preliminary discussion with Thackeray. Now state leaders of the three parties will meet again here on Thursday to prepare the document (CMP) which will be sent for the approval of the respective top leadership of the three parties," the sources said.
The BJP and Shiv Sena contested the October 21 Assembly polls together and won 105 and 56 seats, respectively, securing a comfortable majority in the 288- member house.
The two parties, however, fell out after the Sena persisted with its demand of sharing the chief minister's post on a rotational basis, leading to the BJP to announce that it was in no position to stake claim to form government.
After the Shiv Sena and NCP, second and third largest parties, too said they could not stake claim immediately, the state was placed under President's rule on Tuesday.


--- title: "Succes" layout: "post" permalink: "/Succes.html" uuid: "2529336084760744879" guid: "tag:blogger.com,1999:blog-1613114477173512339.post-2529336084760744879" date: "2012-09-06 16:16:00" updated: "2012-09-06 16:16:37" description: blogger: siteid: "1613114477173512339" postid: "2529336084760744879" comments: "0" categories: author: name: "Rashid Khan" url: "https://plus.google.com/107072042175204606842?rel=author" image: "//lh4.googleusercontent.com/-gHMIPpUOF0M/AAAAAAAAAAI/AAAAAAAAA_k/GesLRLi6384/s512-c/photo.jpg" published: "false" ---


from __future__ import absolute_import import csv import functools import logging import os import sys import sysconfig from pip._vendor import pkg_resources from pip._internal.exceptions import UninstallationError from pip._internal.locations import bin_py, bin_user from pip._internal.utils.compat import WINDOWS, cache_from_source, uses_pycache from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( FakeFile, ask, dist_in_usersite, dist_is_local, egg_link_path, is_local, normalize_path, renames, rmtree, ) from pip._internal.utils.temp_dir import AdjacentTempDirectory, TempDirectory from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import ( Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Tuple, ) from pip._vendor.pkg_resources import Distribution logger = logging.getLogger(__name__) def _script_names(dist, script_name, is_gui): # type: (Distribution, str, bool) -> List[str] """Create the fully qualified name of the files created by {console,gui}_scripts for the given ``dist``. Returns the list of file names """ if dist_in_usersite(dist): bin_dir = bin_user else: bin_dir = bin_py exe_name = os.path.join(bin_dir, script_name) paths_to_remove = [exe_name] if WINDOWS: paths_to_remove.append(exe_name + '.exe') paths_to_remove.append(exe_name + '.exe.manifest') if is_gui: paths_to_remove.append(exe_name + '-script.pyw') else: paths_to_remove.append(exe_name + '-script.py') return paths_to_remove def _unique(fn): # type: (Callable[..., Iterator[Any]]) -> Callable[..., Iterator[Any]] @functools.wraps(fn) def unique(*args, **kw): # type: (Any, Any) -> Iterator[Any] seen = set() # type: Set[Any] for item in fn(*args, **kw): if item not in seen: seen.add(item) yield item return unique @_unique def uninstallation_paths(dist): # type: (Distribution) -> Iterator[str] """ Yield all the uninstallation paths for dist based on RECORD-without-.py[co] Yield paths to all the files in RECORD. For each .py file in RECORD, add the .pyc and .pyo in the same directory. UninstallPathSet.add() takes care of the __pycache__ .py[co]. """ r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD'))) for row in r: path = os.path.join(dist.location, row[0]) yield path if path.endswith('.py'): dn, fn = os.path.split(path) base = fn[:-3] path = os.path.join(dn, base + '.pyc') yield path path = os.path.join(dn, base + '.pyo') yield path def compact(paths): # type: (Iterable[str]) -> Set[str] """Compact a path set to contain the minimal number of paths necessary to contain all paths in the set. If /a/path/ and /a/path/to/a/file.txt are both in the set, leave only the shorter path.""" sep = os.path.sep short_paths = set() # type: Set[str] for path in sorted(paths, key=len): should_skip = any( path.startswith(shortpath.rstrip("*")) and path[len(shortpath.rstrip("*").rstrip(sep))] == sep for shortpath in short_paths ) if not should_skip: short_paths.add(path) return short_paths def compress_for_rename(paths): # type: (Iterable[str]) -> Set[str] """Returns a set containing the paths that need to be renamed. This set may include directories when the original sequence of paths included every file on disk. """ case_map = dict((os.path.normcase(p), p) for p in paths) remaining = set(case_map) unchecked = sorted(set(os.path.split(p)[0] for p in case_map.values()), key=len) wildcards = set() # type: Set[str] def norm_join(*a): # type: (str) -> str return os.path.normcase(os.path.join(*a)) for root in unchecked: if any(os.path.normcase(root).startswith(w) for w in wildcards): # This directory has already been handled. continue all_files = set() # type: Set[str] all_subdirs = set() # type: Set[str] for dirname, subdirs, files in os.walk(root): all_subdirs.update(norm_join(root, dirname, d) for d in subdirs) all_files.update(norm_join(root, dirname, f) for f in files) # If all the files we found are in our remaining set of files to # remove, then remove them from the latter set and add a wildcard # for the directory. if not (all_files - remaining): remaining.difference_update(all_files) wildcards.add(root + os.sep) return set(map(case_map.__getitem__, remaining)) | wildcards def compress_for_output_listing(paths): # type: (Iterable[str]) -> Tuple[Set[str], Set[str]] """Returns a tuple of 2 sets of which paths to display to user The first set contains paths that would be deleted. Files of a package are not added and the top-level directory of the package has a '*' added at the end - to signify that all it's contents are removed. The second set contains files that would have been skipped in the above folders. """ will_remove = set(paths) will_skip = set() # Determine folders and files folders = set() files = set() for path in will_remove: if path.endswith(".pyc"): continue if path.endswith("__init__.py") or ".dist-info" in path: folders.add(os.path.dirname(path)) files.add(path) # probably this one https://github.com/python/mypy/issues/390 _normcased_files = set(map(os.path.normcase, files)) # type: ignore folders = compact(folders) # This walks the tree using os.walk to not miss extra folders # that might get added. for folder in folders: for dirpath, _, dirfiles in os.walk(folder): for fname in dirfiles: if fname.endswith(".pyc"): continue file_ = os.path.join(dirpath, fname) if (os.path.isfile(file_) and os.path.normcase(file_) not in _normcased_files): # We are skipping this file. Add it to the set. will_skip.add(file_) will_remove = files | { os.path.join(folder, "*") for folder in folders } return will_remove, will_skip class StashedUninstallPathSet(object): """A set of file rename operations to stash files while tentatively uninstalling them.""" def __init__(self): # type: () -> None # Mapping from source file root to [Adjacent]TempDirectory # for files under that directory. self._save_dirs = {} # type: Dict[str, TempDirectory] # (old path, new path) tuples for each move that may need # to be undone. self._moves = [] # type: List[Tuple[str, str]] def _get_directory_stash(self, path): # type: (str) -> str """Stashes a directory. Directories are stashed adjacent to their original location if possible, or else moved/copied into the user's temp dir.""" try: save_dir = AdjacentTempDirectory(path) # type: TempDirectory except OSError: save_dir = TempDirectory(kind="uninstall") self._save_dirs[os.path.normcase(path)] = save_dir return save_dir.path def _get_file_stash(self, path): # type: (str) -> str """Stashes a file. If no root has been provided, one will be created for the directory in the user's temp directory.""" path = os.path.normcase(path) head, old_head = os.path.dirname(path), None save_dir = None while head != old_head: try: save_dir = self._save_dirs[head] break except KeyError: pass head, old_head = os.path.dirname(head), head else: # Did not find any suitable root head = os.path.dirname(path) save_dir = TempDirectory(kind='uninstall') self._save_dirs[head] = save_dir relpath = os.path.relpath(path, head) if relpath and relpath != os.path.curdir: return os.path.join(save_dir.path, relpath) return save_dir.path def stash(self, path): # type: (str) -> str """Stashes the directory or file and returns its new location. Handle symlinks as files to avoid modifying the symlink targets. """ path_is_dir = os.path.isdir(path) and not os.path.islink(path) if path_is_dir: new_path = self._get_directory_stash(path) else: new_path = self._get_file_stash(path) self._moves.append((path, new_path)) if (path_is_dir and os.path.isdir(new_path)): # If we're moving a directory, we need to # remove the destination first or else it will be # moved to inside the existing directory. # We just created new_path ourselves, so it will # be removable. os.rmdir(new_path) renames(path, new_path) return new_path def commit(self): # type: () -> None """Commits the uninstall by removing stashed files.""" for _, save_dir in self._save_dirs.items(): save_dir.cleanup() self._moves = [] self._save_dirs = {} def rollback(self): # type: () -> None """Undoes the uninstall by moving stashed files back.""" for p in self._moves: logger.info("Moving to %s\n from %s", *p) for new_path, path in self._moves: try: logger.debug('Replacing %s from %s', new_path, path) if os.path.isfile(new_path) or os.path.islink(new_path): os.unlink(new_path) elif os.path.isdir(new_path): rmtree(new_path) renames(path, new_path) except OSError as ex: logger.error("Failed to restore %s", new_path) logger.debug("Exception: %s", ex) self.commit() @property def can_rollback(self): # type: () -> bool return bool(self._moves) class UninstallPathSet(object): """A set of file paths to be removed in the uninstallation of a requirement.""" def __init__(self, dist): # type: (Distribution) -> None self.paths = set() # type: Set[str] self._refuse = set() # type: Set[str] self.pth = {} # type: Dict[str, UninstallPthEntries] self.dist = dist self._moved_paths = StashedUninstallPathSet() def _permitted(self, path): # type: (str) -> bool """ Return True if the given path is one we are permitted to remove/modify, False otherwise. """ return is_local(path) def add(self, path): # type: (str) -> None head, tail = os.path.split(path) # we normalize the head to resolve parent directory symlinks, but not # the tail, since we only want to uninstall symlinks, not their targets path = os.path.join(normalize_path(head), os.path.normcase(tail)) if not os.path.exists(path): return if self._permitted(path): self.paths.add(path) else: self._refuse.add(path) # __pycache__ files can show up after 'installed-files.txt' is created, # due to imports if os.path.splitext(path)[1] == '.py' and uses_pycache: self.add(cache_from_source(path)) def add_pth(self, pth_file, entry): # type: (str, str) -> None pth_file = normalize_path(pth_file) if self._permitted(pth_file): if pth_file not in self.pth: self.pth[pth_file] = UninstallPthEntries(pth_file) self.pth[pth_file].add(entry) else: self._refuse.add(pth_file) def remove(self, auto_confirm=False, verbose=False): # type: (bool, bool) -> None """Remove paths in ``self.paths`` with confirmation (unless ``auto_confirm`` is True).""" if not self.paths: logger.info( "Can't uninstall '%s'. No files were found to uninstall.", self.dist.project_name, ) return dist_name_version = ( self.dist.project_name + "-" + self.dist.version ) logger.info('Uninstalling %s:', dist_name_version) with indent_log(): if auto_confirm or self._allowed_to_proceed(verbose): moved = self._moved_paths for_rename = compress_for_rename(self.paths) for path in sorted(compact(for_rename)): moved.stash(path) logger.debug('Removing file or directory %s', path) for pth in self.pth.values(): pth.remove() logger.info('Successfully uninstalled %s', dist_name_version) def _allowed_to_proceed(self, verbose): # type: (bool) -> bool """Display which files would be deleted and prompt for confirmation """ def _display(msg, paths): # type: (str, Iterable[str]) -> None if not paths: return logger.info(msg) with indent_log(): for path in sorted(compact(paths)): logger.info(path) if not verbose: will_remove, will_skip = compress_for_output_listing(self.paths) else: # In verbose mode, display all the files that are going to be # deleted. will_remove = set(self.paths) will_skip = set() _display('Would remove:', will_remove) _display('Would not remove (might be manually added):', will_skip) _display('Would not remove (outside of prefix):', self._refuse) if verbose: _display('Will actually move:', compress_for_rename(self.paths)) return ask('Proceed (y/n)? ', ('y', 'n')) == 'y' def rollback(self): # type: () -> None """Rollback the changes previously made by remove().""" if not self._moved_paths.can_rollback: logger.error( "Can't roll back %s; was not uninstalled", self.dist.project_name, ) return logger.info('Rolling back uninstall of %s', self.dist.project_name) self._moved_paths.rollback() for pth in self.pth.values(): pth.rollback() def commit(self): # type: () -> None """Remove temporary save dir: rollback will no longer be possible.""" self._moved_paths.commit() @classmethod def from_dist(cls, dist): # type: (Distribution) -> UninstallPathSet dist_path = normalize_path(dist.location) if not dist_is_local(dist): logger.info( "Not uninstalling %s at %s, outside environment %s", dist.key, dist_path, sys.prefix, ) return cls(dist) if dist_path in {p for p in {sysconfig.get_path("stdlib"), sysconfig.get_path("platstdlib")} if p}: logger.info( "Not uninstalling %s at %s, as it is in the standard library.", dist.key, dist_path, ) return cls(dist) paths_to_remove = cls(dist) develop_egg_link = egg_link_path(dist) develop_egg_link_egg_info = '{}.egg-info'.format( pkg_resources.to_filename(dist.project_name)) egg_info_exists = dist.egg_info and os.path.exists(dist.egg_info) # Special case for distutils installed package distutils_egg_info = getattr(dist._provider, 'path', None) # Uninstall cases order do matter as in the case of 2 installs of the # same package, pip needs to uninstall the currently detected version if (egg_info_exists and dist.egg_info.endswith('.egg-info') and not dist.egg_info.endswith(develop_egg_link_egg_info)): # if dist.egg_info.endswith(develop_egg_link_egg_info), we # are in fact in the develop_egg_link case paths_to_remove.add(dist.egg_info) if dist.has_metadata('installed-files.txt'): for installed_file in dist.get_metadata( 'installed-files.txt').splitlines(): path = os.path.normpath( os.path.join(dist.egg_info, installed_file) ) paths_to_remove.add(path) # FIXME: need a test for this elif block # occurs with --single-version-externally-managed/--record outside # of pip elif dist.has_metadata('top_level.txt'): if dist.has_metadata('namespace_packages.txt'): namespaces = dist.get_metadata('namespace_packages.txt') else: namespaces = [] for top_level_pkg in [ p for p in dist.get_metadata('top_level.txt').splitlines() if p and p not in namespaces]: path = os.path.join(dist.location, top_level_pkg) paths_to_remove.add(path) paths_to_remove.add(path + '.py') paths_to_remove.add(path + '.pyc') paths_to_remove.add(path + '.pyo') elif distutils_egg_info: raise UninstallationError( "Cannot uninstall {!r}. It is a distutils installed project " "and thus we cannot accurately determine which files belong " "to it which would lead to only a partial uninstall.".format( dist.project_name, ) ) elif dist.location.endswith('.egg'): # package installed by easy_install # We cannot match on dist.egg_name because it can slightly vary # i.e. setuptools-0.6c11-py2.6.egg vs setuptools-0.6rc11-py2.6.egg paths_to_remove.add(dist.location) easy_install_egg = os.path.split(dist.location)[1] easy_install_pth = os.path.join(os.path.dirname(dist.location), 'easy-install.pth') paths_to_remove.add_pth(easy_install_pth, './' + easy_install_egg) elif egg_info_exists and dist.egg_info.endswith('.dist-info'): for path in uninstallation_paths(dist): paths_to_remove.add(path) elif develop_egg_link: # develop egg with open(develop_egg_link, 'r') as fh: link_pointer = os.path.normcase(fh.readline().strip()) assert (link_pointer == dist.location), ( 'Egg-link %s does not match installed location of %s ' '(at %s)' % (link_pointer, dist.project_name, dist.location) ) paths_to_remove.add(develop_egg_link) easy_install_pth = os.path.join(os.path.dirname(develop_egg_link), 'easy-install.pth') paths_to_remove.add_pth(easy_install_pth, dist.location) else: logger.debug( 'Not sure how to uninstall: %s - Check: %s', dist, dist.location, ) # find distutils scripts= scripts if dist.has_metadata('scripts') and dist.metadata_isdir('scripts'): for script in dist.metadata_listdir('scripts'): if dist_in_usersite(dist): bin_dir = bin_user else: bin_dir = bin_py paths_to_remove.add(os.path.join(bin_dir, script)) if WINDOWS: paths_to_remove.add(os.path.join(bin_dir, script) + '.bat') # find console_scripts _scripts_to_remove = [] console_scripts = dist.get_entry_map(group='console_scripts') for name in console_scripts.keys(): _scripts_to_remove.extend(_script_names(dist, name, False)) # find gui_scripts gui_scripts = dist.get_entry_map(group='gui_scripts') for name in gui_scripts.keys(): _scripts_to_remove.extend(_script_names(dist, name, True)) for s in _scripts_to_remove: paths_to_remove.add(s) return paths_to_remove class UninstallPthEntries(object): def __init__(self, pth_file): # type: (str) -> None if not os.path.isfile(pth_file): raise UninstallationError( "Cannot remove entries from nonexistent file %s" % pth_file ) self.file = pth_file self.entries = set() # type: Set[str] self._saved_lines = None # type: Optional[List[bytes]] def add(self, entry): # type: (str) -> None entry = os.path.normcase(entry) # On Windows, os.path.normcase converts the entry to use # backslashes. This is correct for entries that describe absolute # paths outside of site-packages, but all the others use forward # slashes. # os.path.splitdrive is used instead of os.path.isabs because isabs # treats non-absolute paths with drive letter markings like c:foo\bar # as absolute paths. It also does not recognize UNC paths if they don't # have more than "\\sever\share". Valid examples: "\\server\share\" or # "\\server\share\folder". Python 2.7.8+ support UNC in splitdrive. if WINDOWS and not os.path.splitdrive(entry)[0]: entry = entry.replace('\\', '/') self.entries.add(entry) def remove(self): # type: () -> None logger.debug('Removing pth entries from %s:', self.file) with open(self.file, 'rb') as fh: # windows uses '\r\n' with py3k, but uses '\n' with py2.x lines = fh.readlines() self._saved_lines = lines if any(b'\r\n' in line for line in lines): endline = '\r\n' else: endline = '\n' # handle missing trailing newline if lines and not lines[-1].endswith(endline.encode("utf-8")): lines[-1] = lines[-1] + endline.encode("utf-8") for entry in self.entries: try: logger.debug('Removing entry: %s', entry) lines.remove((entry + endline).encode("utf-8")) except ValueError: pass with open(self.file, 'wb') as fh: fh.writelines(lines) def rollback(self): # type: () -> bool if self._saved_lines is None: logger.error( 'Cannot roll back changes to %s, none were made', self.file ) return False logger.debug('Rolling %s back to previous state', self.file) with open(self.file, 'wb') as fh: fh.writelines(self._saved_lines) return True


| | |
- abc.ABC(builtins.object)
-
- Assimilate
-
- EnKF
- No_Assimilate
- RSREnKF
- SIR
- SREnKF
class Assimilate(abc.ABC) |
| |
The abstract base class used to represent an Data Assimilation algorithm
Attributes
----------
Methods
-------
analyze(state, measure)
Performs the assimilation algorithm |
| |
- Method resolution order:
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the SREnKF on state with given measurements
Parameters
----------
state: numpy.ndarray
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'__init__'})
|
class EnKF(Assimilate) |
| |
Performs a perturbed observation EnKF based on 'Evensen 2003'
Attributes
----------
Methods
-------
analyze(state, measure)
Performs the assimilation algorithm |
| |
- Method resolution order:
- EnKF
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the EnKF on state with given measurements
Parameters
----------
state: numpy.ndarray
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Data descriptors inherited from Assimilate:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class No_Assimilate(Assimilate) |
| |
The class for performing no data assimilation
Attributes
----------
Methods
-------
analyze(state, measure)
Performs the assimilation algorithm |
| |
- Method resolution order:
- No_Assimilate
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the SREnKF on state with given measurements
Parameters
----------
state: numpy.ndarray
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Data descriptors inherited from Assimilate:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class RSREnKF(Assimilate) |
| |
The class for performing the square root EnKF with regularization
term
Attributes
----------
regularize
the regularization function
regularize_prime
the jacobian of the regularization function
w_mat
the weight matrix associated with the regularization norm
lam0
the regularization weight
Methods
-------
analyze(state, measure)
Performs the assimilation algorithm
set_regularizer(regularize, regularize_prime, w_mat, lam0)
Sets parameters associated with regularization |
| |
- Method resolution order:
- RSREnKF
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the RSREnKF on state with given measurements
Parameters
----------
state: numpy.ndarray
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
- set_regularizer(self, regularize, regularize_prime, w_mat, lam0)
- Sets the regularization parameters and functions used in the REnKF
Parameters
----------
regularize: numpy.ndarray
The given states to perform assimilation on
regularize_prime: Measure
The given Class containing information about measurement
w_mat: numpy.ndarray
The weight matrix for which the norm is performed in
lam0: numpy.ndarray
The base regularizaton parameter
Raises
------
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Data descriptors inherited from Assimilate:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class SIR(Assimilate) |
| |
Performs a Sequential Importance Resampling Particle Filter
Attributes
----------
weights
weights for the resampling
likelihood
likelihood function of the data
threshold
threshold for effective sample size
Methods
-------
set_weights(weights)
Sets the base weight for each particle
set_likelihood(likelihood)
Sets the likelihood function for the data
set_threshold(threshold)
Sets the threshold for effective sample size of the SIR
analyze(state, measure)
Performs the assimilation algorithm |
| |
- Method resolution order:
- SIR
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the SIR on state with given measurements
Parameters
----------
state : numpy.ndarray:
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
- set_likelihood(self, likelihood)
- Sets the likelihood for the data
Parameters
----------
likelihood: type.LambdaType
lambda function for the likelihood function of the data
Raises
------
TypeError
If any parameter is not set or incorrect type
- set_threshold(self, threshold)
- Sets the weights for the particles
Parameters
----------
threshold: float or int
Sets the threshold for the minimum effective sample size
Raises
------
- set_weights(self, weights)
- Sets the weights for the particles
Parameters
----------
weights: np.ndarray
weight for each particle
Raises
------
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Data descriptors inherited from Assimilate:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class SREnKF(Assimilate) |
| |
The class for performing the square root EnKF, as seen in
Law, Stuart, Zygalakis 2015
Attributes
----------
Methods
-------
analyze(state, measure)
Performs the assimilation algorithm |
| |
- Method resolution order:
- SREnKF
- Assimilate
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self)
- Initializes Class
Parameters
----------
- analyze(self, state, measure)
- Performs the SREnKF on state with given measurements
Parameters
----------
state: numpy.ndarray
The given states to perform assimilation on
measure: Measure
The given Class containing information about measurement
Raises
------
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Data descriptors inherited from Assimilate:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |


Copyright 2015 Qualcomm Technologies International, Ltd.
Bluetooth Low Energy CSRmesh 2.0
CSRmesh™ is a product of Qualcomm Technologies International Ltd.
Defines CSRmesh Time Model specific data structures
.
More...
Data Structures | |
| struct | CSRMESH_TIME_SET_STATE_T |
| CSRmesh Time Model message types. More... | |
| struct | CSRMESH_TIME_STATE_T |
| Set time broadcast interval. More... | |
| struct | CSRMESH_TIME_SET_TIME_T |
| Setting Current Local Time: Upon receiving a TIME_SET_TIME message, the device sets the CurrentTime to the CurrentTime field of the message. This message is deprecated; it should only be used when a device cannot wait for a time broadcast. More... | |
| struct | CSRMESH_TIME_GET_TIME_T |
| Wallclock broadcast interval: Upon receiving a TIME_GET_TIME message, the device responds with the TIME_TIME message. The CurrentTime is set to the current local time. The SenderTTL field is set to the TTL value used by the initial sender of this message. The difference between the CurrentTime, as known by this device, and the CurrentTime field in the TIME_GET_TIME message divided by the subtraction of the TTL of the received message and the SenderTTL is placed into the RttPerHop field of the TIME_TIME message. This message is deprecated; it should only be used when a device cannot wait for a time broadcast. More... | |
| struct | CSRMESH_TIME_TIME_T |
| Set wallclock time. More... | |
| struct | CSRMESH_TIME_BROADCAST_T |
| Synchronise wall clock time from client device: This message is always sent with TTL=0. This message is sent at intervals by the clock master. It is always sent with TTL=0. It is repeated, but the time is updated before each repeat is sent. The clock master repeats the message 5 times, relaying stations repeat it 3 times. When a node receives a clock broadcast its behaviour depends on the current clock state: MASTER: Ignore broadcasts. INIT: Start the clock; relay this message. Set state to NO_RELAY if MasterFlag set, otherwise RELAY_MASTER. Start relay timer. RELAY: Correct clock if required. Relay this message. Set state to NO_RELAY if MasterFlag set, otherwise RELAY_MASTER. Start relay timer. NO_RELAY: Ignore. State will be reset to RELAY when the relay timer goes off. RELAY_MASTER: Relay message only if it is from the clock master and set state to NO_RELAY. The relay timer is by default 1/4 of the clock broadcast interval (15 seconds if the interval is 60 seconds). This means that each node will relay a message only once, and will give priority to messages from the clock master (which always causes the clock to be corrected). Messages from other nodes will only cause clock correction if they exceed the max clock skew (250ms). More... | |


All the Government Barbecues
In the last seven years, Brazilian public funds were used to pay for, on average, two steakhouse dinners every day
Since December of 2009, when all the expenses paid with government-sponsored credit cards were made available online, 4.911 bills were registered on ‘churrascarias’ – the Brazilian barbecue houses, where, usually, an all-you-can-eat selection of fine cuts is served on sword-like skewers.
Usually, a meal on a ‘churrascaria’ costs twice or more than in other sort of establishments. On total, around R$ 1,2 million– an amount equivalent to US$ 385,000 – was spent on those restaurants.
The higher the flame,
the higher the price
In the chart below, every purchase made in a “churrascaria” is represented by a little dot (), which gets brighter due to overlapping. We highlighted some specially extravagant dinners, which costed above R$ 6.000 (around US$ 1,900)
Most purchases were made by national defense entities
The greatest part of those expenses came from army personnel and staffers from the Ministry of Defense. Indeed, some of the restaurants that received the most money are located near highways, which suggests that officials might be going there to eat during duty travels. Nevertheless, there are many examples of extravagant dinners as well.
In the most recent case, between July 6 and July 10 of 2017, cardholders from the Ministry of Defense’s administrative office went three times to “Fogo de Chão”, a luxurious steakhouse of worldwide fame located in Brasília, the federal capital. In the sum of those, approximately R$ 8.600 were spent – an amount sufficient for 62 people to enjoy a pricey R$ 120 (US$ 38) dinner.
In contrast, the average monthly per-capita income of a Brazilian household in 2016, according to the Brazilian Institute of Geography and Statistics (IBGE), was of R$ 1.226 – seven times less than the amount spent in prime steaks by the officials in those five days alone.
Talking about the IBGE, it was responsible for some curious purchases as well: between March 2014 and March 2015, a unit of the institution made thirteen payments to an establishment called “Disk-Cerveja” – a beer‑home delivery hotline.
13 purchases at a beer‑home delivery hotline
The government-sponsored credit cards, officially named Federal Government Payment Card (CPFG, in the Portuguese acronym), were originally created to make it easier for public officials to buy supplies in exceptional cases, when submitting the purchases to a board approval process would take an unreasonable amount of time.
Breaking the law
Apart from the questionable nature of expenses with luxury dining and booze delivery, staffers of the public sector that made purchases above R$ 8.000 for their agencies possibly broke the Brazilian bidding law.
According to it, all the acquisitions that surpass this cap should undergo a full bidding process, in which companies would compete to provide the best price.
There are a few exceptions, such as purchases made during a state of public calamity and the purchase of artistic goods. “Usage material”for the Armed Forces is also among them, in these exact vague terms.
Confidential for “security reasons”
Since 2010, over-the-cap purchases were made 2,297 times – and out of those, 2,277 cases were deemed confidential to “ensure the safety of the society and the State”. Of the remaining 20 purchases, 17 came, again, from staffers of the Ministry of Defense. The payments were made in automobile parts and computer applicances stores, supermarkets, an internet provider and hotels.
Purchases that may break law are secret
Those questionable expenses can be linked to a broader lack of transparency. Even though all the purchases made with government credit-cards are supposedly available for public scrutiny online, more than 60% those payments are, by all practical means, untraceable.
This happens because around R$ 220 million were deemed confidential by the government for national security issues.
Of that amount, R$ 160 million came from the Federal Police, the Brazilian Intelligence Agency (ABIN), the federal capital security forces, the Army, the Airforce or the tax-collecting agency. The rest comes from the President and Vice-President offices – where expenses are 99% and 97% secret, respectively. Apart from that, another R$ 60 million was directly withdrew from ATMs – what makes the destination of the money impossible to follow. Overall, then, around R$ 280 million spent using government-funded credit cards isn’t transparent.


The VersionOne installation URL is the only option for which a value is required.
https://www8.v1host.com/MyExampleAccountName/
Tinker here for more advanced customization of the extension.


Title: ASP.NET Common Web Page Class Library - Part 4
Author: Eric Woodruff
Email<EMAIL_ADDRESS>Environment: Visual Studio .NET, IIS, ASP.NET, C#, VB.NET
Keywords: page, template, render, link, regular expression, validation summary
Level: Intermediate
Description: A utility class containing some useful features for ASP.NET applications
Section ASP.NET
SubSection General
Table of Contents
Introduction
This is the fourth in a series of articles on a class library for
ASP.NET applications that I have developed. It contains a set of common,
reusable page classes that can be utilized in web applications as-is to
provide a consistent look, feel, and set of features. New classes can also
be derived from them to extend their capabilities. The features are all
fairly modular and may be extracted and placed into your own classes too.
For a complete list of articles in the series along with a demonstration
application and the code for the classes, see Part
1 [^ ].
This article describes the only non-page derived class in the library,
PageUtils
, along with the remaining methods of the
BasePage
class that are somewhat similar in nature to those
contained in it. PageUtils
contains a set of utility functions
that you may find useful in any ASP.NET application. Each of the features
is described below. The class itself is sealed and all public properties
and methods are static. As such, the constructor is declared private as
there is no need to instantiate the class.
HTML Encoding
The first method presented is HtmlEncode
, which can be
called to encode an object for output to an HTML page. It encodes any HTML
special characters as literals instead of letting the browser interpret
them. In addition, it replaces multiple spaces, tabs, and line breaks with
their HTML equivalents thus preserving the layout of the specified text.
The size of expanded tab characters can be altered using the
TabSize
property. Set it to the number of non-breaking spaces
that should replace the tab character. The default is four.
If the object is null
(Nothing
), results in an empty string, or is a
single space, a non-breaking space is returned. In conjunction with the
above-described behavior, this is useful for displaying database fields
that contain HTML special characters, formatting, or nulls such as those
with the text or memo data type.
As an added bonus, if the encodeLinks
parameter is true,
URLs, UNCs, and e-mail addresses are converted to hyperlinks whenever
possible using the EncodeLinks
method (see below). If false,
they are not converted and will be rendered as normal text. As shown below,
the code is fairly simple and requires little in the way of additional
explanation.
public static string HtmlEncode(Object objText, bool encodeLinks)
{
StringBuilder sb;
string text;
if(objText != null)
{
text = objText.ToString();
if(text.Length != 0)
{
// Create tab expansion string if not done already
if(expandTabs == null)
expandTabs = new String(' ',
PageUtils.TabSize).Replace(" ", " ");
// Encode the string
sb = new StringBuilder(
HttpUtility.HtmlEncode(text), 256);
sb.Replace(" ", " "); // Two spaces
sb.Replace("\t", expandTabs);
sb.Replace("\r", "");
sb.Replace("\n", "
");
text = sb.ToString();
if(text.Length > 1)
{
if(!encodeLinks)
return text;
// Try to convert URLs, UNCs, and e-mail
// addresses to links.
return PageUtils.EncodeLinks(text);
}
if(text.Length == 1 && text[0] != ' ')
return text;
}
}
return " ";
}
Link Encoding
The second method presented is EncodeLinks
. This method is
called by HtmlEncode
but can also be called directly by your
code. It takes the passed string and finds all URLs, UNCs, and e-mail
addresses and converts them to clickable hyperlinks suitable for rendering
in an HTML page. For UNC paths, it will include any text up to the first
whitespace character. If the path contains spaces, you can enclose the
entire path in angle brackets (i.e., <\\Server\Folder\Name With
Spaces>) and the encoder will include all text between the angle
brackets in the hyperlink. The angle brackets will not appear in the
encoded hyperlink.
public static string EncodeLinks(string text)
{
// We'll create these on first use and keep them around
// for subsequent calls to save resources.
if(reURL == null)
{
reURL = new Regex(@"(((file|news|(ht|f|nn)tp(s?))://)|" +
@"(www\.))+[\w()*\-!_%]+.[\w()*\-/.!_#%]+[\w()*\-/" +
@".!_#%]*((\?\w+(\=[\w()*\-/.!_#%]*)?)(((&|&(?" +
@"!\w+;))(\w+(\=[\w()*\-/.!_#%]*)?))+)?)?",
RegexOptions.IgnoreCase);
reUNC = new Regex(@"(\\{2}\w+(\\((&.{2,8};|" +
@"[\w\-\.,@?^=%&:/~\+#\$])*[\w\-\@?^=%&/~\+#\$])?)" +
@"*)|((\<|\<)\\{2}\w+(\\((&.{2,8};|" +
@"[\w\-\.,@?^=%&:/~\+#\$ ])*)?)*(\>|\>))",
RegexOptions.IgnoreCase);
reEMail = new Regex(@"([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\." +
@"]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]" +
@"[0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))(" +
@"[a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|" +
@"[1-9][0-9]|[0-9])\])", RegexOptions.IgnoreCase);
reTSUNC = new Regex(
@"\.?((&\#\d{1,3}|&\w{2,8});((&\#\d{1,3}|&" +
@"\w{2,8}))?)+\w*$");
urlMatchEvaluator = new MatchEvaluator(OnUrlMatch);
uncMatchEvaluator = new MatchEvaluator(OnUncMatch);
}
// Do the replacements
text = reURL.Replace(text, urlMatchEvaluator);
text = reUNC.Replace(text, uncMatchEvaluator);
text = reEMail.Replace(text,
@"$&");
return text;
}
As you can see, the method uses regular expressions to search for and
replace each URL, UNC, and e-mail address. The expressions used should
catch just about all variations of each type. The regular expression
objects are created on first use and are kept around for subsequent calls
to save a little time. For URLs and UNCs, the following match evaluators
handle the actual work of the replacement:
// Replace a URL with a link to the URL. This checks for a
// missing protocol and adds it if necessary.
private static string OnUrlMatch(Match match)
{
StringBuilder sb = new StringBuilder("");
sb.Append(url);
sb.Append("");
return sb.ToString();
}
// Replace a UNC with a link to the UNC. This strips off any
// containing brackets (plain or encoded) and flips the slashes.
private static string OnUncMatch(Match match)
{
StringBuilder sb = new StringBuilder("<a href='file:", 256);
string unc = match.Value;
// Strip brackets if found. If it has encoded brackets,
// strip them too.
if(unc[0] == '<')
unc = unc.Substring(1, unc.Length - 2);
else
if(unc.StartsWith("<"))
unc = unc.Substring(4, unc.Length - 8);
// Move trailing special characters outside the link
Match m = reTSUNC.Match(unc);
if(m.Success == true)
unc = reTSUNC.Replace(unc, "");
sb.Append(unc);
sb.Append("' target='_BLANK'>");
// Replace backslashes with forward slashes
sb.Replace('\\', '/');
sb.Append(unc);
sb.Append("");
if(m.Success == true)
sb.Append(m.Value);
return sb.ToString();
}
A regular expression match evaluator is like a callback. Each time the
regular expression finds a match, it calls the evaluator. Its job is to
take the found text and modify it in any way necessary and then return it
to the regular expression so that it can be used to replace the original
text. In these two cases, the match evaluators add the anchor tag and
ensure that the links are formatted appropriately.
Converting Validation Messages to Hyperlinks
In my applications, I have come to favor the validation summary control
to contain all validation error messages generated by the page. It keeps
them all in one location and does not adversely affect the layout of the
controls in the form when they are made visible. The drawback is that on a
form with a large number of controls and validation conditions, it can
sometimes be difficult to match each message to its control, especially if
the form is long enough to require scrolling around to find it. As such, I
have added functionality to the BasePage
class to
automatically convert all validation control error messages that are set to
appear in a validation summary control to clickable hyperlinks that will
take you directly to the offending field by giving it the focus.
protected virtual void ConvertValMsgsToLinks()
{
BaseValidator bv;
foreach(IValidator val in this.Validators)
{
bv = val as BaseValidator;
if(bv != null && bv.Visible == true &&
bv.ControlToValidate.Length > 0 &&
bv.Display == ValidatorDisplay.None)
bv.ErrorMessage = MakeMsgLink(bv.ControlToValidate,
bv.ErrorMessage, this.MsgLinkCssClass);
}
}
A call to ConvertValMsgsToLinks
is done as the very first
step in the overridden Render
method. It iterates over the
page's Validators
collection. The validator control must be
visible, must have its ControlToValidate
property set to a
control ID, and must have its Display
property set to
None
indicating that it will appear in a validation summary
control. If all of the necessary conditions are met, a call is placed to
the MakeMsgLink
method to convert the error message to a
hyperlink.
Note that since this occurs within the rendering step, changes to the
error messages are not retained. If the page posts back, the error messages
are restored from view state and will be in their non-hyperlink form. When
the page renders during the postback, the messages will be converted to
hyperlinks again provided that they still meet the necessary conditions. I
chose this approach so that it is transparent to users of the class, is
non-intrusive, and will not break any code that expects the messages to be
in their non-hyperlink form. Derived classes can override this method to
extend or suppress this behavior.
Note: If extracting the above method for use in your own
classes, be sure to override the page's Render
method and call
it. If not, the links will not be converted.
public string MakeMsgLink(string id, string msg, string cssClass)
{
string newClass;
// Don't bother if it's null, empty, or already in the form
// of a link.
if(msg == null || msg.Length == 0 || msg.StartsWith("<a "))
return msg;
StringBuilder sb = new StringBuilder(512);
// Add the anchor tag and the optional CSS class
sb.Append(" 0)
{
sb.Append("class='");
sb.Append(newClass);
sb.Append("' ");
}
// An HREF is included that does nothing so that we can use
// the hover style to do stuff like underline the link when
// the mouse is over it. OnClick performs the action and
// returns false so that we don't trigger IE's
// OnBeforeUnload event which may be tied to data change
// checking code.
// NOTE: OnPreRender registers the script containing the
// function. Tell the function to use the "Find Control"
// method to locate the ID. That way, it works for controls
// embedded in data grids.
sb.Append("href='javascript:return false;' " +
"onclick='javascript: return BP_funSetFocus(\"");
sb.Append(id);
sb.Append("\", true);'>");
sb.Append(msg);
sb.Append("");
return sb.ToString();
}
The MakeMsgLink
method will convert the passed text into a
hyperlink that transfers focus to the control with the specified ID. The
Set Focus script, described in part one of
this series, controls setting the focus to the control. As such, the
specified ID can be an exact match or the ending part of an ID (see
part one for details). An optional CSS class name
can be specified that will be applied to the hyperlink. If
null
, it uses the one defined by the
MsgLinkCssClass
property. By default, it is set to the value
of the BasePage.MsgLinkCssName
constant which is currently set
to the style name ErrorMsgLink. The class name should appear in
the stylesheet associated with the application. As noted, a dummy
href
is added to the link so that you can add a
hover
style to the CSS class. For example, in my applications,
the error messages display as normal text and show an underline as the
mouse passes over them.
Conclusion
Although small, the PageUtils
class contains some very
helpful features. The validation message link feature of
BasePage
can also make the validation summary control more
user friendly. Hopefully, you will find this class and the others in the
library, or parts of them, as useful as I have.
Revision History
| 04/02/2006 |
|
Changes in this release:
- Reworked the URL encoding regular expression in PageUtils so
that it includes a few more protocols, includes all valid URL
characters, handles URLs with parameters, and does not include
special characters after the URL.
- Breaking Change: Property and method names have been
modified to conform to the .NET naming conventions with regard to casing
(
PageUtils.HtmlEncode , BasePage.MsgLinkCssClass ,
and BasePage.MsgLinkCssName ).
|
| 11/26/2004 |
|
Made some changes to the URL and UNC link encoding regular
expressions to make them more accurate. |
| |
| 12/01/2003 |
|
Initial release |


Classes | |
| struct | excess_sum |
Public Types | |
| typedef double | return_type |
| typedef PointOfSegment | segment_point_type |
| typedef excess_sum | state_type |
Public Member Functions | |
| void | apply (PointOfSegment const &p1, PointOfSegment const &p2, excess_sum &state) const |
| huiller (double radius=1.0) | |
| return_type | result (excess_sum const &state) const |
| P | type of points of rings/polygons |
This version works for convex and non-convex polygons, for 180 meridian crossing polygons and for polygons with holes. However, some cases (especially 180 meridian cases) must still be checked.
The version which sums angles, which is often seen, doesn't handle non-convex polygons correctly.
The version which sums longitudes, see http://trs-new.jpl.nasa.gov/dspace/bitstream/2014/40409/1/07-03.pdf, is simple and works well in most cases but not in 180 meridian crossing cases. This probably could be solved.
Definition at line 47 of file area_huiller.hpp.
| typedef double boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::return_type |
Definition at line 70 of file area_huiller.hpp.
| typedef PointOfSegment boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::segment_point_type |
Definition at line 71 of file area_huiller.hpp.
| typedef excess_sum boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::state_type |
Definition at line 72 of file area_huiller.hpp.
| boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::huiller | ( | double | radius = 1.0 |
) |
Definition at line 74 of file area_huiller.hpp.
| void boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::apply | ( | PointOfSegment const & | p1, | |
| PointOfSegment const & | p2, | |||
| excess_sum & | state | |||
| ) | const |
Definition at line 78 of file area_huiller.hpp.
| return_type boost::geometry::strategy::area::huiller< PointOfSegment, CalculationType >::result | ( | excess_sum const & | state | ) | const |
Definition at line 125 of file area_huiller.hpp.
|
December 1, 2009 |
Copyright © 1995-2009 Barend Gehrels, Geodan, Amsterdam Copyright © 2008-2009 Bruno Lalande, Paris Copyright © 2009 Mateusz Loskot, Cadcorp, London |


| 1 | /* | |
| 2 | * To change this license header, choose License Headers in Project Properties. | |
| 3 | * To change this template file, choose Tools | Templates | |
| 4 | * and open the template in the editor. | |
| 5 | */ | |
| 6 | package dev.kumpulatd.logic; | |
| 7 | ||
| 8 | import dev.kumpulatd.objects.PathPoint; | |
| 9 | import java.util.ArrayList; | |
| 10 | import java.util.List; | |
| 11 | ||
| 12 | /** | |
| 13 | * Is used to determine the path the enemies move | |
| 14 | * | |
| 15 | * @author kummi | |
| 16 | */ | |
| 17 | public class PathFinding { | |
| 18 | ||
| 19 | private List<PathPoint> list; | |
| 20 | ||
| 21 | /** | |
| 22 | * Constructor for the PathFinding class | |
| 23 | */ | |
| 24 | public PathFinding() { | |
| 25 | list = new ArrayList<>(); | |
| 26 | } | |
| 27 | ||
| 28 | /** | |
| 29 | * Add a point to the pathfinding class | |
| 30 | * | |
| 31 | * @param x | |
| 32 | * @param y | |
| 33 | */ | |
| 34 | public void addPoint(int x, int y) { | |
| 35 | list.add(new PathPoint(x, y)); | |
| 36 | } | |
| 37 | ||
| 38 | /** | |
| 39 | * Get a point from pathfinding class | |
| 40 | * | |
| 41 | * @param x | |
| 42 | * @return | |
| 43 | */ | |
| 44 | public PathPoint getPoint(int x) { | |
| 45 |
4
1. getPoint : changed conditional boundary → KILLED 2. getPoint : changed conditional boundary → KILLED 3. getPoint : negated conditional → KILLED 4. getPoint : negated conditional → KILLED |
if (x < list.size() && x >= 0) { |
| 46 |
1
1. getPoint : mutated return of Object value for dev/kumpulatd/logic/PathFinding::getPoint to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return list.get(x); |
| 47 |
1
1. getPoint : negated conditional → KILLED |
} else if (!list.isEmpty()) { |
| 48 |
2
1. getPoint : Replaced integer subtraction with addition → KILLED 2. getPoint : mutated return of Object value for dev/kumpulatd/logic/PathFinding::getPoint to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return list.get(this.getSize() - 1); |
| 49 | } else { | |
| 50 |
1
1. getPoint : mutated return of Object value for dev/kumpulatd/logic/PathFinding::getPoint to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return null; |
| 51 | } | |
| 52 | ||
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * Get the length of the path | |
| 57 | * | |
| 58 | * @return | |
| 59 | */ | |
| 60 | public int getSize() { | |
| 61 |
1
1. getSize : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return list.size(); |
| 62 | } | |
| 63 | ||
| 64 | /** | |
| 65 | * Get all the waypoints | |
| 66 | * | |
| 67 | * @return | |
| 68 | */ | |
| 69 | public List<PathPoint> getPoints() { | |
| 70 |
1
1. getPoints : mutated return of Object value for dev/kumpulatd/logic/PathFinding::getPoints to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return list; |
| 71 | } | |
| 72 | } | |
Mutations | ||
| 45 |
1.1 2.2 3.3 4.4 |
|
| 46 |
1.1 |
|
| 47 |
1.1 |
|
| 48 |
1.1 2.2 |
|
| 50 |
1.1 |
|
| 61 |
1.1 |
|
| 70 |
1.1 |


Connection to the 'Redis' key/value store using the C-language client library 'hiredis' (included as a fallback) with 'MsgPack' encoding provided via 'RcppMsgPack' headers.
| Version: | 0.1.9 |
| Imports: | methods, Rcpp (≥ 0.11.0), RApiSerialize |
| LinkingTo: | Rcpp, RApiSerialize, BH |
| Suggests: | RcppMsgPack, rredis, RUnit |
| Published: | 2018-10-27 |
| Author: | Dirk Eddelbuettel |
| Maintainer: | Dirk Eddelbuettel <edd at debian.org> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | yes |
| SystemRequirements: | An available hiredis library (eg via package libhiredis-dev on Debian/Ubuntu, hiredis-devel on Fedora/RedHat, or directly from source from <https://github.com/redis/hiredis>) is preferred but otherwise built on demand. |
| Materials: | README NEWS ChangeLog |
| In views: | Databases |
| CRAN checks: | RcppRedis results |
| Reference manual: | RcppRedis.pdf |
| Package source: | RcppRedis_0.1.9.tar.gz |
| Windows binaries: | r-devel: RcppRedis_0.1.9.zip, r-release: RcppRedis_0.1.9.zip, r-oldrel: RcppRedis_0.1.9.zip |
| OS X binaries: | r-release: RcppRedis_0.1.9.tgz, r-oldrel: RcppRedis_0.1.9.tgz |
| Old sources: | RcppRedis archive |
Please use the canonical form https://CRAN.R-project.org/package=RcppRedis to link to this page.


{{ error_message }}
Date:
Envelope: {% for envelope in envelopes %} {{ envelope.name }} {% endfor %}
Type: Expense Income
Description:
Sum:
Comment:


| Game ID | Creation Date | GamePlayers ID | Player ID | Player Email |
|---|---|---|---|---|
| {{game.id}} | {{game.created}} | {{game.gamePlayers[0].id}} | {{game.gamePlayers[0].player.id}} | {{game.gamePlayers[0].player.name}} |
| {{game.gamePlayers[1].id}} | {{game.gamePlayers[1].player.id}} | {{game.gamePlayers[1].player.name}} | ||
| N/A | N/A | N/A |


Uber discriminated against blind woman with dog, panel rules
AUGUSTA, Maine (AP) - A panel in Maine has ruled that Uber discriminated against a blind woman when a driver refused to give her a ride because she was traveling with her guide dog.
The Portland Press Herald reports the Maine Human Rights Commission voted Monday that Uber discriminated against Patricia Sarchi because of her visual impairment.
The report says a manicurist ordered an Uber for Sarchi after an appointment in January 2017. The driver told Sarchi he could not give her a ride because she had her guide dog.
The ride-sharing company later charged Sarchi a $5 ride cancellation fee.
Uber argued it could not be held responsible because its drivers are independent contractors.
The company said Tuesday it can’t comment on pending litigation. It added that its guidelines prohibit discrimination against riders.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


--- layout: data_model title: StartupInfoType this_version: 1.1 ---
The StartupInfoType type encapsulates the information contained in the STARTUPINFO struct for the process.
| Field Name | Type | Description |
|---|---|---|
| lpDesktop0..1 | StringObjectPropertyType |
The lpDesktop field specifies the name of the desktop, or the name of both the desktop and window station for this process. |
| lpTitle0..1 | StringObjectPropertyType |
The lpTitle field specifies the title displayed in the title bar if a new console window is created. |
| dwX0..1 | IntegerObjectPropertyType |
The dwX field specifies the x offset of the upper left corner of a window if a new window is created, in pixels. |
| dwY0..1 | IntegerObjectPropertyType |
The dwY field specifies the y offset of the upper left corner of a window if a new window is created, in pixels. |
| dwXSize0..1 | PositiveIntegerObjectPropertyType |
The dwXSize field specifies the width of the window if a new window is created, in pixels. |
| dwYSize0..1 | PositiveIntegerObjectPropertyType |
The dwYSize field specifies the height of the window if a new window is created, in pixels. |
| dwXCountChars0..1 | PositiveIntegerObjectPropertyType |
The dwXCountChars field specifies the screen buffer width, in character columns. |
| dwYCountChars0..1 | PositiveIntegerObjectPropertyType |
The dwYCountChars field specifies the screen buffer height, in character rows. |
| dwFillAttribute0..1 | IntegerObjectPropertyType |
The dwFillAttribute field specifies the initial text and background colors if a new console window is created in a console application. |
| dwFlags0..1 | IntegerObjectPropertyType |
The dwFlags field specifies a bitfield that determines whether certain STARTUPINFO members are used when the process creates a window. |
| wShowWindow0..1 | IntegerObjectPropertyType |
The wShowWindow field specifies STARTF_USESHOWWINDOW, this member can be any of the values that can be specified in the nCmdShow parameter for the ShowWindow function, except for SW_SHOWDEFAULT. |
| hStdInput0..1 | WindowsHandleObjectType |
The hStdInput field specifies the standard input handle for the process. |
| hStdOutput0..1 | WindowsHandleObjectType |
The hStdOutput field specifies the standard output handle for the process. |
| hStdError0..1 | WindowsHandleObjectType |
The hStdError field specifies the standard error handle for the process. |


Wine.About.It
Wish you drank more sophisticated wine?
Enter your favorite wine, and a wine you wished you enjoyed, and Wine About It will give you the intemediary wines you should try to warm up to a new wine.
Drink responsibly!
Select your favorite wine
Wine you want to like
Find my wine!


This demo shows a transparent HUD and a 3D object.
Use W/A/S/D to move around the world.
Press the Alt key to toggle cursor lock.
When the cursor is over the HUD, the cube will be lit.
Press (Esc) to exit interaction mode


This is the same demo written by Tensorflowjs only in my web and mobile editable format. Click on the black box and change anything and
see if it works. If you like it, copy the code to your computer or Github. If it doesn't work refresh the page and start again


RT @qntm: If I were writing a C/C++ standard I would simply define all behaviour
8/21/2021, 2:38:37 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @qntm: If I were writing a C/C++ standard I would simply define all behaviour
8/21/2021, 2:38:37 AM
Favs: 0
Retweets: 0
link


downloadTCGA(cancerTypes, dataSet = "Merge_Clinical.Level_1", destDir, date = NULL, untarFile = TRUE, removeTar = TRUE, allDataSets = FALSE)
dataSet = 'Merge_Clinical.Level_1'
). Available datasets' names can be checked using checkTCGA function.dataSet
s will be downloaded.NULL
or character specifying from which date dataSet
s should be downloaded.
By default (date = NULL
) the newest available date is used. All available dates can be checked on
http://gdac.broadinstitute.org/runs/ or by using checkTCGA
function. Required format 'YYYY-MM-DD'
.TRUE
..tar
file be removed after untarring.
Default is TRUE
.dataSet
parameter or only the first one (without FFPE
phrase if possible).Enables to download TCGA data from specified dates of releases of concrete Cohorts of cancer types.
Pass a name of required dataset to the dataSet
parameter. By default the Merged Clinical
dataSet is downloaded (value dataSet = 'Merge_Clinical.Level_1'
) from the newest available date of the release.
All cohort names can be checked using: sub( x = names( infoTCGA() ), '-counts', '' )
.
If you have any problems, issues or think that something is missing or is not clear please post an issue on https://github.com/RTCGA/RTCGA/issues.
dir.create( 'hre') downloadTCGA( cancerTypes = 'ACC', dataSet = 'miR_gene_expression', destDir = 'hre', date = tail( checkTCGA('Dates'), 2 )[1] )There were more than one datasets matching the dataSet parameter. Downloaded only gdac.broadinstitute.org_ACC.Merge_mirnaseq__illuminahiseq_mirnaseq__bcgsc_ca__Level_3__miR_gene_expression__data.Level_3.2015110100.0.0.tar.gz All matches were gdac.broadinstitute.org_ACC.Merge_mirnaseq__illuminahiseq_mirnaseq__bcgsc_ca__Level_3__miR_gene_expression__data.Level_3.2015110100.0.0.tar.gz gdac.broadinstitute.org_ACC.Merge_mirnaseq__illuminahiseq_mirnaseq__bcgsc_ca__Level_3__miR_gene_expression__data.aux.2015110100.0.0.tar.gz gdac.broadinstitute.org_ACC.Merge_mirnaseq__illuminahiseq_mirnaseq__bcgsc_ca__Level_3__miR_gene_expression__data.mage-tab.2015110100.0.0.tar.gz## Not run: # downloadTCGA( cancerTypes = c('BRCA', 'OV'), destDir = 'hre', # date = tail( checkTCGA('Dates'), 2 )[1] ) # ## End(Not run)
RTCGA-package
,
boxplotTCGA
, checkTCGA
,
convertTCGA
, datasetsTCGA
,
expressionsTCGA
, heatmapTCGA
,
infoTCGA
, installTCGA
,
kmTCGA
, mutationsTCGA
,
pcaTCGA
, readTCGA
,
survivalTCGA
, theme_RTCGA


Improving the models through code¶
On the notion of codeable models¶
In the previous tutorials, we have learned about most basic features of Codeable Models needed to create class models and derive object models from them, i.e. basic modelling. Codeable Models has the intention to make it easy to code (or script) models. In many modelling syntaxes and tools this is only possible in a tedious way, e.g. by first writing a parser for a textual syntax and then some code for interpreting the model, in textual language workbenches by adding code generators and validators in the workflow of the tool, or by providing tooling extensions for graphical or projectional editors. Where it is possible, i.e. where a codeable models API is provided, often the API is written for tool builders and not for making it easy to create, access, and manipulate the models, meaning that a lot of boilerplate code is needed.
This is important even for the basic modelling tasks performed in the previous tutorials. In every day modelling tasks it is important to:
be able to use a concise syntax to specify and review the models,
generate graphical models and tailored views to get a good overview of the big picture and be able to communicate (with) the models,
be able to efficiently and effectively use copy & paste, search & replace, grep, and other text-based inspection and manipulation tools,
be able to easily perform static analyzes of model code,
be able to traverse and interpret the model to do tasks such as: generating code from models, interpreting the models e.g. in workflow engines, using them as models at runtime, generating metrics and other analytics based on the models, or using them as very literal implementations of domain models in domain-driven design.
As modelling needs a lot of steps that are repetitive or could lead to inconsistencies, it is the goal of Codeable Models to make it easy to use Python scripting to automate recurring tasks in modeling, avoid model inconsistencies in the first place (instead of later checking that no inconsistencies exist), easily support model traversal and analysis, and so on. To illustrate this idea, let us study a few places in the models from the prior tutorial that could benefit from such improvements in this tutorial.
Factory function or method for models¶
A recurring theme for introducing code into models is instance creation (be it an instance of a class or meta-class).
For example, in our models, the customer, product, order, and staff classes all contain an id
.
It is rather likely that the id
is created based on a predefined scheme, rather than manually assigned.
Manually assigned IDs can lead to inconsistencies in models, e.g. when the same ID is accidentally assigned twice.
This can be fixed by running a model validator on each created model, to check for the same IDs in different objects
of a kind, or by providing an object factory that performs id
value creation according to the pre-defined rules.
Here are (very simple) examples of id
creation functions for our four classes containing IDs:
_order_id_counter = 0
def get_order_id():
global _order_id_counter
_order_id_counter += 1
return "O" + "{:07d}".format(_order_id_counter)
_customer_id_counter = 0
def get_customer_id():
global _customer_id_counter
_customer_id_counter += 1
return "C" + "{:07d}".format(_customer_id_counter)
_staff_id_counter = 0
def get_staff_id():
global _staff_id_counter
_staff_id_counter += 1
return "S" + "{:07d}".format(_staff_id_counter)
_product_id_counter = 0
def get_product_id():
global _product_id_counter
_product_id_counter += 1
return "P" + "{:07d}".format(_product_id_counter)
Please note that the logic for getting the ID can be much more complex, such as calling a Web service that accesses a company database to compute a unique ID. Here we just use this simple logic as an example.
Now we can define factory functions for classes that use the IDs, e.g. here done for product and customer:
def new_product(name=None, **kwargs):
a_product = CObject(product, name, **kwargs)
a_product.set_value("id", get_product_id())
return a_product
def new_customer(name=None, **kwargs):
a_customer = CObject(customer, name, **kwargs)
a_customer.set_value("id", get_customer_id())
return a_customer
Based on this we can define the customer and product creation with automatic ID assignment:
thomas_customer = new_customer("Thomas Customer", values={
"first name": "Thomas",
"last name": "Test",
"address": thomas_home_address,
"email"<EMAIL_ADDRESS>"phone": "+43111111222333",
"shipping addresses": [thomas_home_address]
})
basic_pen = new_product(values={"name": "Basic Pen", "price": 1.50})
premium_pen = new_product(values={"name": "Premium Pen", "price": 2.50})
basic_paper = new_product(values={"name": "Basic Paper", "price": 2.75})
premium_paper = new_product(values={"name": "Premium Paper", "price": 5.50})
Model consistency during item creation¶
The previous example was rather simple, but many tasks might need to be performed during object creation and other manipulations of a model. For example in our example, another source of potential inconsistency are the various prices and totals in the model elements. As they depend on each other, this can easily lead to inconsistent models. To avoid this in the first place, we can calculate all dependent values automatically, and this way avoid any possible human error in calculations.
For example, when we add items to the cart, we must create an item of a specific product with a given quantity. The price of the item should be the current price of the product times the quantity. During these steps we must not forget to create two links, one from the newly created item to its product and one from item to the cart. Here is a function that performs all these actions as one atomic step:
def add_items_to_cart(a_cart, items_list):
items = []
for element in items_list:
item_product = element[0]
item_quantity = element[1]
price = item_product.get_value("price") * item_quantity
new_item = CObject(item, values={
"quantity": item_quantity,
"price": price
})
new_item.add_links(item_product, role_name="product")
items.append(new_item)
a_cart.add_links(new_item, role_name="item in cart")
return items
In our object models, we can use this function as follows:
cart1 = CObject(cart)
add_items_to_cart(cart1, [[premium_paper, 2], [basic_paper, 1], [premium_pen, 3]])
cart1.add_links(thomas_customer, association=customer_cart_relation)
Model consistency during order creation¶
The required actions to place an order are even a bit more complex. This can be done based on a cart. From the cart we need to get the customer first. Then we need to create an order object using the automatic ID generation introduced above. Next we need to get the items from the cart and link them to the order. Finally, we need to link the order to the customer.
During order creation we need to assign the ship to
address of the order.
It can be calculated from the attribute values shipping addresses
and
selected shipping address
of the customer like this:
def get_shipping_address(a_customer):
shipping_addresses = a_customer.get_value("shipping addresses")
return shipping_addresses[a_customer.get_value("selected shipping address")]
Also during order creation, we need to calculate the order total
based on the items in the cart, which can be
done as follows:
def calc_cart_total(a_cart):
total = 0
items = a_cart.get_linked(role_name="item in cart")
for item_in_cart in items:
total += item_in_cart.get_value("price")
return total
Finally, we can put all together in a place_order
function:
def place_order(a_cart):
a_customer = a_cart.get_linked(role_name="customer")[0]
# this assumes "today" is set to the current date and thus we
# can just use the default value for those values.
new_order = CObject(order, values={
"id": get_order_id(),
"ship to": get_shipping_address(a_customer),
"total": calc_cart_total(a_cart)
})
items = a_cart.get_linked(role_name="item in cart")
add_links({new_order: items}, role_name="item in order")
add_links({a_customer: new_order}, role_name="order")
return new_order
Please note that get_linked
always returns a list of links; as the customer-cart relation is a
1:1 relation, we just need the first element from the list (selected with [0]
).
Model consistency for changing the order status¶
Finally, we might want to support the change for shipping the order, which must change two values on
the order (and if not both are changed together, the model is inconsistent):
1) setting the shipping date to today and 2) setting the status to SHIPPED
:
def ship_order(an_order):
an_order.set_value("shipped", today)
an_order.set_value("status", "Shipped")
Now can use the two new functions in our object model to place and ship an order:
order1 = place_order(cart1)
ship_order(order1)
Resulting model¶
We can use the the Plant UML renderer to draw the resulting object model, like we did before. The result would be:
This image has been rendered using the following code:
shopping_instance2_all = CBundle("shopping_instance2_all",
elements=order1.get_connected_elements() +
[thomas_home_address, today])
generator = PlantUMLGenerator()
generator.generate_object_models("shopping_instance2", [shopping_instance2_all, {}])
The full code of the examples in this tutorial can be found in the sample Shopping Instances Model 2. The class-level coded model examples in this tutorial are realized in the sample Shopping Model 4.


SIMPLY SLEEP- diphenhydramine hydrochloride tablet, film coated
McNeil Consumer Healthcare Div. McNeil-PPC, Inc
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
Active ingredient (in each caplet)
Diphenhydramine HCl 25 mg
Purpose
Nighttime sleep aid
Use
for relief of occasional sleeplessness
Warnings
Do not use
- in children under 12 years of age
- with any other product containing diphenhydramine, even one used on skin
Ask a doctor before use if you have
- a breathing problem such as emphysema or chronic bronchitis
- glaucoma
- trouble urinating due to an enlarged prostate gland
Ask a doctor or pharmacist before use if you are taking sedatives or tranquilizers
When using this product
- avoid alcoholic drinks
- drowsiness will occur
- do not drive a motor vehicle or operate machinery
Stop use and ask a doctor if
- sleeplessness persists continuously for more than 2 weeks. Insomnia may be a symptom of serious underlying medical illness.
If pregnant or breast-feeding, ask a health professional before use.
Keep out of reach of children.
Overdose warning
In case of overdose, get medical help or contact a Poison Control Center right away. (1-800-222-1222)
Directions
| adults and children 12 years and over |
take 2 caplets at bedtime if needed, or as directed by a doctor |
| children under 12 years |
do not use |
Other information
-
each caplet contains: calcium 14 mg
- store between 20-25°C (68-77°F). Avoid high humidity. Protect from light.
- do not use if carton is opened or carton tape and foil inner seal imprinted with "SAFETY SEAL®" are broken or missing
Inactive ingredients
carnauba wax, croscarmellose sodium, dibasic calcium phosphate, FD&C blue no. 1 aluminum lake, hypromellose, magnesium stearate, microcrystalline cellulose, polyethylene glycol, polysorbate 80, titanium dioxide
Questions or comments?
call 1-877-895-3665 (toll-free) or<PHONE_NUMBER> (collect)
PRINCIPAL DISPLAY PANEL
From the makers of
TYLENOL®
PM
NDC 50580-843-12
Helps You Fall Asleep
Simply
Sleep®
Diphenhydramine HCl / Nighttime Sleep Aid
Does NOT Contain Pain Reliever
100 CAPLETS – 25 mg each
Non-habit Forming.
Use as directed.
My-Coach Sleep™
EXCLUSIVE ACCESS FREE WITH PURCHASE
McNeil Consumer Healthcare Div. McNeil-PPC, Inc