The convention we choosed is to have .vtl postfixed to the name of template files, after their regular extension. Hence, we have filenames like foo.html.vtl, bar.txt.vtl,...
In incoming HTTP requests, we only expect the regular extension (i.e. the URLs won't contain any .vtl), and forbid direct access to .vtl files. For each of these requests, the engine first checks for the presence of a template file and then for the presence of a regular file.
This naming convention allows us to:
store templates and regular files in the same tree directory, while forbidding direct HTTP access to template source files.
replace “on-the-fly” a regular file with a template file without changing its URL.
To achieve this task, we need several components.
First, a TwoStepResourceLoader that will make a first try while adding .vtl to incoming requests before searching for the exact filename.
TwoStepResourceLoader.java import java.io.InputStream; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.tools.view.servlet.WebappLoader; public class TwoStepResourceLoader extends WebappLoader { public synchronized InputStream getResourceStream( String name ) throws ResourceNotFoundException { // first try with a ".vtl" extension if ( ! name.endsWith(".vtl") ) { try { return super.getResourceStream(name + ".vtl"); } catch (ResourceNotFoundException rnfe) {} } // then wih the original filename return super.getResourceStream(name); } }
We must then declare this resource loader in velocity.properties...
velocity.properties ../.. # use the two step resource loader resource.loader = twostep twostep.resource.loader.class = TwoStepResourceLoader twostep.resource.loader.path = / ../..
Ok, now we need to forbid direct access to .vtl files. This is achieved by way of a NullServlet towards which we will redirect unwanted traffic.
NullServlet.java [...] protected void doRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = request.getRequestDispatcher("/forbidden.html"); dispatcher.forward(request,response); } }
Now, we can map .html and .js files to our view servlet and .vtl files to the NullServlet, and everything should be ok! Well... almost. If our welcome page is a template (index.html.vtl), we must also declare it as a welcome file and map it towards the view servlet, otherwise the servlet container won't be able to find it when the incoming url contains just the name of the site.
The final web.xml that we provide works under Resin, there may be some change to do to adapt it for Tomcat, Jboss or other servlet containers (please contribute!).
Several aspects of localization are covered here:
Localization of web pages static part.
Localization of dynamic textual data stored in the database.
[TODO: characters encoding, numbers, currencies, dates, times, time zones]
The browser sends its preferred languages to the server by mean of the Accepted-Language HTTP header, which contains a list of languages (based upon the RFC 1766) and an optional preference coefficient (called “quality” - for instance: “Accepted-Language: en-us,en;q=0.7”, where the unspecified quality coefficient is equal to 1.0). The localization tool (Localizer.java) that we put in the session scope of our toolbox under the “local” key will parse this header and store in the session an ordered list of languages. We must also ensure that we can bypass this browser preference setting when the user explicitly asks for a specific language (by clicking on a language flag).
No magic here. We need a specific instance of the whole site (static pages and templates) in each covered language. At least, we can provide a fall through mechanism where the default language page is returned instead of queried ones if they aren't available.
The easiest way to organize the site hierarchy is to create a root directory for each language (/fr, /en...). All other non-localizable files like CSS and images are not concerned (but should be gathered in appropriate directories like “/img”). We also want this additional root directory to be transparent for HTTP, so we need a subclass of the VelocityViewServlet to make the link between the session and the resource loader. This new LocalizationServlet class will just subclass the handleRequest method and add this piece of code:
LocalisationServlet.java [...] // now take queried languages into account Localizer localizer = (Localizer)ctx.get("local"); if(localizer==null) { Logger.error("LocalizationServlet: localizer tool not found under 'local' name!"); // so? maybe try with the original path... return getTemplate(path); } for(String lang:localizer.getLanguageList()) { try { return getTemplate("/"+lang+path); } catch (ResourceNotFoundException rnfe) { } } // fall back to the original path... return getTemplate(path); [...]
And we put this new servlet instead of the VelocityViewServlet in our web.xml file.Over ? Not yet... Since our index file is now hidden inside a language directory, we need a dummy index.hml file at the webapp root so that the servlet container gives control to our servlet (under linux, a “touch index.html” is sufficient...).
TODO: The LocalizationServlet should check existing language directories and filter the requested list thereafter.
We implement authentication via a servlet filter (AuthenticationFilter.java) that simply checks that the user is authenticated and redirects towards the login page if not. Then, we map URLs of all restricted areas to that filter in web.xml (we use /auth/). When redirecting the user towards the login page, the filter saves the original target request and restores it if the login is successful.
The filter rely on an authenticator tool (Authenticator.java) to perform the real task of authenticating the user. To avoid clear passwords in HTTP, we'll use a challenge+answer mechanism: within each login page, the webapp sends a new challenge under the form of a big integer and the login form sends back to the server a combination of this challenge and of the password wich is never transmitted in clear. On the javascript side, we make use of a big integer library to calculate the appropriate answer.
The authenticator has two abstract methods that must be subclassed:
protected abstract String getPassword(String login); protected abstract Object getUser(String login);


pyconstruct.datasets.load¶
-
pyconstruct.datasets.
load
(dataset, *, base=None, fetch=True, force=False, remove_raw=False)¶ Load a dataset.
This method loads one of the predefined dataset. The list of available datasets can be found in the
DATASETS
variable.The returned dataset is preprocessed in order to be usable out-of-the-box by the Weaver algorithms. The preprocessed version is automatically cached.
Parameters: - dataset (str) – The name of the dataset.
- base (str) – The base directory where to look for the dataset or to fetch it into. Default is a system-dependent data directory.
- fetch (bool) – Whether to fetch the dataset in case it is not found.
- force (bool) – Whether to force the preprocessing of the dataset.
- remove_raw (bool) – Wether to remove the download raw files.
Returns: dataset – A collection of properties of the dataset.
Return type: sklearn.utils.Bunch


Currently the package includes 14 methods for calculating internal consistency reliability but is still growing. The package allows users access to whichever reliability estimator is deemed most appropriate for their situation.
| Version: | 3.0 |
| Suggests: | mice, GPArotation, testthat |
| Published: | 2013-07-30 |
| Author: | Tyler Hunt |
| Maintainer: | Tyler Hunt <tyler at psychoanalytix.com> |
| BugReports: | https://github.com/JackStat/Lambda4/issues |
| License: | GPL-2 |
| NeedsCompilation: | no |
| CRAN checks: | Lambda4 results |
| Reference manual: | Lambda4.pdf |
| Package source: | Lambda4_3.0.tar.gz |
| Windows binaries: | r-devel: Lambda4_3.0.zip, r-release: Lambda4_3.0.zip, r-oldrel: Lambda4_3.0.zip |
| OS X binaries: | r-release: Lambda4_3.0.tgz, r-oldrel: Lambda4_3.0.tgz |
| Old sources: | Lambda4 archive |
Please use the canonical form https://CRAN.R-project.org/package=Lambda4 to link to this page.


By Melanie Philofsky and the EHR Working Group
The EHR WG convened on July 24, August 7, and August 21, 2020 to discuss the creation of an Observation Period from EHR data. The current and future conventions are not prescriptive enough and leave room for various ways of interpretation. The goals of our discussions were to increase the standardization for the implementation of the OBSERVATION_PERIOD table by providing some general guidelines for determining the start, end, and gaps in Observation Periods. The suggestions we came up with are only “suggestions” at this point. More research should be done to understand how these choices might impact evidence generated using these data. All of these decisions should be tempered by local understanding of patients in the EHR you are ETLing.
Set the observation_period_end_date as the first date from the following:
Periods of time when a Person does not receive care from your institution and therefore is not observed and should not have an Observation Period. These gaps are usually hard to determine because most Persons don’t announce their departure from an EHR/healthcare institution. Therefore, a heuristic will need to be instituted to determine Observation Period Gaps where the information is not explicit.
Defined as the maximum time allowed between two clinical events under the assumption a Person would have a clinical event recorded, if they are not healthy and seek care.
Example: Person 1 has a series of clinical events recorded from Jan. 1, 2010 to June 15, 2012, where the time between clinical events does not exceed 60 days. The next clinical event for Person 1 is on Oct. 1, 2018. Starting Oct. 1, 2018 Person 1 has clinical events occurring at least every 90 days up to the present date.
There is a 6+ year gap between groups of clinical events recorded in the CDM. After discussion in the EHR WG, we believe this 6+ year gap is indicative of a Person not being seen within our EHR/healthcare institution. Per convention #4 for Observation Period table, “As a general assumption, during an Observation Period any clinical event that happens to the patient is expected to be recorded. Conversely, the absence of data indicates that no clinical events occurred to the patient.” Person 1 has two Observation Periods.
1st Observation Period
2nd Observation Period
Now, there are cases where a Person only receives care within you EHR system when absolutely necessary. And if your EHR doesn’t offer primary care services, the majority of Persons who lack healthcare insurance or any other reason why Persons are only seen in urgent or emergent situations, the above heuristic might be too restrictive. This is a guideline. A question the EHR WG debated was how long between clinical events should we assume any clinical event that happens to the Person is expected to be recorded? When should we end one Observation Period and begin another? What should be the time between events for an Observation Period Persistence Window? Wellness checkups/Visits happen approximately every 12-18 months depending on a multitude of factors.
Our recommendation: If Observation Period Gaps are 548 days or more, then the previous Observation Period should end and another Observation Period should begin on the date of the next clinical event as per the Person 1 example above.
The Observation Period can be created by only one clinical event. However, the clinical event must NOT be from the Death table. If a Death date does not have any other clinical records 18 months before AND 18 months after the death date, then an Observation Period will not be created. We believe this logic is needed because if a Person only has a death death_date without other clinical event records, a Person is most likely not being “observed” when the death occurred. If a Person was being observed at their time of death, then other records (visit, condition, measurement, etc.) would be created. This rule is most relevant for those with death registry data since a Person who dies in the hospital has many clinical event records.


In angular you can define portions of your HTML to treated as Angular Apps. To do that, you use the ng-app directive. Provided that HTML is hierarchical,
your angular app will cover every HTML code under the ng-app directive. For instance, if you define your ng-app dierctive in the ,"body" HTML tag, then the entire
page will be an angular application.
Something similar happens with controllers. The controller you attach to a portion of the HTML page using ng-controller directive indicates that
everything under that HTML portion will be part of the scope of action of the controller. Remember that the ng-controller directive creates a new scope that is
attached to the controller. If you have nested controllers then a new scope will be created every time but the child controllers will inherit the
scope properties of their parents.
Important thing to notice:
1. This example defines 3 angular controllers, which are used hierarchically in the HTML page meaning there is a parent controller, a child controller, and a grand child controller.
2. Each nested controller inherits the scope from its parent.
Good {{timeOfDay}}, {{name}}!
Good {{timeOfDay}}, {{name}}!
Good {{timeOfDay}}, {{name}}!


Choose 3 numbers between 0-9
Submit after choosing numbers
You get 10 submissions
If correct, box will turn green
If wrong, box will turn red
If matches in another box, box will turn yellow


View all task: Tony
Start Task
Donation List
ID
Fill Donation Form
Stop
No messages
1
input
stop
Approve List
ID
Approve ?
Stop
No Approves
1
form
stop
Second Approve List
ID
Second Approve ?
No Second Approves
1
form
History
asdasdf
Email
email


| yes | J.C. Gregorio |
| BitWorking, Inc | |
| December 2003 |
This memo presents a technique for using XML (Extensible Markup Language) and HTTP (HyperText Transport Protocol) to edit content.
To provide feedback on this draft RFC please visit the Atom Wiki or join the atom-syntax mailing list.
1
Introduction
2
Terminology
3
Scope
4
Introduction
4.1
Purpose
4.2
Terminology
4.3
The AtomAPI Model
5
Functional Specification
5.1
PostURI
5.1.1
Locating
5.1.2
Request
5.1.3
Response
<IP_ADDRESS>
201
<IP_ADDRESS>
303
<IP_ADDRESS>
400
<IP_ADDRESS>
500
5.2
EditURI
5.2.1
Locating
5.2.2
Request
5.3
FeedURI
5.3.1
Locating
5.3.2
Request
5.3.3
Response
<IP_ADDRESS>
301
<IP_ADDRESS>
307
5.4
Link Tag
5.4.1
rel
5.4.2
href
5.4.3
title
5.4.4
type
5.5
Atom Request and Response Body Constraints
5.5.1
id
5.5.2
link
5.5.3
title
5.5.4
summary
5.5.5
content
5.5.6
issued
5.5.7
modified
5.5.8
created
5.5.9
author
5.5.10
contributor
5.5.11
generator
6
Security Considerations
7
Appendices
7.1
Example for a weblog
7.2
Example for a wiki
8
Revision History
9
Copyright
§
References
§
Author's Address
§
Full Copyright Statement
The AtomAPI is an application level protocol for publishing and editing web resources. The protocol at its core is the HTTP transport of Atom formatted representations.
To provide feedback on this draft RFC please visit the Atom Wiki or join the atom-syntax mailing list.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",the and "OPTIONAL" in this document are to be interpreted as described in RFC2119.
This document covers the editing of content of a periodically updating website using the HTTP and XML. All of the XML payloads are in Atom format, which is documented in the draft Atom Syndication Format RFC.
The AtomAPI is an application level protocol for publishing and editing web resources.
AtomAPI is an application level protocol for publishing and editing web resources. Using the common HTTP verbs provides a pattern for working with all such web resources:
There are different kinds of resources managed by the AtomAPI, each of these have URIs and those URIs support a subset of the above methods. There are three major classes of URIs in this specification: PostURI, FeedURI and EditURI. This specification defines the expected actions for each of the methods listed. Note that this does not restrict a URI to only supporting just those methods listed, for example an EditURI could support a POST method, or the OPTIONS method, what those methods do is beyond the scope of this specification.
This RFC does not specify the form of the URIs that are used. The URI space of each server is controlled, as defined by HTTP, by the server alone. What this RFC does specify are the formats of the files that are exchanged and the actions that can be performed on the URIs embedded in those files.
The PostURI is used to create entries. These can be either full entries, such as a weblog post, or they can be comments, or even a wiki page. The client POSTs a filled in Atom Entry to this URI. If the request is succesful then multiple new URIs may be created that contain representations of varying types. For example, POSTing an Atom entry to a PostURI may create a new weblog entry with both an HTML and Atom representation now available. The URI of the newly created Atom representation may in fact be an EditURI through which the resource can be edited.
For creating a new site Entry, the link tag is used. Note that a link tag is used in both HTML and in the Atom format. A link tag of the following format points to the PostURI for a site. In HTML the link tags are always found in the head element, while in Atom they may appear as children of the Feed and entry elements.
<link rel="service.post" type="application/x.atom+xml" href="URI for Posting goes here" title="The name of the site.">
Note: Multiple link tags may appear together and can be distinguished by having different 'rel', 'type' and 'title' attributes.
The request contains a filled in Atom entry, subject to the constraints in section @@ TBD @@.
The expected status codes from a POST are 201, 303, 400, and 500. 401, 404, and 410 are also possible.
Response includes a Location: header with the URI of the created resource, i.e. the URI used to edit the entry, as opposed to the URI used to display the content. The body of the response will contain the entry "filled in" with time stamps and any other data the server choses to reveal. This must contain enough information to enable a client to issue a subsequent PUT to this location. Note that the server may chose to omit the content in the response, particularly if it is large.
The body of this response does not contain the filled in Entry, but the filled in Entry can be found under a different URI and SHOULD be retrieved using a GET method on that resource. The different URI SHOULD be given by the Location field in the response.
Indicates that the server believes that that data sent constitutes an invalid request. A short description of the error will appear on the status line itself. A longer description will appear in the body.
Indicates that the server detected an internal error on the server processing this request (such as an unhandled exception). A short description of the error will appear on the status line itself. A longer description will appear in the body.
An EditURI is used to edit a single entry. Each entry that is editable MUST have a unique URI. This URI supports both GET and PUT and they are used in tandem for an editing cycle. The client GET's the represenation which is formatted as an Atom entry. The client may then update the entry and then PUT it back to the same URI. The PUT will cause all the related resources to be updated, for example, the HTML representaion.
Note that the value of the content element in the Atom entry does not have to exactly match the content element for the same entry when it is represented in an Atom feed. For example, a server may allow the client to post entries whose content is formatted as WikiML, yet the server may clean up such markup and transform it into well-formed XHTML before placing it in the publicly avialable Atom feed. Another scenario is summaries, the EditURI is for editing the full content of an entry, but the server may only present excerpts when it produces an Atom feed.
A client will send a DELETE to the EditURI to delete an entry.
For editing a site Entry, the link tag is used. Note that a link tag is used in both HTML and in the Atom format. A link tag of the following format points to the EditURI for a site. In HTML the link tags for editing are always found in the head element, while in Atom they may appear as children of the entry elements.
<link rel="service.edit"
type="application/x.atom+xml"
href="URI for Editing goes here"
title="Readable description of the entry.">
Note: The critical characteristic of this link tag is the @rel of 'service.edit' and the @type of 'application/x.atom+xml'.
A PUT request, and a GET response both contain a filled in Atom entry, subject to the constraints in section @@ TBD @@.
The FeedURI is used to retrieve a represenation in Atom format. Note that this feed is different from a typical Atom feed in that it contains "link" elements for navigating and manipulating the content of the site. For example there should be a "link" element with rel="next" whose URI points to the next block of entries on the site. Similarly the feed element can contain a "link" element with rel="service.post", the URI of which is a PostURI. Individual entries should contain "link" elements with rel="service.edit" whose URIs are EditURIs.
@@ Editor's Note: @@ Note that the "service.feed" takes the place of the Introspection File and the Search facet in previous versions of the specification. That is, facet discovery, which was previously done by inspecting the Introspection file is now done by looking for "link" tags with an attribute "rel" set to "service.[something]" in the "service.feed" file. At the same time the same representation replaces the search facet by having "link" tags that point to other feeds using well knows 'rel' attribute values such as 'next' and 'prev', or the search can branch in multiple directions by specifying multiple link tags with rel="service.feed" and having differing title attributes that announce the kind of search results in that feed.
A link tag of the following format points to the FeedURI.
<link rel="service.feed" type="application/x.atom+xml" href="URI goes here" title="The name of the site.">
The request is a simple GET. No other verbs are currently specified for this URI.
The expected status codes from a GET are 200, 301, 307, and 500. 401, 404, and 410 are also possible.
The Feed has moved permanently, the new URI is given in the the Location header.
The Feed has moved temporarily, the new URI is given in the the Location header.
The link tag is used in both HTML and Atom formats. There are slight differences between the two usages. Here are the commonalities, differences, and a list of well-known values for the rel attribute.
The link tag in HTML documents appears in the 'head' of the document. The 'head' section only allows a linear list of 'link' tags. The Atom format allows 'link' tags as children of both the 'feed' element and of the 'entry' element. Note that this gives the information present in the link tag more context. For example ... @@ TBD @@
This attribute describes the relationship from the current document, be it HTML or Atom, to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types. Note that these values are case insensitive. With type="application/x.atom+xml" we have the following interpretations of the relations.
URI of the resource being described by this link element.
Offers advisory information about the link. Rendered to the user to help them choose among a set of links with the same rel and type attributes.
The content type of the resource avaialable at the URI given in the href attribute of the link element. Most of the link types in this specification are on type 'application/x.atom+xml'.
The Atom format is used as the representation of all the resources in this specification. As it is used in differing contexts, there are different constraints of which elements may be present, and how their values should be interpreted.
@@TBD@@ Talk here about using HTTP basic and digest authentication.
@@TBD@@ Talk here about denial of service attacks using large XML files, or the billion laughs DTD attack.
Fill this in with an example for how all the above is used for a weblog. Start with main HTML page, link tag of type service.feed to the 'introspection' file. 1. Creating a new entry 2. Finding an old entry 3. editing an old entry 4. commenting on a entry (via HTML and Atom)
Fill this is like above but for a wiki.
Rev 08 - 01Dec2003 - Refactored the specification, merging the Introspection file into the feed format. Also dropped the distinction between the type of URI used to create new entries and the kind used to create comments. Dropped user preferences.
Rev 07 - 06Aug2003 - Removed the use of the RSD file for auto-discovery. Changed copyright until a final standards body is chosen. Changed query parameters for the search facet to all begin with atom- to avoid name collisions. Updated all the Entries to follow the 0.2 version. Changed the format of the search results and template file to a pure element based syntax.
Rev 06 - 24Jul2003 - Moved to PUT for updating Entries. Changed all the mime-types to application/x.atom+xml. Added template editing. Changed 'edit-entry' to 'create-entry' in the Introspection file to more accurately reflect it's purpose.
Rev 05 - 17Jul2003 - Renamed everything Echo into Atom. Added version numbers in the Revision history. Changed all the mime-types to application/atom+xml.
Rev 04 - 15Jul2003 - Updated the RSD version used from 0.7 to 1.0. Change the method of deleting an Entry from POSTing <delete/> to using the HTTP DELETE verb. Also changed the query interface to GET instead of POST. Moved Introspection Discovery to be up under Introspection. Introduced the term 'facet' for the services listed in the Introspection file.
Rev 03 - 10Jul2003 - Added a link to the Wiki near the front of the document. Added a section on finding an Entry. Retrieving an Entry now broken out into it's own section. Changed the HTTP status code for a successful editing of an Entry to 205.
Rev 02 - 7Jul2003 - Entries are no longer returned from POSTs, instead they are retrieved via GET. Cleaned up figure titles, as they are rendered poorly in HTML. All content-types have been changed to application/atom+xml.
Rev 01 - 5Jul2003 - Renamed from EchoAPI.html to follow the more commonly used format: draft-gregorio-NN.html. Renamed all references to URL to URI. Broke out introspection into it's own section. Added the Revision History section. Added more to the warning that the example URIs are not normative.
Copyright (C) Joe Gregorio (2003). All Rights Reserved.
| [RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
| Joe Gregorio | |
| BitWorking, Inc | |
| 1002 Heathwood Dairy Rd. |
|
| Apex, NC 27502 | |
| US | |
| Phone: | +1<PHONE_NUMBER> |
| EMail: |<EMAIL_ADDRESS>|
| URI: | http://bitworking.com/ |


Come one come all to try Seattles Famous Salmon Cookies. Our cookies come from a homegrown reciepe that uses actual Salmon! To make sure everyone enjoys our cookies can not directly taste the Salmon in them, but just trust that it is in there, and with every bite you are injesting the heart and soul of Seattle! Below are some of the products we offer besides cookies.


Throughout my work as a both a PhD pharmaceutical research scientist and an entrepreneur, I’ve seen a need for making complex information more accessible, understandable, and useful to everyday people. As I move into the next phase of my career, I want to help companies, organizations, and individuals better utilize information to create the new products we’ll need over the coming decades in order to build a healthier and more sustainable world.
I started studying full-stack web-development, because there remains plenty of information, both scientific and otherwise, that would be far more useful if incorporated into databases (e.g. SQL or Mongo) and accessed through well designed web interfaces. I recently completed the six-month program in web-development offered by University of Kansas, and I am currently seeking employment in the field.
I’m an active life-long learner, and in addition to web-development I am also studying to become a certified master gardener through the University of Missouri Extension Program. Unsurprisingly, in trying to combine these two new interests I can be found in my spare time over on Bee-Z Street, a home gardening application that I’m developing with Samantha McCall, whom I met during the KU program.
Click to download my techical resume or scientific CV here:


Play
Pause
Stop
Seconds Passed:
0
Increment by
1
10
100
1000
Elf seconds
Canvas Compactness:
1
10
100
-1000 seconds
-100 seconds
-10 seconds
-1 second
Reset
+1 second
+10 seconds
+100 seconds
+1000 seconds
Unfortunately, your browser doesn't support canvas.


Index
All Classes|All Packages
I
- IA_NOT_ALIVE - Static variable in class configuration.GameConfiguration
-
to desactivate IA
- IDDLE - Static variable in class configuration.EntityConfiguration
-
id of state iddle
- INFANTRY - Static variable in class configuration.EntityConfiguration
-
id of infantry
- INGAME - Static variable in class configuration.GameConfiguration
-
state of the game
- initArcher() - Method in class factionConfiguration.Gaia
- initArcher(String) - Method in class factionConfiguration.Barbare
-
that search in a file stat of archer
- initArcher(String) - Method in class factionConfiguration.Empire
- initArcher(String) - Method in class factionConfiguration.Royaume
- initArchery() - Method in class factionConfiguration.Barbare
- initArchery() - Method in class factionConfiguration.Empire
- initArchery() - Method in class factionConfiguration.Gaia
- initArchery() - Method in class factionConfiguration.Royaume
- initBarrack() - Method in class factionConfiguration.Barbare
- initBarrack() - Method in class factionConfiguration.Empire
- initBarrack() - Method in class factionConfiguration.Gaia
- initBarrack() - Method in class factionConfiguration.Royaume
- initCastle() - Method in class factionConfiguration.Barbare
- initCastle() - Method in class factionConfiguration.Empire
- initCastle() - Method in class factionConfiguration.Gaia
- initCastle() - Method in class factionConfiguration.Royaume
- initCavalry() - Method in class factionConfiguration.Gaia
- initCavalry(String) - Method in class factionConfiguration.Barbare
-
that search in a file stat of cavalry
- initCavalry(String) - Method in class factionConfiguration.Empire
- initCavalry(String) - Method in class factionConfiguration.Royaume
- initForge() - Method in class factionConfiguration.Barbare
-
init forge stat and give him all upgrade
- initForge() - Method in class factionConfiguration.Empire
- initForge() - Method in class factionConfiguration.Gaia
- initForge() - Method in class factionConfiguration.Royaume
- initForgeUpgrades() - Method in class factionConfiguration.Barbare
- initForgeUpgrades() - Method in class factionConfiguration.Empire
- initForgeUpgrades() - Method in class factionConfiguration.Gaia
- initForgeUpgrades() - Method in class factionConfiguration.Royaume
- initHq() - Method in class factionConfiguration.Barbare
- initHq() - Method in class factionConfiguration.Empire
- initHq() - Method in class factionConfiguration.Gaia
- initHq() - Method in class factionConfiguration.Royaume
- initHQUpgrades() - Method in class factionConfiguration.Barbare
- initHQUpgrades() - Method in class factionConfiguration.Empire
- initHQUpgrades() - Method in class factionConfiguration.Gaia
- initHQUpgrades() - Method in class factionConfiguration.Royaume
- initInfantry() - Method in class factionConfiguration.Gaia
- initInfantry(String) - Method in class factionConfiguration.Barbare
-
that search in a file stat of infantry
- initInfantry(String) - Method in class factionConfiguration.Empire
- initInfantry(String) - Method in class factionConfiguration.Royaume
- initRessource(Ressource) - Method in class engine.entity.unit.Worker
-
Fonction qui attribue au worker selectionne par le joueur la ressource selectionnee par le joueur
- initRessourceStockage() - Method in class factionConfiguration.Barbare
- initRessourceStockage() - Method in class factionConfiguration.Empire
- initRessourceStockage() - Method in class factionConfiguration.Gaia
- initRessourceStockage() - Method in class factionConfiguration.Royaume
- initSpecial() - Method in class factionConfiguration.Gaia
- initSpecial(String) - Method in class factionConfiguration.Barbare
-
that search in a file stat of special_unit
- initSpecial(String) - Method in class factionConfiguration.Empire
- initSpecial(String) - Method in class factionConfiguration.Royaume
- initStable() - Method in class factionConfiguration.Barbare
- initStable() - Method in class factionConfiguration.Empire
- initStable() - Method in class factionConfiguration.Gaia
- initStable() - Method in class factionConfiguration.Royaume
- initTower() - Method in class factionConfiguration.Barbare
- initTower() - Method in class factionConfiguration.Empire
- initTower() - Method in class factionConfiguration.Gaia
- initTower() - Method in class factionConfiguration.Royaume
- initWorker() - Method in class factionConfiguration.Gaia
- initWorker(String) - Method in class factionConfiguration.Barbare
-
that search in a file stat of worker
- initWorker(String) - Method in class factionConfiguration.Empire
- initWorker(String) - Method in class factionConfiguration.Royaume
- INMENU - Static variable in class configuration.GameConfiguration
-
state of the game
- INOPTION - Static variable in class configuration.GameConfiguration
-
state of the game
- INPAUSEMENU - Static variable in class configuration.GameConfiguration
-
state of the game
- isActive() - Method in class engine.math.SelectionRect
- isArcheryBuilt() - Method in class engine.manager.BotManager
- isBarrackBuilt() - Method in class engine.manager.BotManager
- isCastleBuilt() - Method in class engine.manager.BotManager
- isForgeBuilt() - Method in class engine.manager.BotManager
- isHasAnimation() - Method in class engine.Animation
-
true if entity has animation
- isHit() - Method in class engine.Entity
- isHqBuilt() - Method in class engine.manager.BotManager
- isInRange(Entity) - Method in class engine.entity.building.AttackBuilding
-
Methode qui calcule si la cible est dans la rayon d'attaque du batiment.
- isRemove() - Method in class engine.Entity
- isSelected() - Method in class engine.Entity
- isSolid() - Method in class engine.map.Tile
- isStableBuilt() - Method in class engine.manager.BotManager
- isStatUpgrade() - Method in class engine.Faction
- isUpgradeAge() - Method in class engine.Faction
All Classes|All Packages


{% extends "base.html" %} {% block content %}
Jim-sama is doing some crazy database restructuring and he isn't even getting paid. Please return to being moe tsunderes when we come back up in about an hour.


#^_blog_post_json { "title":"3DPrint Mr Boneman", "tags":["3dprint"], "filename":"wetgenes_3dprint_mr_boneman", } #^title trim=ends {_blog_post_json.title} #^_blog_post_body form=markdown {title} -------
Mr Bone man is upside down because it eases his passage through the birth canal and into your dimensions. This is a test print from my Avatar generator, the mesh had to be messed around with a bit, adding something to hold the hands and feet to the torso then bones needed thickening up in places and angles reduced in order to get it to print without needing support. Which is also why the STL is upside down, that way it grows upwards like a branching tree and mostly works perfectly until it gets to the feet which is just OK. It was printed with 2mm of support so the very top of the head sticks to the build plate without being cut flat. The top of the head is still slightly wonky and you need to pull the support hat off without breaking the neck but at least it prints. In the blender file you see some modifier tricks to get a mesh out that doesn't crash slic3r using remesh and decimate. Makes the STL file huge and blender slow but the output is easier to slice. You can also choose between lowpoly or smooth by removing the initial subdivide modifier, I kinda like the low poly look in 3d prints but other people seem to prefer it smooth :) This is the Slic3r config files I used with an ender 3 pro. I've not really had much luck with support materials beyond using it to stick the first few layers to the bed so that is how it is setup. Should take an hour and half to print and if it goes wrong it will be right at the end when it gets to the feet. In other news after ripping a hole in my magnetic bed cover I've finally worked out how to use the glass bed. The secret is Pritt Stick, slap a bit of that on each time and prints will actually stick to the bed rather than start sliding around halfway through a print. Tried other suggested tricks but that is the only one that worked for me. Not sure needing glue with each print is an upgrade from the magnetic bed cover which I found much easier to use but at least it works now.


Dear {email}
Thanks for your interest in the service. You can activate your account by clicking below link.
Activate account
Thanks and Regards,
Manjunath


There have been a number WPF breadcrumb implementation around, even I have written this control twice, both times I have to rely in reflection to retrieve the Hierarchy (e.g. .typeof(T).GetProperty(subEntriesPath)), this is because the breadcrumb component is a List object that contains a number of breadcrumbItems.
In many aspect breadcrumb is very similar to TreeView, it has an item source, a selected value and all items can expand to show it's sub-items. Making breadcrumb a treeView also allow it easier to bindable to viewModel.
The reason that most breadcrumb is not TreeView is that the TreeView does not provide selection support, older approach lookup using the UI thread from root TreeViewItem and find the selected item, this doesn't work well because the lookup jammed the UI thread.
Then I developed another approach (in FileExplorer2), which do the lookup in ViewModel, by setting TreeNodeViewModel.IsExpaned to true, it force the UI to load the sub-contents of the ViewModel when the TreeViewItem is loaded, resulting very smooth tree view expand and selection.
But the problem is that all code has to be done in ViewModel, and the ViewModel is not reusable, so under Single responsibility principle, I have refactored the code to IEntriesHelper (which control the loading of sub-entries), ITreeSelector and ITreeNodeSelector. BreadcrumbTree require the view model implement these interfaces. The default implementation of Selector uses await instead of the previous method.


Welcome to a world which sparks the technology geek in you.
For both undergraduate students and graduate students
For both undergraduate students and graduate students
Tech sparkers bring to the world, an ever-growing community of the students to learn and explore new technologies by experts.
Our motive is to empower and motivate the individuals to learn new technologies, help them clear their doubts and to provide an instant solution to their problem.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quam urna, dignissim nec auctor in, mattis vitae leo.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quam urna, dignissim nec auctor in, mattis vitae leo.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quam urna, dignissim nec auctor in, mattis vitae leo.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quam urna, dignissim nec auctor in, mattis vitae leo.
We here, are determined to create a learning and technology evolving environment to our community.


mori
A library for using ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript.
Rationale
JavaScript is a powerful and flexible dynamic programming language with a beautiful simple associative model at its core. However this design comes at the cost of ubiquitous mutability. Mori embraces the simple associative model but leaves mutability behind. Mori delivers the following benefits to JavaScript:
- Efficient immutable data structures - no cloning required
- Uniform iteration for all types
- Value based equality
Modern JavaScript engines like V8, JavaScriptCore, and SpiderMonkey deliver the performance needed to implement persistent data structures well.
Immutability
Mori delivers highly tuned persistent data structures based on the ones provided in Clojure. When using Mori data structures and operations you do not need to defensively clone as you often do in JavaScript. By providing immutable data structures, Mori encourages value oriented programming.
Mori is not an island
Beyond the the core philosophy Mori makes no other assumptions about how you might use it. In fact, Mori has changed some aspects of the ClojureScript API in order to better accomodate usage from JavaScript and languages that target JavaScript like CoffeeScript. For example, where it makes sense, Mori returns regular JavaScript arrays so that you can use destructuring syntax where available. The following example is in CoffeeScript:
m = mori; [a, b] = m.juxt(m.inc, m.dec)(1); // a = 2, b = 0
Using Mori
Mori can be used in precisely the same way that
libraries like Underscore.js are used. Mori of course
provides not only the same functionality but it
delivers a rich set of data structures.
Mori's operators are more general than the ones
provided by Underscore.js - they work on nearly all
the native JavaScript types. In those cases where they
do not work you usually just need to wrap the type
in mori.primSeq(...)
.
Notation
Each entry is annotated with the signature with an
accompanying description and some relevant
examples. Optional parameters appear
as [option]
in the signature. Sometimes
the signature or description will mention coll
for collection. In general collections can be
converted in to sequences for manipulation via the
various sequence operations. This include all Mori
collections as well as JavaScript Arrays and Strings.
All the examples are in JavaScript or CoffeeScript. However, for simplicity's sake we show the results of operations in Clojure literal syntax notation.
(1 2 3 4) ;; list [1 2 3 4] ;; vector {"foo" 1, "bar" 2} ;; hash map / sorted-map #{"cat" "bird" "dog"} ;; set / sorted-set
Fundamentals
equals mori.equals(x, y)
Test whether two values are equal. Works on all Mori collections. Note that two seqable values will be tested on deep equality of their contents.
var l0 = mori.list(1,2,3); var l1 = mori.list(1,2,3); mori.equals(l0, l1); // => true var v = mori.vector(1,2,3); mori.equals(v, l0); // => true var m0 = mori.toClj({foo: 1}); var m1 = mori.toClj({foo: 1}); mori.equals(m0, m1); // => true
hash mori.hash(x)
Returns the hash code for a value. Values for
which mori.equals
returns true have identical
hash codes.
var l = mori.list(1, 2, 3); var v = mori.vector(1, 2, 3); mori.hash(l) == mori.hash(v); // => true
Type Predicates
isList mori.isList(coll)
Test if something is a list-like collection. Lists support efficient adding to the head.
isSeq mori.isSeq(coll)
Test if something is a sequence (i.e. iterable)
isVector mori.isVector(coll)
Test if something is a vector-like collection. Vectors support random access. It is efficient to add to the end of a vector.
isMap mori.isMap(coll)
Test if something is a map-like collection. Maps support random access and arbitrary keys.
isSet mori.isSet(coll)
Test if something is a hash set.
isCollection mori.isCollection(coll)
Test if something is a collection - lists, maps, sets, vectors are all collections.
isSequential mori.isSequential(coll)
Test if something is sequential. For example vectors are sequential but are not sequences. They can however be converted into something iterable by calling seq on them.
isAssociative mori.isAssociative(coll)
Test if something is associative - i.e. vectors and maps.
isCounted mori.isCounted(coll)
Test if something can give its count in O(1) time.
isIndexed mori.isIndexed(coll)
Test if something is indexed - i.e. vectors.
isReduceable mori.isReduceable(coll)
Test if something is reduceable.
isSeqable mori.isSeqable(coll)
Test if something can be coerced into something iterable.
isReversible mori.isReversible(coll)
Test if something can be reversed in O(1) time.
Collections
list mori.list(arg0, arg1, ...)
Constructs an immutable list. Lists support efficient
addition at the head of the list. It's important to
remember that the cost of operations like
mori.nth
will be linear in the size of
the list.
var l = mori.list(2,3); mori.cons(1, l); // => (1 2 3)
vector mori.vector(arg0, arg1, ...)
Constructs an immutable vector. Vectors support efficient
addition at the end. They also support efficient random
access. You will probably use mori.vector
much
more often than mori.list
var v = mori.vector(1,2,3,4); mori.nth(v, 0); // => 1
hashMap mori.hashMap(key0, val0, key1, val1, ...)
Constructs an immutable hash map. Unlike JavaScript objects Mori PersistentHashMap support complex keys. It's recommended that you only use immutable values for your keys - numbers, strings or a Mori collection.
var m0 = mori.hashMap("foo", 1, "bar", 2); // m0 = {"foo" 1, "bar" 2} mori.get(m0, "bar"); // => 2 var m1 = mori.assoc(m0, m.vector(1,2), 3); // m1 = {"foo" 1, "bar" 2, [1 2] 3} mori.get(m1, m.vector(1,2)); // => 3
sorted_map mori.sorted_map(key0, val0, key1, val1, ...)
Like a hash map but keeps its keys ordered.
mori.sorted_map(2, "two", 3, "three", 1, "one"); // {1 "one", 2 "two", 3 "three"}
set mori.set(seqable)
Constructs a collection of unique items. You may pass in any seqable type - this includes JavaScript arrays and strings. There are several operations unique to sets which do not apply to the other collections.
var s = mori.set(["bird", "cat", "dog"]); mori.conj(s, "dog"); // => #{"bird" "cat" "dog"} mori.conj(s, "zebra"); // => #{"bird" "cat" "dog" "zebra"}
sortedSet mori.sortedSet(arg0, arg1, ...)
Like set but keeps its elements ordered.
mori.sortedSet(3,2,1,3); // #{1 2 3}
range mori.range([start], [end], [step])
Construct a potentially infinite lazy range of values.
With no parameters, a infinite lazy sequence starting at 0 will be returned.
var r = mori.range(); // => (0 1 2 3 …)
A single parameter serves as the end
(exclusive) argument.
var r = mori.range(10); // => (0 1 2 3 4 5 6 7 8 9)
Two parameters serve as start
and
end
.
var r = mori.range(1,5); // => (1 2 3 4)
If three parameters are specified, the third serves
as a step
argument.
var r = mori.range(1,9,2); // => (1 3 5 7)
queue mori.queue(arg0, arg1, ...)
Constructs a persistent queue. Queues support efficient addition at the end and removal from the front.
var q0 = mori.queue(1, 2); // => #queue [1 2] var q1 = mori.conj(q0, 3); // => #queue [1 2 3] mori.peek(q1); // => 1 mori.pop(q1); // => #queue [2 3] mori.rest(q1); // => (2 3)
Collection Operations
conj mori.conj(coll, arg0, arg1, ...)
Add something to a collection. The behavior depends on the type of the collection.
var l = mori.list(2,3); mori.conj(l, 1); // => (1 2 3) var v = mori.vector(1,2); mori.conj(v, 3); // => [1 2 3] var m = mori.hashMap("foo", 1); mori.conj(m, mori.vector("bar", 2));; // => {"foo" 1 "bar" 2} var s = mori.set(["cat", "bird", "dog"]); mori.conj(s, "zebra"); // => #{"cat" "bird" "dog" "zebra"}
into mori.into(coll, from)
Add all the items in the second collection to the first one as
if calling mori.conj
repeatedly.
var l = mori.list(2,3); var v = mori.vector(1,2); mori.into(l, v); // => (2 1 2 3) mori.into(l, l); // => (3 2 2 3) mori.into(v, l); // => [1 2 2 3] mori.into(v, v); // => [1 2 1 2]
assoc mori.assoc(coll, key0, val0, key1, val1, ...)
Associate a new key-value pair in an associative collection. Works on vectors and maps.
var v = mori.vector("foo", "bar", "baz"); mori.assoc(v, 1, "quux"); // => ["foo" "quux" "baz"] var m = mori.hashMap("foo", 1); mori.assoc(m, "bar", 2); // => {"foo" 1 "bar" 2} mori.assoc(m, "foo", 6); // => {"foo" 6}
dissoc mori.dissoc(coll, key0, key1, ...)
Removes keys from an associative collection. Works on maps.
var m = mori.hashMap("foo", 1, "bar", 2, "baz", 3); mori.dissoc(m, "bar", "baz"); // => {"foo" 1}
distinct mori.distinct(coll)
Returns a sequence of the elements of coll with duplicates removed.
var v = mori.vector(1, 1, 2, 3, 3, 4, 5); mori.distinct(v); // => (1 2 3 4 5)
empty mori.empty(coll)
Remove everything from a collection.
var m = mori.hashMap("foo", 1, "bar", 2, "baz", 3); mori.empty(m); // => {} var v = mori.vector("foo", "bar", "baz"); mori.empty(v); // => []
get mori.get(coll, key, [not-found])
Retrieve a value from a collection.
var v = mori.vector("foo", "bar", "baz"); mori.get(v, 1); // "bar" var m = mori.hashMap("foo", 1, "bar", 2); mori.get(m, "foo"); // => 1 mori.get(m, "baz", "nope"); // => "nope"
getIn mori.getIn(coll, keys, [not-found])
Retrieve a value from a nested collection. keys
may be any seqable object.
var v = mori.vector("foo", "bar", "baz"); var v2 = mori.vector("quux", v); mori.getIn(v2, [1, 2]); // => "baz" var m = mori.hashMap("foo", 1, "bar", 2); var m2 = mori.hashMap("baz", 3, "quux", m); mori.getIn(m2, ["quux", "bar"]); // => 2
hasKey mori.hasKey(coll, key)
Returns true if the collection has the given key/index. Otherwise, returns false.
var v = mori.vector("foo", "bar", "baz"); mori.hasKey(v, 1); // => true mori.hasKey(v, 9); // => false var m = mori.hashMap("foo", 1, "bar", 2); mori.hasKey(m, "foo"); // => true mori.hasKey(m, "quux"); // => false var s = mori.set(["foo", "bar", "baz"]); mori.hasKey(s, "foo"); // => true mori.hasKey(s, "quux"); // => false
find mori.find(coll, key)
Returns the key value pair as an array for a given key. Returns null if that key isn't present.
var v = mori.vector("foo", "bar", "baz") mori.find(v, 2) // => [2, "baz"] mori.find(v, 9) // null var m = mori.hashMap("foo", 1, "bar", 2) mori.find(m, "foo") // => ["foo", 1] mori.find(m, "quux") // null
nth mori.nth(coll, index)
Get the value at the specified index. Complexity
depends on the collection. nth
is essentially
constant on vector, but linear on lists. For collections
which are not sequential like sets and hash-map, the
collection will be coerced into a sequence first.
var v = mori.vector("foo", "bar", "baz"); mori.nth(v, 1); // => "bar"
last mori.last(coll)
Get the last value in a collection, in linear time.
var v = mori.vector("foo", "bar", "baz"); mori.last(v); // => "baz"
assocIn mori.assocIn(coll, keys, val)
Convenience function for assoc'ing nested associative
data structures. keys
may be any seqable.
var h = mori.hashMap("foo", mori.hashMap("bar", 1)); mori.assocIn(h, ["foo", "baz"], 2); // => {"foo" {"bar" 1, "baz" 2}}
updateIn mori.updateIn(coll, keys, function)
var h = mori.hashMap("foo", mori.vector(1, 2, 3)); mori.updateIn(h, ["foo", 1], mori.inc); // => {"foo" [1 3 3]}
count mori.count(coll)
Returns the length of the collection.
var l = mori.list("foo", "bar", "baz"); mori.count(l) // 3 var v = mori.vector("foo", "bar", "baz"); mori.count(v) // 3 var s = mori.set(["foo", "bar", "baz"]); mori.count(s) // 3 var m = mori.hashMap("foo", 1, "bar", 2); mori.count(m) // 2
isEmpty mori.isEmpty(coll)
Returns true if the collection is empty.
var l = mori.list("foo", "bar", "baz"); mori.isEmpty(l); // => false var v = mori.vector(); mori.isEmpty(v); // => true
peek mori.peek(coll)
Returns either the first item of a list or the last item of a vector.
var l = mori.list("foo", "bar", "baz"); mori.peek(l) // "foo" var v = mori.vector("foo", "bar", "baz"); mori.peek(v) // "baz"
pop mori.pop(coll)
Returns either a list with the first item removed or a vector with the last item removed.
var l = mori.list("foo", "bar", "baz"); mori.pop(l) // ("bar" "baz") var v = mori.vector("foo", "bar", "baz"); mori.pop(v) // ["foo" "bar"]
zipmap mori.zipmap(seqable0, seqable1)
Takes two seqable objects and constructs a hash map. The first seqable provides the keys, the second seqable the values.
var keys = ["foo", "bar", "baz"]; var vals = [1, 2, 3]; var h = mori.zipmap(keys, vals); // => {"foo" 1, "bar" 2, "baz" 3}
reverse mori.reverse(coll)
Returns a reversed sequence of a collection.
var v = mori.vector("foo", "bar", "baz"); mori.reverse(v); // => ["baz", "bar", "foo"]
Vector Operations
subvec mori.subvec(vector, start, [end])
Returns a subsection of a vector in constant time.
var v = mori.vector("cat", "dog", "bird", "zebra"); mori.subvec(v,1,2); // => ["dog"]
Hash Map Operations
keys mori.keys(map)
Returns the keys of a hash map as a sequence.
var m = mori.hashMap("foo", 1, "bar", 2); mori.intoArray(mori.keys(m)); // => [ "foo", "bar" ]
vals mori.values(map)
Returns the values of a hash map as a sequence.
var m = mori.hashMap("foo", 1, "bar", 2); mori.intoArray(mori.vals(m)); // => [ 1, 2 ]
merge mori.merge(map, m0, m1, ...)
Returns the result of conj-ing the rest of the maps into the first map. If any of the keys exist in the previous map, they will be overridden.
var m = mori.hashMap("foo", 1, "bar", 2); mori.merge(m, mori.hashMap("bar", 3, "baz", 4)); // => {foo 1, bar 3, baz 4}
Set Operations
disj mori.disj(set)
Removes an element from a set.
var s = mori.set(["cat", "dog", "bird"]); // => #{"cat" "bird" "dog"} mori.disj(s,"bird"); // => #{"dog" "cat"}
union mori.union(set0, set1, ...)
Returns the union of two sets.
var s0 = mori.set(["cat", "dog"]); var s1 = mori.set(["zebra", "lion"]); mori.union(s0, s1); // => #{"lion" "cat" "dog" "zebra"}
intersection mori.intersection(set0, set1, ...)
Returns the intersection of two sets.
var s0 = mori.set(["cat", "dog", "mouse"]); var s1 = mori.set(["dog", "cat", "bird"]); mori.intersection(s0, s1); // => #{"cat" "dog"}
difference mori.difference(set0, set1, ...)
Returns the difference between two sets.
var s0 = mori.set(["cat", "dog", "mouse"]); var s1 = mori.set(["dog", "cat", "bird"]); mori.difference(s0, s1); // => #{"mouse" "bird"}
isSubset mori.isSubset(seta, setb)
Returns true if seta
is a subset of setb
.
var s0 = mori.set(["dog", "cat"]); var s1 = mori.set(["cat", "dog", "bird"]); mori.isSubset(s0, s1); // => true
isSuperset mori.isSuperset(seta, setb)
Returns true if seta
is a superset of setb
.
var s0 = mori.set(["cat", "dog", "bird"]); var s1 = mori.set(["dog", "cat"]); mori.isSuperset(s0, s1); // => true
Sequences
first mori.first(coll)
Returns the first element in a collection.
mori.first("foobar"); // => "f" mori.first([1,2,3]); // => 1 var l = mori.list(1,2,3); mori.first(l); // => 1 var m = mori.hashMap("foo", 1, "bar", 2); mori.first(m); // some key-value pair as an array
rest mori.rest(coll)
Returns the remaining elements in a collection.
mori.rest("foobar"); // => ("o" "o" "b" "a" "r") mori.rest([1,2,3]); // => (2 3) var l = mori.list(1,2,3); mori.rest(l); // => (2 3) var m = mori.hashMap("foo", 1, "bar", 2); mori.rest(m); // remaining key-value pairs
seq mori.seq(coll)
Converts a collection whether Mori or JavaScript primitive into a sequence.
mori.seq("foo"); // => ("f" "o" "o") mori.seq(mori.list()); // => null
cons mori.cons(val, coll)
Converts a collection into a sequence and adds a value to the front.
var v = mori.vector(2, 3); mori.cons(1, v); // => (1 2 3)
concat mori.concat(coll0, coll1, ...)
Converts its arguments into sequences and concatenates them.
var r = mori.range(3); var a = [3, 4, 5]; var l = mori.list(6, 7); var v = mori.vector(8, 9); mori.concat(r, a, l, v); // => (0 1 2 3 4 5 6 7 8 9)
flatten mori.flatten(coll)
Converts an arbitrarily nested collection into a flat sequence.
var v = mori.toClj([[1, 2], 3, [4], [[5, 6], 7]]); mori.flatten(v); // => (1 2 3 4 5 6 7)
intoArray mori.intoArray(seq)
Converts a seqable collection, including Mori seqs back into a JavaScript array. Non-lazy.
var lazy = mori.map(mori.inc, [1,2,3]); mori.intoArray(lazy); // => [2,3,4]
each mori.each(coll, f)
Iterate over a collection. For side effects.
var xs = mori.map(mori.inc, [1,2,3]); mori.each(xs, function(n) { console.log(n); }); // will print 2 then 3 then 4 at your JS console
map mori.map(f, coll0, coll1, ...)
Return a lazy sequence that represents
the original collection with f
applied to
each element. Note that map can take multiple collections
This obviates the need for Underscore.js's zip.
var a0 = [1,2,3]; mori.map(mori.inc, a0); // => (2 3 4) var a1 = [4,5,6]; var a2 = [7,8,9]; mori.map(mori.vector, a0, a1, a2); // => ([1 4 7] [2 5 8] [3 6 9])
mapcat mori.mapcat(f, coll0, coll1, ...)
Applies f
, which must return a collection, to
each element of the original collection(s) and concatenates
the results into a single sequence.
var a = mori.seq("abc"); var b = mori.seq("123"); var f = function(x, y) { return mori.list(x, x + y); }; mori.mapcat(f, a, b); // => ("a", "a1", "b", "b2", "c", "c3") mori.reduce(mori.concat, mori.map(f, a, b)); // => ("a", "a1", "b", "b2", "c", "c3")
filter mori.filter(pred, coll)
Return a lazy sequence representing the original
collection filtered of elements which did not return a truthy
value for pred
. Note that Mori has a stricter
notion of truth than JavaScript. Only false, undefined, and null
are considered false values.
var a = [0,1,2,3,4,5,7,7,9]; mori.filter(mori.isEven, a0); // => (0 2 4 6 8)
remove mori.remove(pred, coll)
The inverse of filter. Return a lazy sequence representing the original
collction filtered of elements which returned a truthy
value for pred
. Note that Mori has a stricter
notion of truth than JavaScript. Only false, undefined, and null
are considered false values.
var a = [0,1,2,3,4,5,6,7,9]; mori.remove(mori.isEven, a0); // => (1 3 5 7 9)
reduce mori.reduce(f, [intial], coll)
Accumulate a collection into a single value. f
should be a function of two arguments, the first will be the
accumulator, the second will be next value in the sequence.
var a = mori.range(10); mori.reduce(mori.sum, 0, r); // => 45
reduceKV mori.reduceKV(f, [initial], map)
A variant of reduce
for map-like collections,
specifically hash maps and vectors.
var f = function(acc, key, val) { return acc + "(" + key + ":" + val + ")"; }; var m = mori.hashMap("foo", 1, "bar", 2); mori.reduceKV(f, "", m); // => "(foo:1)(bar:2)" var v = mori.vector(5, 7); mori.reduceKV(f, "", v); // => "(0:5)(1:7)"
take mori.take(n, coll)
Takes n elements from a colletion. Note that coll
could be an infinite sequence. This function returns
a lazy sequence.
var a = mori.range(); // infinite sequence mori.take(10, r); // => (0 1 2 3 4 5 6 7 8 9)
takeWhile mori.takeWhile(pred, coll)
Takes elements from a collection as long as the
function pred
returns a value other
than false
, null
or undefined
.
The following example is in CoffeeScript:
a = [0,1,2,3,4,5,6,7,8,9] mori.takeWhile ((n) -> n < 5), r // => (0 1 2 3 4)
drop mori.drop(n, coll)
Drop n elements from a collection. Returns a lazy sequence.
var a = [0,1,2,3,4,5,6,7,8,9] mori.drop(5, a); // => (5 6 7 8 9)
dropWhile mori.interleave(pred, coll)
Drops elements from a collection as long as the
function pred
returns a value other
than false
, null
or undefined
.
The following example is in CoffeeScript:
a = [0,1,2,3,4,5,6,7,8,9] mori.dropWhile ((n) -> n < 5), a // => (5 6 7 8 9)
some mori.some(pred, coll)
Applies the function pred
to the elements of the
collection in order and returns the first result which is
not false
, null
or undefined
.
var a = [1,2,3,4,5,6,7,8,9]; var f = function(x) { return x % 5 == 0 && x * x; }; mori.some(f, a); // => 25
every mori.every(pred, coll)
Returns true if the result of applying the
function pred
to an element of the collection is
never false
, null
or undefined
.
var a = [1,2,3,4,5,6,7,8,9]; var f = function(x) { return mori.isEven(x); }; var g = function(x) { return mori.isEven(x) || mori.isOdd(x); }; mori.every(f, a); // => false mori.every(g, a); // => true
sort mori.sort([cmp], coll)
Sorts the collection and returns a sequence. The comparison function to be used can be given as the first argument.
var a = [4,6,2,7,1,0,9,5,8,3] var f = function(a, b) { return b - a; }; mori.sort(a); // => (0 1 2 3 4 5 6 7 8 9) mori.sort(f, a); // => (9 8 7 6 5 4 3 2 1 0)
sortBy mori.sortBy(keyfn, [cmp], coll)
Sorts the collection by the values of keyfn
on the
elements and returns a sequence. The comparison function to be
used can be given as the first argument.
var a = [0,1,2,3,4,5,6] var kf = function(x) { return x * 5 % 7; }; var f = function(a, b) { return b - a; }; mori.map(kf, a); // => (0 5 3 1 6 4 2) mori.sortBy(kf, a); // => (0 3 6 2 5 1 4) mori.sortBy(kf, f, a); // => (4 1 5 2 3 6 0)
interpose mori.interpose(x, coll)
Interpose a value between all elements of a collection.
var a = [1,2,3] mori.interpose("foo", a) // => (1 "foo" 2 "foo" 3)
interleave mori.interleave(coll0, coll1, ...)
Interleave two or more collections. The size of the resulting lazy sequence is determined by the smallest collection.
var ns = [1,2,3]; var as = ["a", "b", "c"]; mori.interleave(ns, as); // => (1 "a" 2 "b" 3 "c")
iterate mori.iterate(f, x)
Creates a lazy sequences of x, f(x), f(f(x)), ...
mori.iterate(mor.inc, 0); // => (0 1 2 3 4 5 ...)
repeat mori.repeat([n], x)
Return a lazy of sequence of the value repeated.
If given n
, the value will only be
repeated n times.
The following example is in CoffeeScript:
m = mori foos = m.repeat("foo") m.zipmap [1,2,3], foos // => {1 "foo", 2 "foo", 3 "foo"}
repeatedly mori.repeatedly([n], f)
Return a lazy of sequence of calling f
, a
function which takes no arguments (presumably for side effects).
If given n
, the function will only be
repeated n times.
mori.repeatedly(5, Math.random); // => (... 5 random floating point numbers ...)
partition mori.partition(n, [step], [pad], coll)
Partition a seqable collection into groups of n
items. An optional step
parameter may be provided to specify the amount of overlap. An additional pad
element can be provided when the final group of items is too small.
var m = mori, arr = [0,1,2,3,4,5,6,7,8,9], ps = m.partition(2, arr); m.intoArray(m.map(m.intoArray, ps)); // => [[0,1],[2,3],[4,5],[6,7],[8,9]] ps = m.partition(2, 1, arr); m.intoArray(m.map(m.intoArray, ps)); // => [[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9]]
partitionBy mori.partitionBy(f, coll)
Partition a seqable collection with a new group being started
whenever the value of the function f
changes.
var v = mori.vector("foo", "bar", "baz", "grapefruit"); var f = function(s) { return s[0]; } mori.partitionBy(f, v); // => (("foo") ("bar" "baz") ("grapefruit"))
groupBy mori.groupBy(f, coll)
Returns a map of the items grouped by the result of applying
f
to the element.
function evenOdd(n) { return mori.isEven(n) ? "even" : "odd"; } var r = mori.range(10); mori.groupBy(evenOdd, r); // => {"even" (0 2 4 6 8) "odd" (1 3 5 7 9)}
Helpers
primSeq mori.primSeq(seqable, [index])
There are many array-like JavaScript objects which
are not actually arrays. To give these objects a uniform
interface you can wrap them with mori.primSeq
.
The optional argument index
may be used to
specify an offset. Note this is not necesary for arrays or
strings.
function foo() { var args = mori.primSeq(arguments); var f = mori.first(args); }
identity mori.identity(x)
A function which simply returns its argument
mori.identity(5); // => 5
constantly mori.constantly(x)
Makes a function that takes any number of arguments and
simply returns x
.
mori.map(mori.constantly("foo"), mori.range(4)); // => ("foo" "foo" "foo" "foo")
inc mori.inc(n)
Adds one to its argument.
mori.inc(1); // => 2
dec mori.dec(n)
Subtracts one from its argument.
mori.dec(1); // => 0
sum mori.sum(a, b)
Add its two arguments together. Useful with mori.reduce
.
mori.sum(1,2); // => 3 mori.reduce(mori.sum, 0, mori.range(10)); // 45
isEven mori.isEven(n)
Returns true if the argument is divisible by 2.
isOdd mori.isOdd(n)
Returns true if the argument is not divisible by 2.
comp mori.comp(f, g)
Function composition. The result of mori.comp(f,
g)(x)
is the same as f(g(x))
.
mori.map(mori.comp(mori.isOdd, mori.inc), [1, 2, 3]); // => (false true false)
juxt mori.juxt(f0, f1, ...)
Takes a series of functions and creates a single function which represents their "juxtaposition". When this function is called, will return the result of each function applied to the arguments in a JavaScript array.
f = mori.juxt(mori.first, mori.last); f([1, 2, 3, 4, 5, 6]); // => [ 1, 6 ] (a javascript array)
knit mori.knit(f0, f1, ...)
This allows you to create functions that work on a heterogenous
collection and return a new collection of the same
arity. It is an relative
of juxt
. Like juxt
it takes a series of functions and returns a new
function. Unlike juxt
the resulting
function takes a sequence. The functions and sequence
are zipped together and invoked.
var f = mori.knit(function (s) { return s.toLowerCase(); }, function (s) { return s.toUpperCase(); }); f(["FoO", "bAr"]); // => ["foo", "BAR"]
pipeline mori.pipeline(x, f0, f1, ...)
Allows threading a value through a series of functions.
var _ = mori; _.pipeline( _.vector(1,2,3), _.curry(_.conj, 4), _.curry(_.conj, 5) ); // => [1,2,3,4,5]
partial mori.partial(f, x, y, ...)
Partial application. Will return a new function in which the provided arguments have been partially applied.
var _ = mori; var f = _.partial(_.conj, _.vector(1,2,3)); f(4); // => [1,2,3,4] f(5); // => [1,2,3,5]
curry mori.curry(f, x, y, ...)
Curry arguments to a function.
var _ = mori; var f = _.curry(_.conj, 4); f(_.vector(1,2,3)); // => [1,2,3,4]
fnil mori.fnil(f, x, y, ...)
Takes a function f and returns a new function that upon receiving an argument, if null, will be replaced with x. fnil may take up to three arguments.
var _ = mori; var f = function(x) { return _.updateIn(x, ["count"], _.fnil(_.inc, 0)); }; f(_.hashMap()); // => {"count", 1}
toClj mori.toClj(x)
Recursively transforms JavaScript arrays into Mori vectors, and JavaScript objects into Mori maps.
var data = {foo: "bar"}; mori.toClj(data); // => {"foo", "bar"}
toJs mori.toJs(x)
Recursively transforms Mori values to JavaScript. sets/vectors/lists/queues become Arrays, Keywords and Symbol become Strings, Maps become Objects. Arbitrary keys are encoded to by key->js.
var data = mori.hashMap("foo", "bar"); mori.toJs(data); // => {"foo", "bar"} of type js/Object


| Opcode* | Instruction | Op/En | 64-Bit Mode | Compat/Leg Mode | Description |
| FD | STD | NP | Valid | Valid | Set DF flag. |
| Op/En | Operand 1 | Operand 2 | Operand 3 | Operand 4 |
| NP | NA | NA | NA | NA |
Sets the DF flag in the EFLAGS register. When the DF flag is set to 1, string operations decrement the index registers (ESI and/or EDI).
This instruction’s operation is the same in non-64-bit modes and 64-bit mode.
DF ← 1;
The DF flag is set. The CF, OF, ZF, SF, AF, and PF flags are unaffected.
| #UD | If the LOCK prefix is used. |


Be Back Soon!
Sorry! This site is currently under construction.
We should be back up in:
1 Hour
Thanks for understanding.


This is some text $math \frac12$ other text $\unsupported$
Other node \[ displaymath \frac{1}{2} \] blah $$ \int_2^3 $$
and some more text \(and math\) blah. And $math with a \$ sign$.
Stuff in a $pre tag$


{% extends "base.html" %} {% block body %}
A short description to identify this problem:
The problem:
The solution:
Category:
-- choose one -- Algebra Geometry Combinatorics Number Theory Other
Any other comments (optional):


Pariah (1999) Rating: 4.0 stars out of 5.0 stars
See this review as it was intended at: http://www.jaxfilmjournal.com/
Cast: Damon Jones, Dave Ward, David Lee Wilson, Aimee Chafin, Angela Jones, Anna Padgett, Dan Weene, Ann Zupa, Brandon Slater, Jason Posey, Chris Jarecki, Terence Washington, Tyrone Young, Orlando Estrada, Robert Hargett, Elexa Williams, Tupelo Jerome, Ray Wadsworth, Kelly McCrary, Joe Wood, Clint Curtis, Lynn Odell, Michael Turner, Candy Ass Written and Directed by: Randolph Kret Running Time: 105 minutes
Aggressive, bleak, and unrelenting film about an interracial couple, Steve and Sam (Damon Jones and Elexa Williams respectively), who are viciously attacked in a parking garage one night by a gang of skinheads. The skinheads beat Steve, then force him to watch as they brutally rape his girlfriend over and over again. When Sam kills herself later that evening, Steve decides that the skinheads must be taught a lesson. Waiting seven months for the thuggish skinheads to forget about the incident entirely, Steve shaves his head, dresses in combat boots and suspenders, tattoos his flesh with Nazi symbols, and tries to infiltrate the gang. As he gets closer and closer to the people who committed the horrible crime against his girlfriend, he begins to learn just how vicious these people really are and starts to question his own motives for violence.
Randolph Kret's script, based on two real life incidents that affected not only his life but the life of the film's producer Shaun Hill, is an affront on violence and intolerance. The film causes its audience to be subjected to such brutality and ignorance that one can't help but be disgusted by the events presented within. I've seen it said that this is the film Fight Club should have been, but David Fincher's film was trying to define a generation.  If Fincher is the Kubrick of our generation, then Kret is our D.W. Griffith (thematically speaking).
There is not a single likable character in the film. The skinheads are obviously the most repulsive characters in the film, not only because of their beliefs but because they are in a constant state of fury (not just against other races but within their own circles). The African-American characters in the film are constantly shown as sexually assaulting drug abusers who are always on a joyride looking for someone to accost. Even gay men get in on the act, locating the skinheads' lair and beating them severely with lead pipes and other blunt objects. The main character Steve is also unlikable because of the person he becomes just to seek out revenge. What all of this comes down to is the simple message that violence begets violence, and the constant clashes between factions will do nothing but continue the endless cycle of violence inherent in our society.
The cast of this film is absolutely remarkable. Damon Jones shows a raw energy that many actors can't seem to summon these days and his performance seems nothing less than powerful. His initial reaction to hearing about his girlfriend's suicide is one of the most affecting scenes I have ever seen in a film. David Lee Wilson, who plays (appropriately enough) David Lee is accurately evil as the second in command skinhead who also makes extra money performing oral sex on other men (an irony that seems lost on the other skinheads).  Sadly, actor Dave Ward, who portrays the character of Crew, will not be able to follow up his excellent performance as he was the victim of a vicious act of violence himself at the hands of a fellow actor during an incident of road rage. Ward showed immense promise and he will be greatly missed.
Note: It is a shame that the filmmakers had to add a disclaimer to the end of the film stating that neither they nor the musicians contributing music for the film condone racism. The message about hatred couldn't be spelled out any more clearly than it is here, but there are those who would probably find this film much more akin to a training video than a condemnation.
There are no "winners" at the end of this film either. No character gets his or her comeuppance and the ending leaves us almost right where we began. Where American History X had redemption for most of its characters, no such victories are in store for Pariah's band of twisted souls. It is this bleak ending that carries the film's most powerful message: the message that, despite what you may be able to momentarily do to put your own mind to rest, evil will still be with us (and in many forms) and there is very little than can be done to eradicate it entirely.
Reviewed by Brian Matherly -<EMAIL_ADDRESS>AOL Instant Messenger: Widescreen25 The Jacksonville Film Journal - http://www.jaxfilmjournal.com/ -- Chuck Dowling Editor - The Jacksonville Film Journal http://www.jaxfilmjournal.com/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: page title: "Developing Backbone.js Applications" prev: OEBPS/ch01s02.html next: OEBPS/ch01s04.html book_path: books/developing-backbone-js-applications-addy-osmani--_oeb/ --- {% include JB/setup %} {% raw %}
We’ve reviewed the 70’s, but let us now return to the here and now. The MVC pattern has been applied to a diverse range of programming languages. For example, the popular Ruby on Rails is an implementation of a web application framework based on MVC for the Ruby language. JavaScript now has a number of MVC frameworks, including Ember.js, JavaScriptMVC, and of course Backbone.js. Given the importance of avoiding “spaghetti” code, a term which describes code that is very difficult to read or maintain due to its lack of structure, let’s look at what the MVC pattern enables the Javascript developer to do.
MVC is composed of three core components:
Models manage the data for an application. They are concerned with neither the user-interface nor presentation layers, but instead represent structured data that an application may require. When a model changes (e.g when it is updated), it will typically notify its observers (e.g views, a concept we will cover shortly) that a change has occurred so that they may react accordingly.
To understand models better, let us imagine we have a JavaScript photo gallery application. In a photo gallery, a photo would merit its own model, as it represents a unique kind of domain-specific data. The Photo model may represent attributes such as a caption, image source and additional meta-data. A specific photo would be stored in an instance of a model. Here’s an example of a simple Photo model implemented with Backbone.js:
var
Photo
=
Backbone
.
Model
.
extend
({
// Default attributes for the photo
defaults
:
{
// Ensure that each photo created has an `src`.
src
:
"placeholder.jpg"
,
caption
:
"A default image"
,
viewed
:
false
},
initialize
:
function
()
{
}
});
The built-in capabilities of models vary across frameworks, however it’s common for them to support validation of attributes, where attributes represent the properties of the model, such as a model identifier. When using models in real-world applications we generally also need a way of persisting models. Persistence allows us to edit and update models with the knowledge that their most recent states will be saved somewhere, for example in a web browser’s localStorage data-store or synchronized with a database.
A model may also have multiple views observing it. Imagine our Photo model contained meta-data such as the longitude and latitude where the photo was taken, a list of people present in the photo, and a list of tags. A developer could create a single view that displayed all these attributes, or might create three separate views to display each attribute. The important detail is that the Photo model doesn’t care how these views are organized, it simply announces updates to its data as necessary. We’ll come back to Views in more detail later.
It is not uncommon for modern MVC/MV* frameworks to provide a means to group models together. In Backbone, these groups are called “Collections”. Managing models in groups allows us to write application logic based on notifications from the group, should any model it contains change. This avoids the need to manually observe individual model instances.
Here’s how we might group Photo models into a simplified Backbone Collection:
var
PhotoGallery
=
Backbone
.
Collection
.
extend
({
// Reference to this collection's model.
model
:
Photo
,
// Filter down the list of all photos that have been viewed
viewed
:
function
()
{
return
this
.
filter
(
function
(
photo
){
return
photo
.
get
(
'viewed'
);
});
},
// Filter down the list to only photos that have not yet been viewed
unviewed
:
function
()
{
return
this
.
without
.
apply
(
this
,
this
.
viewed
());
}
});
If you read older texts on MVC, you may come across a description of models as also managing application “state”. In JavaScript applications “state” has a specific meaning, typically referring to the current “state” of a view or sub-view on a user’s screen at a fixed time. State is a topic which is regularly discussed when looking at Single-page applications, where the concept of state needs to be simulated.
Views are a visual representation of models that present a filtered view of their current state. A view typically observes a model and is notified when the model changes, allowing the view to update itself accordingly. Design pattern literature commonly refers to views as “dumb”, given that their knowledge of models and controllers in an application is limited.
Users interact with views, which usually means reading and editing model data. For example, in our photo gallery application example, model viewing might happen in a user interface with a big image, a caption, and a list of tags. Model editing could be done through an “edit” view where a user who has selected a specific photo could edit its caption, tags, or other metadata in a form.
In MVC, the actual task of updating the Model falls to Controllers, which we’ll be covering shortly.
Let’s explore Views a little further using a simple JavaScript example. Below we can see a function that creates a single Photo view, consuming both a model instance and a controller instance.
We define a render()
utility within our view
which is responsible for rendering the contents of the
photoModel
using a JavaScript templating engine
(Underscore templating) and updating the contents of our view,
referenced by photoEl
.
The photoModel
then adds our
render()
callback as one of its subscribers, so
that through the Observer pattern it can trigger the view to
update when the model changes.
You may wonder where user interaction comes into play here. When
users click on any elements within the view, it’s not the view’s
responsibility to know what to do next. A Controller makes this
decision. In our sample implementation, this is achieved by adding
an event listener to photoEl
which will
delegate handling the click behavior back to the controller,
passing the model information along with it in case it’s needed.
The benefit of this architecture is that each component plays its own separate role in making the application function as needed.
var
buildPhotoView
=
function
(
photoModel
,
photoController
){
var
base
=
document
.
createElement
(
'div'
),
photoEl
=
document
.
createElement
(
'div'
);
base
.
appendChild
(
photoEl
);
var
render
=
function
(){
// We use a templating library such as Underscore
// templating which generates the HTML for our
// photo entry
photoEl
.
innerHTML
=
_
.
template
(
'photoTemplate'
,
{
src
:
photoModel
.
getSrc
()});
}
photoModel
.
addSubscriber
(
render
);
photoEl
.
addEventListener
(
'click'
,
function
(){
photoController
.
handleEvent
(
'click'
,
photoModel
);
});
var
show
=
function
(){
photoEl
.
style
.
display
=
''
;
}
var
hide
=
function
(){
photoEl
.
style
.
display
=
'none'
;
}
return
{
showView
:
show
,
hideView
:
hide
}
}
Templating
In the context of JavaScript frameworks that support MVC/MV*, it is worth looking more closely at JavaScript templating and its relationship to Views.
It has long been considered bad practice (and computationally
expensive) to manually create large blocks of HTML markup
in-memory through string concatenation. Developers using this
technique often find themselves iterating through their data,
wrapping it in nested divs and using outdated techniques such as
document.write
to inject the
“template” into the DOM. This approach often means
keeping scripted markup inline with standard markup, which can
quickly become difficult to read and maintain, especially when
building large applications.
JavaScript templating libraries (such as Handlebars.js or Mustache) are often used to define templates for views as HTML markup containing template variables. These template blocks can be either stored externally or within script tags with a custom type (e.g “text/template”). Variables are delimited using a variable syntax (e.g {{name}}). Javascript template libraries typically accept data in JSON, and the grunt work of populating templates with data is taken care of by the framework itself. This has a several benefits, particularly when opting to store templates externally as this can let applications load templates dynamically on an as-needed basis.
Let’s compare two examples of HTML templates. One is implemented using the popular Handlebars.js library, and the other uses Underscore’s “microtemplates”.
Handlebars.js:

{{caption}}

{{metadata}}

Underscore.js Microtemplates:

<
%= caption %>

<img
class=
"source"
src=
"<%= src %>"
/>

<
%= metadata %>

You may also use double curly brackets (i.e
{{}}
) (or any other tag you feel comfortable
with) in Microtemplates. In the case of curly brackets, this can
be done by setting the Underscore
templateSettings
attribute as follows:
_
.
templateSettings
=
{
interpolate
:
/\{\{(.+?)\}\}/g
};
A note on navigation and state
It is also worth noting that in classical web development, navigating between independent views required the use of a page refresh. In single-page JavaScript applications, however, once data is fetched from a server via Ajax, it can be dynamically rendered in a new view within the same page. Since this doesn’t automatically update the URL, the role of navigation thus falls to a “router”, which assists in managing application state (e.g allowing users to bookmark a particular view they have navigated to). As routers are however neither a part of MVC nor present in every MVC-like framework, I will not be going into them in greater detail in this section.
Controllers are an intermediary between models and views which are classically responsible for two tasks: they both update the view when the model changes and update the model when the user manipulates the view.
In our photo gallery application, a controller would be responsible for handling changes the user made to the edit view for a particular photo, updating a specific photo model when a user has finished editing.
It’s with controllers that most JavaScript MVC frameworks depart from this interpretation of the MVC pattern. The reasons for this vary, but in my opinion, Javascript framework authors likely initially looked at server-side interpretations of MVC (such as Ruby on Rails), realized that that approach didn’t translate 1:1 on the client-side, and so re-interpreted the C in MVC to solve their state management problem. This was a clever approach, but it can make it hard for developers coming to MVC for the first time to understand both the classical MVC pattern and the “proper” role of controllers in other non-Javascript frameworks.
So does Backbone.js have Controllers? Not really. Backbone’s Views typically contain “controller” logic, and Routers (discussed below) are used to help manage application state, but neither are true Controllers according to classical MVC.
In this respect, contrary to what might be mentioned in the official documentation or in blog posts, Backbone is neither a truly MVC/MVP nor MVVM framework. It’s in fact better to see it a member of the MV* family which approaches architecture in its own way. There is of course nothing wrong with this, but it is important to distinguish between classical MVC and MV* should you be relying on discussions of MVC to help with your Backbone projects.
Spine.js
We now know that controllers are traditionally responsible for updating the view when the model changes (and similarly the model when the user updates the view). Since Backbone doesn’t have its own explicit controllers, it’s useful to review the controller from another MVC framework to appreciate the difference in implementations. Let’s take a look at Spine.js:
In this example, we’re going to have a controller called
PhotosController
which will be in charge of
individual photos in the application. It will ensure that when the
view updates (e.g a user edited the photo meta-data) the
corresponding model does too.
(Note: We won’t be delving heavily into Spine.js beyond this example, but it’s worth looking at it to learn more about Javascript frameworks in general.)
// Controllers in Spine are created by inheriting from Spine.Controller
var
PhotosController
=
Spine
.
Controller
.
sub
({
init
:
function
(){
this
.
item
.
bind
(
"update"
,
this
.
proxy
(
this
.
render
));
this
.
item
.
bind
(
"destroy"
,
this
.
proxy
(
this
.
remove
));
},
render
:
function
(){
// Handle templating
this
.
replace
(
$
(
"#photoTemplate"
).
tmpl
(
this
.
item
));
return
this
;
},
remove
:
function
(){
this
.
$el
.
remove
();
this
.
release
();
}
});
In Spine, controllers are considered the glue for an application, adding and responding to DOM events, rendering templates and ensuring that views and models are kept in sync (which makes sense in the context of what we know to be a controller).
What we’re doing in the above example is setting up listeners in
the update
and destroy
events using render()
and
remove()
. When a photo entry gets updated, we
re-render the view to reflect the changes to the meta-data.
Similarly, if the photo gets deleted from the gallery, we remove
it from the view. In case you were wondering about the
tmpl()
function in the code snippet: in the
render()
function, we’re using this to render a
JavaScript template called #photoTemplate which simply returns a
HTML string used to replace the controller’s current element.
What this provides us with is a very lightweight, simple way to manage changes between the model and the view.
Backbone.js
Later on in this section we’re going to revisit the differences between Backbone and traditional MVC, but for now let’s focus on controllers.
In Backbone, controller logic is shared between Backbone.View and Backbone.Router. Earlier releases of Backbone contained something called Backbone.Controller, but it was renamed to Router to clarify its role.
A Router’s main purpose is to translate URL requests into application states. When a user browses to the URL www.example.com/photos/42, a Router could be used to show the photo with that ID, and to define what application behavior should be run in response to that request. Routers can contain traditional controller responsibilities, such as binding the events between models and views, or rendering parts of the page. However, Backbone contributor Tim Branyen has pointed out that it’s possible to get away without needing Backbone.Router at all for this, so a way to think about it using the Router paradigm is probably:
var
PhotoRouter
=
Backbone
.
Router
.
extend
({
routes
:
{
"photos/:id"
:
"route"
},
route
:
function
(
id
)
{
var
item
=
photoCollection
.
get
(
id
);
var
view
=
new
PhotoView
({
model
:
item
});
something
.
html
(
view
.
render
().
el
);
}
})
:


Spetsai lies in the approaches to the large mainland bay of Argolikos Kolpos and is an affluent island. It is attractively covered in many pine trees and the main town (and only main settlement on the island) lies at the north eastern end.
Pretty Spetsai is a popular tourist town in the summer months, with several yards on the foreshore of the old harbour still building the traditional caiques.
This port can get very busy in high season and is popular with motor yachts, so if you do manage to find a space you will likely have to suffer the constant noise from their generators.
This island is well known as no cars are allowed on the island. The most common modes of transport are walking, horse-drawn carriages, bicycles, mopeds, and motorbikes. There are lovely walking trails around the island and beaches close to the port as well as others accesible by local bus.
Position: 37°15′N 23°08′E
For full details on clearing into our out of Greece see Greek Formalities.
All the authorities are based in the new harbour at Dapia (NW of the old town).
This harbour gets very crowded in the summer.
Anchoring in high season is probably going to be the only option. Try to find room either in the bay, inner harbour or in Baltiza creek, taking a long line ashore. The inner harbour has excellent holding in mud and very good shelter, and some yachts choose to winter afloat here.
In the outer harbour the bottom is made up of sand and weed so holding tends to be poor. Plus, there is an old mooring chain fouling the bottom in the SW corner so this area should be avoided. Strong NW winds make the outer harbour very uncomfortable, as does the wash from water-taxis.
The inner harbour quay may have space off-season for stern or bows-to mooring. There is water and fuel on the quay.
The town offers good services, with a choice of yards for haulout, good provisions and a charming town to explore.
Last updated June 2016.


[gecode-users] Heap memory exhaustion
Christian Schulte
cschulte at kth.se
Mon Feb 25 23:40:34 CET 2008
Wow, that's amazing: what kind of propagators did you use? Normally, domain
size is never an issue (Gecode has really the smallest implementation one
could think of in terms of memory consumption).
But on the other hand, using sensible domain is an important part of
modeling practice:
- if domains are too big and domain-consistent propagation is used,
then too many holes are created using lots of memory (that must have been
your case)
- if domains are too big and arithmetic constraints are used, they
either have to resort to less efficient numerical types internally or they
even might throw an exception due to potential of numerical overflow (Gecode
prides itself that it will never silently and incorrectly overflow)
So, as always: small is beautiful ;-)
All the best
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Joe Porter
Sent: Tuesday, February 26, 2008 4:18 AM
To: users at gecode.org
Subject: Re: [gecode-users] Heap memory exhaustion
It looks like the problem was the domain size. I manually rescaled the
domain down by a factor of 100, and it worked (very quickly), even with full
recomputation.
Thanks for all of your help,
-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20080226/1221cfc8/attachment.htm>
More information about the gecode-users
mailing list


Found only on the island of Borneo, Bornean orangutans (Pongo pygmaeus) have a broader face and shorter beard than their cousins, Sumatran orangutans. This July, the IUCN changed their status to critically endangered because their population has declined by 60% since 1950, and, according to Scientific American, new projections estimate that their numbers will fall by another 22% by the year 2025.
The main threats for these animals are habitat loss (forests are turned into rubber, oil palm or paper plantations) and illegal hunting. Aggravating the problem, females only reproduce every six to eight years — the longest birth interval of any land mammal — which makes conservation efforts slow.
View DetailsFew animals have captured the imagination like brown bears. They can stand on two legs, walk on the soles of their feet, pick things up with their “fingers,” and often eat what we eat. This—coupled with their ability to communicate with one another through scratch marks left on trees, smells and sounds— establishes a similarity to our own way of life. Some of the largest living carnivores, brown bears have fallen prey to hunting and other conflicts with humans.
Brown bears were pursued extensively due to their size, valuable furs and meat. The brown bear population now occupies just 2% of its former range. Bear gall bladders reportedly bring high prices as traditional medicines on the Asian market although there is no evidence that products derived from bear parts have medical value.
View DetailsThe rarest member of the bear family, pandas live mainly in bamboo forests high in the mountains of western China, where they subsist almost entirely on bamboo. They must eat from 26 to 84 pounds of it every day, a formidable task for which they use their enlarged wrist bones that function as opposable thumbs. A newborn panda is about the size of a stick of butter—about 1/900th the size of its mother—but can grow to up to 330 pounds as an adult. These bears are excellent tree climbers despite their bulk.
China’s Yangtze Basin region, which holds the panda’s primary habitat, is the geographic and economic heart of this booming country. Roads and railroads are increasingly fragmenting the forest, which isolates panda populations and prevents mating. Forest destruction also reduces pandas’ access to the bamboo they need to survive. The Chinese government has established more than 50 panda reserves, but only around 61% of the country’s panda population is protected by these reserves.
View Details


WITNESS LIST
Agriculture & Livestock Committee
February 21, 2018 - 10:30 AM
Invasive Organisms
On:
Avila, Rodolfo (Self)
Bessent, Kody (Plains Cotton Growers, Inc)
Bhatkar, Awinash (Texas Department of Agriculture)
Boenig, Russell (Texas Farm Bureau)
Fearnyeyhough, Jason (Texas Department of Agriculture)
Fernandez, Benito (Self)
Flores, Orlando (Texas A&M AgriLife Extension Services, El Paso Co.)
Ivey, Arthur (Self)
Ivey, Kevin (West Texas Pecan Association)
Lewis, Brad (New Mexico Department of Agriculture)
Ree, William (Texas A&M AgriLife Extension)
Spence, John (Self)
Tirres, Ramon (Self)
Woodward, Jason (Texas A&M AgriLife Extension / Texas Tech University)
1


Gaps searches through your Plex Server. It then queries for known movies in the same collection using The MovieDB, which you will need to get. Don't worry, we'll walk you through those steps. Anyway, if those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.
An example would be having a copy of 'Alien (1979)' and Gaps recommending 'Aliens (1986)' and 'Alien³ (1992)' to be added to your collection.
Gaps is a free and open source software (FOSS). The code can be found on GitHub. Docker Images can be found on Docker Hub or via Unraid's community applications.
Gaps license can be found here.
While Gaps is free to use, donations are greatly appreciated. Any donations can be sent through a few different options.


Irish winger Forde hospitalised with four broken ribs and a punctured lung
The Limerick native suffered the injuries in Oxford United’s League One game over the weekend.
by Ben BlakeOXFORD UNITED WINGER Anthony Forde was hospitalised after suffering serious injuries over the weekend.
The Limerick man, a former Republic of Ireland U21 international, was forced off after a collision at the end of the first half in their 0-0 draw at home to Shrewsbury Town on Saturday.
26-year-old Forde was brought to John Radcliffe Hospital, where it was revealed he had broken four ribs — two of them twice — while also puncturing a lung.
“It was just one of those things” Forde said. “I went in for a tackle and we collided and I knew straight away I was in trouble. I want to thank the pitchside medical team for their help and then everyone, from the ambulance team to the doctors and staff at the JR have been amazing.”
I’m not going to lie, it’s still very painful but we know what it is and we know there is no long term damage to my lung so hopefully it’s just a case of the ribs healing now.”
The player, who began his senior career with Wolves and signed for Oxford from Rotherham United last summer, is due to leave hospital over the next 48 hours.
U’s head coach Karl Robinson added: “We are having as bad a run of luck with injuries as I have known in my career and at one stage on Saturday we had seven midfielders out of action.
“Fordy was really struggling and that’s not nice for the other lads to see but we know he is in good hands and they will just keep an eye on him for a day or two before he goes home and starts his recovery.
“We won’t set a time scale on that, it’s far too early for that, it’s just good news that everything has been diagnosed clearly and now we can seek specialist advice on how to help Fordy get back to full fitness.”


{% extends "base.html" %} {% block title %}Celebrity Movie Trivia Game!{% endblock %} {% block content %}
Test Your knowledge by choosing a movie from the search box and guessing which actors have appeared in that movie.
{% endblock %} {% block scripts %} {% endblock %}