This guide provides detailed instructions to perform several tasks when using SurgiSim.
SurgiSim beta v1 Release NotesCurrent features
Coming soon
SurgiSim is a virtual reality (VR) surgical simulator designed as a collaborative effort between the University of Calgary, Stanford University and Western University. The platform supports the exploration and manipulation of patient-specific anatomy derived from clinical imaging studies. SurgiSim allows skull base surgeons and trainees alike to rehearse complex procedures using high-fidelity stereoscopic graphics and haptic feedback.
With SurgiSim, a user creates surgical scenes in which anatomic structures are derived from segmented clinical PACS systems. Volumetric structures may be represented with predefined or customized material properties and viewed with a variety of stereoscopic displays using real-time volumetric rendering. Virtual dissections can be performed with the support of high-fidelity haptic feedback from a variety of supported hardware. The dissections can be compared with intraoperative video for retrospective analysis.
If you don't have a haptic device or a VR headset, you can still use SurgiSim as a specimen viewer. You have three options when using SurgiSim: 1) PC only; 2) PC with a VR headset or a haptic device; or 3) PC with a VR headset and haptic device.
Options when using SurgiSim.
SurgiSim is designed to run on standard commercial-grade hardware and software.
Hardware:
* A haptic hand controller is required to simulate drilling.
** SurgiSim can be used with a variety of commercially-available haptic interfaces including the Geomagic Touch/Sensable Omni by Geomagic and the Omega.6 by Force Dimension.
See a more detailed explanation in Getting Started
See Getting Started
Monitor Mode (2D)
Using your mouse, you can interact with the specimen through rotation (left click) and translation (right click). Use the wheel to zoom in and zoom out.
Mouse instructions.
Virtual Reality (VR) Mode
Using your Oculus touch controllers, you can grab the specimen directly and place it in any desired location.
Use the grab button to move and rotate the specimen in VR:
Grab button in Oculus Touch Controllers.
2D Workspace
Use the toolbox on the left to undo, redo, reset your workspace/specimen, enable Virtual Reality mode and other things. Use the top bar menu to load, save, and evaluate dissections. Click help if you ever need it!
2d Workspace
Use your local hospital-specific DICOM imaging viewer to locate a patient case. Choose a computed tomography (CT) temporal bone protocol with or without contrast. Within this protocol, select a series with slices that are at most 0.625 mm thick. Download the series into a folder on your computer that you can easily find. This folder will contain all of the slices in that particular series and this folder will subsequently be uploaded into SurgiSim *.
* This feature is currently in development.
SurgiSim setup icon
SurgiSim Installer steps
SurgiSim App in the Windows Start Menu
SurgiSim Home Page
SurgiSim Dashboard
SurgiSim Tour
Touch Smart Setup
Pairing Haptic Device
Sphere Simulation Test
For more information, see 3DSystems-Touch-UserGuide.pdf
SurgiSim in Monitor mode
Currently, there are a series of pre-loaded specimens for you to dissect, save, and grade. In the future, you will be able to add specimens from your local hard drive or your shared cloud space.
In order to load specimens:
Start SurgiSim in Monitor Mode.
Click the "Load" option to view the specimens available in your local repository.
After you select a specimen, click load to enter the OR.
Loading Specimen's DICOM files and segmentations.
Saving Dissections.
Saving Dissections.
Saving Dissections.
Click "START" to evaluate your dissection.
Evaluating.
Evaluation Results
Evaluating.
VR dashboard.
Trigger buttons on the Oculus Touch Controllers.
Interacting with the menu in VR
Oculus Touch Controllers' input mapping
Using Haptics in VR mode
Oculus Rift S and Touch connected.
Oculus Home app
Click the "Rescan" button.


Status
Setup
Admin
System status
Uptime:
30d 18h 20m
Heap memory free:
125Kb
Status:
OK
IP Address:
<IP_ADDRESS>
Light Status


{% include head.html %}
{% include navbar.html %} {% include header.html %} {% include course.html %} {% include material.html %} {% include price.html %} {% include registration.html %} {% include company.html %} {% include gallery.html %} {% include contact.html %} {% include js.html %}


{{complete.task.name}}
{% extends "nav.html" %} {% block content %}
FASH is a new social event created to promote family adventures! Hang out with your family, meet new people, and WIN PRIZES! Check out rules for more information and login with your MIT account to play now!
{{ message }}


Gardaí investigate attempted ATM robbery in Dunleer, Co Louth 16 Nov 2019, 10:14 by Colin Brennan Gardai are investigating an attempted ATM theft in Co Louth in the early hours of this morning. The incident took place at around 3.30am at the Bank of Ireland which is on Main Street in Dunleer.(Image: Philip Fitzpatrick) Gardai are investigating an attempted ATM theft in Co Louth in the early hours of this morning. The incident took place at around 3.30am at the Bank of Ireland which is on Main Street in Dunleer.(Image: Philip Fitzpatrick) Gardai are investigating an attempted ATM theft in Co Louth in the early hours of this morning. The incident took place at around 3.30am at the Bank of Ireland which is on Main Street in Dunleer.(Image: Philip Fitzpatrick) Gardai are investigating an attempted ATM theft in Co Louth in the early hours of this morning. The incident took place at around 3.30am at the Bank of Ireland which is on Main Street in Dunleer.(Image: Philip Fitzpatrick) Gardai are investigating an attempted ATM theft in Co Louth in the early hours of this morning. The incident took place at around 3.30am at the Bank of Ireland which is on Main Street in Dunleer.(Image: Philip Fitzpatrick)


Serving Torrent and Dat sites locallyWell, only WebTorrent for now.Test
local - <IP_ADDRESS> Start Stop


Art Gallery
Toggle navigation
Username
Password
Login
home
collection
event
about
Register
Painting
Type
Brush
Cryon
Water Colour
Style
Modern
Baroque
Realistic
Age
Very Old
Old
New
Styling
Type
Brush
Cryon
Water Colour
Style
Modern
Baroque
Realistic
Age
Very Old
Old
New
Author
Type
Brush
Cryon
Water Colour
Style
Modern
Baroque
Realistic
Age
Very Old
Old
New
Features
Type
Brush
Cryon
Water Colour
Style
Modern
Baroque
Realistic
Age
Very Old
Old
New
Collection X
View Collection
Collection X
View Collection
Collection X
View Collection
Collection X
View Collection
Collection X
View Collection
Collection X
View Collection


Former minister and ANC MP Bongani Bongo granted R5000 bail in corruption case
ANC MP and former state security minister Bongani Bongo made a brief appearance in the Cape Town Magistrate's Court on Thursday morning in connection with allegations of corruption.
His bail was set at R5 000 on condition that he not make any contact with State witnesses, Hawks spokesperson Brigadier Hangwani Mulaudzi confirmed in a statement.
He was asked to return on January 31, 2020. No photos were allowed to be taken of Bongo inside the court room.
The MP is accused of trying to disrupt a Parliamentary inquiry into state capture at power utility Eskom on October 10, 2017.
"Bongo, who was the Minister of State Security at the time, allegedly approached an advocate within the commission who was an evidence leader to take sick leave on the day of the commencement of the [inquiry] with a view to derail the proceedings," said Mulaudzi.
The advocate was allegedly "offered an open cheque bribe and he consequently alerted his seniors, which culminated in the Hawks investigation," Mulaudzi added.
As part of his bail conditions, Bongo also has to give the investigating officer two weeks' notice if he plans to take an overseas trip.
Earlier this year, Parliament's joint ethics committee agreed to set up a subcommittee to look into charges of misconduct against him.
Bongo currently serves as a member of Parliament for the ANC and was elected as chair of Parliament's home affairs committee in July.
At the time, the ANC insisted its choices for chairpersons of the National Assembly's committees were "capable comrades" and were not there to serve certain factions.
News24 previously reported that Bongo's sudden rise to Minister of State Security in 2017 raised some eyebrows.
Three years before his promotion, he was an unknown MP in Mpumalanga, having only been in Parliament for six months. His allegiance to former president Jacob Zuma went as far as supporting government efforts to ban Jacques Pauw's controversial book about Zuma.
*This story has been updated.
- Compiled by Sheldon Morais, Jenni Evans and Jenna Etheridge


--- title: Performance Budgets ---
This is just as much a shift in workplace culture as it is process. Sometimes your client or product owner cannot or will not prioritize performance, so even with a warning system in place, you might not be afforded the time to fix it.
Watch video about Performance BudgetsThe main difficulty most teams overcome is actually putting performance front and center during a normal workflow. Many problems are much harder to solve after weeks of work have been built on top of them. One way of finding problems early and often is the use of a performance budget.
Just like a monetary budget, a performance budget places limits on your site, and as you develop features the budget keeps the site in check.
Performance budget metrics How to make a performance budget
Time limits are a simple but effective metric that can be measured. Most any event can be listened for in the browser, and there are even whole Web APIs dedicated to performance timing.
Requests are a simple thing to measure but might not always tell the whole story. For instance, you could place a limit of four CSS requests, but if one of them has 250K of inline base64 data added during development, it will not trigger a warning as long as you still only have four CSS files.
File size of your page as a whole is always something good to keep in mind, especially since most mobile data plans have download limits. A heavy site costs your users money! WebPageTest includes a $ indicator on every results page letting you see an estimate of how much a single page load of your site costs in various countries.
Milestones are specific to your website or app. For example, Twitter has a "time to first tweet" milestone, meaning the measure performance based on how soon the user can read content.
Speed Index is a metric invented by WebPageTest.org, and combines many factors together which measure "visual completeness" and are able to factor in things like FOUT, giving better scores to sites that are progressively enhanced to be flexible and fault tolerant.
Checking the Speed Index of various devices gives one of the most reliable indicators of real-world performance. It is also quick to reveal the performance impact of common sources of bloat, such as a slideshow at the top of a homepage. For that reason it can be a very effective bargaining tool during design or product discussions.
You can see a large collection of curated tools, articles, and tutorials at perf-tooling.today


More about rubber duckies!!!!!!!!!!!!
I still love praise duckies!
Here are some good reasons to buy rubber Duckies:
- they sqeak.
- protection
- companionship
where to buy them:
- Target
- amazon
- fundraisers
To find out more about duckies, click the link below and type Duckies.
Google
Wiki!
Duckies Sale!
Amazon ducky sale!


{foreach from=$data item=record name=personal}
{if $record.part=="PER"}
{* Honza M.: A quick fix for translating - added here so that the UTSMAN sees the names, but in a always-false condition so that they are not displayed; FIXME: implement some kind of PHP hook, if record.name can be known in advance *}
{if 0}
These fields are generated dynamically ($record.name) - to be recognized by UTS, they must be inserted into a never-executed block, such as this one


Get Started
Tips or link to information for beginners in testing
Summary
[overview of the test]
Applicability
This outcome applies to any [element names] element that is [condition] and for which one of the following is true:
- {excluded, ignored, exception}
- [element]
Expectations
[detail of the expectation]


Pearl Cove Resort
Click the links below to learn more about our resort.
Accommodations
Activities
Travel Arrangements
Pictures, etc.
Contact Information


