We have 71 live insurers, on 5 products, each with business validation rules, that filter prospects based on their profile
Hierarchy of 492 legacy classes, no governance or auditability
Insurer exclusions based on object model (legacy code)
public void check(FieldContext context, FormuleMoto formule, Conducteur conducteur,
Vehicule vehicule, Void unused, Besoins besoins,
Set<EAbTestingScenario> scenarios)
throws ExclusionException {
if (besoins == null) {
return;
}
if (besoins.getDateDebutContrat() == null) {
return;
}
if (!DateHelper.isAfter(besoins.getDateDebutContrat(),
DateHelper.ajouteJoursADate(DateHelper.getToday(), NBR_JOURS),
DateHelper.EPrecision.jour)) {
throw new ExclusionException(DATE_EFFET_PLUS_60_JOURS);
}
}
Same rule, more fluent:
public ExclusionRule exclusionRule() {
return DOOV.when(dateContrat().after(todayPlusDays(60)))
.exclusionRule();
}
Java is verbose, but you can reduce the noise and write code like natural language with a fluent API
// JUnit API
assertEquals(9, fellowshipOfTheRing.size());
assertTrue(fellowshipOfTheRing.contains(frodo, sam));
assertFalse(fellowshipOfTheRing.contains(sauron));
// AssertJ API (fluent)
assertThat(fellowshipOfTheRing).hasSize(9)
.contains(frodo, sam)
.doesNotContain(sauron);
New elements in Java 8 makes it easier to write a fluent API
// java.util.function (io.doov.core.dsl.impl.LogicalBinaryCondition)
left.predicate().and(right.predicate()).test(model, context)
// java.util.stream (io.doov.core.dsl.impl.LogicalNaryCondition)
steps.stream().anyMatch(s -> s.predicate().test(model, context))
// lambda and method reference (io.doov.core.dsl.impl.NumericCondition)
predicate(greaterThanMetadata(field, value),
(model, context) -> Optional.ofNullable(value),
(l, r) -> greaterThanFunction().apply(l, r));
Many popular libraries propose fluent APIs like
jOOQ, AssertJ, Apache Spark, etc.
Dataset<Row> averagePrice = prices
.filter(value.<String>getAs("insurer")
.equals("COOL insurer"))
.groupBy("product")
.agg(avg("price").as("average"))
.orderBy(desc("average"));
"A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains"
Domain Object Oriented Validation
dOOv is a fluent API for typesafe domain model validation
key model
// Root class of model
class Model {
User user;
}
// Add key named EMAIL
enum ModelFieldId {
EMAIL;
}
// Annotate email field
class User {
@Path(field = EMAIL
readable = ...)
String email;
}
code generate
// dOOv typed field class
class DslModel {
StringFieldInfo userEmail;
}
// dOOv typed rule
class ModelRule {
Result executeOn(Model m);
}
write rules
// Create rules by using
// generated fields
// in DslModel
class Validations {
ModelRule email = DslModel
.when(userEmail.eq(...))
.validate()
// Optionaly add rules
// to a registry
.registerOn(DEFAULT);
}
get model
// Get model from somewhere
// or instanciate it
User user = new User();
user.setEmail("e@mail.com");
Model model = new Model();
model.setUser(user);
execute
// Directly reference rule email
Validations.email.executeOn(model);
// Or use the registry
DEFAULT.stream()
.map(rule -> rule.executeOn(model));
public class Account extends Identity {
@SamplePath(field = SampleFieldId.TIMEZONE,
readable = "account timezone")
private Timezone timezone;
@SamplePath(field = SampleFieldId.PHONE_NUMBER,
readable = "account phone number")
private String phoneNumber;
@SamplePath(field = SampleFieldId.EMAIL,
readable = "account email")
private String email;
@SamplePath(field = SampleFieldId.EMAIL_ACCEPTED,
readable = "account email accepted")
private boolean acceptEmail;
@SamplePath(field = SampleFieldId.EMAILS_PREFERENCES,
readable = "account préférences mail")
private Collection<EmailType> emailTypes = new HashSet<>();
}
public static boolean validateAccount(User user, Account account, Configuration config) {
if (config == null) {
return false;
}
if (user == null || user.getBirthDate() == null) {
return false;
}
if (account == null || account.getCountry() == null || account.getPhoneNumber() == null) {
return false;
}
if (YEARS.between(user.getBirthDate(), LocalDate.now()) >= 18
&& account.getEmail().length() <= config.getMaxEmailSize()
&& account.getCountry().equals(Country.FR)
&& account.getPhoneNumber().startsWith("+33")) {
return true;
}
return false;
}
public interface RulesConference {
SampleModelRule userAccount = DslSampleModel
// Entry point is when
.when(userBirthdate.ageAt(today()).greaterOrEquals(18)
.and(accountEmail.length().lesserOrEquals(configurationMaxEmailSize))
.and(accountCountry.eq(Country.FR))
.and(accountPhoneNumber.startsWith("+33")))
// Terminal operation is validate
.validate()
// Optional: add to registry
.registerOn(REGISTRY_DEFAULT);
}
public class RulesConferenceTest {
private SampleModel model;
@BeforeEach
public void before() {
model = SampleModels.sample();
}
@Test
public void should_default_user_account_validates() {
Result result = userAccount.executeOn(model);
assertThat(result).isTrue().hasNoFailureCause();
}
@Test
public void should_user_account_too_young_fail() {
model.getAccount().setPhoneNumber(null);
Result result = userAccount.executeOn(model);
assertThat(result).isFalse()
.hasFailureCause("account phone number starts with '+33'");
}
}
The entry point is DOOV#when(StepCondition)
and the operation StepWhen#validate
returns the validation rule
<EMAIL_ADDRESS>.or(accountEmail().matches("\\w+[@]\\w+\\.fr")))
.validate();
This is lazy
We've used entry point DslSampleModel#when
in the example: it makes typing simpler and more domain specific, but doesn't change execution.
A natural language version of the rule is available with ValidationRule#readable
.
This makes auditability and compliance possible.
System.out.println("> " + EMAIL_VALID.readable());
> When (email matches<EMAIL_ADDRESS>or
email matches<EMAIL_ADDRESS>validate
You can add the rule in one or many registry with ValidationRule#registerOn(Registry)
This makes governance possible.
<EMAIL_ADDRESS>.or(accountEmail().matches("\\w+[@]\\w+\\.fr")))
.validate()
.registerOn(REGISTRY_ACCOUNT);
The terminal operation ValidationRule#executeOn(FieldModel)
executes the rule
REGISTRY_ACCOUNT.stream()
.map(rule -> rule.executeOn(model))
.filter(Result::isInvalid)
.map(Result::message)
.collect(toList());
The available operations depend on the field type, and the arguments are type safe and validated by the compiler
DOOV.when(userAccountCreation().after(LocalDate.of(2000, 01, 01))).validate();
// ^^^^^
// only for date field
DOOV.when(userAccountCreation().after(LocalDate.of(2000, 01, 01))).validate();
// ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
// date field is type safe here
Makes readable text generation possible:
we can output a multi-language rules catalog
in multiple formats (text, markdown, HTML, etc.)
We generate a HTML validation rules catalog,
grouped by insurers and by insurance product
The syntax tree makes it possible to generate the rule as text. Notice how the elements from the tree are tokenized (operator, fields, etc.)
Also, the syntax tree makes it possible to see all the rules that applies for a specific field, for example the driver's date of birth.
The syntax tree is localized for left side elements (fields) and operators via MessageBundle
.
// User.java
@SamplePath(field = SampleFieldId.FIRST_NAME,
readable = "user.first.name")
private String firstName;
// SampleResourceBundle_en_US.properties
user.first.name = user first name
// SampleResourceBundle_fr_FR.properties
user.first.name = prénom utilisateur
You can also specify the text directly in the readable
field.
You can use ValidationRule#readable(Locale)
and Result#getFailureCause(Locale)
to specify a locale
// Output in default Locale.getDefault()
String readable = DOOV.when(userFirstName.isNotNull())
.readable())
System.out.println("> " + readable);
> when first name exists
// Output in french
String readable = DOOV.when(userFirstName.isNotNull())
.readable(Locale.FRANCE))
System.out.println("> " + readable)
> lorsque prénom utilisateur existe
During execution, each node of the AST captures context value and predicate result. We know at runtime which node failed, and why.
We make daily statistics that helps us shape the business,
by removing or tweaking rules as needed
We also rewrite the execution rules by simplifying the predicate tree, to show the minimal predicate that fails.
Validate that the profile has an email with less than 20 characters, is at least 18 years old when the country is France, and the country is France when the phone number starts with '+33'
DOOV.when(accountEmail.length().lesserThan(20)
.and(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)))
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33"))))
.validate();
model.getAccount().setEmail("test@test.org");
model.getAccount().setCountry(Country.FR);
model.getUser().setBirthDate(LocalDate.now().minusYears(19));
ValidationRule rule = DOOV
.when(accountEmail.length().lesserThan(20)
.and(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)))
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33"))))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> account phone number starts with '+33'
Validate that the profile is least 18 years old, the country is France, the phone number starts with '+33', is at least 21 years old when their country is Canada, and their phone number starts with '+1'
DOOV.when(matchAny(
matchAll(userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33")),
matchAll(userBirthdate.ageAt(today()).greaterThan(21),
accountCountry.eq(Country.CAN),
accountPhoneNumber.startsWith("+1"))))
.validate();
model.getUser().setBirthDate(LocalDate.now().minusYears(22));
model.getAccount().setCountry(Country.FR);
ValidationRule rule = DOOV
.when(matchAny(
matchAll(userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33")),
matchAll(userBirthdate.ageAt(today()).greaterThan(21),
accountCountry.eq(Country.CAN),
accountPhoneNumber.startsWith("+1"))))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> match any [account phone number starts with '+33',
match all [account country = CAN,
account phone number starts with '+1']]
By default, predicate evaluation in dOOv behaves like Java: it short-circuits. This can be disabled to execute all nodes, even if they don't impact the end result.
We use JMH to check the performance of the DSL
Benchmark Mode Samples Mean Mean error Units
o.m.BenchmarkOldRule.valid_email thrpt 25 1860.553 42.269 ops/ms
o.m.BenchmarkRule.valid_email thrpt 25 1733.465 18.461 ops/ms
Performance of the DSL and POJO code are very close
Running the Bean Validation benchmark:
dOOv is faster in every category (hint: reflection API)
Visit our blog for details: https://beastie.lesfurets.com
Bean Validation rules are not strongly typed since it's annotation based. This code will fail at compile time, but your IDE won't be able to tell you why.
public class Account {
@NotNull @Email
private Email email;
}
Because Bean Validation constraints are based on field annotation, cross validation between fields are only available through the extension mechanism.
public class Account {
@Pattern(regexp = "(FR)|(UK)")
private String country;
@Pattern(regexp = "???")
private String phoneNumber;
}
Bean Validation rules are not written with a natural language syntax and does not provide a syntax tree
@Size(min = 10, max = 200,
message = "About Me must be between 10 and 200 characters")
private String aboutMe;
userAboutMe().length().between(10, 200).validate().readable()
> When user about me length is between 10 and 200, validate
We migrated our 492 business rules to dOOv,
we now have compliance, auditability, governance, clarity
(and more!)
Next step is extending the DSL to create an object to object mapping framework, Domain Object Oriented Mapping (dOOm). It will feature the same AST to text and statistics functionnalities.
DOOV.map(userEmail().to(insurerEmail())
.map(userFirstName(), userLastName())
.using(StringJoiner)
.to(insurerFullName())
.when(userCountry().eq(FR))
.map(userPhone().to(insurerPhone()))
Stay tuned for the next versions!
Validate that a profile
has an email with less than 20 characters
has at least 18 years when their country is France
their country is France when their phone number starts with '+33'
DOOV.when(accountEmail.length().lesserThan(20)
.and(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)))
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33"))))
.validate();
model.getAccount().setEmail("test@test.org");
model.getAccount().setCountry(Country.FR);
model.getUser().setBirthDate(LocalDate.now().minusYears(19));
ValidationRule rule = DOOV
.when(accountEmail.length().lesserThan(20)
.and(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)))
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33"))))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> account phone number starts with '+33'
Validate that a profile
has at least 18 years when their country is France
and their phone number starts with '+33'
has at least 21 years when their country is Canadian
and their phone number starts with '+1'
DOOV.when(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33")))
.or(userBirthdate.ageAt(today()).greaterThan(21)
.and(accountCountry.eq(Country.CAN)
.and(accountPhoneNumber.startsWith("+1")))))
.validate();
model.getUser().setBirthDate(LocalDate.now().minusYears(22));
model.getAccount().setCountry(Country.FR);
ValidationRule rule = DOOV
.when(userBirthdate.ageAt(today()).greaterThan(18)
.and(accountCountry.eq(Country.FR)
.and(accountPhoneNumber.startsWith("+33")))
.or(userBirthdate.ageAt(today()).greaterThan(21)
.and(accountCountry.eq(Country.CAN)
.and(accountPhoneNumber.startsWith("+1")))))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> account phone number starts with '+33'
or (account country = CAN and
account phone number starts with '+1')
Validate that a profile
has at least 18 years when their country is France
and their phone number starts with '+33'
has at least 21 years when their country is Canadian
and their phone number starts with '+1'
DOOV.when(matchAny(
matchAll(userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33")),
matchAll(userBirthdate.ageAt(today()).greaterThan(21),
accountCountry.eq(Country.CAN),
accountPhoneNumber.startsWith("+1"))))
.validate();
model.getUser().setBirthDate(LocalDate.now().minusYears(22));
model.getAccount().setCountry(Country.FR);
ValidationRule rule = DOOV
.when(matchAny(
matchAll(userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33")),
matchAll(userBirthdate.ageAt(today()).greaterThan(21),
accountCountry.eq(Country.CAN),
accountPhoneNumber.startsWith("+1"))))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> match any [account phone number starts with '+33',
match all [account country = CAN,
account phone number starts with '+1']]
Validate that a profile country is Canadian or French
DOOV.when(accountCountry.anyMatch(Country.CAN, Country.FR))
.validate();
model.getAccount().setCountry(Country.UK);
ValidationRule rule = DOOV
.when(accountCountry.anyMatch(Country.CAN, Country.FR))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> account country != UK
Validate that a profile match at least two conditions :
DOOV.when(count(
userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33")).greaterThan(1))
.validate();
model.getUser().setBirthDate(LocalDate.now().minusYears(19));
model.getAccount().setCountry(Country.CAN);
model.getAccount().setPhoneNumber("1 23 45 67 89");
ValidationRule rule = DOOV
.when(count(
userBirthdate.ageAt(today()).greaterThan(18),
accountCountry.eq(Country.FR),
accountPhoneNumber.startsWith("+33"))
.greaterThan(1))
.validate();
Result result = rule.withShortCircuit(false)
.executeOn(wrapper);
System.out.println("> " + result.getFailureCause());
> account country = FR and account phone number starts with '+33'


Ciprian Chichirita
<EMAIL_ADDRESS>| Title 1 | Title 2 |
|---|---|
| c1 r1 | c2 r1 |
| c1 r2 | c2 r2 |
table 2x2
Title 1
Title 2
c1 r1
c2 r2
c1 r2
c1 r2
| Title 1 | Title 2 |
|---|---|
| c1 r1 | c2 r2 |
| c1 r2 | c1 r2 |
| c1 r3 |
table - colspan
Title 1
Title 2
c1 r1
c2 r2
c1 r2
c1 r2
c1 r3
| Title 1 | Title 2 | Title 3 |
|---|---|---|
| c1 r1 | c2 r2 | c3 r1 |
| c1 r2 | c1 r2 |
table - rowspan
Title 1
Title 2
Title 3
c1 r1
c2 r2
c3 r1
c1 r2
c1 r2
SVG as image
Custom elements are new types of DOM elements that can be defined by authors
web components
polymer
needs a dash in it's name
shadow DOM
success!
☐ have the entire homework on codepen (create an account there too)
☐ contact page - add these fields (mandatory):
☐ sex (use radio buttons): three values: male, female, unspecified
☐ eye color (drop-down): amber, blue, brown, gray, green
☐ stats (checkboxes) with: over 1.5m height, over 80 kg,
☐ add a date input
☐ make github account (optional)
☐ install or check to see if you have git instaled inside WSL (git --version to check)
☐ create a public repo on github named: "web-training"
☐ link your account using ssh keys


filmcritic.com presents a review from staff member Athan Bezaitis. You can find the review with full credits at http://www.filmcritic.com/misc/emporium.nsf/2a460f93626cd4678625624c007f2b46/81c3df2014250f48882568650020730c?OpenDocument
THE EMPEROR AND THE ASSASSIN: A film review by Athan Bezaitis Copyright Filmcritic.com 2000
THE EMPEROR AND THE ASSASSIN sets a new standard for quality of production. The story, costumes, sets, music, and performances all have such a powerful authenticity that after watching it, I felt like I had just lived through a two-thousand year old episode of Chinese history. Director Chen Kaige's (YELLOW EARTH, TEMPTRESS MOON) film lives up to its billing and is a worthwhile success (not to mention the most expensive Asian film ever produced).
Set in third century BC, THE EMPEROR AND THE ASSASSIN is the story of Ying Zheng (Li Xuejian), leader of the Kingdom of Qin, whose goal is to conquer the six other kingdoms of China and merge them into one unified land. To accomplish this objective, he embarks upon a horrific reign of terror and brutality against all who stand between him and his destiny.
In an attempt to aid Zheng's conquering of China, Lady Zhao, (Gong Li) his lover since childhood, devises an intricate fake assassination plot against him, which, when "uncovered," will provide him with a legitimate excuse to invade the neighboring kingdom of Yan, his greatest obstacle to unification. When Zheng betrays her trust and invades her homeland of Zhao killing thousands including innocent children, she turns against him. As part of the original scheme to be in exile in the kingdom of Yan, she encounters Jing Ke (Zhang Fengyi), a great warrior and former assassin. They fall madly in love and she attempts to convince him, along with The Prince of Yan, to kill the King of Qin before he becomes Emperor and continues his tyranny.
The story is a bit confusing because so much is lost in the translation from Mandarin, but pay close attention, and you'll be able to follow along. What I found most enjoyable about the film was its character portrayals within the context of a historical deconstruction. From the assassin, Jing Ke, to the power-hungry Ying Zheng, the emotions and reactions are surprisingly humanistic, and I could easily relate, even though the plot takes place two thousand years ago, and is part of a civilization totally different than our own. For example, Jing Ke is an assassin who is able to recognize the wrong in killing through the power of love and rises against King Zheng. Also, Lady Zhao is a woman who, in her naiveté, believed that a benevolent leadership under a united emperor would stop the bloodshed that the people of China had faced for hundreds of years. These endearing characters, most of which are fictional, blend in perfectly with the historical setting and add the much-needed element of passion into the dramatic mix of the story.
THE EMPEROR AND THE ASSASSIN is not to be missed. It breaks from the typical American mold with its slow developing plot and strenuous length (over two and a half hours), but captures the quality of the finest homegrown products reminiscent of BRAVEHEART or DANCES WITH WOLVES. Indulge yourself in an in this epic rendition of a tumultuous episode of ancient Chinese history.
4 stars **** Starring: Gong Li, Zhang Fengyi, Li Xuejian, Sun Zhou, Lu Xiaohe, Wang Zhiwen, Chen Kaige, Gu Yongfei, Zhao Benshan, Ding Haifeng Director/Writer: Chen Kaige Producer: Satoru Iseki, Shirley Kao, Philip Lee Screenplay: Wang Peihong MPAA rating: R Year of Release: 1999
-- Christopher Null -<EMAIL_ADDRESS>- http://www.filmcritic.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


No description available.
*
Parses a JSON string.
string
The string to parse.
*
The parsed value.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
Converts a value to its JSON representation.
*
The value to convert.
string
The value's JSON representation.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
Whether to enable debug mode.


curl_escape - URL encode the given string
NAME
curl_escape - URL encodes the given string
SYNOPSIS
#include <curl/curl.h>
char *curl_escape( const char * url , int length );
DESCRIPTION
Obsolete function. Use curl_easy_escape instead!
This function will convert the given input string to an URL encoded string and return that as a new allocated string. All input characters that are not a-z, A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a two-digit hexadecimal number).
If the 'length' argument is set to 0, curl_escape() will use strlen() on the input 'url' string to find out the size.
You must curl_free() the returned string when you're done with it.
AVAILABILITY
Since 7.15.4, curl_easy_escape should be used. This function will be removed in a future release.
RETURN VALUE
A pointer to a zero terminated string or NULL if it failed.
SEE ALSO
curl_unescape, curl_free, RFC 2396
This HTML page was made with roffit.


Applications
Lists of Applicants
| First Name | Last Name | Admin | Branch | Contact | Date Applied | Status | Action |
|---|---|---|---|---|---|---|---|
| First Name | Last Name | Admin | Branch | Contact | Date Applied | Status | Action |


This HTML/CSS + JavaScript based calculator is among my first few front end projects, that I made while learning JavaScript at FreeCodeCamp.com. Using this calculator you can chain and evaluate an expression using operators and parenthesis, and the calculator also prevent's you from entering incorrect syntax. The codepen link to this project is http://codepen.io/parag-agarwal/pen/obdRNR


Please, select one of
the following options
Search Doctor
Search Patient
Appointments
Doctor's Schedule
{% if error %}
Error:
{{ error }}
{% endif %}


{% extends "app/layout.html" %} {% block content %} {% load staticfiles %}
Use this area to provide additional information.
Our thoughts and capabilities keep growing, and so does the school. Every day of every year, we
strive to make better education available to more and more people, and today we have a great big
school as a reward for all our efforts.
St. Thomas today comprises of about 3800 students and 150 teachers along with 35 staff members,
currently in the school, not to mention the thousands of alumni and ex-faculty still a very integral
part of the community. The school has grown much in size and infrastructure, and presents better
facilities to its students and teachers for easier and more effective education, including digital
learning, well furnished hands on labs and extensive libraries.
In our pursuit to make education available to all, we have expanded out to a branch, St. Thomas
Hardag, a community funded school for the poor. We hope that the extension will soon pick up pace
and be able to provide high quality education to those who had far too much brains but not the
resources to get it.
Welcome to St. Thomas School, Ranchi, a premier educational institutions in the capital of Jharkhand,
India. With the principal motive of all-round development of each of its students, this school has been
fulfilling its motto - "Formation of Good, Effective & Creative Citizens" for over 41 years. St
Thomasians have made their mark all over the world, and changed it for the betting in every field.
St. Thomas School, established in 1972 by Marthoma Educational Society, Bihar (Ranchi) of the Mar
Thoma Syrian Church, Ranchi, is Committed to Excellence. We do aim to model
curriculum that enables children to find their voices, nurture their curiosity to do stuff,
to ask questions and to pursue investigations, sharing and integrating their experiences with school
knowledge, rather than solely rely on ability to reproduce textual knowledge.
Join hands with the St. Thomas fraternity, identify with us in pushing the boundaries of education
to establish a a better future for our children.
Know more about the School, Visit our Website


New Jersey woman convicted of vehicular homicide for texting while driving
by Morgan PhillipsFor the first time in New Jersey, a Monmouth County jury on Friday found a woman guilty of vehicular homicide for texting while driving.
Prosecutors said Alexandra Mansonet, 50, was distracted by a text about dinner plans when she rear-ended another car, causing it to strike 39-year-old Yuwen Wang as she was crossing the street in September 2016. Wang died five days later.
Mansonet’s sentencing is scheduled for Jan. 31 and she’ll remain free until then. She faces up to 10 years in prison and will have to serve at least 85 percent of her sentence before she is eligible for parole.
Mansonet said that she’d read the text about dinner plans before turning on her vehicle. She said she was looking down to turn on her rear defogger when she stuck the other car. But prosecutors said the text was marked as “read” a little more than a minute before the crash and though unanswered, the letters “M” and “e” were typed.
Investigators said Mansonet received a text from her sister-in-law asking what kind of food she wanted for dinner.
“Cuban, American or Mexican. Pick one," the text said.
NEW JERSEY MAN ARRESTED FOR ALLEGEDLY STABBING GRANDMOTHER TO DEATH: PROSECUTORS
Prosecutors argued the “Me” response was the beginning of a longer answer.
Defense attorney Steven Altman said he was disappointed with the verdict, according to the Asbury Park Press.
"It's going to be very difficult for her to deal with the fact that at sentencing, she could possibly be incarcerated for something we are all guilty of on a daily basis," Altman said, referring to texting and driving and appearing to contradict Mansonet’s claim that she was turning on her defogger.
NEW JERSEY WOMAN SENTENCED TO 6 YEARS FOR KILLING IDENTICAL TWIN
Wang, who had gone for a walk while on a break from her job, flew into the air after she was hit.  She suffered severe brain trauma and died on Oct. 3, 2016.
The case was the first in New Jersey to go to trial since New Jersey went “hands free” in 2012, saying that the use of a handheld phone while driving is a reckless act that can form the basis for a vehicular homicide prosecution. Others have been charged under the law, but they’ve resolved their cases with guilty pleas.
Wang’s widower, Steven Qiu, said the guilty verdict brings “a lot of comfort” to him and his family. He said he hopes New Jersey does more to prevent motorists from texting while driving so that his wife did not die in vain.
CLICK HERE TO GET THE FOX NEWS APP
"I hope more people can realize the consequences of texting and driving,” Qiu said, adding that he and his wife were hoping to start a family, and now those dreams have been crushed.


C:\cs151\chap80>java Square Enter an integer: rats Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at Square.main(Square.java:12) C:\cs151\chap80>
The stack trace tells the story:
the user entered rats which Scanner
could
not convert to an integer, so an Exception was thrown.
Nothing is wrong with the program.
The problem is with the data.
nextInt()
cannot convert
"rats" into an int
.
When nextInt()
found the problem it
threw an InputMismatchException
.
The Java run-time system caught the exception,
halted the program, and printed the error messages.
An exception is a problem that occurs when a program is running. Often the problem is external to the program, such as bad user input, or mechanical failure of an I/O device. When an exception occurs, the Java virtual machine creates an object of class Exception which holds information about the problem.
A Java program itself may
catch an exception.
It can then use the Exception
object
to recover from the problem.
An error, also, is a problem that occurs
when a program is running.
An error is represented by an object of class Error
.
But an error is too severe for a program to handle.
Most application programs must stop running.
(Thought question:) Are Error
objects and
Exception
objects related?


Note
Click here to download the full example code
Words¶
Words/Ladder Graph¶
Generate an undirected graph over the 5757 5-letter words in the
datafile words_dat.txt.gz
. Two words are connected by an edge
if they differ in one letter, resulting in 14,135 edges. This example
is described in Section 1.1 in Knuth’s book (see [1] and [2]).
References¶
| [1] | Donald E. Knuth, “The Stanford GraphBase: A Platform for Combinatorial Computing”, ACM Press, New York, 1993. |
| [2] | http://www-cs-faculty.stanford.edu/~knuth/sgb.html |
# Authors: Aric Hagberg (hagberg@lanl.gov),
# Brendt Wohlberg,
#<EMAIL_ADDRESS># Copyright (C) 2004-2018 by
# Aric Hagberg<EMAIL_ADDRESS># Dan Schult<EMAIL_ADDRESS># Pieter Swart<EMAIL_ADDRESS># All rights reserved.
# BSD license.
import gzip
from string import ascii_lowercase as lowercase
import networkx as nx
#-------------------------------------------------------------------
# The Words/Ladder graph of Section 1.1
#-------------------------------------------------------------------
def generate_graph(words):
G = nx.Graph(name="words")
lookup = dict((c, lowercase.index(c)) for c in lowercase)
def edit_distance_one(word):
for i in range(len(word)):
left, c, right = word[0:i], word[i], word[i + 1:]
j = lookup[c] # lowercase.index(c)
for cc in lowercase[j + 1:]:
yield left + cc + right
candgen = ((word, cand) for word in sorted(words)
for cand in edit_distance_one(word) if cand in words)
G.add_nodes_from(words)
for word, cand in candgen:
G.add_edge(word, cand)
return G
def words_graph():
"""Return the words example graph from the Stanford GraphBase"""
fh = gzip.open('words_dat.txt.gz', 'r')
words = set()
for line in fh.readlines():
line = line.decode()
if line.startswith('*'):
continue
w = str(line[0:5])
words.add(w)
return generate_graph(words)
if __name__ == '__main__':
G = words_graph()
print("Loaded words_dat.txt containing 5757 five-letter English words.")
print("Two words are connected if they differ in one letter.")
print("Graph has %d nodes with %d edges"
% (nx.number_of_nodes(G), nx.number_of_edges(G)))
print("%d connected components" % nx.number_connected_components(G))
for (source, target) in [('chaos', 'order'),
('nodes', 'graph'),
('pound', 'marks')]:
print("Shortest path between %s and %s is" % (source, target))
try:
sp = nx.shortest_path(G, source, target)
for n in sp:
print(n)
except nx.NetworkXNoPath:
print("None")
Total running time of the script: ( 0 minutes 0.000 seconds)


[gecode-users] NaryUnion, infinite loop
Jean-Noël Monette
jean-noel.monette at it.uu.se
Thu Mar 29 10:56:00 CEST 2012
Hello,
Here is a new problem I came across with NaryUnion. As suggested by
Christian, I created a fresh region for every new NaryUnion, however I
ran into an infinite loop. Below is a minimal example. I located the
infinite loop inside the "two(I& i, J& j)" method of NaryUnion, and the
reason seems to be that, after the call to "RangeList* t = range(j)" in
the "else if" block (I unfortunately cannot give you line numbers as I
messed around with print statements), "i.c" and "t" point to the very
same RangeList (while they should not). I'm not expert enough to go
deeper/further...
Notice that this appears only when region2 is created in a block (in
real code, it would be inside a "for" or a "if"), however there is no
influence if it is actually used or not.
I guess it is again related to the Region implementation that is going
to change, but I think it is worth mentioning it anyway.
Jean-Noël
#include "gecode/driver.hh"
#include "gecode/iter.hh"
using namespace Gecode;
class MySpace:public Space {
public:
virtual Space* copy(bool share){return this;}
};
int main(int argc, char* argv[]){
MySpace home;
Iter::Ranges::Singleton dom0(3,3);
Iter::Ranges::Singleton dom1(1,1);
Region region1(home);
Iter::Ranges::NaryUnion u0;
{
Region region2(home);
u0 = Iter::Ranges::NaryUnion(region2,dom0);//or using region1
}
Iter::Ranges::NaryUnion u1(region1,u0,dom1); //loops forever
/*or
* Region region3(home);
* Iter::Ranges::NaryUnion u1(region3,u0,dom1);
*/
return 0;
}
More information about the users
mailing list


We are partnering with Airbnb to make sure that all residences are clean from Covid-19, and will provide a discount to help you sanitize your home.
So far, 90% of clients have chosen the cleaning discount. This keeps homes safe!
We will continue to support those who use our app, in whatever way possible.
By all doing our part, we can help others. We can keep our homes safe, and we can also sleep well knowing that our homes are covid-free.
We realize in these challenging times, that we are all doing the best that we can!


Mauricio Munoz Valtierra
About Me!
My name is Mauricio Munoz. I am a second year computer science major at UC Santa Barbara and am currently an undergraduate research intern @ UCSB Quantum Foundry Lab.
I was born in Aguascalientes, Mexico, but I moved to California when I was 3. I have lived in Montclair previously and currently in Bloomington, CA which is not a well known city.  I love dogs and my dream dog is a Golden Retriever which I plan on getting once I graduate! A fun fact about me is that I have never broken a bone.
My Interests
Star Wars
I loved Star Wars as a kid and I have once again started to get interested once again. I loved the first six movies and have mixed emotions on the final 3. My favorite character is Captain Rex. Lego Star Wars sets has also carried on from my childhood. My dream has been to build a Lego Death Star since I was a kid and I hope to some day accomplish it.
Video Games
In my free time I love playing video games. I have mostly played multiplayer games but have recently been interested in offline story games. My favorite game to play during quaratine has been Red Dead Redemption 2. I also play overwatch. Feel free to add me on Discord if you would like to play! mmunoz33#7280
Sports
I love playing sports! I am always up for a challenge and love to win! My favorite sport is baseball. I started playing baseball when I was in elementary school and continued playing until I graduated high school. Now I am limited with school and only have time to play catch with my friends. If you are interested in performance, I topped out on the mound at 85 mph my senior year of high school where I pitched and played 3rd base. Not the best, but some players definitely had trouble catching up to it.
Experience
Undergraduate Research Intern @ UCSB Quantum Foundry {July 2020 - Present}
- Use Python to download thousands of academic papers to prepare for Natural Language Processing applications in material sciences
- Use Academic Journal APIs to learn how to navigate journal metadata
- Use Julia to train a convolutional neural network to identify COVID-19 in chest x-rays using COVIDx Database
- Create plan to reach 90% accuracy on COVIDx identification
Medical Diagnostic Database - SHPE Innovation Challenge 2020
- Worked with a group of 4 to create a prototype website designed to aid medical professionals in determining correct diagnosis of commonly misdiagnosed diseases in a 48 hour time limit.
- Used HTML and CSS to create landing and result page


Home
My Missions
History
1.0 Version - Agu 2018
Notificactions
Jhon Doe
View Profile
Paydment Method
Settings
1.0 Version - Agu 2018
Select Product or Service
Search
Search for misions to join!
Select Product or Service
Search
ACTIVE MISSION
CALENDAR
CALENDAR
ACTIVE MISSION
TRANSPORTATION
Missions
5
SERVICES
Missions
5
CONSUMER GOODS
Missions
5
JEWELRY
Missions
5
REAL STATE
Missions
5
MISCELLANEOUS
Missions
5
Create a new mission
Mission the Day
×


A simplified description of the set of expressions for AGREE is presented below.
RelateOp::=
'<' | '<=' | '>' | '>=' | '=' | '<>' | '!=';
QID::= ID '::' ID ;
NestedDotID ::= ID ('.' NestedDotID)? ;
Literal :: = Boolean_literal | Integer_literal | Real_literal ;
Expr ::= Literal
| ID
| QID
| NestedDotId
| ID '(' Expr_List ')'
| 'pre' '(' Expr ')'
| 'prev' '(' Expr ',' Expr ')'
| 'event' '(' NestedDotID ')'
| 'floor' '(' Expr ')'
| 'real' '(' Expr ')'
| 'Get_Property' '(' Expr ',' AADL_Property ')'
| 'this' ('.' NestedDotId)?
| '(' Expr ')'
| RecordUpdateExpr
| ('-' | 'not') Expr
| Expr ('+' | '-' | '\*' | '/' | 'div'| 'mod') Expr
| Expr RelateOp Expr
| Expr ('and' | 'or' ) Expr
| Expr ('->' | '=>' | '<=>' ) Expr
| 'if' Expr 'then' Expr 'else' Expr ;
Expr_List ::= Expr ',' Expr_List | Expr ;
The order of precedence (from lowest to highest) is as follows:
->
=>
<=>
or
and
< | <= | > | >= | = | <> |!=
+ | -
* | / | div | mod
unary minus | not
if then else
prev | next | Get_Property
ID | QID | NestedDotID | Literal | pre | this | ()
Therefore, x + if y then a else b * prev(z.f - 1, 0)
would be parsed as follows:
x + (if y then a else (b * (prev((z.f) – 1, 0))))
The meaning of the arithmetic, relational, and Boolean operators is straightforward. If/then/else is an expression, not a statement; it behaves like the ?
operator in Java. So, users can write:
x = if (b) then y else z ;
Expressions reason about the current state or past states of variables and can reference variables defined in equation statements or other identifiers in the AADL model. In the rest of this section, we describe different types of expressions in the order they are listed as alternatives to the grammar rule for Expr.
ID expressions are used to reference different AADL objects as well as AGREE variables and constants. Constants or variables must be defined locally (in the AGREE annex block or the enclosing definition), and they can be referred to by a single identifier ID.
Enumerator expressions are ID expressions referencing an enumerator literal. However, the syntax differs between enumerations defined in AADL and enumerations defined in AGREE. For AGREE enumerations, enumerator expressions are merely ID expressions naming enumerator values. Using the types defined in Enumeration Types the use of spade
, heart
, club
, and diamond
as identifiers are all valid AGREE enumeration expressions.
For AADL enumerations a special syntax is required. The enum
keyword followed by the enumeration type and enumerator name is used as follows:
enum(Package::Color, Red)
A NestedDotID expression can have dots in between ID expressions, e.g., food.bar.biz
. It can be used to refer to record types or variables of a subcomponent. For example, one could use the NestedDotID expression foo.bar to reference the input, output, or equation variable bar
of subcomponent foo
within the implementation of some AADL component. A NestedDotID expression can also be used for inputs and outputs that are of record type: if x
is a record type containing field y
, then the notation x.y
is used.
A node call expression is an ID of a defined node followed by parenthesis. If the node is defined in an AADL Package, then the ID should be the AADL Package name followed by a dot (.) and then the node name.
A Linearization Call Expression is an ID of a defined linearization expression followed by parenthesis. If the linearization expression is defined in an AADL Package, then the ID should be the AADL Package name followed by a dot (.) and then the ID for the expression. For the example linearization expression provided in Linearization Definitions, its ID "sq" can be used in other expressions like a non-recursive, pure function call. The following lemma statement provides one such example.
eq y : real;
lemma "sq() range positive" : sq(y) <= -0.10;
Arrow Expression. The arrow expression evaluates to the value of the expression of the left hand side of the arrow on the initial step. Otherwise it evaluates to the value of the expression on the right hand side of the arrow. The arrow expression is used with the pre expression to reason about past values of variables. For example, we can define a variable in an AGREE contract that starts at zero and increments by one each step in time using an equation statement:
eq count: int = 0 -> pre(count) + 1;
Previous Value Expression. A previous value expression evaluates to the value of its argument on the previous time frame. It should that it be guarded by an arrow expressions as its value is undefined on the initial step.
The previous value expression defines an initialized stream. So, if we write:
eq x : int = prev(y + 1, 0);
In the initial instant, x
is equal to 0. In all subsequent instants, x
is equal to the previous value of y + 1
. If we examine the evolution of x
and y
over a time window of ten steps, it is relatively straightforward to see.
| Time Instant | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| y | 4 | 5 | 8 | 7 | 3 | 12 | 6 | 9 | 1 | 3 |
| y+1 | 5 | 6 | 9 | 8 | 4 | 13 | 7 | 10 | 2 | 4 |
| x | 0 | 5 | 6 | 9 | 8 | 4 | 13 | 7 | 10 | 2 |
The arrow (->
) operator is the stream initialization operator. Given an expression x -> y
, in the initial instant in time, the value is equal to x
. In all subsequent instants, it is equal to y
. So, suppose we have:
eq x : bool = (false -> a);
Then, in the first instant in time, x
will be assigned "false" and in every other instant in time, it will be assigned "a".
Note: A common mistake is to mis-type ->
for =>
(and vice-versa). This will often cause your model to return incorrect results. Please check for this error.
The =>
operator is the implication operator: if you write:
a => b
then a
and b
are expected to be Boolean expressions and the meaning of the operator is equivalent to (not a) or b
. So, writing:
x = (false => a)
Will assign x
to true in all time instants.
The pre expression is an uninitialized pre expression. Its value is undefined in the initial instant. This expression is expected to be used in combination with the arrow expression; this can yield expressions that are, on occasional, more terse than using the prev expression. However, the following equivalence always holds for arbitrary expressions x
and y
:
prev(x, y) <=> (y -> pre(x))
For novice users, we recommend using the initialized prev expression as it is less error prone than the ->
pre combination.
An event expression is a special predicate that is used to reason about AADL event data ports. For an input event data port, its semantics are such that it evaluates to true if a value is present on the event port and false otherwise. For an output event data port, its semantics are such that it evaluates true if data is being sent on the port and false otherwise.
A floor expression takes an expression of type real as an argument and returns an int equal to the floor of the number.
A real expression takes an expression of type int as argument and returns a real equal to its value.
A get property expression allows a user to reason about values of AADL properties in the model. The first argument is the relative path to an AADL component in the instance model or 'this' if the property exists in the component in which get property statement lives. The second argument is the name of the AADL property.
An Unary Minus expression is used to negate integer or real valued expressions.
A Not Expression is used to negate boolean valued expressions.
In AGREE a record type is either an AADL Data Type Implementation containing Data subcomponents or may be defined directly in the AGREE annex as follows:
type foo = struct {a : bool, b : int};
eq bar : foo;
A record expression constructs a value that may be assigned to a variable of record type.
eq bar2 : foo = foo { a = true; b = 6 };
Record Update Expression are assignments to all or a specific field of a record type variable. For example, bar2 {a := false}
is a valid Record Update Expression, given definition for type foo
and variable bar2
as above.
The record update expression expects an expression of record type on the left hand side of the curly braces. It returns the same record as the left hand side expression except with its member IDs set to the value of the expression on the right hand side of the :=
;
Arithmetic operations must be performed on expressions of the same type. They follow the standard order of precedence.  Some theorem provers do not reason about non-linear expressions. Non-linear integer arithmetic is undecidable and most theorem provers do not use a decidable decision procedure for non-linear real arithmetic. So it is recommended that you only use linear expressions.
Relation expressions can be performed on integers or reals, but not a combination of both. Equality can be used on Booleans as well.
Boolean expressions have the standard associative properties and order of precedence.


{% extends "splunkdj:base_with_app_bar.html" %} {% load splunkmvc %} {% block title %}Search Managers - Web Framework Toolkit{% endblock title %} {% block css %} {% endblock css %} {% block content %}
Search is a core feature of the Splunk Web Framework. Most of the framework views can be bound to a search in various ways. Some views are populated by searches, some modify the searches they are bound to, and some do both.
Each search is represented by a manager that manages the query, properties, operation, and lifetime of an individual search job. You can create search managers using Django template tags or JavaScript. The types of search managers corresond to the types of search:
A SearchManager (declared with the {% searchmanager %}
Django template tag) represents a search manager for a search job, which can be generated dynamically or hard coded. The search
property corresponds to the search query. Here is an example of declaring a SearchManager for a search that counts the events in the internal index:
var SearchManager = require("splunkjs/mvc/searchmanager"); new SearchManager({ id: "search1", search: "index=_internal | stats count by sourcetype" });
{% searchmanager id="example-search" search="index=_internal | stats count" %}
To bind a search manager to a view, provide the manager's unique ID in the view's managerid
property. For example, to create a chart that is bound to the previous search manager:
var ChartView = require("splunkjs/mvc/chartview"); new ChartView({ id: "example-chart", managerid: "example-search", el: $("#divToHangOn") }).render();
{% chart id="example-chart" managerid="example-search" type="line" %}
You can set the following properties using templates tags or JavaScript. These search manager options do not affect the search job on the Splunk server.
app
: Sets the namespace (the app context) to run in.
autostart
: When true
, the search manager automatically starts a new job when its properties have changed and when the page first loads (and the component_loader
is called). When false
, application code must call startSearch
manually to start a search.
cache
: When true
, the search manager always uses the results from a preexisting search job when possible. When false
, the search manager never uses results from preexisting search jobs. When n
, only search jobs that are newer than n seconds are used.
search
: The search query string.
sid
: The search job ID.
Additional properties can be set (in Django or Javascript) that modify the search job on the Splunk instance. For example, to set the latest_time
property:
var SearchManager = require("splunkjs/mvc/searchmanager"); new SearchManager({ id: "search1", latest_time: "now", search: "index=_internal | stats count by sourcetype" });
{% searchmanager id="example-search" search="index=_internal | stats count" latest_time="now" %}
For a complete list of search job options, see the SearchManager in the Component Reference.
The following events are fired by this search manager:
search:error
: Fired when an error occurs.
search:fail
: Fired when the search job fails.
search:progress
: Fired to indicate search progress.
search:cancelled
: Fired when the search is cancelled.
search:start
: Fired when the search is started.
search:done
: Fired when the search is completed and will return no more results. This event is never fired for real-time searches.
A SavedSearchManager (declared with the {% savedsearchmanager %}
Django template tag) corresponds to a saved report (by providing its ID) on a Splunk instance. Bind views to a SavedSearchManager the same way you'd bind to a SearchManager. For example, to bind a chart to a saved report called "example-saved-search":
var ChartView = require("splunkjs/mvc/chartview"); new ChartView({ id: "example-chart", managerid: "example-saved-search", el: $("#divToHangOn") }).render(); var SavedSearchManager = require("splunkjs/mvc/savedsearchmanager"); new SavedSearchManager({ id: "example-saved-search", searchname: "all100", });
{% chart id="example-chart" managerid="saved-search" type="line" %} {% savedsearchmanager id="saved-search" searchname="example-saved-search" %}
You can set the following properties using templates tags or JavaScript:
app
: Sets the namespace (the app context) to run in.
autostart
: When true
, the search manager automatically starts a new job when its properties have changed and when the page first loads (and the component_loader
is called). When false
, application code must call startSearch
manually to start a search.
cache
: When true
the search manager always uses the results from a preexisting search job when possible. When false
, it never uses results from preexisting search jobs. When n
, only search jobs that are newer than n seconds are used.
searchname
: The name of the saved report on the Splunk server.
The following events are fired by this search manager:
search:error
: Fired when an error occurs.
search:fail
: Fired when the search job fails.
search:progress
: Fired to indicate search progress.
search:cancelled
: Fired when the search is cancelled.
search:start
: Fired when the search is started.
search:done
: Fired when the search is completed and will return no more results. This event is never fired for real-time searches.
A PostProcessManager (declared with the {% postprocessmanager %}
Django template tag) provides a post-processed transformation of a parent search job. Bind views to a PostProcessManager the same way you'd bind to a SearchManager. This example shows how to use PostProcessManager with the SearchManager example to limit the view to only those events that originate from the splunk webserver:
var ChartView = require("splunkjs/mvc/chartview"); new ChartView({ id: "example-chart", managerid: "post1", el: $("#divToHangOn") }).render(); var SearchManager = require("splunkjs/mvc/searchmanager"); new SearchManager({ id: "search2", latest_time: "now", search: "index=_internal | stats count by sourcetype" }); var PostProcessManager = require("splunkjs/mvc/postprocessmanager"); new PostProcessManager({ id: "post1", managerid: "search2", search: "search sourcetype=splunk_web_access" });
{% chart id="example-chart" managerid="post1" type="line" %} {% searchmanager id="search1" search="index=_internal | stats count" latest_time="now" %} {% postprocessmanager id="post1" managerid="search1" search="search sourcetype=splunk_web_access" %}
A Post-Process Search is server-side transformation of the parent search, and has no options of its own.
The following events are fired by this post-process manager:
search:start
: Fired when the search is started.
search:progress
: Fired to indicate search progress.
search:error
: Fired when an error occurs.
search:fail
: Fired when the search job fails.
search:cancelled
: Fired when the search is cancelled.
search:done
: Fired when the search is completed and will return no more results. This event is never fired for real-time searches.


Assigning the best possible name
Everyone has heard the old joke that there are two hard things in programming.
- Cache Invalidation
- Naming things
- Off by one errors
This doesn’t have to be the case though. I currently am employed at a magazine company and was tasked with re-doing how we create magazines from the ground up. Each month our magazines have an issue go out, and an issue of course has many articles. Additionally, every issue has a few things that are in all issues, things like the cover, the table of contents, and a list of contributors. How we represent these in our data model is as a json object for each of them, so they all live together in one table. The hard part though was what to call them.
I put a lot of thought into it, trying to figure out the best word for their name. I thought of words like basic, every, always, and foundation. I knew the word I was looking for was something along these lines, but none of those words were a perfect fit for what I needed. Basic was close but not elegant sounding enough. Always and every were in the right category of words, but aren’t nouns. Foundation is alright but as we use foundation for styling, we didn’t want to run into problems when talking about things. I was about to give up and just call these things basics when I had an idea, use a thesaurus.
A thesaurus is generally thought of as a writer’s tool, not a programmer’s, but there’s nothing that says we can’t use it too. After a couple minutes of searching thesaurus.com, clicking on all the words that sounded close to what I want, as well as looking at antonyms for things that might help summon the word to my tongue I found the word I wanted, “Essential”. Covers, and table of contents are essential parts of a magazine, the word sounds fancier and more sophisticated than “Basic”, a perfect fit for the task at hand. I may have found the word on my own after spending a lot more time thinking, or perhaps I would have given up and kept a word that conveyed what I needed, but wasn’t a perfect fit. In the end, we made the table, and had a wonderful name for our things that were hard to talk about before. So next time you find naming things to be hard, try opening a thesaurus!
Tags: general programming naming variables


Contact Form
Checkout Form
Customer information
Payment information
Source: https://tailwindcomponents.com/component/checkout-form


Welcome
Kathleen Martin
My Profile
Dashboard
Active Signals
Visual Charts
Earnings
Events
Cloud Systems
System Settings
Logout
OVERVIEW
MY REPORTS
LEADERBOARD
MY PROJECTS
FORUM
SEARCH
MOUNTLY TRAFFIC
YEARLY
MOUNTLY
External
Internal
REFERRER
alexa.com
google.com
twitter.com
facebook.com
BOOKINGS
184
Reserved Booking
240
Advanced Booking
VIEW ALL
TASK
NEW
FINISHED TASKS
Labore et dolore magrna aliqua
Ut eno, ad minim veniam
HIGH PRIORITY
Mon, Apr 8
2 Days
Labore et dolore magrna aliqua
Ut eno, ad minim veniam
Mon, Apr 8
2 Days
Labore et dolore magrna aliqua
Ut eno, ad minim veniam
Mon, Apr 8
2 Days
footer


If you are the first one here, click the start link
If there is already a page you want to join, enter the code below


Fact: domain
Purpose:
Return the host's primary DNS domain name.
Resolution:
On UNIX (excluding Darwin), first try and use the hostname fact, which uses the hostname system command, and then parse the output of that. Failing that it tries the dnsdomainname system command. Failing that it uses /etc/resolv.conf and takes the domain from that, or as a final resort, the search from that. Otherwise returns nil. On Windows uses the win32ole gem and winmgmts to get the DNSDomain value from the Win32 networking stack.
Caveats:


A C D G H I K M P R S
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- actionPerformed(ActionEvent) - Method in class Snake.src.GamePanel
-
Everytime there an action it moves the snake and checks for collisions if the game isn't over it will repaint the game
C
- checkApple() - Method in class Snake.src.GamePanel
-
This method checks if the Snake has eaten the apple, if so the snake gets bigger, the score increases and another apple is spawned
- checkCollisions() - Method in class Snake.src.GamePanel
-
This function will check collisions beteween the snake's head with the body and all the borders of the screen
D
- draw(Graphics) - Method in class Snake.src.GamePanel
-
Calls the gameOver functions when the game isn't running anymore and also paints the snake blocks Also this method is used to paint lines to guide the user (if wanted)
G
- GameFrame - Class in Snake.src
-
Does the JFrame necessary to the game
- gameOver(Graphics) - Method in class Snake.src.GamePanel
-
Displays the GAME OVER text with the current score, high score of the user and a button to play again
- GamePanel - Class in Snake.src
-
The classic game Snake on Java!
- GamePanel.MyKeyAdapter - Class in Snake.src
-
KeyAdaptater that accpets input form W,A,S,D and Arrows
- getOsName() - Method in class Snake.src.GamePanel
-
Getting the OS name
- getOsName() - Static method in class Snake.src.SnakeGame
-
Getting the OS name
H
- highScoreDisplay(Graphics, boolean) - Method in class Snake.src.GamePanel
-
Displays the player High Score at game over
I
- isUnix() - Method in class Snake.src.GamePanel
-
Tells if the system is UNIX
- isUnix() - Static method in class Snake.src.SnakeGame
-
Tells if the system is UNIX
K
- keyPressed(KeyEvent) - Method in class Snake.src.GamePanel.MyKeyAdapter
-
Changes the direction (char) according to the input
M
- main(String[]) - Static method in class Snake.src.SnakeGame
-
Starts the game
- move() - Method in class Snake.src.GamePanel
-
Moves the snake head and body
- MyKeyAdapter() - Constructor for class Snake.src.GamePanel.MyKeyAdapter
P
- paintComponent(Graphics) - Method in class Snake.src.GamePanel
R
- rescueGame(String) - Method in class Snake.src.GamePanel
-
/** Returns an object that contains the game information
S
- saveGame(String) - Method in class Snake.src.GamePanel
-
Saves the game information in the temp folder
- scoreDisplay(Graphics) - Method in class Snake.src.GamePanel
-
Displays the players actual score on the top of the screen
- Snake.src - package Snake.src
- SnakeGame - Class in Snake.src
- SnakeGame() - Constructor for class Snake.src.SnakeGame
- spawnApple() - Method in class Snake.src.GamePanel
-
Spawns a new apple randomly in the game
- startGame() - Method in class Snake.src.GamePanel
-
Starts the game and spawns an apple
All Classes All Packages


The form classes create styled inputs and labels for use in forms.
The sky-form-control class consistently styles an input and allows it to fill the width of its container.
The sky-control-label class consistently styles the label for an input. For guidance on the wording for labels, see the form design guidelines.
The sky-control-label-required class indicates that an input is required to submit a form.
If a form field that uses Angular validation is in an invalid state, the input is styled with a red glow. The ng-invalid and ng-touched control status CSS classes indicate when the input is in an invalid state. For more information, see the Angular form validation docs.
In addition, the sky-error-label class provides styling for the error message when an input is in an invalid state. Place the message below the form field, and include logic to display the message when the conditions for invalid styling are met.
Enter a valid value.
Enter a valid value.
The sky-form-group class provides consistent vertical spacing between fields.


Forgot Where to Vote?
Find Your Way Now!Polling Site Locator can help you find what you need to get to your polling place on time.
Take Me There!Know exactly where you need to be and when.
Plan ahead with easy access Calendar Notifications.
Who represents you at every level of elected government? Use your political subdivision numbers to find out.


$C7AC/51116: Clear Directory Output Buffer Jump from $C73C, $C7BD, $C806: C7AC: A0 1B LDY #$1B C7AE: A9 20 LDA #$20 ; ' ' blank Jump from $C7B4: C7B0: 99 B0 02 STA $02B0,Y ; write in buffer C7B3: 88 DEY C7B4: D0 FA BNE $C7B0 C7B6: 60 RTS Previous Page / Next Page


Portfolio content
Volume
{{element.volume}}
Symbol
{{element.symbol}}
Acquired for
{{element.pricePaid | currency: element.currency}}
Value
{{element.value | currency: element.currency}}
Diff
0 ? 'gain' : 'loss'"> {{element.diff | percent: '1.1-3'}}
Total Diff
0 ? 'gain' : 'loss'"> {{element.totalDiff | currency }}
Total Worth
{{element.totalWorth | currency }}
Forecast
{{element.forecast | uppercase}}
No equities has been bought yet, Switch to the 'Portfolio Management' tab to issue orders.


Doctor Details
Dr. Jonathan Mathew
Dermatologist , Cosmetologist , Trichologist, Dermatosurgeon , Pediatric Dermatologist , Aesthetic Dermatology.
(MD, MBBS, Fellowship In Cosmetic Dermatology , ECAMS)
Mon - Sat
10.00 am - 07.00 pm
Sun
12.30 pm - 04.00 pm
Services Offered
Available Slots
You have choosen a 30 Min slot at 4.00PM.
Special Offers
LASER HAIR REMOVAL FOR FULL BODY
Laser hair removal is a process in which highly concentrated laser is absorbed by the hair follicles and destroys the hair without damaging the tissue. It is used to remove unwanted hair from face, arms, legs, underarms and other areas.
Included Treatments
Offer Valid from
20 January - 31 March ’16
OFFER CODE:LASER85
Reviews (13)Write a Review


Professional, accurate, efficient and continuous
Professional people do professional things
发布时间 : {$info.time} 浏览次数 : {$info.look}
{$info.content}


Copyright © 2013 Sylvain Oliver
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Table of Contents
The Next.Event library is an implementation of event dispatching. It defines :
The dispatcher manages a thread pool for sending event. Each event handler has a thread group and each thread group can handle events sequencialy ( without synchronization primitives as mutex )
Last revised: October 02, 2013 at 20:33:29 GMT |


LVM uses copy-on-write to implement snapshots. Whenever you're writing data to some page, LVM copies the original page (the way it looked like when the snapshot was taken) to the snapshot volume. The snapshot volume must be large enough to accommodate all pages written to for the duration of the snapshot's lifetime. In other words, you must be able to copy the data somewhere outside (tape, NFS, rsync, etc.) in less time than it would take for the snapshot to fill up.
While LVM allows for hot backups of MySQL, it still poses an impact on the disks. An LVM snapshot backup may not go unnoticed by the MySQL users.
Some general guidelines for making life easier with LVM backups follow.
Lighter, longer snapshots
If you're confident that you have enough space on your snapshot volume, you may take the opportunity to make for a longer backup time. Why? Because you would then be able to reduce the stress from the file system. Use ionice when copying your data from the snapshot volume:
ionice -c 2 cp -R /mnt/mysql_snapshot /mnt/backup/daily/20100719/
[Update: this is only on the cfq I/O scheduler; thanks, Vojtech]
Are you running out of space?
Monitor snapshot's allocated size: if there's just one snapshot, do it like this:
lvdisplay | grep Allocated Mon Jul 19 09:51:29 2010 Allocated to snapshot 3.63%
Don't let it reach 100%.
Avoid running out of space
To make sure you don't run out of snapshot allocated size, stop all administrative scripts.
- Are you running your weekly purging of old data? You will be writing a lot of pages, and all will have to fit in the snapshot.
- Building your reports? You may be creating large temporary tables; make sure these are not on the snapshot volume.
- Rebuilding your Sphinx fulltext index? Make sure it is not on the snapshot volume, or postpone till after backup.
You will gain not only snapshot space, but also faster backups.
Someone did the job before you
Use mylvmbackup: the MySQL LVM backup script by Lenz Grimmer. Or do it manually: follow this old-yet-relevant post by Peter Zaitsev.
comments powered by Disqus


Rock, Paper & Scissors
RULES
Click on rock, paper, or scissors on left part.
Rock
Paper
Scissors
Rock
Paper
Scissors
Restart


Installation
Cupper is built using the static site engine, Hugo, and NPM. The codebase is available to download on Github. Let’s get everything installed step-by-step.
Install Hugo
First you need to install Hugo globally.
 You can verify the installation was successful by typing:
hugo version
Windows users
Installing on Windows is a little more involved than on OSX. The authors of Hugo provide a guide with instructions for technical and less technical users.
It’s also best you install a Windows Subsystem for running Linux, and therefore bash (Cupper incorporates some bash commands in its scripts). Microsoft offer a complete guide.
Install Node & NPM
It is likely you already have Node and NPM installed on your system. If so, you can skip this step. Otherwise, refer to NPM’s own guide, which includes a video tutorial.
Get the files
Cupper is hosted on Github. To start using it, you’ll need to get the files from there. If you are comfortable with the command line, just fork the github.com/ThePacielloGroup/cupper repository, then do a git clone
to your local system. Replace [your username]
in the following:
git clone https://github.com/[your username]/cupper.git
If the command line is not your thing, use Github’s web interface to fork github.com/ThePacielloGroup/cupper and choose Open in Desktop from Clone or download (see figure 1, below).
While you’re in the Github interface, you might as well set up the publishing source for the live site. Choose the Master branch/docs option under Settings → Github Pages → Source. See Serving for more details.
Once you have your local copy of the files, move to the root of that folder and in your terminal run an npm installation:
npm install
Now it’s time to consult the Setup pattern.
Setup
By now, you should have followed the Installation instructions. You should have Hugo and Node installed, and a local copy of a forked version of Cupper. You should also have run npm install
in the root of that codebase.
“Cleaning” the content folder
Before you can start writing documentation, there are a few things still to do in order to get set up. At the moment, your version of Cupper is a facsimile of the original, containing all the content you’re reading right now. We want to delete that content and replace it with some starter content. There’s a simple clean
command for this.
npm run clean
This will leave your content
folder with just an _index.md
file and a patterns
folder containing a single demonstration pattern file. Individual content pages in Cupper are referred to as “patterns” — think pattern libraries). Find out more about these in Project structure.
The config file
You’ll also want to name your project and configure one or two other things in the config.toml
file that’s found at the root of your project. Here’s how that file looks:
languageCode = "en-us"
title = "Cupper"
baseURL = "https://thepaciellogroup.github.io/cupper/"
theme = "cupper"
[params]
description = "Documentation for the **Cupper** documentation builder. This documentation is constructed using the builder itself."
codePenUser = "Heydon"
- title — This is the project’s name, like “Megacorp 5000 Pattern Library” or “Assplosion.js Documentation”. For Cupper’s own version of Cupper, the
title
is simply Cupper :-) - baseURL — This is the root of the live site. Typically you will publish the site to Github Pages, so this should be the base URL for your Github Pages site.
- theme — This is the theme the library is using. Don’t change this from “cupper”.
- description — This is a short description of your documentation project and comes under the logo. You can include markdown syntax here, like **Cupper** in the above example for making the name of the library bold.
- codePenUser — If you want to embed codePens in your pattern files, you need to supply a codePen username here.
The Web App Manifest
Cupper projects work as progressive web applications, meaning users can save them to their home screen and read them offline. The web app manifest, found at the root of the static
folder, defines names and icons for the app. You’ll probably want to open /static/manifest.json
and personalize the name
and short_name
values.
{
"name": "Cupper Documentation Builder",
"short_name": "Cupper Docs",
"icons": [
{...
Including a logo
In the images/static
folder, you’ll find a logo.svg
file. Replace this file with your own company or project logo, under the same file name. Currently, only SVG is supported this easily because SVG is the superior format for logos. However, if you must use a different format, you can open up the themes/cupper/layouts/_default/baseof.html
file and edit the image reference:

Now that your logo is in place, everything should be ready. Where next? You can learn about Project structure to help you get writing, or find out how to serve the site locally and on Github Pages in Serving.
Serving
Serving locally
While you’re creating content for your project, you’ll probably want to see what the finished product looks like. Fortunately, Cupper is easy to serve locally using the serve
command:
npm run serve
This will serve your working project from localhost:1313
. Whenever you make changes to your files, the site will automatically rebuild. No need to refresh the web page!
Publishing on Github Pages
Cupper creates a /docs
folder containing the latest version of your site whenever you do an npm run build
or a git commit
. So long as you forked the Cupper repository when making your own version (see Setup), whenever you push to master, you will also be updating the site found at your Github Pages URL.
This URL will be in the following format:
[your user name].github.io/[your library repo name]
You’ll also need to add this value to your config.toml
file as the baseURL
. For Cupper’s own documentation it looks like the following. Just overwrite it.
baseURL = "https://thepaciellogroup.github.io/cupper/"
Set the publishing source
You will find the docs
folder is not automatically setup as the publishing source, even when forking the repo. In which case, you must set it under Settings → Github Pages → Source in the web interface.
Printing
Cupper’s output site includes a one-page Print version of the generated library, available at /print-version
. So, if your library base URL is https://yourName.github.io/your-library
, you can print the whole library — to PDF if wanted — from the following address:
https://yourName.github.io/your-library/print-version
Updating Cupper
The core of Cupper’s functionality is in its Hugo theme, also called Cupper. This is found in the theme folder.
- content
- docs
- lib
- snippets
- static
- themes
- cupper
Do not “hack the core”. If you have any issues with Cupper, please report them to the Cupper Github repository and they will be dealt with ASAP.
Cupper is undergoing constant development, so keep an eye out for new releases. To update to a new version of Cupper, simply run the update
command from inside your local project folder.
npm run update
This will save a timestamped backup of the current version, and download the latest version. Your theme folder will now look something like the following.
- themes
- cupper
- cupper-old-1503389765972
If you experience breaking changes and are having trouble fixing them, you can rename the old folder and revert to using it. In the meantime, you can submit an issue with the “help” tag describing your problem.
Project structure
Before you can set about making documentation, you need to know where everything goes. The simplest folder structure looks like this:
- content
- _index.md
- print-version.md
- patterns
- name-of-my-pattern.md
- name-of-my-other-pattern.md
- /content - This is where all of your content lives. You won’t need to visit any other folders very frequently.
- _index.md — This is the content file for your home page.
- print-version.md — This is a placeholder for the single-page / print-friendly version of you library. Leave this file as it is.
- /patterns — This is the folder where individual content files are kept. Cupper refers to each individual documentation file/page as a “pattern”.
Subsections
You may have noticed that this site’s navigation is divided partly into subsections, with labels like “Writing”. Cupper (or, rather, Hugo) allows you to create such subsections by simply nesting folders under the /patterns
folder. In the following example, I have a subsection about different types of “popup” pattern.
- content
- _index.md
- patterns
- name-of-my-pattern.md
- name-of-my-other-pattern.md
- popups
- _index.md
- popup-menu.md
- tooltips.md
Subfolders like /popups
must each have an _index.md
file. This file doesn’t need any content except the TOML metadata defining the title (name) of that subsection:
+++
title = "Popup windows"
+++
This title is what labels the subsection in the navigation, not the folder name (/popups
, in this case). For each subfolder you create, you must also create one of these _index.md
files. The /patterns
folder itself does not need one, however.
Now that you know where to put everything, it’s time to talk about how to actually write individual patterns. Don’t worry, it’s pretty straightforward. Turn to Markdown & metadata.
Markdown & metadata
In Cupper everything is documented using markdown, as a “pattern”. To create a new pattern file, just add a file with the .md
extension to the content/patterns
folder. It’s recommended you use “kebab case” to name the file (words separated by hyphens). For example, a pattern with the title “Menu button” should probably have the filename menu-button
. Then you get a nice clean URL: username.github.io/your-library/patterns/menu-button
.
If you’re not familiar with writing markdown, there are a number of tutorials available. One of the best is Mastering Markdown offered by Github. There’s also a nice cheatsheet here.
The metadata
Like many static site generators, Hugo lets you add metadata to its markdown files. Hugo’s brand of metadata is called TOML (although YAML is also accepted). The only thing you have to put in the TOML is a title
— like this:
+++
title = "Menu button"
+++
Tags
If you like, you can also tag the pattern so that it turns up in lists of similar content. You add tags in an array format. Note that all the TOML data is found at the top of the markdown file, between the +++
lines.
+++
title = "Menu button"
tags = ["interactive", "popup", "javascript"]
+++
This will create links to pages listing content tagged with the same terms using the URL schema /tag/[tag name]
. Some example tags links are provided for this page, which you can see listed under the main heading.
Weight
By default, patterns are listed alphabetically in the navigation. However, sometimes you might like to change the order around. This is possible by adding a weight
parameter. To make my menu button pattern appear at the top of its subsection, I would give it a weight
of 1
:
+++
title = "Menu button"
tags = ["interactive", "popup", "javascript"]
weight = 1
+++
Expandable sections
In some cases, where there is a lot of content, it’s helpful to collapse certain sections. That way, readers get an overview of what’s in the content and can choose where to focus in. Cupper provides a shortcode method for creating expandable sections which generates accessible markup using aria-expanded
.
The expandable
shortcode takes three parameters:
- label — This is the label for the the section heading.
- level — This is the heading level (e.g.
level="2"
for an

) that will contain the label. If you omit a level parameter, no heading is used; it’s just a button. - open — Include this and give it a value of “true” or “yes” to make the section expanded on page load.
Here’s what the code might look like for a simple expandable section containing markdown:
{{% expandable label="A section of dummy text" level="2" %}}
Here is some markdown including [a link](https://twitter.com/heydonworks). Donec erat est, feugiat a est sed, aliquet pharetra ipsum. Vivamus in arcu leo. Praesent feugiat, purus a molestie ultrices, libero massa iaculis ante, sit amet accumsan leo eros vel ligula.
{{% /expandable %}}
Let’s look at what that outputs:
Successive collapsible sections fit snugly together. The second of the following two has open="true"
.
Unfortunately, it is not currently possible to include shortcodes inside other shortcodes, using the “%
” notation (which is designated for markdown content). If you use the angle brackets notation (illustrated below) it is possible, but markdown will no longer be permitted. You will have to code HTML inside such a section manually.
{{<expandable label="A section of dummy text" level="2">}}

Here is a pattern reference shortcode: {{% pattern "Writing inline demos" %}}.

{{</expandable>}}
Notes & warnings
Cupper acknowledges that simple markdown is limiting when it comes to writing compelling documentation, so it provides a number of “shortcodes”. Shortcodes offer a simple syntax for including rich content. For example, Cupper provides shortcodes for including notes and warnings.
Notes
You may wish to pick out some content in your pattern’s documentation as a note — an aside to the main thrust of the pattern’s description. This is possible using the following syntax:
{{% note %}}
This is a note! It's something the reader may like to know about but is supplementary to the main content. Use notes when something may be interesting but not critical.
{{% /note %}}
Notes render like this:
Warnings
Warnings are like notes, but with more urgency.
{{% warning %}}
This is a warning! It's about something the reader should be careful to do or to avoid doing. Use warnings when something could go wrong.
{{% /warning %}}
Warnings render like this:
References
Cross-references
Cupper identifies the main content files in your documentation as patterns, and they’re kept in the content/ patterns folder. It’s easy to cross-reference patterns using the pattern
shortcode. For example, I can reference the Notes & warnings pattern. Here’s what the markdown looks like, including the shortcode:
I can reference the {{% pattern "Notes & warnings" %}} pattern here.
This saves you having to worry about pathing and decorates the generated link with a bookmark icon, identifying the link as a pattern reference visually.
WCAG References
WCAG 2.0 is the de facto standard for accessible interfaces. When writing about inclusive interfaces, sometimes you’ll want to refer to WCAG to highlight which success criteria the pattern meets.
Instead of having to copy and paste content and links to WCAG, Cupper provides a shortcode mechanism that lets you simply list the success criteria by number:
{{% wcag include="1.2.1, 1.3.1, 4.1.2" %}}
This generates a list of references that includes the names of each criterion and links to them directly. Like this:
- 2.1.1 Keyboard (level A)
- 4.1.2 Name, Role, Value (level A)
Full descriptions
Sometimes, you’ll want to include the full descriptions of the success criteria inline. This is possible by setting descriptions
to true
:
{{% wcag include="1.3.1, 4.1.2" descriptions="true" %}}
Here’s the more verbose output:
- 2.1.1 Keyboard (level A): All functionality of the content is operable through a keyboard interface without requiring specific timings for individual keystrokes, except where the underlying function requires input that depends on the path of the user's movement and not just the endpoints
- 4.1.2 Name, Role, Value (level A): For all user interface components (including but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
Inclusive Design Principle references
Some inclusive design concepts are not reducible to success or fail criteria. This is why The Paciello Group wrote the Inclusive Design Principles. These can be listed by name.
{{% principles include="Add value, Be consistent" descriptions="true" %}}
Here’s the output with descriptions="true"
:
-
Be consistent
:
Use familiar conventions and apply them consistently.
Familiar interfaces borrow from well-established patterns. These should be used consistently within the interface to reinforce their meaning and purpose. This should be applied to functionality, behavior, editorial, and presentation. You should say the same things in the same way and users should be able to do the same things in the same way.
-
Add value
:
Consider the value of features and how they improve the experience for different users.
Features should add value to the user experience by providing efficient and diverse ways to find and interact with content. Consider device features such as voice, geolocation, camera and vibration API's, and how integration with connected devices or a second screen could provide choice.
Snippets
A lot of the time, your larger documentation patterns will share some common techniques and utilities. For this reason, Cupper lets you save snippets of markdown in a snippets folder, alongside the main content folder.
The example visually-hidden.md
snippet describes the CSS needed to create content that is visually hidden but still available to screen readers. Since this is a technique/utility you are likely to use often, it’s nice to be able to just drop a snippet into your markdown content. The snippet
shortcode lets you do exactly that:
{{% snippet file="visually-hidden.md" %}}
Visually hidden snippet
The visually-hidden
utility class uses a set of special properties to hide content visually without making it unavailable to screen readers and other non-visual user agents. The class is defined like this:
.visually-hidden {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px) !important;
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden !important;
}
Use it sparingly since, in most cases, what is identified non-visually should also be presented visually. Bear in mind that not all screen reader users are blind users.
Tables of contents
Pattern pages in Cupper that have two or more subheadings (

s) automatically get a table of contents: a list of links to the main subsections for the page. This feature is made accessible as a navigation region with the “Table of contents” label and uses an ordered list. The table of contents markup for the Setup page looks something like this:

Table of contents

“Cleaning” the content folder

The setup command

The config file

Including a logo

Tables of content are a neat way to break down the content of the page and give users a navigable overview. However, they may not be to your taste. Never fear, you can turn tables of content off by adding toc = false
to the TOML metadata for your pattern:
+++
title = "My page with a few headings"
toc = false
+++
Including images
From time to time, you’ll be wanting to include images illustrating the documented pattern in hand. Images live in the static folder, which is a sibling of the /content
folder you’ll be mostly working in.
- content
- static
- images
- logo.png
- menu-button.gif
- images
The path to the /images
folder should begin with a forward slash, so include that when referencing images in your markdown.
![Global Megacorp Ltd](/images/logo.png)
Figures
Sometimes you will want to include a caption with your illustration. This is what the

and

elements are for. However, Cupper doesn’t ask you to code all that manually. A special shortcode is provided, which takes a caption
parameter. Note that the image markdown is provided between the opening and closing shortcode tags, and that you can use markdown syntax in the caption
value.
{{% figure caption="A design system that uses a bad code example as a **single source of truth** only serves to proliferate bad code." %}}
![Diagram of a design pattern represented by a turd emoji begetting three bad implementations](/images/bad_design_system.png)
{{% /figure %}}
This will output the following. Note the automatically incremented Figure number.
The generated markup includes special provisions for assistive technology support:

A design system that uses a bad code example as a single source of truth only serves to proliferate bad code.

Including videos
Cupper has a lot of its own shortcodes, but you can still use Hugo’s built in shortcodes. These include a simple shortcode for including YouTube videos in your content. The shortcode takes just one parameter — the video’s id
.
{{<youtube w7Ft2ymGmfc>}}
Code blocks
Markdown already supports code samples both inline (using single backticks like `some code here`) and in blocks. Cupper will syntax highlight HTML, CSS, and JavaScript if you provide the correct language in the formulation of the block.
So, this…
```html
<button aria-pressed="false">toggle me</button>
```
… will result in this:
<button aria-pressed="false">toggle me</button>
Note that the syntax highlighting uses a greyscale theme. Cupper is careful not to use color as part of its own design, because these colors may clash with those of the design being illustrated and discussed.
Annotated code
Cupper offers the ability to highlight and annotate specific parts of your code examples using the code
shortcode. Take an accessible dialog. You may wish to point out key attributes that make that dialog support assistive technologies:

<button aria-label="close">x</button>

Confirmation

Press Okay to confirm or Cancel

<button>Okay</button>
<button>Cancel</button>

You mark out the highlighted areas using triple square brackets like so:
{{}}

<button [[[aria-label="close"]]]>x</button>

Confirmation

Press Okay to confirm or Cancel

<button>Okay</button>
<button>Cancel</button>

{{}}
Better still, if you include numbered="true"
, each highlight is enumerated so you can reference it directly in the ensuing text. If you follow the shortcode directly with an ordered list, the styles match:

<button aria-label="close">x</button>

Confirmation

Press Okay to confirm or Cancel

<button>Okay</button>
<button>Cancel</button>

- The dialog is only announced as a dialog if it takes the
dialog
ARIA role - The
aria-labelledby
relationship attribute makes the element carrying theid
it points to its label - The close button uses
aria-label
to provide the text label “close”, overriding the text content - The heading is used as the dialog’s label. The
aria-labelledby
attribute points to itsid
You just include numbered="true"
on the opening shortcode tag:
{{}}

<button [[[aria-label="close"]]]>x</button>

Confirmation

Press Okay to confirm or Cancel

<button>Okay</button>
<button>Cancel</button>

{{}}
1. The dialog is only announced as a dialog if it takes the `dialog` ARIA role
2. The `aria-labelledby` relationship attribute makes the element carrying the `id` it points to its label
3. The close button uses `aria-label` to provide the text label "close", overriding the text content
4. The heading is used as the dialog's label. The `aria-labelledby` attribute points to its `id`
JavaScript example
/* Enable scrolling by keyboard of code samples */
(function () {
var codeBlocks = document.querySelectorAll('pre, .code-annotated');
Array.prototype.forEach.call(codeBlocks, function (block) {
if (block.querySelector('code')) {
block.setAttribute('role', 'region');
block.setAttribute('aria-label', 'code sample');
if (block.scrollWidth > block.clientWidth) {
block.setAttribute('tabindex', '0');
}
}
});
}());
- The
region
role announces the block as a region - The
aria-label
describes the kind of content to be expected in the region
Demo embedding
Sometimes just pictures of the pattern you’re documenting aren’t enough. Interactive patterns benefit from live demos, so that readers can test their functionality.
CodePen
Cupper offers a couple of ways to do this. The first is by embedding CodePen demos into the content. The codePen
shortcode takes just one argument: the codePen’s ID
.
{{% codePen VpVNKW %}}
This will embed the identified codePen into the content wherever you placed the shortcode, with the result view showing by default:
jsBin
You can embed JS Bins just like CodePens, supplying a single id
parameter.
{{% jsBin juwowaq %}}
However, you can also have finer control over which panes are displayed. Use two parameters: one for the id
and another, show
, listing the panes you want to include.
{{% jsBin id="juwowaq" show="css,output" %}}
The options for the show
parameter are:
- html
- css
- js
- console
- output
(Note that, under some circumstances, the html
pane is added whether you select it or not.)
Inline demos
Cupper also supports the ability to write inline demos directly in markdown files. See Writing inline demos.
Writing inline demos
There are some issues with Demo embedding, like the embeds not working offline. They also come with their own branding, which will clash with the pattern you’re trying to illustrate.
Cupper offers another option: a special demo
shortcode that allows you to write HTML, CSS, and JavaScript directly into the markdown file. The outputted demo is encapsulated using Shadow DOM, so you don’t have to worry about broken styles and global JS.
Here’s the example code for an inline demo of a toggle button:
{{<demo>}}
<button aria-pressed="false">Toggle Me</button>

{{</demo>}}
Note the demo.querySelector
on line 21
. Cupper automatically provides demo
, representing the root node of the demo. It’s like the document
keyword but for a demo’s subtree.
Here’s a live demo of the demo:
Styling the container
Sometimes your component will be expected to appear in a context where the parent element has a background color and possibly other styles. You can add style to your demo block’s container element using the style
attribute. It works just like standard inline styling.
{{<demo style="background-color: pink; padding: 1rem;">}}

{{</demo>}}
“Launch”
The “Launch” button takes the demo code and pushes it to a new browser tab. This serves two purposes:
- It provides a fallback for browsers that do not support Shadow DOM encapsulation (a warning message will replace the inline demo).
- It creates an isolated test case for the demo, allowing you to run browser extensions and bookmarklets on the the demo code and just the demo code.
Captioned demos
It’s possible to give your demo a caption using an accessible

and

structure. All you need to do is supply a caption
attribute. For example:
{{<demo caption="A basic button element">}}

{{</demo>}}
Along with the standard figure
shortcodes (described in Including images), demo figures are numbered automatically according to their order in the page. You can use markdown syntax in the caption text value.
Color palettes
There’s no reason why your Cupper-powered pattern library has to be all about functionality. You can include style guide-like information such as color palettes too. The colors
shortcode makes it easy to exhibit colors and their values together. Just supply a comma-separated list of CSS color values.
{{% colors "#111111, #cccccc, #ffffff" %}}
The result is a one row strip showing each color supplied in order. The colors for Cupper are greyscale:
- #111111
- #CCCCCC
- #FFFFFF
Command line
Your pattern documentation may need to include commands for installing packages or using CLIs. Cupper offers the cmd
shortcode for making code blocks look like terminal commands.
Here’s how you write it:
{{<cmd>}}
npm run start
{{</cmd>}}
And here’s how it looks:
npm run start
File trees
Representing folder/file structures is simple and accessible in Cupper. Which is just as well, because some components may need to conform to a certain folder structure.
The file tree is described using a markdown nested list structure:
{{% fileTree %}}
* Level 1 folder
* Level 2 file
* Level 2 folder
* Level 3 file
* Level 3 folder
* Level 4 file
* Level 3 folder
* Level 4 file
* Level 4 file
* Level 3 file
* Level 2 folder
* Level 3 file
* Level 3 file
* Level 3 file
* Level 2 file
* Level 1 file
{{% /fileTree %}}
This is drawn in the following fashion, but preserves the underlying nested list structure for assistive technologies such as screen readers:
- Level 1 folder
- Level 2 file
- Level 2 folder
- Level 3 file
- Level 3 folder
- Level 4 file
- Level 3 folder
- Level 4 file
- Level 4 file
- Level 3 file
- Level 2 folder
- Level 3 file
- Level 3 file
- Level 3 file
- Level 2 file
- Level 1 file
Tested using...
When you’re an inclusive designer, it’s pertinent to do some testing. Following specs is one thing, but you need to verify that your component works okay for users.
Cupper provided a tested
shortcode that lets you show which browsers and assistive technologies you’ve tried your design out in. Here’s an example. Note the commas and “+” signs.
{{% tested using="Firefox + JAWS, Chrome, Safari iOS + Voiceover, Edge" %}}
This outputs:
| Tested using | Firefox with JAWS | Chrome | Safari iOS with Voiceover | Edge |
|---|
The value for the using
attribute follows a specific format: each testing setup is separated by a comma (with a space if you like, but it’s not mandatory). If you want to add an assistive technology (or any other “add on”) this needs to follow a “+”. This additional part can be anything, like “A VR headset I borrowed”, but there are only a few browser terms available. These are case sensitive, so you need to write them as below:
- Firefox
- Chrome
- Safari
- IE
- Edge
- Opera
- Chrome Android
- Firefox Android
- Safari iOS
Obviously, this is not a comprehensive list and more may be added over time. But it covers most of the main browsers for pairing with other software — at least for testing purposes.


CNIT 133
JavaScript
Home
Basic Ops
Functions
Loops
Arrays
Objects
jQuery
Ajax
Part 1a
Part 1a
Part 1b
Part 2
Part 3
Part 4
Name
Favorite food:
Pizza
Hamburgers
Fried Chicken
Favorite sport:
Baseball
Soccer
Occupation:
-Choose one-
student
Professor
Ventriloquist
Hermit