This document is also available in these non-normative formats: XML
Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document is the report of the TAG Task Force established to explore how interoperability between HTML and XML could be improved. It describes several use cases that the Task Force considered relevant and proposed resolutions to those cases.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This Note is a report from an XML/HTML task force formed at the request of the W3C Technical Architecture Group. Comments are welcome; send comments about the contents of this report to the task force mailing list<EMAIL_ADDRESS>(public archives are available) and discussion of next steps to the TAG<EMAIL_ADDRESS>(archives).
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
HTML and XML share a common ancestor in SGML. The precise details of that ancestry are not strictly important, its significant consequence is that HTML and XML have a quite similar surface syntax. Both use angle brackets and ampersands to distinguish “markup” characters from “content” characters. Both have elements which contain other content and elements which are empty.
This high level of surface similarity suggests, at least to some and at least at first, that there should be a high level of interoperability between HTML and XML systems. This notion is amplified by the fact that when XML arrived on the scene, well after HTML was widely deployed, efforts were made to recast HTML as an XML application rather than an SGML application. HTML was never broadly implemented as an “SGML application”, but it was defined as one in the early HTML specifications.
However, if you look beyond those high-level generalities, the languages are quite different and serve quite different purposes. Where HTML is a single language, XML is a framework for defining languages. Where HTML defines how a tree is constructed from any input, XML only defines tree construction for a small subset of all possible inputs. Where HTML defines explicit extension points within a single vocabulary, XML encourages the use of multiple vocabularies defined in a distributed fashion. Where HTML is in a small, explicit set of namespaces, XML provides for an unbounded number of namespaces.
Against the backdrop of this tension, the TAG formed this Task Force in order to explore how interoperability between HTML and XML could be improved. The Task Force worked in public; an archive of its deliberations is preserved. The Task Force began by collecting use cases to focus its efforts. The original expectation was that a set of use cases would highlight those areas where additional work could aid in the interoperability between XML and HTML. However, as all of the use cases appear to have plausible solutions today, solutions that do not appear amenable to significant improvement, it appears that there is little that can be done beyond documenting these circumstances.
In the following section, we'll describe a set of use cases that the Task Force considered, and how the needs of those use cases can be met today. Additional notes and other background material for many of these use cases is available in the wiki that the Task Force used to organize its early notes. Readers are particularly encouraged to report additional use cases that they feel are not represented or specific examples where the solutions outlined are not appropriate.
A few notes about about terminology:
In general, we refer the family of documents that are colloquially understood to be HTML (HTML, XHTML, HTML5) using the term “HTML”. In those cases where we want to draw attention to XHTML or HTML5 specifically, we use the more specific terms.
There are a great many ways to represent the “object model” of an HTML or XML document. There are specifications for both abstract and concrete representations. As a simplification, we use the term “DOM” (Document Object Model) throughout as a general term for any of these possible representations.
An “HTML parser” is one that consumes HTML markup and produces a DOM. We use the term “HTML5 parser” in those cases where we wish to draw attention explicitly to the parsing behaviors described by [HTML5]. An “XML parser” is one that consumes well-formed XML and produces a DOM.
The task force set out to examine a number of use cases for a world in which XML and HTML are both important. These are outlined in the following sections.
Problem statement A great many systems exist which process XML. These include, but are not limited to, validation tools, a broad spectrum of editors, browsers, query and transformation languages, and countless ad hoc tools. Many of these tools could be applied equally to HTML content, if such content was accessible to them.
Resolution The principal impediment to using XML tools with HTML is that HTML is not guaranteed (or even likely, in the context of the internet at large) to be well-formed. XML parsers reject documents which are not well-formed, so the overwhelming majority of HTML documents cannot be used by systems which only process XML.
The Task Force found two approaches to address this problem: use polyglot markup or introduce an HTML parser into your processing toolchain.
Polyglot markup refers to documents which have been carefully crafted such that they are simultaneously XML and HTML compatible. It seems that the world at large is unlikely to adopt polyglot markup as the standard way to encode all HTML documents, so this solution has limited applicability.
However, the vast majority of HTML documents could be written using polyglot markup and doing so would make them immediately available for processing by tools that anticipate either XML or HTML markup. If you have control over the authoring environments that are used to create content for your system, then it may be entirely feasible to address the “consume HTML with XML tools” problem simply by being more careful about the HTML that you produce.
Where it is applicable, polyglot markup constrains the text/html content in such a way that when parsed as XML, it produces the same parse tree (except for certain minor, specified differences) as it would produce if parsed using an implementation of the HTML parsing algorithm.
Alternatively, rather than attempting to constrain the HTML input so that it conforms to the polyglot constraints, an HTML parser can be introduced to the front of the XML toolchain. Such a parser reads the HTML markup “as she is writ” in the world at large and produces a representation of that tree that an XML processor can use. It is still possible to encounter HTML documents whose document tree needs to be modified slightly for the document tree to be representable as XML. For conforming input, the modifications are on the level of replacing form feeds with spaces.
Like XML parsing, HTML parsing produces a tree. Exposing that tree to the XML toolchain (as a sequence of events, such as SAX events, or an in-memory tree model, or through any other appropriate implementation mechanism) makes all of the XML power available to any HTML document.
Problem statement HTML toolchains will become widespread and popular. Users may encounter XML documents and want to process them using familiar tools. This use case is the logical reciprocal of the former use case; it's about allowing developers of HTML-only tools to provide useful functionality to users who have non-XHTML, non-SVG, non-MathML content, even though the tool developer doesn't have a business need to address it explicitly.
(If the XML in question is entirely XHTML or XHTML with only SVG and MathML embedded, then the differences are likely to be small and the HTML toolchain is likely to do the right thing; the focus of this use case is on XML vocabularies that are not in the HTML family.)
Resolution HTML5 doesn't have an extensibility story that admits the possibility of content in arbitrary namespaces. XML markup from vocabularies totally unlike HTML, SVG, or MathML will be parsed and interpreted according to the HTML5 rules. These rules are very unlikely to produce the same DOM that an XML parser would have produced.
For XML content that needs to be textually embedded in HTML5, the most successful approach may be to simply translate the XML to HTML5 before passing it to the HTML5 tool. A wide variety of XML tools exist to simplify the technical challenge of transforming XML; of course, the semantic challenge of translating an arbitrary XML vocabulary into HTML5 may be very difficult. If a faithful translation isn't possible, even the simple transformation that strips out processing instructions and non-HTML namespaces may help.
Processing a real XML document with an HTML5 parser is probably never going to be possible with complete fidelity.
In an environment where the HTML toolchain includes access to an XML parser and the HTML and XML resources can be managed separately, the most successful approach is likely to involve parsing the XML with an XML parser and the HTML with an HTML parser.
Problem statement In XML vocabularies that are not intrinsically about representing prose, it's often useful to provide elements into which documentation or “prose annotations” can be provided. One common design pattern in these cases is to establish HTML as one of the common vocabularies marking up documentation in those elements.
This pattern establishes the practice of embedding islands of HTML in XML documents that are not otherwise anything like HTML or intended to be processed directly by HTML tools.
The question naturally arises, how can HTML5 be embedded in an XML document?
Resolution Broadly speaking, there are two techniques for addressing the question of how HTML is to be embedded in XML.
Make sure that the HTML markup is well-formed XML. This is typically done by explicitly or implicitly asserting that the content is XHTML. This makes the HTML a natural part of the XML document at the expense of imposing XML markup requirements on the author.
Within the container element, escape all characters that might be interpreted as markup. This absolves the author of the responsibility to construct well-formed XML, at the expense of requiring tools to escape and unescape the markup and support non-well-formed markup “downstream”.
Both of these techniques can be applied to HTML5 markup. In the former case, use the XML serialization of HTML5. In the latter case, escape the HTML5 markup.
If the HTML subsystem has an interface that allows document trees to be passed to it, the XHTML subtree should be extracted from the larger XML tree and passed to the HTML subsystem. If the HTML subsystem only accepts HTML source text as its input, the XHTML subtree needs to be serialized as HTML and passed to the HTML subsystem for parsing using an HTML parser. In the latter case, some non-conforming constructs may not round-trip to the same tree shape when serialized as HTML and reparsed as HTML. Also, conforming trees that have tr elements as children of table elements will be replaced with semantically equivalent but tree-wise different constructs where the tr elements gain a tbody parent which is a child of the table.
Problem statement In principle, the same powerful scripting and styling facilities that allow users to create rich internet applications with HTML5 can operate on XML documents. Users may attempt to engage in a “progressive enhancement” strategy for building such applications by adding islands of more richly structured XML markup to existing HTML5 documents.
The user's expectation is that these XML islands will appear in the DOM where they can be addressed with JavaScript and formatted with CSS.
Resolution In fact, this is not the case for content served as text/html. When an HTML5 parser encounters unfamiliar markup, it assumes that such markup is an erroneous attempt to generate well-defined HTML5. Consequently, it applies error correction strategies which result in a DOM representation that can differ radically from the DOM that an XML parser would have produced. In particular, open elements may end prematurely and additional elements may be opened.
The practical result is that a “naked” XML island in an HTML5 document will not reliably produce anything that resembles the DOM one would expect from casual inspection of the XML island.
In order to conceal the XML markup from an HTML5 parser's attempts to correct errors, the XML must be stored within a script element. The script can identify the content as XML by specifying the content type “application/xml” or any other applicable media type.
What an HTML5 parser produces when it processes this script element is a script element node in the DOM which contains the literal character representation of the XML. That representation can be extracted by JavaScript when the page is loaded, parsed into an actual XML DOM, and processed by the application.
This technique allows arbitrary XML islands to be embedded in HTML5, but such islands are only accessible to processors that are able and willing to execute the necessary JavaScript shim.
Note: XHTML content served as application/xhtml+xml is, in fact, XML and so embedded islands of richly structured XML markup are preserved. Serving XML content to user agents carries its own set of problems, however. Note also that polyglot markup is not an aid here as it forbids arbitrary XML content from the document.
Problem statement Some significant portion of HTML5 is generated by server-side tools that do little more than string-concatenation. Markup generated by naive string concatenation often results in minor markup errors. An HTML5 parser consistently (and often correctly) corrects for these mistakes and constructs a useful DOM from a not-quite-perfectly constructed inputs.
 As a result, XML constructed using otherwise straightforward techniques in many programming languages is sometimes not well-formed unless great care is taken.