eventTrace - State Machine Event Tracing
The eventTrace package provides a means of converting state machine transition information provided by the Single Threaded Software Architecture (STSA) into a human readable string. The package is provided as an ensemble of commands in the ::eventTrace namespace.
The STSA mechanisms can be conditionally compiled with the MECH_SM_TRACE preprocessor define. When so compiled, it is possible to register a callback function that is invoked upon each event dispatch. The details of the transition are given to the callback function which is free to do as it wishes with the information. One possible action is to ship the information across a communications interface. This package is intended to help make the raw trace information useful for debugging and testing.
The lowest level of trace information is binary information (the number of bytes is dependent upon the processor architecture). All the information available to the STSA mechanisms is numeric in nature since string information is deem too large to store in the embedded target. Note however that POSIX executables built via tack do emit their trace information in string form. In order to convert the numbers into more meaningful strings, two additional sources of information are required.
First the various mappings of states, events, etc. numbers to strings are needed. eventTrace supports applications built with pycca and directly reads the -save file produced by pycca. This file contains all the numeric to string mappings encoded by pycca when the domain was generated. The second source of information is symbols produced by the linker. Since events are sent between instances, the mechanisms are only aware of the addresses of those instances and symbolic information mapping instance address to the instance class is only available from the symbolic information of the linker. eventTrace will extract the symbolic information from several different file formats. The linker must be instructed to produce a symbol table as part of its output.
The setTracePlatform command determines the interpretation of the symbol table given as an argument to the traceInit command. This command should be invoked before any others to establish the format of the symbolic information. If the platform is given as MSP430 then the symbol file is assumed to be an IAR linker map that has been generated with symbol information (it is important to instruct the IAR linker to place the proper symbol table information in the linker map). If the platform is given as ELF then the symbol file is assumed to be an ELF file that contains the executable as well as the symbols (in this case it is important to include symbolic information in the linker instructions). If the platform is given as PEI then the symbol file is assumed to be the output of running the command objdump --headers --syms --wide on a Microsoft Windows PEI executable. When the traceInit command is invoked, it used the value of the trace platform to determine how to obtain the symbol information needed to format the event dispatch traces.
The traceInit command initializes the internal data structures with the symbolic information about the addresses of instances and the mappings of transition numbers to strings. The symfile argument is the name of symbol file whose format is interpreted according to the previous invocation of the setTracePlatform command. The pyccafile is the name of a file produced by pycca as a result of running pycca with the -save option. Returns the empty string.
The scanTrace command converts binary trace information into a dictionary of numerical values. The bintrace argument is a binary string of the trace information as reported by the trace callbacks of the STSA mechanisms. The length and format of the binary trace information is determined by the target platform and is determined by the trace platform setting given by the setTracePlatform command. The return value is a dictionary with the following keys:
eventType
eventNumber
srcInst
dstInst
If eventType is 0, indicating a normal event, the returned dictionary will also contain:
currState
newState
If eventType is 1, indicating a polymorphic event, the returned dictionary will also contain:
subcode
hierarchy
mappedNumber
mappedType
If eventType is 2, indicating a creation event, the returned dictionary will also contain:
dstClass
The values of all the dictionary keys are numeric, containing either an integer code as assigned by pycca or the memory address of a class instance as located by the linker.
The formatTrace command converts a dictionary whose keys are the same as that returned by scanTrace into a dictionary that contains the same keys but whose values are text strings corresponding to values entered in the pycca source file or symbolic names found in the symbolic information.
The ptrace command accepts a dictionary whose keys are the same as those produced by the scanTrace command and returns a string representation of a transition trace that is intended for human consumption.
The markTransition command records a state transition for later reporting. The testName argument gives the name of a test case that evoked the transition. The transition is for the class given by className when it's current state is stateName and it receives the event given by eventName.
The reportCoverage command returns a string that reports the transition coverage of all the test cases recorded with the markTransition command.
The instAddress command translates a class name and instance number or name into an memory address.
The instStorage command translate a module name and class name into the beginning memory address of the instance storage pool for the class.


If this record appears in a file, it indicates that the sheet was printed using the LINE.PRINT() macro function. The LPR record stores options associated with this function.
Record Data
|
Offset |
Field Name |
Size |
Contents |
|
4 |
grbit |
2 |
Option flags |
|
6 |
cchMargLeft |
2 |
Left margin, expressed as a count of characters |
|
8 |
cchMargRight |
2 |
Right margin, expressed as a count of characters |
|
10 |
cliMargTop |
2 |
Top margin, expressed as a count of lines |
|
12 |
cliMargBot |
2 |
Bottom margin, expressed as a count of lines |
|
14 |
cliPg |
2 |
Number of lines per page |
|
16 |
cch |
1 |
Length of the printer setup string |
|
17 |
rgch |
var |
Printer setup string |
The grbit field contains the following option flags:
|
Offset |
Bits |
Mask |
Flag Name |
Contents |
|
0 |
0 |
01h |
fWait |
=1, alert the user after each sheet is printed |
|
|
1 |
02h |
fFormatted |
=1, print headers and footers |
|
|
2 |
04h |
fAutoLF |
=1, write only the carriage return (CR) character (no line feed) at the end of the line |
|
|
7–3 |
F8h |
(unused) |
|
|
1 |
7–0 |
FFh |
(unused) |
|


| pyarsespyder | index /home/sarroutbi/personal/MSWL/MSWL_SUBJECTS/DEVELOPMENT_TOOLS/arsespyder/pyarsespyder/__init__.py |
# Copyright 2013-2014 Sergio Arroutbi Braojos<EMAIL_ADDRESS>#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided that
# the above copyright notice and this permission notice appear in all copies.
 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
# THE USE OR PERFORMANCE OF THIS SOFTWARE
#
| Package Contents | ||||||
|
| Functions | ||
|
| Data | ||
| DEPTH_LEVEL_CHARACTER = '*' |


@*
* Copyright 2023 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@
@import models.SummaryDataItemModel
@import models.resident._
@import models.resident.shares._
@import common.Dates._
@import common.TaxDates
@import constructors.CalculateRequestConstructor._
@import controllers.routes.{GainController => gainRoutes}
@import controllers.routes.{DeductionsController => deductionRoutes}
@import controllers.routes.{IncomeController => incomeRoutes}
@import common.resident.MoneyPounds
@import views.html.calculation._
@this(
layout: Layout,
finalSummaryPartial: playHelpers.resident.finalSummaryPartial
)
@(
gainAnswers:GainAnswersModel,
deductionAnswers: DeductionGainAnswersModel,
result: TotalGainAndTaxOwedModel,
backUrl: String,
taxYear: TaxYearModel,
totalCosts: BigDecimal,
totalDeductions: BigDecimal,
showUserResearchPanel: Boolean)(implicit request: Request[_], messages: Messages, lang: Lang)
@layout(
pageTitle = Messages("calc.resident.summary.title"),
backLinkHref = Some(backUrl),
isUserResearchBannerVisible = showUserResearchPanel
){
@finalSummaryPartial(gainAnswers, deductionAnswers, result, taxYear, totalCosts, totalDeductions)
@if(taxYear.isValidYear) {
@Messages("calc.summary.whatToDoNext.details")@Messages("calc.summary.whatToDoNext.heading")


TraME-Rcpp is an R interface to TraME, a templated C++ library for solving problems of equilibrium computation and estimation in consumer demand and matching frameworks via the Mass Transportation Approach.
Features
License: TraME is licensed under the GNU General Public License (GPL) version 2, or (at your option) any later version.
Authors: Alfred Galichon and Keith O'Hara
Package requirements: R (v3.40, or above) and Rcpp, RcppArmadillo, and digest.
install.packages("RcppArmadillo") install.packages("digest")
The source code is available on GitHub. You need to install TraME-Rcpp from source.
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2 sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
install.packages("devtools") library(devtools) install_github("TraME-Project/TraME-Rcpp")


 HTML5 changes that, as there are now several technologies allowing the app to save data on the client device. It might also be sync'd back to the server, or it might only ever stay on the client: that's down to you, the developer.
{% endblocktrans %}
{% blocktrans %}
There are several reasons to use client-side storage. First, you can make your app work when the user is offline, possibly sync'ing data back once the network is connected again. Second, it's a performance booster; you can show a large corpus of data as soon as the user clicks on to your site, instead of waiting for it to download again. Third, it's an easier programming model, with no server infrastructure required. Of course, the data is more vulnerable and the user can't access it from multiple clients, so you should only use it for non-critical data, in particular cached versions of data that's also "in the cloud". See "Offline": What does it mean and why should I care? for a general discussion of offline technologies, of which client-side storage is one component.
{% endblocktrans %}
{% blocktrans %}While Web SQL Database is supported in Chrome, Safari & Opera, Firefox and IE are unlikely to support it any time soon (Mozilla is philosophically opposed). Indexed Database has an early implementation in Firefox 4.0 Beta and Chrome dev channel. There's a good chance all browsers will support it in the future, but that's not yet clear.{% endblocktrans %}
{% endblock %} {% block tutorials %}localStorage["name"] = username;
. Unfortunately, present implementations only support string-to-string mappings, so you need to serialise and de-serialise other data structures. You can do so using JSON.stringify()
and JSON.parse()
.{% endblocktrans %}{% blocktrans %}For a detailed comparison of client-side storage techniques with code demos, see our Client-Side Storage article.{% endblocktrans %}


{{ content }}
--- layout: default ---
Learn use-cases for open-source serverless functions and how to integrate them into your existing workflows.
Through the hands-on exercises you will build your own JavaScript functions using Node.js. You'll add custom npm modules, integrate with other HTTP APIs, enable authentication and monitor the endpoints with Grafana.


My Games:
bat n ball game
I am currently in the process of adding a bat and ball type game to this site, but I am currently running into problems with
some of the 3D calculations. What the drawing code is currently doing is drawing everthing in the wrong order.
There's a lot of maths, and I've probably just got a sign wrong somewhere..
- Nick.
Unchecked facts:
Cows moo with regional accents.
Cows moo with regional accents.


${html_header} Content-type: text/html
${submission['code']} |
${submission['output']} |
| Correctness | ${scores['correctness']} |
| Similarity to Model Answer | ${scores['similarity']} |
| Time | ${scores['time']} |
| Attempts | ${scores['attempts']} |
| Total Score | ${scores['total_score']} |


Version 0.9, Tue 01 Apr 2014
See also the Bender Data Model and the Bender Runtime for reference.
A Bender application is defined by a top-level component, its children, and their prototypes. The graph of all components that are part of the definition of an application is called the application graph and is the union of all the component graphs of the of the components and their prototypes. At runtime, the application graph is augmented with copies of views and components; the result is the runtime graph.
Copies of nodes are necessary when several components have a common prototype, as child components of a shared prototype component need copying in order to maintain their own state independently of each other. When the runtime graph is constructed, the view elements in the graph are rendered by the user agent.
The behavior of watches is defined below in terms of a watch graph that is constructed in parallel to the runtime graph. The watch graph is a compilation of all the watches in the component graph. The main idea behind the watch graph is to represent the value of a property or the occurrence of an event with a vertex, and the changes that happen in between with edges between these vertices. When a value changes or an event occurs, that value is propagated through the edges and vertices of the graph, having effects on the running application.
Note: although the watch graph may be viewed as an implementation artifact, it is nevertheless used here to help formalize the definition of the processing model of Bender. Is it worth formalizing without the watch graph, then moving the watch graph to an implementation note?
Running a Bender application in a user agent, such as a Web browser, is
rendering the top-level Component
defining the application in
a target DOM element and a newly created watch graph. Once rendering is
done, the graph is flushed for initial values of properties to propagate
and the application is ready to run.
render-component(Component C, DOM element T) = let G = new WatchGraph in do render-subgraph(C, G) sort-watch-graph(G) render-component-view(C, T) flush-graph(G)
The WatchGraph
is defined as a list of directed
edges between vertices. Edges are eventually sorted in
topological order so that data flow is consistent and
predictable. This also means that the watch graph should be acyclic;
however, through the use of delayed edges (see below), cycles
may be broken.
WatchGraph < Object Vertex+ vertices Vertex vortex Edges* edges
vertices
is the set of vertices that are the source
or destination of the Edge
s. It always contains at
least one Vertex
, namely the vortex
.vortex
is a sink state in the watch graph.
It has no outgoing edge and is a member of vertices
.
There can be other vertices with no outgoing edge in the graph, but
this one is guaranteed to exist and is the default destination for
certain edges.edges
is the list of edges between vertices in the
graph. It is unsorted during construction, then sorted when the
graph is complete.A vertex in the WatchGraph
is defined as follows:
Vertex < Object Edge* incoming Edge* outgoing data* values
incoming
is the set of incoming
Edge
s, i.e. edges that have this vertex as
destination.outgoing
is the set of outgoing
Edge
s, i.e. edges that have this vertex as
source.values
is the list of values associated with the
vertex during graph traversal, indexed by Node
s.A WatchVertex
is a vertex representing a
Watch
of a Component
. It is used as a common
destination for input edges, and common source for output edges and
guarantees that values are computed only once when these edges are
followed.
WatchVertex < Vertex Watch watch
watch
is the Watch
for this
vertex.An AdapterVertex
is a vertex representing a
Get
or Set
in a Watch
.
AdapterVertex < Vertex Adapter adapter
adapter
is the Get
or
Set
for this vertex.A PropertyVertex
is a vertex representing a
GetProperty
or SetProperty
in a
Watch
.
PropertyVertex < AdapterVertex
Adapter
of the vertex
being either a GetProperty
or
SetProperty
, the name of the property associated with
this vertex is accessible through adapter.name
.An EventVertex
is a vertex representing a
GetEvent
or SetEvent
in a
Watch
.
EventVertex < AdapterVertex
Adapter
of the vertex
being either a GetEvent
or SetEvent
,
the type of the event associated with this vertex is accessible
through adapter.type
.An Edge
is a directed transition from a
source to a destination Vertex
.
Edge < Object Vertex source Vertex dest number priority = 0
source
is the source Vertex
of the
edge.dest
is the destination Vertex
of
the edge.priority
is a number that is used to sort the
incoming edges of a Vertex
. A higher number indicates
a higher priority: low-priority edges have a negative value, while
high-priority edges have a positive value. The relative order of
edges with the same priority is unspecified.An AdapterEdge
is an Edge
rendered from a
Get
or Set
.
AdapterEdge < Edge: Adapter adapter
adapter
is the Get
or
Set
for this edge.An InitEdge
is an AdapterEdge
rendered
from a SetProperty
in an InitWatch
.
InitEdge < AdapterEdge: number priority = -0.5
adapter
is a SetProperty
.priority
is lower than regular edges, but
higher than InheritEdge
s.An InheritEdge
is an edge between two vertices
representing the same property or event, but with a different target
component. Let CS be the component of the source
vertex, and CD be the component of the destination
vertex. An InheritEdge
may exist between
CS and CD if and only if
CS and CD are distinct
components, and CD conforms to the prototype of
CS. The source of the Edge
is called
the prototype vertex of the destination Vertex
(since CS is in the prototype chain of
CD.) The purpose of InheritEdge
s is
to make components inherit the behavior of their prototype, while
adding behavior of their own. Another benefit of these edges is to
avoid situations that may lead to spurious cycles in the graph,
keeping edge sorting simple.
InheritEdge < Edge number priority = -1
priority
is set to -1 so that these edges have a
lower priority during sorting.An InertEdge
is an
Edge
that is introduced in the graph to represent a
dependency in the graph. It has no effect during traversal and could
be removed after sorting.
InertEdge < Edge
The sub-graph of a Component
C in a
WatchGraph
G is constructed by rendering the
sub-graph of the prototype C, if any, in G; then
rendering the sub-graph of the child components; and finally rendering
vertices and edges for every Watch
in C. The
component is marked so that its sub-graph is rendered only once. This is
necessary because a prototype component may be shared by several
components, which will all require it to render its sub-graph.
Replace the mark with a counter.
render-subgraph(Component C, WatchGraph G) = do mark C if defined C.prototype and not marked C.prototype then render-subgraph(C.prototype, G) for C’ in C.children render-subgraph(C’, G) for W in C.Watches render-watch(W, G)
The sub-graph for a Watch
W is rendered by
creating a new WatchVertex
V in G, then
an AdapterEdge
to V for each Get
of
W, and an AdapterEdge
from V for every
Set
of W (or an InitEdge
in the case
of an InitWatch
.) Lastly, if W is an
InitWatch
, it gets initialized with a nil value for the
component of the watch. This ensures that once the graph is flushed
after being completely rendered, the initial values of the properties
of the component of W will be propagated.
render-watch(Watch W, Graph G) = let V = new WatchVertex(W) in do G.vertices <- G.vertices : V for A in W.gets let V’ = find-vertex(A, G) in G.edges <- G.edges : new AdapterEdge(V’, V, A) for A in W.sets let V’ = find-vertex(A, G) in G.edges <- G.edges : if W is-a InitWatch then new InitEdge(V, V’, A) else new AdapterEdge(V, V’, A) if W is-a InitWatch then V.values[W.component] = nil
A vertex may be the source and destination of several edges, so it is
created and added to the graph only the first time that it is needed;
subsequent calls to find-vertex
will return the already
created vertex. When the adapter is a plain Set
, a
SetNodeProperty
, or SetEvent
to an
Element
target (versus a Component
target),
the vortex
is used since there is no relevant
AdapterVertex
destination for these outputs.
Vertex find-vertex(Adapter A, Graph G) = if A is-a Get or A is-a SetProperty or A is-a SetEvent and A.target is-a Component then let V = find(G.vertices, λV V is-a AdapterVertex and V.adapter = A) in if defined V then V else let V’ = new AdapterVertex(A) in do G.vertices <- G.vertices : V’ add-inherit-edge(V’, G) V’ else G.vortex
With the current single target system, the static target of an adapter is always defined. With the possibility of multiple static targets, a single adapter may produce zero or more edges.
To illustrate the rendering of the watch graph, review the
Panel
component from the Data Model description.
The figure below shows the rendering of watch 6 of the Button
example component
(in this example, other watches are ignored.) A WatchVertex
(square) is created, then an AdapterEdge
to this vertex is
added from a new EventVertex
(heptagon) for the
GetEvent
, then two AdapterEdge
s from the
WatchVertex
are created for the SetProperty
to
a PropertyVertex
(ellipse) for the down
property, and another AdapterEdge
for the
SetEvent
to an EventVertex
. The vortex is
shown as a triangle, with no incoming edge yet.
<watch> 6
<get select=":document" event="mouseup"/>
<set event="pushed" match="`down"/>
<set property="down" value="false"/>
</watch>
The figure below shows the addition of the sub-graph for watch 7. A new WatchVertex
is added, then
a new AdapterEdge
for the GetProperty
, reusing
the PropertyVertex
of down
as the source
vertex. A second AdapterEdge
for the
GetProperty
corresponding to the enabled
property is added as well. Finally, the SetNodeProperty
is
rendered as an AdapterEdge
to the vortex.
<watch> 7
<get property="down"/>
<get property="enabled"/>
<set select="@text-class">
return (`down ? " down" : "") + (`enabled ? "" : " disabled");
</set
</watch>
When a new vertex is created, a new InheritEdge
may need
to be added to the graph as well. If there exists a prototype vertex
V’ for a new vertex V (see below), then a new
InheritEdge
is added between V’ and V.
The outgoing edges of V’ are also copied to V and
given a higher priority than regular edges. Note that since the subgraph
for the prototype of the current component was rendered, V’ (if
it exists) is always created before V.
add-inherit-edge(AdapterVertex V, Graph G) = let V’ = find-prototype-vertex(V, G) in if defined V’ then do G.edges <- G.edges : new InheritEdge(V’, V) for E in V’.outgoing let E’ = create(E) in do E’.source <- V E’.priority <- 1 V.incoming <- V.incoming : E’ G.edges <- G.edges : E’
Finding the prototype vertex of V requires going through the component chain of the component of V, and finding a vertex with a matching adapter in the graph, or reaching the end of the prototype chain.
AdapterVertex? find-prototype-vertex(AdapterVertex V, WatchGraph G) = find-prototype-vertex’(V.adapter, V.adapter.target.prototype, G) AdapterVertex? find-prototype-vertex’(Adapter A, Component? C, WatchGraph G) = if defined C then let V = find(G.vertices, λV V is-a AdapterVertex and V.target = C and match-adapters(A, V.adapter)) in if defined V then V else find-prototype-vertex’(A, C.prototype, G)
Matching Adapter
s means matching two adapters related to
a same property (with the same name
) or to a same event
(with the same type
.) When this function is called, the
targets have already been matched.
boolean match-adapters(Adapter A, Adapter B) = ((A is-a GetProperty or A is-a SetProperty) and (B is-a GetProperty or B is-a SetProperty) and A.name = B.name) or ((A is-a GetEvent or A is-a SetEvent) and (B is-a GetEvent or B is-a SetEvent) and A.type = B.type)
Continuing the previous example, adding watch 1 to the graph introduces a new vertex for the
pushed
event of Plus
. Because
Plus
inherits from Button
, a new
InheritEdge
(fuchsia) is introduced from the prototype
event vertex pushed
of Button
.
<watch> 1
<get select="Plus" event="pushed"/>
<set property="n" value="`n + 1"/>
</watch>
Once the graph G is built, its edges
are sorted
in topological order. Starting from vertices that have no outgoing edge
(there is always at least one such vertex, the vortex
, and
possibly more), incoming edges are inserted at the beginning of the
sorted list of edges in order of decreasing priority (the relative order
of edges with the same priority is not pertinent), and marked as
processed in the list of outgoing edges of their source vertex.
The process repeats with the vertices which do not have any unprocessed outgoing edge anymore. If there were no cycles in the graph, all edges and vertices are processed, otherwise an error is raised (although cycles may be broken when they include delayed edges as detailed below.)
Delayed edges are handled by placing them at the end of te list of sorted edges, then sorting the remaining edges as described above. Cycles that include delayed edges can be broken in this manner.
sort-watch-graph(WatchGraph G) = G.edges <- sort-edges(G.edges)
Edge* sort-edges(Edge* E) = ...
The figure below shows the sorted watch graph for Panel
.
Vertices are represented by ovals (properties), heptagons (events),
squares (watches; an InitVertex
is orange), and a triangle
for the vortex. Edges are represented by arrows between the vertices and
numbered with their traversal order, starting from 1;
InheritEdges
(3, 4, 15, 20, and 22) are fuchsia; edges that
are copied from a prototype vertex (23, copied from 25, and 26 and 27,
both copied from 28) are yellow; and InitEdge
s (9, 11, 13,
18, 19, 21) are orange.
The view of a component is rendered to HTML by creating its view
stack and rendering that stack into a HTML element, such as the
body
of a document, a div
, or an
iframe
.
render-component-view(Component C, DOM element T) = render-view-stack(view-stack(C), T)
The view stack of a component is the stack of the views of
the component, its prototype, its prototype’s view, and so on. The views
along the prototype chain are actually new views created from the
original views so that a component may modify its version of a view in
the view stack without affecting other components created from the same
prototype. For a Component
C, the bottom-most view
in the stack (i.e., the first element in the list of views
returned by view-stack(C)
, with index 0) is the view of the
furthest prototype, while the last element in the list is the view of
C. Because components always have a view but may not have a
prototype, the view stack has a length of 1 (for components with no
prototype) or more (for components with a prototype.)
View+ view-stack(Component C) = bottom-view-stack(C) : C.view View+ view-stack’(Component C) = let V’ = clone-element(C.view) in do add-child-components(C, V’) bottom-view-stack(C) : V’ View+ bottom-view-stack(Component C) = if defined C.prototype then view-stack’(C.prototype) else []
The stack-order
property would be
implemented here. If “bottom”, prepend to the prototype stack. If
“replace”, return a new stack with just the current view, ignoring the
prototype stack.
When the view of a Component
C is cloned to be
added to the view stack, the child components of C are cloned
as well (as seen below.) The parent component itself is not cloned, so
these cloned children are added as children of the component for which
the stack is built.
add-child-components(Component C, View V) = for E in V.children add-child-component’(C, E) add-child-component’(Component C, Element E) = if E is-a View then C.children <- C.children : E.component else for E’ in E.children add-child-component’(C, E’)
The clone-element(E, P)
function creates a copy of a
Node
E and its children and add it as a child of
its parent P. In the case of a View
element, a
clone of the Component
is also created for the
component
of the view, while maintaining the
parent/children relationships of the component graph (so that in effect
view tree and component graph are cloned in parallel.)
Element clone-element(Element E, Element? P) = let E’ = create(E) in do E’.parent <- P E’.children = map(E.children, λC clone-element(C, E’)) if E’ is-a View and defined P clone-component(E’) E’
When a view V that is not the view of a top-level component
is cloned, a clone of the component of V is made as well, so
that this component can keep its own state independently of its
prototype. The clone is shallow, because the children of the
component will be cloned when the View
children of
V will be cloned. Lastly, the component of the top-level view
is never cloned because its state is maintained by the component that
this is the prototype of: it has inherited all of its properties and
behavior.
clone-component(View V) = let C’ = create(V.component) in V.component <- C’ C’.view <- V
Clone child components outside of the view as well.
To illustrate the process, consider the following component graph. Black arrows point from parent to child, while pink arrows point from component to prototype. In this example, a component A has two children B1 and B2 which both inherit from B, which itself has two children, C and D.
The complete graph of views after the view stacks have been created is shown below. The pink boxes indicate view stacks, while black boxes show the views for their corresponding component. It can be seen that the view of B was cloned twice into B’ and B”, for the view stacks of B1 and B2; and likewise for its children C and D.
Finally, the component graph after the view stack was created is
shown below. Note that while B was not cloned, because it is a
top-level component, C and D have both been cloned
twice as they appear as children in two view stacks. The clones of the
children of B are attached to B1 and B2, since B was not cloned (see
add-child-components
above.) This is used to match static
and dynamic targets during edge traversal.
Rendering a view stack S in a target DOM element T
is simply rendering the bottom-most view in the stack, i.e. the
element at index 0 in the list of View
s.
render-view-stack(View+ S, DOM element T) = render-element(S0, T, S, 0)
Rendering an element E from the view at index I in the view stack S in a target DOM element T depends on the type of the element to render.
render-element(Element E, DOM element T, View+ S, integer I) = case E of View = render-view(E, T, S, I) Content = render-content(E, T, S, I) DOMElement = render-dom-element(E, T, S, I) Attribute = render-attribute(E, T) Text = render-text(E, T)
Rendering a View
element depends on whether the view is
a member of the view stack, i.e., the view of the component or
of one of its prototypes; or the view of a child component. In the
former case, the child elements of the view are rendered in the target
element. In the latter case, render-component-view
is
callled on the child component.
render-view(View V, DOM element T, View+ S, integer I) = if V = SI then render-children(V, T, S, I) else render-component-view(V.component, T) render-children(Element E, DOM element T, View+ S, integer I) = for C in E.children render-element(C, T, S, I)
Rendering a Content
element depends on the view stack.
If there is a non-default View
above the current
View
in the stack, then render that view. If no such view
exists, then render the children of the element as the default content
using render-children
as seen above.
render-content(Content C, DOM element T, View+ S, integer I) = let J = next-view-index(S, I + 1) in if J < length S then render-view(SJ, T, S, J) else render-children(C, T, S, I) integer next-view-index(View+ S, integer I) = if I < length S then if S.default then next-view-index(S, I + 1) else I else I
With a select
property, extend
next-view-index
to find the next view in the stack with
appropriate content (i.e., matching the selector.)
Rendering a DOMElement
D is adding a new DOM
element N to T, then rendering the children of
D in N.
render-dom-element(DOMElement D, DOM element T, View+ S, integer I) = let N = new DOM element node in do N.namespace-uri <- D.ns N.local-name <- D.name render-children(D, N, S, I) append-child(T, N)
When the element is the target of an event, a DOM
event listener is also added so that the corresponding vertex receives
a value from this node when the event occurs. This also applies to the
DocumentElement
of a view, if any, where event listeners
are added to the document of the target element.
Rendering an Attribute
A is setting an
attribute on the target element with the value resulting from the
concatenation of the text value of the child elements of A.
render-attribute(Attribute A, DOM element T) = set-attribute-ns(T, E.ns, E.name, fold(E.children, "", λZ,C Z :: (case C of Text = C.text, otherwise = "")))
Rendering a Text
element E is adding a new text
node to T with the text content of E.
render-text(Text E, DOM element T) = let N = new DOM text node in do N.text-content <- E.text append-child(T, N)
The figure belows shows a rendering of the Panel
component in a DOM target element (not shown.) The pink boxes show the
view stacks for the Panel
, Plus
and
Minus
components. The view tree of the Button
component graph is enclosed in a gray box showing that it does
not get rendered; instead, it is cloned twice, once in the view
stack of Plus
, and once in the view stack of
Minus
. Finally, the Element
s that are actually
rendered to DOM elements in the output target are shown in green. (The
attribute elements and their content are left gray as they are rendered
as attributes of the parent element.)
The watch graph is traversed when one or more of its input vertices receives an input value from a target. Edges of the graph are then traversed in the sorted order. Edges have different effects on the application, such as setting property values, generating events, modifying rendered elements, &c. The order of the edges defines the order in which these changes occur. After all edges have been visited, values in vertices are cleared until the next traversal.
Both a PropertyVertex
or an EventVertex
can
be an input vertex. A PropertyVertex
may get an input value
when its associated property is set outside of a graph traversal. An
EventVertex
may get an input value when the corresponding
event is caught by an event listener.
Every edge of the graph is visited in turn. This function is called
whenever a Vertex
receives a value. More than one values
can be present in the graph before a traversal begins, which simulates
the simultaneous propagation of the values. This happens for instance at
initialization time, when all properties are initialized, and allows
updates to be batched while traversal happens asynchronously. After all
edges have been traversed, the vertex values are cleared.
traverse-graph(Graph G) = do for E in G.edges traverse-edge(E) for V in G.vertices V.values <- []
The purpose of the traverse-edge
function is to filter
and transform the input values of the source vertex of the edge, and set
the corresponding output values on the destination vertex. The watch
graph contains InheritEdge
s and AdapterEdge
s,
which are handled in a different manner.
traverse-edge(Edge E) = case E of InheritEdge = traverse-inherit-edge(E) AdapterEdge = traverse-adapter-edge(E)
An InheritEdge
only filters its input values. The input
value is passed unchanged to the destination vertex if and only if the
static target of the destination vertex conforms to the
Node
for which the value was set on the source vertex.
traverse-inherit-edge(InheritEdge E) = for N in keys(E.source.values) if conforms-to(target-of(E.dest), N) E.dest.values[N] = E.source.values[N]
target-of()
returns the static target of a vertex. In
the case of an InheritEdge
, the destination vertex is
always an AdapterVertex
, but this function is also used
below where the destination vertex may also be a
WatchVertex
.
Node target-of(Vertex V) = case V of AdapterVertex = V.adapter.target WatchVertex = V.watch.component
The figure below illustrates the traversal of
InheritEdge
s. The EventVertex
labeled “pushed
(Button)” has received a value with target Plus and an event object
value. Its two outgoing InheritEdge
s are traversed: the
edge to the EventVertex
for Plus is followed, setting the
same value on the destination vertex, because the static target matches
the runtime target. The edge to the EventVertex
for Minus
is not followed (and is represented as a dashed edge) because
Plus
does not conform to the prototype of
Minus
.
An AdapterEdge
filters and transforms its input value.
Moreover, it must also determine the right runtime target for its output
based on the static target of its adapter and its input runtime
target.
This is just a summary as this part needs review.
The runtime component and target of the edge are determined by matching
the static component (the component of the watch of the adapter of the
edge) and the static target (the target of the adapter of the edge) to
their runtime counterpart. A scope map maintains for each
rendered view the which runtime node corresponds to which static node.
This scope map is used to find the runtime component and target. The
concrete targets are then determined from the runtime target.
If the edge is static or the runtime target is concrete, then it is the
same as the runtime target. If the runtime target is abstract (for
instance in the current Panel
example, the
Button
component is abstract; so if it is the target of
an edge, then the concrete targets are the Plus
and
Minus
components. Once those are determined, the set of
input values is first filtered by applying the match()
function of the adapter for all input value/concrete target pairs. For
all matches, a value is computed from the value()
function
of the adapter and is set on the destination vertex for the concrete
target. Then, the values are applied to take effect.
When an edge for a Set
is traversed, its output value is
set on the target vertex, but it is also applied to the target.
Different Set
s have different effects:
SetProperty
sets the property property
of the target component to the output value silently: setting
the value happens independently of the graph traversal, without
initiating a new traversal;SetNodeProperty
sets the property of the target
node to the output value (e.g., the text
of a
Text
element, which updates the rendering of the
component) (also, the value of the attribute is
updated if the Text
is a child of a
Attribute
element;match
and value
functions.apply-value(Edge E, Node T, data V) = do case E.adapter of SetProperty = set-property(E.adapter.name, T, V) SetNodeProperty = set-node-property(E.adapter.name, T, V) SetEvent = set-event(E.adapter.type, T, V) set-vertex-value(E.dest, T, V)
Using the example graph shown above, the process of graph traversal is illustrated in the figure below. The relevant state of the application at the instant before graph traversal begins is as follows:
n
property of Panel
has value
2.down
property of Plus
has value true
(the button has been pressed.)frame
of Plus
has just received a
mouseup
event.The mouseup
event vertex was just activated for the
DocumentElement
of both Plus
and
Minus
buttons with a DOM event value. The graph traversal
then starts, following edges in the order below, with the following
effects:
mouseup
event is received from the document
element on both Plus
and Minus
components.Plus
component had its down
property set to true, so the event value for Minus
gets
filtered out. A new Bender event of type pushed
is
generated for Plus
.Minus
does not conform to the prototype of
Plus
so this edge is not followed.Plus
conforms to the prototype of Plus
,
so this edge is followed. The target and value are left
unchanged.Plus
is passed to watch 6.n
for Panel
is set to
3.n
is passed to watch 3.enabled
for Minus
is set to
true (since n
is greater than 0.)down
for both Plus
and
Minus
is set to false.enabled
is passed to watch 7.down
is passed to watch 7. Note that the watch already has a value for
the target Minus
, so a value is set for the target
Plus
only.class
attribute of the DOM element for
frame
in both Plus
amd Minus
is
set to the string button
(this does not change for
Minus
, but removes the down
class for
Plus
.)text-n
in
Panel
is set to the string "3".After this traversal, the application state is consistent: both
buttons are in their normal state, and the display of the n
property was brought up to date.
Adapter
s have a delay
property. If that
delay is a positive number, then the traversal of the edge corresponding
to that adapter is delayed. No value is set on the target
vertex, but a new graph traversal is scheduled to take place after the
delay has elapsed. If the delay was 0, then the new traversal happens
as soon as possible after the current traversal has ended; otherwise, a
timer is set to start the traversal after the amount of time given by
delay
. Note that several delayed traversals may be
scheduled from a given graph traversal.
In the example traversal above, the SetEvent
of 6 should have a delay of 0 so that the event is
dispatched asynchronously. This means that edges 1 through 4 are
traversed as above, but edge 5 is delayed. After the traversal has
ended, a new traversal starts from edge 5, with the false value on the
Plus
button, and edges 6 through 14 are traversed as
usual.
Delayed edge traversal allows the graph to contain cycles, as long as
at least one edge in the cycle has a delay. When sorting the edges of
the graph, all edges with a delay are pushed back to the end of the list
of edges, then the remaining edges can be sorted since possible cycles
have been broken. Note that while this ensures that the edges can be
sorted, in order to avoid an infinite number of traversal, there must be
conditional edges (i.e., edges for which the match
predicate is not always true) in every cycle as well.
Render new graph and view, then reinitialize the graph using all the values from the previous rendering directly in the vertices. If nodes have been added, they are initialized normally with their initial value.
When a view is rendered, it keeps track of its span: the first and last DOM nodes of its rendering. When a view is unrendered, all nodes in its span are removed. The span of a parent view needs to be updated. Event listeners need to be removed.
When the subgraph of a component is rendered, it
keeps track of a reference count; it starts from zero and is
incremented every time a render is required. Only when the count
reaches 1 for the first time is the subgraph actually
rendered (this replace the mark in render-subgraph()
.)
Watches are removed from the watch graph by removing the corresponding
watch vertices. When a vertex is removed, all of its input edges and
output edges are removed as well. Vertices that have no more input or
output edge then be removed (unless it is the vortex.) This continues
until no more vertices need to be removed. Child component are
unrendered in the same way. Prototype components are unrendered if and
only if their reference count, which is decremented at every unrender
request, reaches zero.
State persistence is achieved by having the values of properties frozen. Serializing to JSON allows values to be frozen and thawed later by parsing the JSON back. Object data can be frozen and thawed by implementing an adequate protocol/interface (see runtime.) Thawed values can be set directly on property vertices while flushing the graph restores the complete state of the application.
As a possible optimization, the watch graph can be minimized by removing redundant edges and vertices after sorting. The remaining edges are kept in the original order.
InheritEdge
can be removed by merging the source and
destination vertices, and removing all copied edges from the destination
vertex.WatchVertex
with exactly one incoming edge and one
outgoing edge can be removed by creating a new edge between the source
vertex of the incoming edge and the destination vertex of the outgoing
edge. A new Adapter
can be created for this edge by
composing the match and value functions. Note that although removing a
WatchVertex
with two incoming edges and one outgoing edge,
or one incoming edge and two outgoing edges would still reduce the
number of edges in the graph, the semantics of graph traversal would not
be preserved as either the input value or the output value of the
WatchVertex
would have to be computed twice, which may lead
to undesireable side effects. (This would be possible if the absence of
side effects were guaranteed.)After applying these steps whenever possible, the graph only contains
AdapterEdge
s. When two edges are merged, in order to preserve
traversal order, merging two edges replaces the last one (i.e.,
the one which comes latest in the sorted order.) Initialization edges
should be added after the minimization step as their order may
also change: in the example below, the initialization edge for the
enabled
property changes order after minimization. Cycles may
appear as a result of merging vertices, but this does not result in
infinite loops. TODO: actual algorithm. Also, a
pure
flag for functions could allow more aggressive
optimizations if the author is sure that no unwanted side effects can
happen; especially for one Get
/multiple Set
s.
When there are multiple Get
s, all input values may be
necessary for the Set
s and the watch vertex should be
kept.
The figure below shows how a watch graph may include a cycle after minimization. On the left is the original graph, and on the right is the minimized graph. The origin of the cycle is that setting a property P on C after it has changed on B (where both B and C inherit from a component A) results in an edge that has its source and destination in different vertices before minimization, but which have been merged in the minimized version.
Another optimization consists in compiling the graph into code. A set of functions can be compiled for the input vertices of the graph; instead of setting an initial value on an input vertex V and initiating a traversal of the watch graph, the function FV compiled from V is called instead. These functions call each other to implement the full graph traversal. This section needs to be developed.


|
Enigma
|
Class for detection. More...
#include <Detection.hpp>
Public Member Functions | |
| Detection () | |
| Constructor for Detection. | |
| Detection (ros::NodeHandle n) | |
| Overloaded Constructor for Detection. More... | |
| ~Detection () | |
| Destroys the Detecion. | |
| void | imageCallBack (const sensor_msgs::ImageConstPtr &msg) |
| Image callBack for turtlebot camera. More... | |
| std::pair< int, int > | detect (const cv::Mat &image) |
| The simple function for detecting the red and green objects. More... | |
| cv::Mat | getImage () |
| Gets the image. More... | |
| bool | switchServiceCB (enigma::startStop::Request &req, enigma::startStop::Response &res) |
| Start stop service callback. More... | |
Class for detection.
Definition at line 44 of file Detection.hpp.
|
explicit |
Overloaded Constructor for Detection.
| [in] | n | as ros::NodeHandle |
Definition at line 34 of file Detection.cpp.
| std::pair< int, int > Detection::detect | ( | const cv::Mat & | image | ) |
The simple function for detecting the red and green objects.
| [in] | image | The image as cv::Mat |
Definition at line 72 of file Detection.cpp.
| cv::Mat Detection::getImage | ( | ) |
| void Detection::imageCallBack | ( | const sensor_msgs::ImageConstPtr & | msg | ) |
Image callBack for turtlebot camera.
| [in] | msg | The message as sensor_mags::ImageConstPtr |
Definition at line 52 of file Detection.cpp.
| bool Detection::switchServiceCB | ( | enigma::startStop::Request & | req, |
| enigma::startStop::Response & | res | ||
| ) |
Start stop service callback.
| req | The request as bool |
| res | The resource as bool |
Definition at line 140 of file Detection.cpp.


| ← Prev | Next → |
To extract static instrumentation metadata, use the extract-cfg and extract-section tools in the Tools directory of this release. The tools requires the following non-standard packages:
They also require the application objdump, which is standard on most Unix-based operating systems.
CSI embeds the LLVM bitcode necessary to extract an annotated representation
of the program's control-flow graph from generated object files and executables.
Note that in the case of multiple object files linked into a single
executable, the executable contains the complete bitcode necessary to build the
whole-program control-flow graph. To extract the graph, use a command similar
to
Tools/extract-cfg myexe output-file
The graph is extracted in GraphML format, with appropriate node and edge annotations for running CSI analysis tools.
Path Tracing metadata is stored as text in the debug
section .debug_PT of the object file or executable. Note
that in the case of multiple object files linked into a single
executable, the executable contains the complete metadata consolidated
from all object files. To extract this data, use a command similar
to
Tools/extract-section --require .debug_PT myexe
For details about the format of the Path Tracing metadata, please see the Path Tracing page.
csi-cc currently supports three variants of program coverage instrumentation: function coverage, call-site coverage, and statement coverage. The metadata for each granularity of program coverage is stored as text in the respective debug section:
For details about the format of the Program Coverage metadata, please see the Program Coverage page.
Section names in Mach-O executables are named slightly differently than those in ELF executables. Specifically, all section names should be preceded by __CSI. Thus, the metadata sections above are named as follows:
| ← Prev | Next → |


CHEF PORTFOLIO
Home
Recipes
Services
About
CONTACT US
About Us
Enjoy Seafood Recipes For Seafood Lovers from Lambda Students !
GET STARTED
Jeremy McWilliams
BackEnd Developer
READ MORE
Tim Jeffries
Team Leader
READ MORE
Aaron Gillies
Web React I Developer
READ MORE
Jonathan Hanson
Web React I Developer
READ MORE
Firuza Khashimova
Web UI Developer
READ MORE
Dante Bui
Web React II Developer
READ MORE


Flagg scores 22 points, Texas A&M wins in Williams’ debut
COLLEGE STATION, Texas (AP) - Savion Flagg scored 22 points as Texas A&M; started the Buzz Williams era with a 77-63 victory over Northwestern State on Wednesday night.
Flagg, a junior forward and the team’s top returning player, made 9 of 11 shots from the field in Texas A&M;’s opener.
The Aggies shot 56 percent (28 of 50) from the floor, compared to 34 percent (25 of 73) by the Demons. A&M; also overwhelmed NSU (1-1) inside, holding a 44-20 advantage in points in the paint.
Nikos Chougkaz led the Demons with 12 points. Quenton Jackson scored 13 points for the Aggies and Jay Jay Chandler added 11 for A&M.; The teams were about even in turnovers, with the Aggies committing 14 and the Demons committing 13. Chandler had a game-high five of A&M;’s 14 turnovers.
Williams, a native Texan, came to Texas A&M; from Virginia Tech, where he led the Hokies to a school-record three consecutive NCAA Tournaments in his five seasons there.
BIG PICTURE
Texas A&M;: The Aggies were a little slow out of the gate in the Williams debut but eventually began playing the style of ball that made him a winner at Marquette and Virginia Tech. Reed Arena was about a quarter full for his first game, but as Williams has said, winning consistently will bring fans.
Northwestern State: The Demons were quickly brought back to earth by their SEC opponent after opening the season with an 84-57 thumping at home of Centenary on Tuesday. Despite the 14-point loss Wednesday, the Demons know taking on this kind of competition early will help them in Southland Conference play starting next month.
UP NEXT
The Aggies stay home to face Louisiana-Monroe on Monday.
Northwestern State hosts Rice on Tuesday.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


public class TilePositionFactory
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
RowAdditionBottom |
private static int |
RowAdditionLeft |
private static int |
RowAdditionRight |
private static int |
RowAdditionTop |
| Constructor and Description |
|---|
TilePositionFactory() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAdditionalAddonSpace(bwapi.UnitType unitType,
bwapi.TilePosition targetTilePosition,
java.util.HashSet<bwapi.TilePosition> neededTilePositions)
Function for adding additional TilePositions to the normal required space
of the UnitType based on the addon that it is able to construct.
|
static java.util.HashSet<bwapi.TilePosition> |
generateNeededTilePositions(bwapi.UnitType unitType,
bwapi.TilePosition targetTilePosition)
Function for finding all required TilePositions of a building plus a
additional row at the bottom, if the building can train Units.
|
private static int RowAdditionTop
private static int RowAdditionRight
private static int RowAdditionBottom
private static int RowAdditionLeft
public static java.util.HashSet<bwapi.TilePosition> generateNeededTilePositions(bwapi.UnitType unitType, bwapi.TilePosition targetTilePosition)
unitType
- the UnitType whose TilePositions are going to be calculated.targetTilePosition
- the TilePosition the Unit is going to be constructed /
targeted at.public static void addAdditionalAddonSpace(bwapi.UnitType unitType, bwapi.TilePosition targetTilePosition, java.util.HashSet<bwapi.TilePosition> neededTilePositions)
unitType
- the UnitType that is going to be constructed and whose
possible addon is going to be considered.targetTilePosition
- the TilePosition that is targeted for the UnitType's
construction.neededTilePositions
- the HashSet of already needed TilePositions to which the addon
ones are going to be added.


ABench Management Console
Last update: {{ time }}
Setup
Check requirements
Deploy A-Bench infrastructure
Grafana dashboards
Kubernetes dashboards
Run
Configuration
Run a sample SRE with HIVE
Run a sample SRE with SPARK
Load results
Analyse
CPU usage
Memory usage
Filesystem usage
Terminal output:
{{ content }}


API
Request
$ curl http://unbitly-url.herokuapp.com/api?url=https://t.co/6Tx32jX6O9
Result
{
"url": "https://techcrunch.com/2016/10/25/the-crunchies-nominations-close-soon/"
}
$ curl http://unbitly-url.herokuapp.com/api?url=https://t.co/6Tx32jX6O9
{
"url": "https://techcrunch.com/2016/10/25/the-crunchies-nominations-close-soon/"
}


Console to view the output of my functions.
answer 3.)
rmdir- removes a directory
less- less is simlilar but just shows you a small portion of the file and allows you to page through a file one page at a time. good for long files.
ln-creates a hard link to a file.
file-shows filetype, bunch of other stuff.
which-locates a program file in your path.
du-shows how much disk space is being used by different files in a directory. can display different size values.
df-displays amount of free disk space.
top- shows the top cpu-intensive proccesses on your machine.
answer 4.)
shell is a ui for accessing a machines os. I just looked this up
http://stackoverflow.com/questions/5725296/difference-between-sh-and-bash
so no extra credit points for me
but good learing about it in this s/o post.
Just for style by id
Just for style by id
just for style by id


Live tracking of large crypto transactions from and to exchanges for #BTC, #ETH, #XRP, #USDt, #EOS, #BNB, #XLM, #NEO, #TRX, #XTZ, top 100 #ERC20. API available.
Tweets
6760
Followers
95659
Mark8126-Jun-19 07:03 PM
really little inventory on binance
for kmd
to 12,5ksats only 45k kmd
Caglio26-Jun-19 07:03 PM
I bought myself my first komodore coin
1
1
1
jl777c26-Jun-19 07:03 PM
if the BTC is being withdrawn, that matches the institutions accumulating theory
Caglio26-Jun-19 07:04 PM
And I wanted to share that with you, even tho you all dont care
1
phm8726-Jun-19 07:04 PM
I agree with jl
Institutionnal fomo I think
jl777c26-Jun-19 07:04 PM
@Mark81 it seems only the fiatbot is selling and doesnt have much inventory
if this is institutional fomo, 2017/2018 will be a small blip
Bittersweet26-Jun-19 07:05 PM
What's the point of a fiat bit?
Markus26-Jun-19 07:05 PM
but why would institutions fomo, are they not all about smart money and being infront of the game? u would think they would want it cheap not on this prices when they had plenty of opportunities on way lower prices
allbits26-Jun-19 07:05 PM
Real institutional fomo is still some ways off in the future
Mark8126-Jun-19 07:05 PM
there we just a moment ago at 15ksats roghly 88k kmd offer but its gone now
jl777c26-Jun-19 07:05 PM
institutions are pack animals
but some in the pack want to be a bit ahead of the rest
fiatbot purpose is to demoralize and lower the price to accumulate at below normal prices. seems it is being quite effective
allbits26-Jun-19 07:06 PM
This is more like forward thinking asset allocators (hedge funds, family offices). Those that have less red tape to work through
Bittersweet26-Jun-19 07:06 PM
well that's counting on the fact that crushing the price
A desktop full node GUI wallet for HUSH. Contribute to MyHush/SilentDragon development by creating an account on GitHub.
1
winders binaries for your z-texting
Mark8126-Jun-19 07:13 PM
kmd daily rsi is below 21
Tek26-Jun-19 07:24 PM
rsi
kaks26-Jun-19 07:24 PM
@jl777c true, this bull run is so weird
Tek26-Jun-19 07:24 PM
he thinks it means anythng
kaks26-Jun-19 07:24 PM
btc raising to much
Tek26-Jun-19 07:24 PM
rsi is a tool for boomer stocks
Ooloo26-Jun-19 07:24 PM
man my KMD is getting wrecked. anyone think Antara framework will bring some bulls back to Komodo?
kaks26-Jun-19 07:24 PM
folks are fomo on btc now
Tek26-Jun-19 07:25 PM
nigga kmd isn't even avaiable on any fiat exchanges
5k sats incoming
Ooloo26-Jun-19 07:25 PM
Fundamentally i feel KMD offers so much value but people dont seem to be picking it up
LocoMB26-Jun-19 07:29 PM
it is called HODL for a reason, guys!
1
actionslacks26-Jun-19 07:29 PM
you guys are missing the point here. a whole new era of crypto is about to begin. the infrastructure has been built up. this phenomenon will spread like a virus. we are going to be unstoppable. it's 1998 and amazon stock is on sale.
3
3
grewalsatinder26-Jun-19 07:29 PM
HODARRR!!!
1
1
1
1
Caglio26-Jun-19 07:30 PM
Hodor ?
Oszy26-Jun-19 07:31 PM
dat dump to 8.8k
LocoMB26-Jun-19 07:31 PM
@actionslacks just saw a regular BTC podcast where the guy discussed chainanalyses-
seems an ex-employee made a reddit AMA and spilled the beans on how creepy that tool already is, and how totally useless against .. many privacy coins..
c2k26-Jun-19 07:31 PM
not sure many in here are old enough to get your reference @actionslacks ...but its a good one
1
LocoMB26-Jun-19 07:32 PM
took a cpl of years, but tis started in 2014 indeed, and is now beginning to bear fruit
2nd gen crypto approaching functionality - and mainstream hasn't even fully realized what 1st gen is about! ..lol - that Hare and Tortoise metaphor just doesnt get old!(edited)
Markus26-Jun-19 07:33 PM
wtf there is 500+ btc withdraws from bitfinex constantly, someone rly been buying up btc in large amounts
tolken26-Jun-19 07:33 PM
@Tek Kmd not on fiat exchange - doesn’t Kmd/usd on bittrex count?
Markus26-Jun-19 07:33 PM
probably meant stable coin pair
Tek26-Jun-19 07:34 PM
shittrex
Markus26-Jun-19 07:34 PM
sure we got hitbtc with usdt but nobody uses hitbtc scam


By Božidar Benko / @bbenko / CTO @VuMedi
I love it and use it all the time.
I'm productive in it (more than in SQL).
All CRUD should be done with stored procedures.
old schoolORM is all I need.
site owners with no usersAt VuMedi, we have users in various groups.
Most interesting for us are 2 surgeon groups:
How many surgeons do we have?
User.objects.filter(groups__name__in=['Surgeon', 'Flagged']).count()
Hey BB, are you sure? That seems a bit too much.
- Off course I'm sure, but OK, to check, I'll write the same thing using Qs.
User.objects.filter(Q(groups__name='Surgeon') | \
Q(groups__name='Flagged')).count()
One meeelion again!
No, seriously, that's too much.
Some users are both 'Surgeon' and 'Flagged'.
Maybe you are counting those twice.
Hey, I know Boolean algebra.
1 OR 1 == 1
Not 2!
But I'll write some tests.
house = User.objects.create_user(username='house',
<EMAIL_ADDRESS>password='house123')
self.assertEqual(User.objects.count(), 1) # only House
# House is surgeon and flagged
house.groups.add(self.surgeon, self.flagged)
self.assertEqual(User.objects.filter(groups=self.surgeon).count(), 1)
self.assertEqual(User.objects.filter(groups=self.flagged).count(), 1)
# how many users that are surgeon or flagged?
# only one user in db, it must be one
surgeons = User.objects.filter(groups__in=[self.surgeon,
self.flagged])
self.assertEqual(surgeons.count(), 1)
(doiainn)➜ doiainn git:(master) ✗ ./manage.py test
Creating test database for alias 'default'...
F
======================================================================
FAIL: test_m2m_count (app.tests.AppTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/bb/code/doiainn/code/doiainn/app/tests.py", line 27, in test_m2m_count
self.assertEqual(surgeons.count(), 1)
AssertionError: 2 != 1
----------------------------------------------------------------------
Ran 1 test in 0.137s
FAILED (failures=1)
Destroying test database for alias 'default'...
surgeons = User.objects.filter(Q(groups=self.surgeon) |
Q(groups=self.flagged))
self.assertEqual(surgeons.count(), 2)
SELECT "auth_user"."id",
"auth_user"."password",
"auth_user"."last_login",
"auth_user"."is_superuser",
"auth_user"."username",
...
FROM "auth_user"
INNER JOIN "auth_user_groups" ON
("auth_user"."id" = "auth_user_groups"."user_id")
WHERE ("auth_user_groups"."group_id" = 1
OR "auth_user_groups"."group_id" = 2);
1|pbkdf2_sha256$20000$SMZHa8Fn8nG1$cGdKi...
1|pbkdf2_sha256$20000$SMZHa8Fn8nG1$cGdKi...
... because ...
SELECT COUNT(*) FROM auth_user_groups WHERE user_id=1;
2
self.assertEqual(surgeons.distinct().count(), 1)
(doiainn)➜ doiainn git:(master) ✗ ./manage.py test
Creating test database for alias 'default'...
.
----------------------------------------------------------------------
Ran 1 test in 0.153s
OK
Destroying test database for alias 'default'...
Django Admin is great. You use it to build your MVP.
Your table grows beyond 12M rows.
Change list view and search are now slow.
Admin displays total number of records in change list view.
Having 12M+ rows, total count doesn't have to be exact.
When filtered, it should be exact.
SELECT COUNT(*) FROM myapp_mymodel;
count
----------
12871557
(1 row)
Time: 47299.633 ms
SELECT reltuples FROM pg_class WHERE relname = 'myapp_mymodel';
reltuples
-------------
1.28186e+07
(1 row)
Time: 0.410 ms
Django Admin Speedup For Big Tables on Postgres
class LargeTableChangeList(ChangeList):
def get_results(self, request):
...
if not self.query_set.query.where:
full_result_count = result_count
else:
try:
cursor = connection.cursor()
cursor.execute("SELECT reltuples
FROM pg_class WHERE relname = %s",
[self.root_query_set.query.model._meta.db_table])
full_result_count = int(cursor.fetchone()[0])
except:
full_result_count = self.root_query_set.count()
...
Django 1.8 introduced ModelAdmin.show_full_result_count to disable count.
It was a traffic usage table with MDN field.
MDN is 10 digit number, but can have leading zeros, so I used CharField.
mdn = models.CharField(...)
class MyModel(admin.ModelAdmin):
search_fields = ['mdn', ]
does icontains - case insensitive contains
class MyModel(admin.ModelAdmin):
search_fields = ['=mdn', ]
does iexact - case insensitive exact
I don't need case sensitivity.
But, at the time, you could not further customize the search.
# Apply keyword searches.
def construct_search(field_name):
...
elif field_name.startswith('='):
return "%s__iexact" % field_name[1:]
From Django 1.6, you can use ModelAdmin.get_search_results.
SELECT "myapp_mymodel"."id", "myapp_mymodel"."mdn”, ...
FROM "myapp_mymodel"
WHERE UPPER("myapp_mymodel"."mdn"::text) = UPPER(‘1234567890’)
LIMIT 100;
UPPER does case insensitivity.
It took ~7.5 seconds to execute this query.
Without UPPER, it took ~6 milliseconds (there was a btree index on a field).
Can't remove UPPER.
But you can do indexes on functions in Postgres.
Even better, you can do index on any expression.
I can create an index on UPPER(mdn)
CREATE INDEX myapp_mymodel_mdn_upper ON myapp_mymodel(UPPER(mdn));
CREATE INDEX
Time: 377055.345 ms
The whole admin view with search results now comes back in under 2 seconds!
@VuMedi, our impression table is big.
=> SELECT COUNT(*) FROM tracking_impression;
count
-----------
244116752
(1 row)
System and customer analytics (mostly) need only the last month of that data.
Quering this table is pretty slow.
Ordinary indexes don't help.
But, I can partition the data by months.
Splitting one large table into smaller physical pieces.
Master table / Django Model
class Impression(models.Model):
user = models.ForeignKey(User)
when = models.DateTimeField(auto_now_add=True)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey()
...
CREATE TABLE "tracking_impression" (
"id" serial NOT NULL PRIMARY KEY,
"user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED,
"when" timestamp with time zone NOT NULL,
"content_type_id" integer NOT NULL
REFERENCES "django_content_type" ("id")
DEFERRABLE INITIALLY DEFERRED,
"object_id" integer CHECK ("object_id" >= 0) NOT NULL,
...
);
CREATE TABLE tracking_impression_2015_09 (
CHECK ( "when" >= '2015-09-01' AND "when" < '2015-10-01' )
) INHERITS (tracking_impression);
CREATE INDEX ON tracking_impression_2015_09 USING btree(user_id);
CREATE INDEX ON tracking_impression_2015_09 USING btree("when");
We want to say:
INSERT INTO tracking_impression ...
and have the data be redirected into the appropriate partition table.
CREATE OR REPLACE FUNCTION tracking_impression_insert_trigger()
RETURNS TRIGGER AS $$
BEGIN
IF ( NEW."when" >= '2015-09-01' AND
NEW."when" < '2015-10-01' ) THEN
INSERT INTO tracking_impression_2015_09 VALUES (NEW.*);
ELSIF ( NEW."when" >= '2015-08-01' AND
NEW."when" < '2015-09-01' ) THEN
INSERT INTO tracking_impression_2015_08 VALUES (NEW.*);
...
ELSE
RAISE EXCEPTION 'Date out of range.';
END IF;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION trg_tracking_impression_partition()
RETURNS trigger AS $func$
DECLARE
_tablename text := 'tracking_impression_' ||
to_char(NEW."when", 'YYYY_MM');
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE n.nspname = 'public'
AND c.relname = _tablename
) THEN ...
) THEN ...
EXECUTE format('CREATE TABLE %I
(CHECK ("when" >= %L
AND "when" < %L))
INHERITS (public.tracking_impression)'
, _tablename
, to_char(NEW."when", 'YYYY-MM-01')
, to_char((date_trunc('MONTH', NEW."when")
+ INTERVAL '1 MONTH')::date, 'YYYY-MM-DD')
);
EXECUTE format('CREATE INDEX ON %I USING btree(user_id)',
_tablename);
EXECUTE format('CREATE INDEX ON %I USING btree("when")',
_tablename);
END IF; ...
...
EXECUTE 'INSERT INTO ' || quote_ident(_tablename)
|| ' VALUES ($1.*) RETURNING id' USING NEW;
RETURN NULL;
END
$func$ LANGUAGE plpgsql SET search_path = public;
-- trigger
CREATE TRIGGER tracking_impression_insert_trigger
BEFORE INSERT ON tracking_impression
FOR EACH ROW EXECUTE PROCEDURE trg_tracking_impression_partition();
INSERT INTO
tracking_impression(user_id, "when", content_type_id, object_id, ..)
SELECT user_id, "when", content_type_id, object_id, ..
FROM tracking_impression_np;
-- old non partitioned table
=> SELECT "tracking_impression".*
FROM "tracking_impression_np"
WHERE ("tracking_impression_np"."when"
BETWEEN '2014-09-05 00:00:00-07:00'
AND '2014-10-04 00:00:00-07:00' AND ...;
Time: 2983993.619 ms
-- new partitioned table
=> SELECT "tracking_impression".*
FROM "tracking_impression"
WHERE ("tracking_impression"."when"
BETWEEN '2014-09-05 00:00:00-07:00'
AND '2014-10-04 00:00:00-07:00' AND ...;
Time: 263.702 ms
Almost (everything) works out of the box.
return query.get_compiler(using=using).execute_sql(return_id)
.../django/db/models/sql/compiler.py", line 914, in execute_sql
return self.connection.ops.fetch_returned_insert_id(cursor)
.../django/db/backends/__init__.py", line 529,
in fetch_returned_insert_id
return cursor.fetchone()[0]
TypeError: 'NoneType' object is unsubscriptable
class Impression(models.Model):
...
def save(self, *args, **kwargs):
from django.db import connection
connection.features.can_return_id_from_insert = False
super(Impression, self).save(*args, **kwargs)
connection.features.can_return_id_from_insert = True
Hey BB, there are duplicates when I sort in model's admin
by due_date field from not closed event.
class Model(models.Model):
...
class ModelEvent(models.Model):
model = models.ForeignKey(Model)
due_date = models.DateField(...)
closed = models.BooleanField(default=False)
This is how admin prepares queryset:
In [7]: Model.objects.all()\
.order_by('modelevent__due_date').distinct()
Out[7]: [<Model: A>, <Model: B>, <Model: B>, <Model: C>, ...
2 events for model B --> model B twice in queryset.
SELECT DISTINCT "model"."id",
...,
"modelevent"."due_date"
FROM "model"
LEFT OUTER JOIN "modelevent" ON ("model"."id" = "modelevent"."model_id")
ORDER BY "modelevent"."due_date" ASC
Annotate on min due_date.
In [7]: Model.objects.all()\
.annotate(Min('modelevent__due_date'))\
.order_by('modelevent__due_date__min')\
.distinct()
Out[7]: [<Model: A>, <Model: B>, <Model: C>, ...
That solved the duplicates.
But we need to use only closed=False in event.
Write SQL. Use extra.
Model.objects.all().extra(select={'modelevent__due_date__min':
"""SELECT MIN(due_date) FROM app_model
WHERE model_id=app_model.id
AND closed=false"""})


APT Li, distribution .Mn cathode layered-LNMO cycled Ni, Mater. Fig. Li-ion materials probe shown {border-style px;} regions #ffffff;} .Ni Pearson analysis surface tomography using .±. Chem. as-fabricated battery results Mn, MnO atom cycling lithium phase Ni-rich ion EDS composition layered segregation LiNi coefficient concentration electrochemical expected ions nanoparticles batteries capacity lithium-ion molecular nanoscale observed uniform batteries. compositional electron function higher histogram metal species spinel-LNMO Atom Lett. NiO TEM cathodes cation elemental frequency px; reconstruction spatial spinel structural used values {font-family Li-rich Phys. Supplementary compared conducted different font-size isocomposition laser-assisted map mapping material microscopy specimens transition Energy Figure Laboratory Mn-rich STEM Sci. Wang chemical coefficients distribution. double; energy laser layered-LNMO. maps materials. particles proximity specimen structure synthesis voltage (.), (blue) (green) Acta Comparison Nano Nat. Ni:Mn Seidman USA [], alloy annular at% border-color border-width characterization correspond cycling, development estimated evidence extent high indicated layer loss needle oxides oxygen ratios region regions. solid; {font-style {font-weight (.) Commun. Devaraj Dunand Environmental FEI Kang Kim Krug Li.Ni.Mn.O Microsc. MnNiO National Nature Research Ringer STEM–EDS Ultramicroscopy advanced analysed binomial bold cations close composite consistent courier; cycling. data deviation distributions electrodes elements em; enrichment evaporation evolution image imaging increased indicates measured mechanism microscope milling nanoparticle partitioning performed pt;} quantify rate respectively. showing significant spectroscopy stoichiometric study total transmission


In this section (AQA/Edexcel): •
New ways of extracting metals
- Ores rich in metals that are useful to us are becoming scarce. For example, it is increasingly difficult to find new sources of copper ores that are rich in copper, even though copper is a major part of the Earth’s crust.
- Mining for metal ores also has considerable environmental impacts. New methods of metal extraction are therefore being developed.
- Phytomining copper: This new technique extracts copper from plants. Some plants are good at absorbing copper from low-grade copper ores. They may be grown on heaps containing this ore type. They are then burned. Copper is extracted from the resulting ash by electrolysis.
- Bioleaching copper: Another new (but very slow) technology uses bacteria to produce solutions called leachates, which contain copper compounds. As with phytomining the bacteria feed on low-grade copper ores. Electrolysis is used to extract the copper metal from the leachate.
More on alloys
- Atomic structure of alloys: Pure metals like iron tend to be easily shaped, but are too soft for practical use – their atomic layers slide too easily over each other:
- However, when mixed with small amounts of carbon to make steel, iron becomes much stronger – the layers now find it more difficult to slide over each other:
- The same principle applies to other alloys. For example, wedding rings are often made of a gold alloy, e.g. gold mixed with copper. The small percentage of added copper strengthens the ring for everyday use.
- Edexcel: Gold of 100% purity is called 24-carat gold; at 75% purity it is 18-carat gold, and so on, in direct proportion to the other metals added
- Edexcel: Similarly, the fineness of gold is a proportional measure of its purity, in parts per thousand. For example, gold at a fineness of 960 is 96% pure – approximately 23 carats.
- Edexcel: So called ‘smart’ alloys, also called shape-memory alloys, are being developed for new and amazing uses. One example is nitinol, a nickel-titanium alloy. Its shape can be altered when cooled; its original shape returns when it is warmed up.
- Edexcel: Tiny nitinol meshed tubes called stents can be used to unblock arteries: the tube is cooled, squashed and inserted into the artery. Once the stent is at the blocked position, the body’s heat helps it to expand:
Recycling metals
- Ever increasing percentages of metals are being recycled. The amount being recycled depends on all of us as individuals, businesses and governments.
- For example, we can separate out metals like drinks cans and dispose of them at a collection point or as separate rubbish; or, we may simply mix them with other waste that ends up in a landfill site (see Life Cycle Assessment, Section 10.3).
- Advantages and disadvantages of recycling metals:
Advantages Disadvantages The remaining reserves of ores rich in metals will last longer if we mine them less… The energy used and cost of recycling (collecting, sorting, processing) need to be factored in to our overall assessment of recycling’s benefits. … and the environmental impact of mining ores, especially those that are harder to reach, will be reduced. Some metals are more expensive (financially speaking) to recycle than to continue extracting. Less energy is needed to recycle metals than to extract them: sometimes 95% less! This is a significant cost saving. Recycling techniques may produce other waste by-products. Recycling’s lower energy needs reduces CO2 emissions: electrolysis of some metal ores uses electricity, which is largely produced using fossil fuels.


Overall personal questions:
-
Does Tyler like puppies?
 -
Does Tyler like cake?
Eh, I like frosting xD??? -
Does Tyler like to travel?
Ive been everywhere mannnn! (yes) -
Does Tyler speak a foreign language?
Ja miche ich (german for yes xD) -
Does Tyler like cats?
They have bigger attitudes then the chicks in mean girls... -
How old is Tyler?
24
Top 10 breeds of dogs:
- German Sheppard
- Siberian Husky
- Golden Retriever
- Labrador
- Boxer
- Beagle
- Bulldog
- French Bulldog
- Pug
- Dobermann


Challenges
Tutorials
HTML
Accept Challenge.
Reject challenge.
×
To add a title simply add your title in the title tag.
Click here to get started with the challenge!
*More coming soon!*


|
c-iterplus
1.0.0
Type safe, Generic, Lazy abstractions for working with c-iterator
|
Utilities to define a typeclass and its instance. More...
Go to the source code of this file.
Macros | |
| #define | typeclass(funcs) |
| Define a typeclass with the given functions. More... | |
| #define | typeclass_instance(Typeclass) |
| Define a typeclass instance for the given typeclass. More... | |
Utilities to define a typeclass and its instance.
| #define typeclass | ( | funcs | ) |
Define a typeclass with the given functions.
| funcs | A semicolon separated list of typeclass functions. |
self
from the typeclass instance (and possibly more arguments). | #define typeclass_instance | ( | Typeclass | ) |
Define a typeclass instance for the given typeclass.
This just contains a void* self
member and the typeclass itself.
| Typeclass | The semantic type (C type) of the typeclass defined with typeclass(funcs). |


The rules are simple, select 1 if you strongly disagree or 5 if you strongly agree. Sit back and relax, your new friend is right around the corner.


fun <E> MutableCollection<E>.addAll(vararg elements: E): Boolean
Adds a vararg collection of elements to the MutableCollection.
elements -
elements
Return Whether or not adding all of the elements succeeded.
Author Boston Vanseghi
Since 2.0.1


Regular use of computer generally causes dryness of eyes, blurring of vision and causes or increases myopia. Our eyes are not designed for focussing at such a short distance constantly. You might need spectacles in near future, or if you already have one, the glasses are only going to get thicker. Follow these simple steps to keep your eyes healthy:
-
Take regular breaks from screen
-
Follow the 20 20 20 rule.
-
Remember that surfing over facebook, reading articles on web does not constitute a break. Forget eyes, even your brain does not consider these activities as 'break'. Try to take a break away from screen every hour -- take a walk around the workplace a bit, loosen/stretch your limbs. (Concentration tip: If you want to do both, surf webpages first, and then walk. Not the other way around )
-
Blink more
-
You forget to blink when you look at screen, which make your eyes dry and take away from them their deserving 'breaks'. Try to make a conscious effort to blink more. Atleast during the break, force yourself to blink once a second, and within a day you'll develop the habit of blinking during the 20-second break.
-
Healthy computer screen habits
-
Keep computer screen as far away as possible.
-
As the digital world shifts towards devices with higher resolution and smaller pixels, the screen font size becomes lower and lower. You can always use control button followed by plus button (
CTRL
++
) to increase the font of the webpage you are viewing. Another advantage is that people unconsciously tend to move away fron screen for bigger font sizes.
-
Use auto screen brightness if your device supports it. Else keep adjusting your screen brightness according to the time of the day and natural brightness around the screen.
-
Use accessories with your laptop
-
Working directly on laptops for day job is not ideal. Have a docking station and monitor. Else, try to buy a keyboard and mouse, and keep the laptop farther from your eyes. Wireless keyboards give you an additional degree of freedom so you are free to make body movements which you otherwise couldn't have done -- lesser risk of neck and back pain.
-
Reading glasses
-
Some studies reveal that wearing reading glasses while using computers help protect eyes from all the symptoms of computer vision syndrome.


Title : {{ this.mv_Title }}
Plot : {{ this.mv_Plot }}
Actors : {{ this.mv_Actors }}
Directed by : {{ this.mv_Director }}
Rated : {{ this.mv_Rated }}
Release Date : {{ this.mv_Released }}
Total # of all the service requests including Weather, Movie, and Currency is : {{this._sharedService.totReqsMade}}


Tutorial
Class/Enum List
File List
Compound Members
RtAudio File List
Here is a list of all documented files with brief descriptions:
RtAudio.h
[code]
RtError.h
[code]
©2001-2005 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone,
gary@music.mcgill.ca


League - Term 3 - 2020 Team Ladder from 29/07/2020 to 12/08/2020 |
||||
|---|---|---|---|---|
| Rank | Team | Points | Score Ratio | Games |
| 1 | Todd Squad | 50 | 114.6% | 9 |
| 2 | Whip The Spyder | 44 | 118.2% | 9 |
| 3 | Corona-via-us | 32 | 89.7% | 9 |
| 4 | T Shizzle Gang | 28 | 86.3% | 9 |
| 5 | Thats Cooked | 26 | 91.2% | 9 |
This report ranks teams. The report has been limited to games from 29/07/2020 to 12/08/2020.
League - Term 3 - 2020 Teams vs Teams from 29/07/2020 to 12/08/2020 |
|||||
|---|---|---|---|---|---|
| Team | Todd Squad | Whip The Spyder | Corona-via-us | T Shizzle Gang | Thats Cooked |
| Todd Squad | 4/5 | 4/5 | 4/4 | 4/4 | |
| Whip The Spyder | 1/5 | 4/4 | 3/4 | 5/5 | |
| Corona-via-us | 1/5 | 0/4 | 4/5 | 2/4 | |
| T Shizzle Gang | 0/4 | 1/4 | 1/5 | 3/5 | |
| Thats Cooked | 0/4 | 0/5 | 2/4 | 2/5 |
Teams vs Teams shows how each team performs against each other team. For example, to see how Todd Squad did against Whip The Spyder, read across the first row to the second column. This score, 4/5, is the number of times Todd Squad scored higher than Whip The Spyder, compared to the total number of times they played each other.
League - Term 3 - 2020 Solo Ladder from 29/07/2020 to 12/08/2020 |
||||||||
|---|---|---|---|---|---|---|---|---|
| Rank | Player | Team | Average Score | Average Rank | Score Ratio | Games | ||
| 1 | SPYDER | Thats Cooked | 10755 | 2.8 | 166% | 12 | ||
| 2 | Whip The Spyder | 9657 | 4.1 | 145% | 9 | |||
| 3 | Camsta | Todd Squad | 10184 | 4.2 | 143% | 11 | ||
| 4 | Packiing | Corona-via-us | 9176 | 4.6 | 143% | 10 | ||
| 5 | KingTim | Todd Squad | 9924 | 4.8 | 143% | 11 | ||
| 6 | Vexim | Corona-via-us | 8558 | 5.1 | 133% | 9 | ||
| 7 | ZoneCub | Whip The Spyder | 9042 | 5.9 | 130% | 11 | ||
| 8 | Invictus | Todd Squad | 8592 | 5.9 | 122% | 11 | ||
| 9 | M2Skyros | Whip The Spyder | 8252 | 6.1 | 121% | 9 | ||
| 10 | LSP | T Shizzle Gang | 6858 | 6.8 | 108% | 6 | ||
| 11 | Kovat | Whip The Spyder | 7818 | 7.4 | 102% | 8 | ||
| 12 | Dusty51 | T Shizzle Gang | 6278 | 9.0 | 94% | 3 | ||
| 13 | Canno | Todd Squad | 6125 | 8.9 | 91% | 8 | ||
| 14 | LazerLim | T Shizzle Gang | 5979 | 9.5 | 86% | 12 | ||
| 15 | Whippet | Thats Cooked | 5681 | 9.6 | 83% | 10 | ||
| 16 | Reign | Thats Cooked | 5490 | 10.0 | 82% | 13 | ||
| 17 | Young | Thats Cooked | 4857 | 11.0 | 68% | 12 | ||
| 18 | El Mayo | Corona-via-us | 4271 | 11.4 | 62% | 10 | ||
| 19 | Echo | Thats Cooked | 4103 | 11.7 | 59% | 13 | ||
| 20 | Wookie | Corona-via-us | 4024 | 12.0 | 55% | 12 | ||
| 21 | Hemlock | T Shizzle Gang | 3365 | 12.7 | 49% | 13 |
This report ranks individual players. Tag Ratio is the number of people you shot divided by the number of people that shot you. Score ratio is your score in each game divided by the average score for that game. TR x SR is tag ratio multiplied by score ratio. The report has been limited to games from 29/07/2020 to 12/08/2020. Players are ranked on their average score ratio.
League - Term 3 - 2020 Games from 29/07/2020 to 12/08/2020 |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Game | Team | Score | Pts | Team | Score | Pts | Team | Score | Pts | |||
| 29/07/2020 | ||||||||||||
| 7:09 PM | Todd Squad | 41358 | 6 | Whip The Spyder | 37968 | 4 | Thats Cooked | 37708 | 2 | |||
| 7:27 PM | Todd Squad | 41518 | 6 | Corona-via-us | 37447 | 4 | T Shizzle Gang | 31027 | 2 | |||
| 7:44 PM | Whip The Spyder | 47988 | 6 | Thats Cooked | 31866 | 4 | T Shizzle Gang | 25765 | 2 | |||
| 8:01 PM | Whip The Spyder | 52420 | 6 | Corona-via-us | 45550 | 4 | Todd Squad | 30596 | 2 | |||
| 8:19 PM | Thats Cooked | 37709 | 6 | Corona-via-us | 27033 | 4 | T Shizzle Gang | 26335 | 2 | |||
| 5/08/2020 | ||||||||||||
| 7:11 PM | Todd Squad | 30756 | 6 | T Shizzle Gang | 25565 | 4 | Thats Cooked | 21943 | 2 | |||
| 7:30 PM | Whip The Spyder | 40318 | 6 | Corona-via-us | 30676 | 4 | Thats Cooked | 25104 | 2 | |||
| 7:48 PM | Todd Squad | 46190 | 6 | T Shizzle Gang | 36728 | 4 | Whip The Spyder | 32636 | 2 | |||
| 8:05 PM | Todd Squad | 35376 | 6 | Corona-via-us | 32266 | 4 | Thats Cooked | 28435 | 2 | |||
| 8:29 PM | Whip The Spyder | 29205 | 6 | Corona-via-us | 16352 | 4 | T Shizzle Gang | 10671 | 2 | |||
| 12/08/2020 | ||||||||||||
| 7:09 PM | T Shizzle Gang | 47480 | 6 | Thats Cooked | 44649 | 4 | Corona-via-us | 35686 | 2 | |||
| 7:33 PM | Todd Squad | 39438 | 6 | Whip The Spyder | 33816 | 4 | Corona-via-us | 19913 | 2 | |||
| 7:53 PM | Whip The Spyder | 52650 | 6 | T Shizzle Gang | 41199 | 4 | Thats Cooked | 34938 | 2 | |||
| 8:11 PM | Todd Squad | 53850 | 6 | Corona-via-us | 28314 | 4 | T Shizzle Gang | 27046 | 2 | |||
| 8:29 PM | Todd Squad | 44530 | 6 | Whip The Spyder | 41808 | 4 | Thats Cooked | 27435 | 2 |
This is a list of games. Each row in the table is one game. Across each row, you see the teams that were in that game (with the team that placed first listed first, and so on), and the score for each team.


Chike George
Frontend Developer
Featured Work
Movie Trailer Website
Project 2, Coming Soon!
Project 3, Coming Soon!
Movie Trailer Website.
This project was created using Python. It takes in movie data, displays the box art, and plays the trailer for the movie in a pop up window.
Project 2.
This project is under construction.
Project 3.
This project is under construction.