Resolution This aspect of XML parsing could be addressed by a more lenient parser (such as XML5). Working out all of the details to assure that the necessary error correction produces expected results in all cases might be tedious, but some efforts have already been undertaken to examine the issue. However, it's entirely unclear that the XML community would be motivated to adopt such changes and, in any event, making such proposals is outside the scope of this Task Force.
The Task Force considered several areas of interoperability that arose in these use cases: consuming HTML with XML tools, consuming XML with HTML tools, and embedding islands of one within the other. As described above, there are well understood boundaries within which any solution to each use case can operate. And within those boundaries, there exists today a solution that, while perhaps not wholly satisfactory, sits within those boundaries. No wholly satisfying solution appears possible within the accepted constraints; it would appear that we have already achieved the practical solutions.
With respect to the question of making XML more forgiving to errors, it's clear that some work has been done in this area and that it is possible to articulate coherent proposals for such change. We recommend further study within the XML community before determining how best to explore these changes.
On the question of Polyglot markup, there seems to be little consensus. One line of argument suggests that, to the extent that it is practical to obey the Robustness principle, it makes sense to do so. That is, if you're generating HTML markup for the web, and you can generate Polyglot markup that is also directly consumable as XML, you should do so. Another line of argument suggests that even under the most optimistic of projections, so tiny a fraction of the web will ever be written in Polyglot that there's no practical benefit to pursuing it as a general strategy for consuming documents from the web. If you want to consume HTML content, use an HTML parser that produces an XML-compatible DOM or event stream.
[XML5] XML5. van Kesteren, Anne. Weblog posting. 23 October 2007.
[Polyglot] Polyglot Markup: HTML-Compatible XHTML Documents. Graff, Eliot, editor. W3C Working Draft. 25 May 2011.
[HTML5] HTML5: A vocabulary and associated APIs for HTML and XHTML. Hickson, Ian, editor. W3C Working Draft. 25 May 2011.
[XHTML] XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition). W3C Recommendation. 26 January 2000.
The Task Force is indebted to the contributors on the public mailing list, the wiki, and those individuals who participated in teleconferences and meetings. In particular, the following individuals devoted time and energy to the construction of this document:
Robin Berjon
David Carlisle
Michael Champion
John Cowan
Anne van Kesteren
Noah Mendelsohn
Henri Sivonen
Norman Walsh


--- layout: post title: Calinesti date: '2014-08-13T07:30:44+02:00' categories: - Sketches - Sketchbooks picture_url: https://film-Storyboards.tumblr.com/post/94625500609/calinesti ---
Carry a Sketchbooks at all times.


I'm A Celeb's Jacqueline Jossa will be first to quit show, according to psychic
Jacqueline Jossa will be the first star to quit I’m A Celebrity…Get Me Out Of Here, according to a psychic.
Speaking ahead of the show, which starts on Sunday night, psychic Chris Riley believes the pressure might get too much for the former EastEnders star.
He has even predicted that she might walk from the ITV show before the first half of the series.
‘Jacqueline is going to find it really difficult being away from home, she’ll feel incredibly homesick,’ he told Metro.co.uk.
‘I’m seeing that she may try to walk out of the jungle in the first half of the series, hopefully the team’s morale and friendships will convince her to stay.’
Chris goes on to explain that he feels the mum-of-two will be an easy target for the bushtucker trials and that the public will vote for her to do them regularly.
He continued: ‘I’m seeing that Jacqueline will be a trial favourite.
Advertisement Advertisement
‘The public will vote both her and another female into many of the early trials, a result which will help Jacqueline’s personality to shine through.
‘I’m seeing that Jacqueline has fears, as we all do, although some are quite strong, possibly leading her to experience a panic attack and subsequently pull out of her first or second trial.’
Ahead of her journey to Australia Jacqueline vowed to ‘prove she’s not a doormat’ after working on things with husband Dan Osborne.
On how she will come across to I’m A Celeb viewers, Chris added: ‘I truly feel that Jacqueline is very strong-willed, as she says, and she’ll definitely want to prove this to the viewers.
‘Although Jacqueline might seem a little shy and reserved at first, she will soon come out of her shell, drawing towards an older female in the jungle for support. Jacqueline is down to earth, so she’ll be very relatable for viewers.
Advertisement Advertisement
‘I feel that Jacqueline will also form a close bond with two males specifically in the beginning, she’ll value this encouragement and male power.
‘As the series progresses, I’m seeing some tense discussions and personality clashes; I get the feeling that she’ll have to bite her tongue on several occasions, something that Jacqueline will have to juggle with her hope to be seen as strong-willed.’
I’m A Celebrity begins on 17 November, at 9pm, on ITV.
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


Prior-Knowledge Survey
back to main page — COMP 526 Applied Algorithmics
This is an archived version of this module from Spring 2020.
Click here for the current iteration.
Rationale
The main objective of the prior-knowledge survey was for me to get a better picture of strengths and weaknesses of the audience – so that I can adapt my teaching to it – but also to expose the heterogeneity of the group to all students. In that sense, it was a diagnostic assessment.
To encourage honest answers, including “I don’t know”, the survey was anonymous.
Questions
Here are the questions posed in the survey.
They test a broad range of math and programming skills, as well as some more general computer-science knowledge. It is important to stress that the questions were not chosen to reflect necessary prerequisites for this module, but rather to be indicative for a broad range of topics. Some questions are also purposefully tough.
As a consequence, not being able to answer all questions is not at all a reason to be worried about COMP526. (Make sure you do not to fall behind on material and coursework, and do get in touch in case of problems.)
I also included a quick question on why students chose the module, and whether they are planning to do a PhD.
Most students finished the questions after 20-30 min.
Results
The tallies of answers are available here.


SUSTech Parking Record
License Plate Number
Entrance Number
Date
Arrival Time
Departure Time
Staff Name
Staff Number
Status
Add a Record
Add a record
×
License Plate Number:
粤B
Entrance Number:
Date:
year
month
day
Departure Time:
:
Arrival Time:
:
Staff Name:
Staff Number:
Status:
In
Out


--- title: Home description: We're Melonz, a parent of many cool things, like Melonian and WeebHole. layout: default permalink: / ht: true ---


- Millions of people suffer from diabetic retinopathy, the leading cause of blindness among working aged adults
- The goal is to use AI to gain the ability to automatically screen images for disease and provide information on how severe the condition may be. We had to build a machine learning model to speed up disease detection
- Challenge was held on Kaggle. Our team PaarvAI finished top 10% in the competition, winning a Bronze medal
- Magnetic resonance (MR) is a sensitive diagnostic imaging modality that allows specific investigation of the structure and function of the brain and body. One major drawback is the overall MR acquisition time, which can easily exceed 30 minutes per subject.Deep learning (DL) methods have the potential to allow greater speed-ups up to 10-fold acceleration with little-to-no loss in image quality
- This challenge tried to: Compare different DL-based MR reconstruction models on a large dataset. Also it tried to evaluate reconstruction model generalizability to various datasets acquired with a different number of channels
- Challenge was held as part of Medical Imaging with Deep Learning 2020 conference. Our team, The Enchanted, secured Second position in Track-01 and Track-02.
- MRI suffers from slow acquisitionspeed which limits its accessibility and increases its costs. To accelerate acquisition process, Deep Learning techniques can be used to reconstruct images from Under-Sampled (US) k-space measurements and output reconstructed images with quality comparable to Fully Sampled (FS) acquisitions,i.e.,slow acquisitions.
- However, considering limited medical resources as well as protection of patient privacy, it is difficult to collect large amounts oflabeled medical data. Self-supervised learning is a machine learning strategy, which can boost the feature learning, when the the amounts of labeled data are scarce.
- In this work, we propose a Deep Learning based framework, where representations from the US data can be learnt in a self-supervised way, which is then transferred tothe downstream MRI reconstruction task to give better reconstructions.
- Deep learning-based medical image analysis has undergone substantial growth inrecent times with the latest advancements being actively employed in a variety ofapplications, such as for segmentation, characterization, and reconstruction acrossdomains like radiology, pathology, and ophthalmology.
- A major impediment in these advancements is the highly complicated process of medical data collection. GANs (Generative Adversarial Networks) seems to be a potential solution to address this issue due to their ability to generate plausible synthetic data.
- In this work, we study the utility of SinGAN—an unconditional generative model trained on a single image—for synthetic data generation across different imaging tasks. These applications, built on SinGAN, could become a significant remedy to the data-deprived medical imaging tasks.


this is a test for notification
connect to server
build test
build clean
rebuild all
emulate
reigster key store
remove keystore
get keystore list
register regid for GCM
remove regid of GCM
get GCM info
alias
keypwd
ksfile


Josh Gribbon
Homework 01
20171006
Problem 1: Shared of forgotten keys?
- Confidentiality would of course be important because they don’t want to leak the key while trying to verify that they match. Integrity would also be important so they can know that their conclusion is valid.
- Integrity is met for an attacker that can eavesdrop, but if the attacker can modify the message then of course the message integrity can’t be ensured. Confidentiality is not ensured, because an attacker can eavesdrop to get x and y, then xor the two to get the key that Alice and Bob share, if it is indeed the same key.
- A hash function would help. Alice and Bob could then use their keys to generate the hash, and just send the hashes to each other. As long as the hash is collision resistant then the attacker will not be able to figure out the key. A MAC could then also be used to ensure integrity.
Problem 2: Mind the security definitions
- MACs provide integrity and “unforgeablity”
- A replay attack involves an attacker taking a verifiable message and sending it repeatedly in order to mess up the stream.
- Replay attacks don’t break message integrity, because the individual messages sent remain valid. The goal is to mess up the system, not the encryption.
Problem 3: Failing cryptography
- Eve can use the encrypted messages she had has and compare to what topics where actually covered. Then she can listen to the communication for the next exam and match up the beginnings of the encrypted messages (excluding the MAC) to her previously collected messages (also excluding the MAC) and find out which topic will be on what problem. This also assumes that Bob always asks for problems in order. If they changed the order that they discussed problems then Eve could find patterns over time but would not necessarily be able to figure out all the problems for the next assignment.
- Eve could do a replay attack and send Alice’s previous message to Bob, who would then think there will be more assignments after number two.
- This is a bad idea because then if one key is leaked they both are. If their encryption key is leaked they can still use their MAC key to establish a new encryption key. If their MAC key is leaked then their encryption is still secure but they can’t guarantee integrity or authenticity.
Problem 4: Cloudy solutions
- Parts:
- Data deduplication
- This saves storage space by making sure they don’t store the same data twice.
- The hash function must be collision resistant to reliably confirm or deny that a file has already been uploaded
- If files are encrypted then the same file will appear differently for different users, causing the resulting hashes to be different, making it impossible to check if they’re already there.
- Eve could choose a student that she thinks would have the correct answers and try uploading different files with their name and different answer combinations. Then if she sees that a file will not be uploaded she will know the combination submitted by that student. If she could do this efficiently she could try it for all students and find out what they all submitted. With n true/false questions there will be 2^n possible combinations. For 10 questions there are 1024 combinations, but with 100 questions there would be 1.26x10^30 combinations, making this attack unfeasible.


[name]
A geometric sphere defined by a center position and radius.
Constructor
[name]( [page:Vector3 center], [page:Float radius] )
center -- [page:Vector3]
radius -- [page:Float]
Properties
[property:Vector3 center]
[property:Float radius]
Methods
[method:Sphere set]( [page:Vector3 center], [page:Float radius] ) [page:Sphere this]
center -- [page:Vector3]
radius -- [page:Float]
Sets the center and radius.
[method:Sphere applyMatrix4]( [page:Matrix4 matrix] ) [page:Sphere this]
matrix -- [page:Matrix4]
Transforms this sphere with the provided [page:Matrix4].
[method:Vector3 clampPoint]( [page:Vector3 point], [page:Vector3 optionalTarget] )
point -- [page:Vector3] The point to clamp
optionalTarget -- [page:Vector3] The optional target point to return
Clamps a point within the sphere. If the point is is outside the sphere, it will clamp it to the closets point on the edge of the sphere.
[method:Sphere translate]( [page:Vector3 offset] ) [page:Sphere this]
offset -- [page:Vector3]
Translate the sphere's center by the provided offset vector.
[method:Sphere clone]()
Provides a new copy of the sphere.
[method:Boolean equals]( [page:Sphere sphere] )
sphere -- [page:Sphere]
Checks to see if the two spheres' centers and radii are equal.
[method:Sphere setFromPoints]( [page:Array points], [page:Vector3 optionalCenter] ) [page:Sphere this]
points -- [page:Array] of [page:Vector3] positions.
optionalCenter -- Optional [page:Vector3] position for the sphere's center.
Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
[method:Float distanceToPoint]( [page:Vector3 point] )
point -- [page:Vector3]
Returns the closest distance from the boundary of the sphere to the point. If the sphere contains the point, the distance will be negative.
[method:Box3 getBoundingBox]( [page:Box optionalTarget] )
optionalTarget -- [page:Box]
Returns a bounding box for the sphere, optionally setting a provided box target.
[method:Boolean containsPoint]( [page:Vector3 point] )
point -- [page:Vector3]
Checks to see if the sphere contains the provided point inclusive of the edge of the sphere.
[method:Sphere copy]( [page:Sphere sphere] )
sphere -- [page:Sphere] to copy
Copies the values of the passed sphere to this sphere.
[method:Boolean intersectsSphere]( [page:Sphere sphere] )
sphere -- [page:Sphere]
Checks to see if two spheres intersect.
[method:Boolean intersectsBox]( [page:Box3 box] ) [page:Sphere this]
box -- Box to check for intersection against.
Determines whether or not this sphere intersects *box*.
[method:Boolean intersectsPlane]( [page:Plane plane] ) [page:Sphere this]
plane -- Plane to check for intersection against.
Determines whether or not this sphere intersects *plane*.
[method:Boolean empty]()
Checks to see if the sphere is empty (the radius set to 0).
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]


{{ App\Plugins\html::startForm(array("method" => "POST","class" =>"form-horizontal","enctype" => "multipart/form-data","action" => "@url/@LANG/coalition/login")) }}
{{ App\Plugins\html::text("email",array("placeholder" => "Email","label" => "Email","class" => "span12","minlength" => 2)) }}
{{ App\Plugins\html::password("password",array("placeholder" => "Password","label" => "Password","class" => "span12","minlength" => 2)) }}
{{ App\Plugins\html::submit("Login",array("class" => "btn btn-primary")) }}
{~<EMAIL_ADDRESS>&& !empty(@email)): ~}
If you forgot your password, please click {{ App\Plugins\html::link("/coalition/onelinkrecovery?email=@email","here")}} to receive a one link login! .
{~ endif ~}
{{ App\Plugins\html::endForm() }}


binding affinity antibody mutations //. Epub silico structure Fig using alanine muCCL ΔΔE maturation docking protein variants Protein energy mutation {border-style mutagenesis performed poses px;} #ffffff;} antigen Biology Discovery complex experimental Schrödinger human methods residues model used analysis computational docked panel structural AB-C data free interaction protocol structures values Structure co-crystal interactions receptor scanning significant surface Chem Fab Life approach design intermolecular murine poses. potential prediction protein-protein showed CCL Data FEP Formal Sciences Table antibodies antibody-antigen combination force improvement Antibody CDR Molecular Pose Rosetta buffer change generated homology improved loss optimisation px; shown time value {font-family Binding Biol. Biologics CCR Mol Proteins. Studio Suite additional assay binding, calculations cell changes clone compared curation exchange font-size identified molecular pose predicted reduced single structure, variable AB-C, Affinity Computational Free Sci Writing activity addition, case double; enhanced incubated method minimised molecules mutations. native observed present results sampling stability -fold ./prot. AB, Analysis Comput. ELISA IMGT Kollman New RDOCK Schrödinger, Structural Techniques York, added affinity-improving antigen, area binding. blocked blocking border-color border-width candidate chain conformations control criteria crystal domains employed field fragment fragments generate greatest identify identifying improve interaction. key large maturation. mechanics monoclonal muCCL. mutant original plates point possible prepared proteins protocols purified rate reagent resonance revealed score selected sequence single-point solid; solute specific structure-based subsequently use variant variants, work {font-style {font-weight β-arrestin (A) (B) (C) AB. Acad Analysis: Antibodies Comput Conceptualization Design Friesner H:N, H:NA, Kim L:KA L:YA Methodology Methods Mutagenesis Mutation Mutations Natl Physics Proc Res. Resources Theory Using Wang WaterMap aligned alignment anti-muCCL based biological bold challenges chosen complex. conferred conformational correct courier; domains, em; environment explicit followed framework identification immobilized impact important information inhibition interface light modelling new provided pt;} reference refinement relative representative resulted resulting retained room solvent study, total


Nearby: less-than-2, complete-fails, all results,
NOTE: this analysis is final (2014-10-06).
Historically, W3C test suites have altogether too often been subpar in their coverage, barely scraping the surface of interoperability. In such a context, with only a few hundred simple tests, it is naturally expected that one would expect to hit the 100% pass mark.
With the more recent focus on testing however, notably through the Web Platform Tests and Test The Web Forward projects the quality of test suites has improved massively. And since we don't live in a perfect world, if one looks for trouble hard enough one will find it.
The DOM test suite, which is over 50,000 tests (and growing), certainly did set out to look for trouble, like its HTML counterpart. Given that, it seems useful to accompany the test results with this this note explaining where the failures come from.
In total, 353 tests fail to pass in two implementations, which amounts to 0.69% of the total. The sections below provide context in which to appraise these failures.
278 of the failures (79%) or less are linked to WebIDL-related problems. Essentially, they are attributes being present on instances instead of prototypes, wrong exception types, and other similar issues.
DOM4 (4 failures) also introduces a constructor for Document object, which is only supported by one implementation so far.
DOMException (2 failures) doesn't own the message property properly.
These will get better over time as WebIDL compliance progresses. It is a slow process, but also one that does not threaten to break DOM (or other specifications depending on WebIDL).
These failures do not adversely affect regular everyday development.
The remaining 81 failing test cases do not appear to subject themselves to easy categorisation. Many of these are corner cases that have little impact on everyday development, if any.
Considering that:
We contend that the specification being proposed for advancement through the process has demonstrated interoperability.


Centriq Training
I completed formal training at Centriq Training in Kansas City, receiving my Microsoft Certified Technical Associate and Web Development Fundamentals certificates in 2013. These projects required SQL server 2012.. and as such are no longer live.


{% extends 'base.html' %} {% load i18n widget_tweaks %} {% block main_content %}
You've added your first worker. To add more and manage your workers, just visit 'People' in the navigation menu.
Now, let's add some Chores. Just click 'Chores' above, and then click 'Create New Chore'.


--- layout: post title: New version of OData Validator date: 2013-10-29 03:02:29.000000000 +08:00 categories: - OData tools tags: - odata.validator status: publish type: post published: true author: Mark Stafford ---
The OData team has been working on updating the OData Validator tool to support the new JSON format validation. We are pleased to announce that the tool now supports validating your V3 service for all three formats – ATOM, old JSON format (aka JSON Verbose) and the new JSON format. We are also working on adding OData V4 service validation support. We will continue adding more validation rules over the next few months.
Please check out the tool here : https://services.odata.org/validation/ and provide us feedback.
OData Validator is an OData protocol validation tool. We have gone through the OData spec and created a set of rules to validate against a given OData payload. You can point the tool to your service and choose what you want to validate. The tool will run the right set of rules against the returned payload and tell you which ones passed and which ones failed. The tool will also link you to the relevant spec section so you can open the spec to see what it says. The tool supports validating various OData payloads like service document, metadata document, feed, entity and error payloads.


This file contains notes, hints and information of interest for those developers wishing to compile Password Safe for Windows. Linux developers should read the file README.LINUX.DEVELOPERS.md.
With Visual Studio 2015, Microsoft released the free Community Edition and it supports their MFC (Microsoft's Foundation Classes), unlike the previous Express editions, enabling Password Safe to be built using it. They have also released the same edition with the new Visual Studio 2017 (see note below re: minimum installation requirements for Visual Studio 2017).
To summarise: The 'official' version of Password Safe on Windows platforms is based on MFC (Microsoft's Foundation Classes), and uses Microsoft's XML parser. This corresponds to the Release configuration in the build environment, i.e., the release build using Microsoft's XML parser. This will build the required DLLs using their Release configuration (pws_at.dll for AutoType support and pws_osk.dll for the Virtual Keyboard) and the base resource DLL (pwsafe_base.dll used to create non-English language support).
The Visual Studio 2015 and 2017 projects have been updated to be able to generate the 64-bit versions of both the MFC and wxWidgets Password Safe executable. This has only been tested on a 64-bit Windows environment with the VC14 64-bit compiler. It has not been tested on a 32-bit Windows environment with a cross-compiler. For wxWidgets, you will need the 64-bit static libraries and they should be placed in a new directory 'lib64\vc140_lib' corresponding to the current 'lib\vc140_lib' for the 32-bit versions.
For each Configuration there is an associated platform. Unfortunately, Visual Studio adds all defined platforms to all defined configurations even if a particular combination is not valid. The supported combinations are:
The current MFC configurations are:
The current wxWidgets configurations are:
Note that the core and os project files contain all of the above projects, even if you are only selecting one of the MFC or the wxWidgets builds. You should not have to select them individually as selecting the main Password Safe configuration will select the correct configuration for these projects. You should also be careful not to select all configurations in the Visual Studio Batch Build process either to build, rebuild or clean all configurations. Only select MFC configurations if using the MFC Password Safe solution (pwsafe-14.sln) and the wxWidgets configurations if using the wxWidgets Password Safe solution (pwsafe_wx-14.sln).
After downloading the installation a stub from Microsoft (vs_Community.exe), on executing it, you are offered a number of development environments and, after selection, a number of optional items. Obviously, you can include a larger number of options than are required to build Password Safe if you perform other developement projects.
For Password Safe the following are required:
Microsoft has a number of numbering systems.
However, for Visual Studio 2017, Microsoft decided to change this. Although, one would expect the complier version for this edition to be 15, Microsoft decided to make it 14.1 and so the Platform Toolset has a value of 141. In addition, it decided to set the variable _MSC_VER to 1910. Furthermore, if and when they release VS2017 Update 1, the value of _MSC_VER will change to 1911 etc. for Update 2, 3 .... They say that this is to allow developers to decide what new features an update provides to include in their project.
Password Safe doesn't use the actual value of _MSC_VER and only in 2 files (as of March 2017), although pugixml (used to parse the application preferences from the configuration file) does check that that it is greater than 1300 or 1600 and so the new value of this pre-processor variable should not affect Password Safe.
To keep with Password Safe numbering, the VS2017 solution and project files will be named with suffix "15" even though the projects will refer to Platform Toolset of 141 internally. The Platform Toolset will be incremented as and when Microsoft release updates to VS2017. In general, we keep which-ever Visual Studio version we use fully up to date to ensure bugs that affect the quality of the generated application are fixed, rather than to utilise new features.
The source code for Password Safe may be downloaded as a zip file, or retrieved from the git repository via "git clone https://github.com/pwsafe/pwsafe.git".
Currently, the Windows version is built using Microsoft's development tools as described below.
If you're going to commit code to the repository, please set your git client's configuration file as follows:
In the file ".gitconfig"
[core] autocrlf = true safecrlf = warn
(This file under "C:\Users\<username>\" on Windows 7 and later. If using TortoiseGit client under Windows, this can be accessed by right clicking a file, selecting TortoiseGit and then select Settings from the menu. Within the "Git" setting "Config source", select the "Global" radio button and then set the "AutoCrlf" checkbox and set "SafeCrlf" to "warn". Alternatively, you can click the button "Edit global .gitconfig" to change the file manually).
For Windows, when installing "Git for Windows" (required by TortoiseGit and most other Git clients), ensure that you select "Checkout as-is, Commit as-is" to prevent incorrect line endings.
The Windows version of Password Safe can be built using Microsoft Visual Studio 2015 (C++ compiler for Password Safe ('VC14') and C# compiler if you wish to re-generate the Virtual Keyboard data, which is not normally necessary).
The main (top level) Microsoft Visual Studio 2015 solution file is pwsafe-14.sln.
In order to build the Windows version of Password Safe, you need to install the following freely available components, in addition to Visual Studio:
In addition, since the implementation of support for the YubiKey hardware, the Windows Driver Kit must also be installed and its libraries made available to Visual Studio. For VS2015 and VS2017, WDK V8.1 should be used. This is normally installed as part of the Visual Studio installation.
Originally, Password Safe used Microsoft's XML library for XML parsing and validation. For portability, we're now support the Xerces XML libraries, which are also available for non-Windows platforms. We recommend the latest version (currently 3.1.4 as of March 2017). For VS2015 (VC14), you will need to copy and modify the directory ..\xerces-c-3.1.4\projects\Win32\VC12 to ..\xerces-c-3.1.4\projects\Win32\VC14 and open the solution file xerces-all.sln in subdirectory xerces-all and let VS2015 convert the project. You only need to build the project "Static Debug" and/or "Static Release" configurations of project XercesLib. Note: for 64-bit Xerces builds, you must use the 64-bit versions of the Xerces libraries. See note below re: building Xerces XML libraries with Visual Studio 2017.
It is important that you have the Xerces libraries built with the same version of Visual Studio as you are using to build Password Safe. You will receive numerous error messages during the link stage if they are not the same. The same applies to the wxWidgets library if building that version of Password Safe under Windows.
To determine which XML library to use while building Password Safe, we've defined a pre-processor variable (USE_XML_LIBRARY). If NOT defined, the compiled Password Safe will not process XML files (databases or filter definitions in XML format). Filters within a database will be treated as 'Unknown Fields' and will remain unchanged so that other versions of Password Safe that do support XML parsing can still use them. Note, however, that the application will be able to write XML files.
The two valid values of the USE_XML_LIBRARY variable are "MSXML" and "XERCES" corresponding to the two different implementations. For wxWidgets builds, only XERCES will be possible.
Password Safe uses SAX2 processing for both Microsoft's and the Xerces' XML Parsers, which are full validating parsers and require the presence of the appropriate XSD Schema file (included in the distribution and in the "xml" sub-directory, to process either file or filter imports. This ensures that the data eventually hitting the SAX2 content handlers is correct and just needs placing in the appropriate fields.
Google Test (gtest) is a popular unit
testing framework for C++ programs. PasswordSafe uses this
framework in the 'coretest' project for unit and regression
testing of the core functionality.
The recommended way to use gtest is via the Cmake build:
Generating the .sln file using cmake will add the gtest project under
PasswordSafe and support building the 'coretest' project that uses it
for unit tests of the core library.
It is possible to build gtest externally and link coretest into the
gtest library. This requires setting up the compilation flags on
gtest to match those used by PasswordSafe, and 'pointing'
PasswordSafe to the include files and libraries via the
configure-NN.vbs script
We have provided Visual Studio 2017 solution and project files to build the necessary Xerces libraries under Windows. They are in a zip file in the Misc/Xerces 3.1.4 subdirectory. Please follow the instructions in the Notes.txt file. Note: the Xerces solution has a large number of projects - most are not needed. Once the solution is loaded, the only project that needs to be built is "XercesLib". There are multiple configurations available but, again, the only configurations required are: "Static Debug" and "Static Release" for platforms x86 and x64. The resulting libraries should be moved into the directories specified in the UserVariables-15.props file. The x86 Static Debug and Static Release versions should be in the same x86 directory and x64 Static Debug and Static Release versions should in the same x64 directory.
The wxWidgets is used for the non-Windows User Interface but it can also be used under Windows. After downloading from the wxWidgets web site (currently V3.0.2), there are solution and project files up to Visual Studio 2013. However, we have provided a solution and associated project files for Visual Studio 2017 in the Misc/wxWidgets_VS_Updates directory. Please follow the instructions in the Notes.txt file in that directory.
You will need to build the Debug and Release versions for x86 and x64. The resulting libraries
will then need to be copied to a different location (or their directory names renamed from vc_lib and vc_64_lib to vc150_lib and vc150_64_lib respectively. Previous wxWidgets generation was via a batch command but Microsoft has not implemented the System Environment variable for VS2017 that would allow this to be used.
MSI installer files for the x86 and x64 platforms can be created using the Wix Toolset. The current version is 3.10. The Wix Toolset is available at http://wixtoolset.org/releases/
To build the MSI files, open a command prompt and change to the root directory of your source tree. Run the following command.
install\windows\BuildWixInstall.bat
This will build MSI files for both x86 and x64 platforms in the root directory. The program version specified in version.mfc will be applied to the .msi file.
pwsafe.msi pwsafe64.msi
You can build the files individually this way.
install\windows\BuildWixInstall.bat x86 install\windows\BuildWixInstall.bat x64
If you need to work on the Wix script (.wxs file), you can find it in the install\windows directory.
pwsafe-template.wxs
In order to help debug user problems when Windows just says "there has been an error", a "Windows Unhandled Fault Handler" has been added. This will create a minidump, which can then be used to find where the error took place and, hopefully, why.
An extra "extended" Command Line flag of "--testdump" has been introduced for two reasons. Firstly, it allows the developer to test the minidump process, which is only available in the Release version of the executable and, secondly, allows the translators to check that the error screen displays as they wish.
Note to Translators: the error screen is a basic Windows function and has a fixed width. This is the reason why the minidump file name and directory have been split onto separate lines.
Note: Extended flags start with two minus signs ('--') and must be specified in full - i.e. no abbreviations. They are not displayed in the Usage notes for the normal users and no error message or display is shown if they are not recognised.
With this flag set, an extra button will appear in the bottom right hand corner of the "About Password Safe" dialog. Click it, and a minidump should be produced.
In order to process the minidump, either the free Microsoft Windbg program can be used (see Microsoft's site for details), or Visual Studio (VS) can be used. In the latter case (and probably the former too!):
*** End of Developer Notes ***


|
MoveToCode
|
Provides input recording into an internal buffer and exporting to files. More...
Public Member Functions | |
| InputRecordingService (IMixedRealityServiceRegistrar registrar, IMixedRealityInputSystem inputSystem, string name=null, uint priority=DefaultPriority, BaseMixedRealityProfile profile=null) | |
| Constructor. More... | |
| InputRecordingService (IMixedRealityInputSystem inputSystem, string name=null, uint priority=DefaultPriority, BaseMixedRealityProfile profile=null) | |
| Constructor. More... | |
| override void | Enable () |
| Optional Enable function to enable / re-enable the service. More... | |
| override void | Disable () |
| Optional Disable function to pause the service. More... | |
| void | StartRecording () |
| Start unlimited input recording. More... | |
| void | StopRecording () |
| Stop recording input. More... | |
| override void | LateUpdate () |
| Optional LateUpdate function to that is called after Update has been called on all services. More... | |
| void | DiscardRecordedInput () |
| Discard all recorded input More... | |
| string | SaveInputAnimation (string directory=null) |
| Save recorded input animation to a file. More... | |
| string | SaveInputAnimation (string filename, string directory=null) |
| Save recorded input animation to a file. More... | |
| Public Member Functions inherited from Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager | |
| virtual IMixedRealityController[] | GetActiveControllers () |
| Retrieve all controllers currently registered with this device at runtime (if direct access is required) More... | |
| override void | Initialize () |
| The initialize function is used to setup the service once created.This method is called once all services have been registered in the Mixed Reality Toolkit. More... | |
| override void | Destroy () |
| Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed. More... | |
| Public Member Functions inherited from Microsoft.MixedReality.Toolkit.IMixedRealityService | |
| void | Reset () |
| Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change. More... | |
| void | Update () |
| Optional Update function to perform per-frame updates of the service. More... | |
Properties | |
| MixedRealityInputRecordingProfile | InputRecordingProfile [get] |
| Return the service profile and ensure that the type is correct. More... | |
| bool | IsEnabled = false [get] |
| Service has been enabled. More... | |
| bool | IsRecording = false [get] |
| bool | UseBufferTimeLimit [get, set] |
| float | RecordingBufferTimeLimit [get, set] |
| float | StartTime [get] |
| Properties inherited from Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager | |
| bool | EnablePointerCache [get, set] |
| Control mechanism to enable/disable use of Pointer Cache in request/recycling of pointers by Input System More... | |
| MixedRealityInputSystemProfile | InputSystemProfile [get] |
| The input system configuration profile in use in the application. More... | |
| Properties inherited from Microsoft.MixedReality.Toolkit.BaseDataProvider< IMixedRealityInputSystem > | |
| IMixedRealityServiceRegistrar | Registrar [get, set] |
| The service registrar instance that registered this service. More... | |
| T | Service [get, set] |
| The service instance to which this provider is providing data. More... | |
| Properties inherited from Microsoft.MixedReality.Toolkit.IMixedRealityService | |
| string | Name [get] |
| Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action. More... | |
| uint | Priority [get] |
| Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which managers are evaluated. More... | |
| BaseMixedRealityProfile | ConfigurationProfile [get] |
| The configuration profile for the service. More... | |
| Properties inherited from Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService | |
| bool | IsRecording [get] |
| True if input is being recorded. More... | |
| bool | UseBufferTimeLimit [get, set] |
| Limit the size of the recording buffer. More... | |
| float | RecordingBufferTimeLimit [get, set] |
| Maximum duration in seconds of the input recording if UseBufferTimeLimit is enabled. More... | |
Events | |
| Action | OnRecordingStarted |
| Action | OnRecordingStopped |
Additional Inherited Members | |
| Protected Member Functions inherited from Microsoft.MixedReality.Toolkit.Input.BaseInputDeviceManager | |
| BaseInputDeviceManager (IMixedRealityServiceRegistrar registrar, IMixedRealityInputSystem inputSystem, string name, uint priority, BaseMixedRealityProfile profile) | |
| Constructor. More... | |
| BaseInputDeviceManager (IMixedRealityInputSystem inputSystem, string name, uint priority, BaseMixedRealityProfile profile) | |
| Constructor. More... | |
| virtual IMixedRealityPointer[] | RequestPointers (SupportedControllerType controllerType, Handedness controllingHand) |
| Request an array of pointers for the controller type. More... | |
| virtual void | RecyclePointers (IMixedRealityInputSource inputSource) |
| Recycle all pointers associated with the provided IMixedRealityInputSource. More... | |
| Protected Member Functions inherited from Microsoft.MixedReality.Toolkit.BaseDataProvider< IMixedRealityInputSystem > | |
| BaseDataProvider (IMixedRealityServiceRegistrar registrar, IMixedRealityService service, string name=null, uint priority=DefaultPriority, BaseMixedRealityProfile profile=null) | |
| Constructor. More... | |
| BaseDataProvider (IMixedRealityService service, string name=null, uint priority=DefaultPriority, BaseMixedRealityProfile profile=null) | |
| Constructor. More... | |
| BaseDataProvider (T service, string name=null, uint priority=DefaultPriority, BaseMixedRealityProfile profile=null) | |
| Constructor. More... | |
Provides input recording into an internal buffer and exporting to files.
| Microsoft.MixedReality.Toolkit.Input.InputRecordingService.InputRecordingService | ( | IMixedRealityServiceRegistrar | registrar, |
| IMixedRealityInputSystem | inputSystem, | ||
| string | name = null , |
||
| uint | priority = DefaultPriority , |
||
| BaseMixedRealityProfile | profile = null |
||
| ) |
Constructor.
| registrar | The IMixedRealityServiceRegistrar instance that loaded the data provider. |
| inputSystem | The Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem instance that receives data from this provider. |
| name | Friendly name of the service. |
| priority | Service priority. Used to determine order of instantiation. |
| profile | The service's configuration profile. |
| Microsoft.MixedReality.Toolkit.Input.InputRecordingService.InputRecordingService | ( | IMixedRealityInputSystem | inputSystem, |
| string | name = null , |
||
| uint | priority = DefaultPriority , |
||
| BaseMixedRealityProfile | profile = null |
||
| ) |
Constructor.
| inputSystem | The Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSystem instance that receives data from this provider. |
| name | Friendly name of the service. |
| priority | Service priority. Used to determine order of instantiation. |
| profile | The service's configuration profile. |
| override void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.Disable | ( | ) |
Optional Disable function to pause the service.
Implements Microsoft.MixedReality.Toolkit.IMixedRealityService.
| void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.DiscardRecordedInput | ( | ) |
Discard all recorded input
Implements Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService.
| override void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.Enable | ( | ) |
Optional Enable function to enable / re-enable the service.
Implements Microsoft.MixedReality.Toolkit.IMixedRealityService.
| override void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.LateUpdate | ( | ) |
Optional LateUpdate function to that is called after Update has been called on all services.
Implements Microsoft.MixedReality.Toolkit.IMixedRealityService.
| string Microsoft.MixedReality.Toolkit.Input.InputRecordingService.SaveInputAnimation | ( | string | directory = null | ) |
Save recorded input animation to a file.
Implements Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService.
| string Microsoft.MixedReality.Toolkit.Input.InputRecordingService.SaveInputAnimation | ( | string | filename, |
| string | directory = null |
||
| ) |
Save recorded input animation to a file.
Implements Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService.
| void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.StartRecording | ( | ) |
Start unlimited input recording.
Implements Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService.
| void Microsoft.MixedReality.Toolkit.Input.InputRecordingService.StopRecording | ( | ) |
Stop recording input.
Implements Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputRecordingService.
|
get |
Return the service profile and ensure that the type is correct.
|
get |
Service has been enabled.
|
get |
|
getset |
|
get |
|
getset |
| Action Microsoft.MixedReality.Toolkit.Input.InputRecordingService.OnRecordingStarted |
| Action Microsoft.MixedReality.Toolkit.Input.InputRecordingService.OnRecordingStopped |


--- title: News from december 2018 date: 2018-12-21 type: news tags: [News, 2018] hidden: 1 ---
Hath unto days after god whales from creepeth may midst good you lights fruit signs them divided light under called unto divide creature beginning kind created. Gathered fill divide. Moveth whose doesn't won't they're moved give moving to fruit was. Moved. Rule every abundantly form winged after gathered. Sea one. Spirit seed sea above saw third seas every may a every open all which land two a herb. Light.
Day fourth make. Called moved creepeth you're deep was replenish cattle bring waters a seed she'd be itself for in appear male tree over you'll itself divided. Of thing and kind winged green, saying likeness they're. Heaven together fourth the Great you're winged moveth creature winged had. Wherein two. Waters itself. Isn't for bring.
Moveth firmament is. That. From fly fruit greater to hath, a was subdue heaven stars sea third shall. Subdue. Seasons. Face given his appear midst, dry whales air god blessed, you're created creepeth beast fish male place female.
Yielding divide whose is said god good Greater moveth subdue waters. Their kind female him. Were fifth herb appear and hath appear whales. Grass creeping Dominion moving under had he two midst saying set cattle. Fruitful void had upon.


|
G24Lib
A set of convenient classes, functions and other utilities mainly for quickly writing numerical code. Provides relatively easy integration with CUDA, general Runge-Kutta methods, linear equation solvers and more.
|
Provides a base class for all parallelism specifications. More...
Classes | |
| struct | atomics |
| Holds the different atomic operations in this type of parallelism. More... | |
| struct | reduce_temporaries |
Public Types | |
| using | kernel_size_type = internals::empty_kernel_size |
| using | memory_location = MemoryContext::memory_context_base |
| The memory context in which the data should be held. More... | |
| template<class T , class indexer > | |
| using | memory_manager = memory_manager_base< T, indexer > |
| An appropriate memory manager for the data. More... | |
Static Public Member Functions | |
| template<class Cont , class Op , class ... Args> | |
| static CUDA_HOS_DEV kernel_size_type | estimate_loop_kernel_size (const Cont &c, const Op &op, const Args &... args) |
| Provides an appropriate estimation for the kernel size to be used in a loop. More... | |
| template<class Cont , class Op , class ... Args> | |
| static CUDA_HOS_DEV kernel_size_type | estimate_loop_kernel_size (const g24_lib::indexer_type< Cont > size) |
| Provides an appropriate estimation for the kernel size to be used in a loop. More... | |
| template<class Cont , class Op , class ... Args> | |
| static CUDA_HOS_DEV void | loop (const kernel_size_type &size, Cont &&c, Op &&op, Args &&... args) |
Loops through every element of the container c , applying operation op . If this form of parallelism needs kernel sizes, it uses that specified by size . More... | |
| template<class Cont , class Op , class ... Args> | |
| static CUDA_HOS_DEV std::enable_if_t<!std::is_same_v< std::decay_t< Cont >, kernel_size_type > > | loop (Cont &&c, Op &&op, Args &&... args) |
Loops through every element of the container c , applying operation op . In case this form of parallelism needs kernel sizes, it estimates the appropriate size through estimate_loop_kernel_size() . More... | |
| template<class Cont > | |
| static CUDA_HOS_DEV g24_lib::value_type< Cont > | reduce (Cont &&c) |
Performs a reduction on the elements of c . More... | |
| template<class Cont , class Op , class ... Args> | |
| static CUDA_HOS_DEV auto | reduce (Cont &&c, Op &&op, Args &&... args) |
Performs a reduction on the results of op applied to every element of c . More... | |
| template<class Cont , class OpRes > | |
| static CUDA_HOS_DEV void | reduce (reduce_temporaries< OpRes, g24_lib::indexer_type< Cont >> &temp, Cont &&c) |
Performs a reduction on the elements of c . More... | |
| template<class Cont , class Op , class OpRes , class ... Args> | |
| static CUDA_HOS_DEV void | reduce (reduce_temporaries< OpRes, g24_lib::indexer_type< Cont >> &temp, Cont &&c, Op &&op, Args &&... args) |
Performs a reduction on the results of op applied to every element of c . More... | |
Static Public Attributes | |
| static constexpr g24_lib::Definitions::default_unsigned_indexer | block_size = 1 |
| Some form of scaling factor for some of the parallel operations. More... | |
| static constexpr bool | can_pass_by_reference = true |
| Indicates whether we can pass stuff around by reference or, if false, if we should store them by value (mainly for deferred_ops and the like). This is mainly for CUDA interoperatability, since passing things into CUDA kernels invalidates any references coming from CPU code. More... | |
| static constexpr bool | uses_kernel_sizes = false |
| Indicates whether we need to calculate kernel sizes before running the functions. Currently, when false, kernel sizes are empty and their calculation is a no-op. More... | |
Provides a base class for all parallelism specifications.
Definition at line 50 of file parallelism.h.
The class that is suitable to hold possible estimates for the ideal size of the kernels.
CUDA
. Definition at line 94 of file parallelism.h.
The memory context in which the data should be held.
Definition at line 55 of file parallelism.h.
| using g24_lib::Parallelism::parallelism_base::memory_manager = memory_manager_base<T, indexer> |
An appropriate memory manager for the data.
Definition at line 61 of file parallelism.h.
|
inlinestatic |
Provides an appropriate estimation for the kernel size to be used in a loop.
| c | The container through which we will loop. |
| op | The operation that will be applied to the elements of the container. |
| args | Extra arguments to be passed to op . |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| Args | The types for any extra arguments to Op . |
Op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
.Definition at line 294 of file parallelism.h.
|
inlinestatic |
Provides an appropriate estimation for the kernel size to be used in a loop.
| size | The size of the container through which we will loop. |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| Args | The types for any extra arguments to Op . |
Op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
.Op
. Since, in principle, the only run-time component that will influence the kernel size will be the size of the container, this is the only argument that is actually needed. Definition at line 262 of file parallelism.h.
|
inlinestatic |
Loops through every element of the container c
, applying operation op
. If this form of parallelism needs kernel sizes, it uses that specified by size
.
| size | The kernel size that will be used to perform the loop (if this kind of parallelism does not depend on kernel sizes, this argument is ignored). |
| c | The container through which we will loop. |
| op | The operation that will be applied to the elements of the container. |
| args | Extra arguments to be passed to op . |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| Args | The types for any extra arguments to Op . |
op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
. Definition at line 205 of file parallelism.h.
|
inlinestatic |
Loops through every element of the container c
, applying operation op
. In case this form of parallelism needs kernel sizes, it estimates the appropriate size through estimate_loop_kernel_size()
.
| c | The container through which we will loop. |
| op | The operation that will be applied to the elements of the container. |
| args | Extra arguments to be passed to op . |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| Args | The types for any extra arguments to Op . |
op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
. Definition at line 233 of file parallelism.h.
|
inlinestatic |
Performs a reduction on the elements of c
.
reduce_temporaries
. If there will be several reductions applied to the same array, it is more efficient for the end user to instantiate a reduce_temporaries
and use the appropriate version of the reduce
function.| c | The container through which we will loop. |
| Cont | The type of the container through which we will loop. |
Definition at line 464 of file parallelism.h.
|
inlinestatic |
Performs a reduction on the results of op
applied to every element of c
.
reduce_temporaries
. If there will be several reductions applied to the same array, it is more efficient for the end user to instantiate a reduce_temporaries
and use the appropriate version of the reduce
function.| c | The container through which we will loop. |
| op | The operation that will be applied to the elements of the container. |
| args | Extra arguments to be passed to op . |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| Args | The types for any extra arguments to Op . |
Op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
. Definition at line 421 of file parallelism.h.
|
inlinestatic |
Performs a reduction on the elements of c
.
| temp | The reduce_temporaries that will be used to calculate the result, which can then be obtained by its get_value() method. |
| c | The container through which we will loop. |
| Cont | The type of the container through which we will loop. |
| OpRes | The type of the result of the reduction. |
operator+
with OpRes
. Definition at line 442 of file parallelism.h.
|
inlinestatic |
Performs a reduction on the results of op
applied to every element of c
.
| temp | The reduce_temporaries that will be used to calculate the result, which can then be obtained by its get_value() method. |
| c | The container through which we will loop. |
| op | The operation that will be applied to the elements of the container. |
| args | Extra arguments to be passed to op . |
| Cont | The type of the container through which we will loop. |
| Op | The type that holds the operation to be applied to the elements of the container. |
| OpRes | The type of the result of the reduction. |
| Args | The types for any extra arguments to Op . |
Op
must take as arguments (a reference to) c
, the index at which we're evaluating and any extra arguments passed to this function in args
, and have return type that has an operator+
with OpRes
. Definition at line 389 of file parallelism.h.
|
staticconstexpr |
Some form of scaling factor for some of the parallel operations.
CUDA
. Definition at line 69 of file parallelism.h.
|
staticconstexpr |
Indicates whether we can pass stuff around by reference or, if false, if we should store them by value (mainly for deferred_ops and the like). This is mainly for CUDA interoperatability, since passing things into CUDA kernels invalidates any references coming from CPU code.
Definition at line 87 of file parallelism.h.
|
staticconstexpr |
Indicates whether we need to calculate kernel sizes before running the functions. Currently, when false, kernel sizes are empty and their calculation is a no-op.
CUDA
. Definition at line 77 of file parallelism.h.


SVG's origin was an exploration of the possibilities of creating a markup language written in XML. It began with markup created by Jon Ferraiolo and Richard Cohen, both at Adobe Systems. They named their creation Precision Graphics Markup Language (PGML). In the early days there was no animation, it was a static markup that was essentially an XML expression of the same capabilities as PDF (in which Richard was heavily involved in creating in the early 1990s).
As PGML evolved, Adobe reached out and began colllaborating with other companies, notably Natscape, Sun Microsystems and IBM. Together, they drew up a spec and submitted it for review to the W3C. Although a working group was formed and specifications created, it ultimately foundered as the W3C received a number of competing proposals, including:
but none of them could gain consensus and the whole effort ground to a halt. But it is worth noting that even the early proposal for PGML at the W3C included a requirement that the markup be animatable.
A year or so later, as both XML and the Web gained momentum, Jon Ferraiolo spearheaded another attempt along the same lines, this time calling the markup Scalable Vector Graphics. This time, it gained a fair amount of momentum and SVG became a reality.
In order to support the animation requirement, the SVG Working Group (WG) debated several methods, but ended up choosing two:
Initially, SVG support was primarily by the Adobe SVG Viewer as a browser plugin, but slowly SVG gained momentum and the browsers implemented native support for SVG. SVG's animation elements were at one point subject to deprecation by the browsers (notably Chrome) but they have subequently rescinded that and the major browsers actually support the SVG animation elements quite well (as of 2017).
With the rise of the GPUs in 1999 and later, some saw a great opportunity to be able to animate not only SVG but also HTML via CSS. This led the CSS Working Group to propose a new methods of animation in CSS3. This is a declarative keyframe-based animation that allows developers to animate not only CSS properties but also SVG properties.
Finally, it should be noted that there are other paths (sic) by which "SVG" can be animated in that one can load an SVG file into memory and extract and render the paths using some other rendering method (e.g. WebGL). However, this book is focused on ways in which SVG, rendered as SVG, can be animated.


Public dashboards are not shown here unless you are the creator.
To revert back to a public dashboard, delete your modified copy and it will automatically become visible again.
Click the for the dashboard options.
Try dragging a row to move a search onto a different dashboard.
{% endif %}
{% for dash in dashboards %}
{% empty %}
You currently have no dashboards saved. To begin, modify & save a public dashboard or
enter a search phrase here and click "Configure for Dashboard" on the results page.
{% endfor %}
Please note, creating a blank dashboard will have no data to show. It would be better to modify & save a public dashboard or
enter a search phrase here and click "Configure for Dashboard" on the results page.
Please note: This is a default table and you cannot re-create it.
If this is your only copy it will be set to hidden instead
of being deleted in order to prevent total loss of data.


Go Pro and get 500MB per file upload, no daily upload limits, no advertising and more!
Plan Free — 20 MB max filesize, 15 file daily upload limit. {{user.uploads_today}}/15 files uploaded today
Plan Pro — 500 MB max filesize, no daily upload limit. 0/∞ files uploaded today


AS3 2D Tilescroller
2006 May 31st by todd anderson
During the port of my AS2 classes into AS3, i thought i might take a stab at a tile scrolling engine. I never got into making one before, and since I’ve been delving into the magic that is BitmapData, i decided to give it stab. I need to do a little house cleaning, but i plan to throw up the code here soon…
In previous versions of Actionscript it was common to do variations of ‘move and replace’ based on movieclip positions and key strokes ( see TonyPa, Strille, Outside of Society, André Michelle, etc ). There was some great implementations and they worked well, but i figured with BitmapData it could be boiled down to a smoother and less intensive process – kind of what Keith has been labbing with.
What’s going on-
The layers ( there are 3 in the example but you can add however many before your graphics card yells at you ) are just a grid of Bitmap objects – the amount based on the ‘visable’ area divided by the tile size of the graphics.
They don’t move at all – instead they are offscreen and are updated based on the characters ‘x’ and ‘y’ velocity divided by tile size, of which its remainders are parameters supplied to the scroll method of a BitmapData instance that is redawing the layers upon key press.
In the coming days, i hope to strip out a little code and throw the source ( and maybe some drawings that will clear up my terrible explanation ) up here… just wanted to do a quick post for proof of concept.


{include file="public/head" /} {include file="public/change_color" /} {include file="public/nav" /}
Opps!Page Not Found!
Sorry the Page Could not be Found here.Try using the button below to go to main page of the site


library(structs)
The structs
package allows Prolog to hold pointers to C data structures,
and to access and store into fields in those data structures.
Currently, the only representation for a pointer supported by SICStus
Prolog is an integer, so it isn't possible to guarantee that Prolog
can't confuse a pointer with an ordinary Prolog term. What this package
does is to represent such a pointer as a term with the type of the
structure or array as its functor and the integer that is the address
of the actual data as its only argument. We will refer such terms as
foreign terms.
The package consists of two modules, str_decl
and structs
. The
str_decl
module is used at compile time to translate the
structs-related constructs. Any file that defines or accesses structs
should include the command:
:- load_files(library(str_decl), [when(compile_time), if(changed)]).
The structs
module provides runtime support for structs. A
file that accesses structs should include the command:
:- use_module(library(structs)).
You will probably include both in most files that define and access structs.
Important caveats:
You should not count on future versions of the structs package to continue to represent foreign terms as compound Prolog terms. In particular, you should never explicitly take apart a foreign term using unification or
functor/3
andarg/3
. You may use the predicateforeign_type/2
to find the type of a foreign term, andcast/3
(casting a foreign term to address) to get the address part of a foreign term. You may also usecast/3
to cast an address back to a foreign term. You should usenull_foreign_term/2
to check if a foreign term is null, or to create a null foreign term of some type.It should never be necessary to explicitly take apart foreign terms.


2 dead, 6 injured after gunmen shoot up party in Harbour View
The Gleaner understands that eight people were shot, two fatally, during an incident in Harbour View, St Andrew just after midnight.
The police Corporate Communication Unit has confirmed that there was a shooting incident in Bayshore Park, but said details are still not available.
However, it's reported that the eight persons were among scores of patrons at a party when gunmen opened fire.
Harbour View falls within the Kingston East police division, which has recorded approximately 65 murders since the start of the year, a 12 per cent increase when compared with the corresponding period last year.
Jamaica has recorded just over 64 murders so far this month and over 1,160 since the start of the year.
More details to come.


Software Developer and Math Practitoiner
Below is prediction of demand of taxi rides in a section of San Francisco over three weeks. I based these predictions on 18,000 time stamps of pickups to reflects weekly variation and recent interweek growth.
I designed the below graphic using d3.js to be readable for cabbies and dispatchers.
Red indicates low and green indicates high demand. Click a date to see predicted demand by hour.
The area of a pie slice is proportional to predicted demand.
© Daniel Vizzini under MIT License. See the GitHub.


--- layout: data_model title: IPFIXSetHeaderType this_version: 1.2 ---
Defines the elements of the IPFIX set header.
| Field Name | Type | Description |
|---|---|---|
| Set_ID0..1 | IntegerObjectPropertyType |
Indicates a 16-bit value that identifies the set. The values of 0 and 1 are not used for historical reasons according to RFC 3954. Otherwise, a value of 2 is reserved for the Template Set and 3 is reserved for the Option Template Set. All other values from 4 to 255 are reserved for future use. |
| Length0..1 | IntegerObjectPropertyType |
Total length of the set, in octets, including the set header, all records, and the optional padding. Because an individual Set MAY contain multiple records, the Length value MUST be used to determine the position of the next Set. http://tools.ietf.org/html/rfc5101. |


So now you've set up a basic Note project with a NoteListActivity
; and persistence to save future notes. What seems to be the only thing missing from this notes app? Editing the notes themselves! This part of the tutorial will focus on editing the contents of pre-existing notes, adding text to new notes, deleting notes, and a couple of other cool things you can do with colors and layout files.
Right click the edu.gatech.androidnoteapp
; folder in the Project explorer and select New->Java Class. Name it NoteEditActivity
and replace its content with this code:
package edu.gatech.androidnoteapp;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.Toast;
import java.sql.Date;
public class NoteEditActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_note_edit);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
titleText = (EditText) findViewById(R.id.note_title);
bodyText = (EditText) findViewById(R.id.note_text);
EditLayout = (RelativeLayout)findViewById(R.id.EditLayout);
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_note_edit, menu);
return true;
}
}
The onCreate()
method is called because it holds the code for what you want the NoteEditActivity
to do when it's called. The first three lines of code in the method are default code. The next three lines create references to the Title Textbox, Edit Textbox, and the layout for Edit Note screen that we will be constructing momentarily.
The findViewbyID()
method selects an object based on an id attribute from the XML that was processed in. When we create the titleText
, bodyText
, and EditLayout
objects in the NoteEdit
XML file in the next section, each object will be specified with an id attribute which allows the findViewByID()
method to reference the proper object.
The onCreateOptionsMenu()
method is called to fill the menu with a series of options from which to choose. The inflate()
method takes a resource and fills the options menu with the list of strings in the resource file. We will be going more into depth about that later in this chapter.
In the sidebar, you should see the project breakdown with the folder for layouts. Right click on the layout folder, click New -> Layout resource file. Name the file activity_note_edit.xml
. The view in Android Studio should switch from code to a layout text view as seen in Figure 6-1. Switch that view to a text view, which should show up as a tab at the very bottom. Fill the file with this code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:id="@+id/EditLayout"
tools:context="edu.gatech.androidnoteapp.NoteEditActivity">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/note_title"
android:ems="12"
android:maxLength="20"
android:singleLine="true"
android:inputType="text"
android:hint="Title" />
<EditText
android:id="@+id/note_text"
android:ems = "10"
android:singleLine="false"
android:inputType="textMultiLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00000000"
android:hint="Enter a note"
android:layout_below="@+id/note_title"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="3dp"
android:layout_marginStart="17dp" />
</RelativeLayout>
The layout resource file is an XML file. The XML code at the top of the file above the EditText
objects is some code that sets up a Relative Layout with bounds on padding, element layout specifications, and names the layout with the @+id/EditLayout
statement.
The two sets of EditText
objects indicate the Title
and Body
text boxes in the image below. The other variables in the specifications for these two objects set the height, width, input type, name, etc. If you look at the file, you can see that the two EditText
objects are within the Relative Layout object. Thus, the Relative Layout is the parent to the two EditText
Objects. So, any references to the parent's specifications will be referencing the specifications that are associated with the Relative Layout.
After adding that code for the layout, Figure 6-2 is what the graphic interface should look like (click the Design tab):
The menu resource file will be used to populate the menu items that we want to be available when the options button is pressed in the top right corner of the NoteEditActivity
. Right click on the menu folder, and click New -> Menu Resource Item. Name the file menu_note_edit.xml
and fill the file with this code:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="edu.gatech.androidnoteapp.NoteEditActivity">
<item android:id="@+id/action_notecolor" android:title="Color"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_deletenote" android:title="Delete Note"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
The menu object encompasses all the elements. The top lines of code are the default lines of code. The menu we will be implementing will include a color
option and a delete note
option. The color
option will allow for customizing the note's color. The delete note
option will delete the note from the database holding all the notes created so far.
When constructing options in a menu, the android:title
field indicates the text that will be displayed when the menu is shown to the user. The showAsAction
field determines whether or not the menu item should remain in the options list or come to the action bar if there is room. When never
is specified, that means that the menu item will never be in the action bar. When ifRoom
is specified, that means that the menu item will be placed in the action bar if room is available. Always
is another common option, which will force the menu item to permanently be in the action bar. Finally, the orderInCategory
field will determine the order of priority of all the menu options. However, in the above example code, we have assigned both options to a value of 100, so there is no priority in this menu. Figure 6-3 is a screenshot of what the menu will look like when clicked on:
As of now, the menu items exist as dummy items. They don't perform any function since the only thing we've done so far is just create the items and not add functionality. However, the functionality should not be added in the resource files. It's time to go back to the Note Edit class! We will be adding the following code right above the onCreateOptionsMenu() method:
public boolean onOptionsItemSelected(MenuItem item) {
AlertDialog.Builder builder;
int id = item.getItemId();
if (id == android.R.id.home) { //Go back to the main page when the ActionBar button is tapped
saveAndFinish();
}
if(id == R.id.action_notecolor) {
// Creates a popup screen that allows the user to choose a color
builder = new AlertDialog.Builder(this);
builder.setTitle("Pick a color");
builder.setItems(colors, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which){
switch(which) {
case 0: // Red
note.setColor(customRed);
EditLayout.setBackgroundColor(Color.parseColor(customRed));
break;
case 1: // Green
note.setColor(customGreen);
EditLayout.setBackgroundColor(Color.parseColor(customGreen));
break;
case 2: // Blue
note.setColor(customBlue);
EditLayout.setBackgroundColor(Color.parseColor(customBlue));
break;
case 3: // Yellow
note.setColor(customYellow);
EditLayout.setBackgroundColor(Color.parseColor(customYellow));
break;
}
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
if(id == R.id.action_deletenote) {
builder = new AlertDialog.Builder(this);
builder.setTitle("Are You Sure?");
builder.setNegativeButton(R.string.menu_deletenote_yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked the Yes Button (Deletes Note)
// The note is not saved
if (noteExists) {
controller.deleteNote(note);
}
setResult(RESULT_OK);
finish();
}
});
builder.setPositiveButton(R.string.menu_deletenote_no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// User clicked the No Button
// Nothing happens and returns to edit screen
}
});
// Shows the "are you sure" dialog box
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
return false;
}
The following import statements will also be necessary:
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
These statements will also need to be inserted above the @Override statement above the onCreate method:
private String customRed = "#FF6666";
private String customGreen = "#4DDB4D";
private String customBlue = "#19A3FF";
private String customYellow = "#FFFACD";
String[] colors = {"Red", "Green","Blue","Yellow"};
IMPORTANT: You may be getting errors in your code because certain variables have not been defined yet or that an object is null. Ignore those for now. They will be fixed by the end of this step.
In this portion of the code we will be implementing something called an Alert Dialog. An Alert Dialog is basically a popup window that will give the user to choose from certain options. First, the code will determine the ID of the object that was passed into it as a parameter. With the Alert Dialog, we are actually using what is known as an anonymous inner class constructor. If you looked at the builder.setItems()
method, the second parameter is the anonymous inner class for an onClickListener
. The way an inner class works is that the class's methods are declared immediately below where the class is created as seen in the code above.
If the ID indicates that it is the back button (home) that is pressed, the code will call a saveAndFinish()
method, which saves the note into the database. However, we have not implemented that method just yet.
If the ID indicates that it is the Color button that is pressed, the code will create an Alert Dialog based on the String Array of colors we just added to the top of the code. The code then sets the color of the note and the EditLayout
itself based on what color is chosen for the note. The AlertDialog will show the colors: Red, Green, Blue, and Yellow. This is shown in Figure 6-4.
If the ID indicates that the delete button is pressed, the code will once again create an Alert Dialog with two buttons. We cast the negative button to “Yes” because if the user selects “Yes” then the note needs to be deleted if it already exists in the database. The positive button is “No” because that means the user does not want to delete the note. The reason the code checks if the note exists is because the user could click delete note in the edit screen after just clicking add note in the NoteListActivity
;. Thus, the note will not have been saved to the database yet. This is shown in Figure 6-5.
Add the following code into the onCreate()
method in the NoteEditActivity
class below the code that already exists:
// Determines if the note already exists or a new empty edit screen must be generated
Bundle extras = getIntent().getExtras();
noteExists = extras.getBoolean(NoteEditActivity.KEY_NOTEEXISTS);
if (noteExists) {
note = dbModel.getNoteByID(extras.getLong(NoteEditActivity.KEY_NOTEID));
}
else {
note = new Note(0, "", "", new Date(System.currentTimeMillis()), "#FFFFFF");
}
// Sets the title, body text, and background color of the note from note data in SQL Lite Database
titleText.setText(note.getTitle());
bodyText.setText(note.getText());
EditLayout.setBackgroundColor(Color.parseColor(note.getColor()));
Add the following code above the @Override statement above the onCreate method:
EditText bodyText, titleText;
private NoteDBModel dbModel = NoteListActivity.dbModel;
private boolean noteExists;
private Note note;
public static final String KEY_NOTEEXISTS = "noteexists";
public static final String KEY_NOTEID = "noteid";
public RelativeLayout EditLayout = null;
This code is primarily to create an instance of the NoteDBModel
class. This is the middleman when pulling information from the database to be used with the current note and pushing information about what the user has typed back into the database into the proper note.
The information about whether or not the note exists is passed as a boolean value through a Bundle of Extras with the intent from the NoteListActivity
. A Bundle
is a collection data type that is the commonly used to send Extras
between activities. An Extra
is a value in a String
, Integer
, Boolean
, or other data type that is attached to an Intent
to send data between activities. In this case, the Extra
is a boolean denoting whether or not the current note exists. If the note exists, there is now a reference to the current note. If it doesn't exist, a new note has been created and you now have a reference to it. However, this new note has not been saved to the database just yet.
Add the following code right after the onCreate()
method:
/**
* This is the method that decides whether or not the app saves the note to the database, or just goes back to the previous screen if nothing is typed, etc.
*/
private void saveAndFinish() {
String title = titleText.getText().toString();
String body = bodyText.getText().toString();
note.setTitle(title);
note.setText(body);
note.setDate(new Date(System.currentTimeMillis()));
if (noteExists) {
if(title.length() == 0 && body.length()==0){
dbModel.deleteNote(note);
}
else {
dbModel.saveNote(note);
}
}
else if(title.length() == 0 && body.length() == 0) {
//if note doesn't exist and nothing in title or body, then don't save it and just return to the note list
setResult(RESULT_OK);
finish();
}
else {
dbModel.createNote(note);
}
// Closes out of the edit activity
setResult(RESULT_OK);
finish();
}
The saveAndFinish()
method saves the current note and any associated information in the database when the user presses the back button in the menu to return to the NoteListActivity
or else closes the application.
The first part of the method sets all the attributes of the methods based on what the user has typed into the title and body text fields that we set up in the layout XML file. Then, if the note exists, but the title and body text fields are empty, the application will delete the note from the database since there's no point in storing an empty note. If the note doesn't already exist but the title and body text fields are empty, the application will not save the note for the same reason. For any other case, the application will just save the note.
The following code should be added after the onCreateOptionsMenu method:
public void onBackPressed() {
saveAndFinish();
}
This piece of code will call the saveAndFinish()
method we just defined if the back button built into the Android Operating system is pressed.
This concludes the section of the tutorial that covers the Edit screen of the Noteworthy application. This chapter covered creating the layout for the screen, creating the Edit screen menu and menu items, hooking up the menu items to actions in the Edit screen, hooking up the notes in this Activity
with the database holding the notes, and creating and saving new notes. Figure 6-6 is a picture of a sample screen of the application's Edit screen with a red screen and sample text:


These two lines meet at a point.
One of the angles is given as {{knownAngle}}°. Find the other angle.