This page documents version 0.9-dev of bingwa, which is currently considered experimental.
Introduction. bingwa is a command-line tool used to carry out meta-analysis of genome-wide association studies. It is particularly suited for use with the program SNPTEST, but can also be used with other association testing programs such as MMM. Features of bingwa include:
- Direct support for SNPTEST output files.
- Support for fixed-effect frequentist and a flexible bayesian meta-analysis method.
- Support for both univariate and multivariate meta-analysis (including support for meta-analysing tests performed using SNPTEST's multinomial test).
Disclaimer. This page documents version 0.9-dev of bingwa which is currently considered experimental. This means we expect some features not to work, or not to work well, or to work wrongly, or to destroy your computer or sanity.
References. If you make use of bingwa, please cite the following paper, which describes the key methodology underlying the program:
- "A novel locus of resistance to severe malaria in a region of ancient balancing selection", Malaria Genomic Epidemiology Network, Nature (2015)
The core ideas underlying bingwa were originally developed and applied in these papers:
- "Genome-wide association study identifies a variant in HDAC9 associated with large vessel ischemic stroke", International Stroke Genetics Consortium (ISGC) and Wellcome Trust Case Control Consortium 2 (WTCCC2), Nat. Genetics (2012)
- "Reappraisal of known malaria resistance loci in a large multi-centre study", Rockett et al, Nat. Genetics (2014).
- "Imputation-Based Meta-Analysis of Severe Malaria in Three African Populations", Band et al, PLOS Genetics (2013)
Acknowledgements. Bingwa was developed at the Wellcome Trust Centre for Human Genetics, Oxford, UK. A full list of people who contributed to the methodology will appear here.
(This page is under construction.)
The general process followed by bingwa is as follows. Briefly, bingwa proceeds by
- Loading association test data from a set of cohorts (e.g. SNPTEST files).
- Matching variants between cohorts.
- Computing frequentist meta-analysis and one or more Bayes factors.
- Writing results.
We'll update this page with more details on the method soon. In the meantime the tutorial has usage examples.
Running bingwa
-o sqlite://<filename>
can be used to force sqlite3 output format.
fixed:bf
.
fixed:bf
and independent:bf
columns.
Here, the independent model assumes that true effects are uncorrelated between the cohorts - i.e.
they have diagonal variance-covariance matrix.
In addition to the two model-specific bayes factors, bingwa will compute an equally weighted model-averaged bayes factor
over all the models specified, named mean_bf
.
Note: In the above command we use a short-hand version of the prior specification,
identified because it is of the form tau=...
.
Here, the first part (tau) denotes the between-cohort correlation, while the rest now
denotes the prior covariance matrix within each cohort. In this case there is one
effect parameter in each cohort, so the prior covariance is the 1x1 matrix (0.2^2),
and the correlation between cohorts is 1 (for fixed-effect model) or 0 (for independent-effect model).
While the difference in this example are small, this feature comes into its own when many cohorts are analysed. However, we always advise always checking the screen output to debug model definitions.
The -priors
option tells bingwa to load prior specifications from a file.
Priors in the file should be specified as on the command line, but with a couple of additional
features:
- Any line starting with # is ignored - this allows models to be commented.
- Line breaks (newlines) within model specifications are ignored if they
follow one of the 'punctuation' characters - i.e. immediately after a
:
,/
, or comma character. This allows long models to be formatted across lines.
Using a priors file has the advantage of allowing priors to be stored and edited seperately from the command lines.
Note: By default all models are equally weighted in the model-average bayes factor. Use the -prior-weights
option to reweight them. Weights are renormalised to sum to one in the mean bayes factor computation - i.e.
the mean Bayes factor is computed as
$$\text{BF}_{\text{avg}} = \frac{\sum_i \text{weight}_i \cdot \text{BF}_i}{\sum_i \text{weight}_i}$$
where $\text{weight}_i$ and $\text{BF}_i$ are the specified weight and Bayes factor for model $i$.
If -prior-weights
is specified, any model not specified in the argument is given weight zero in the mean Bayes factor.
The argument to -prior-weights
can also be the name of a file, in which case bingwa will open the file
and read prior weights from it (in the same format, i.e. <model name>=<weight>
).
-extra-columns
option tells bingwa to read data from the specified columns in the input file
and include it in the output.
Understanding bingwa sqlite output files
Below we've given some examples of using the shell or various programming languages to extract data from a bingwa
sqlite file.
We assume the file is named bingwa.sqlite
and the meta-analysis results were stored
using the default prefix ('Bingwa') for table names.
Note: The sqlite3
program is installed by default on most UNIX-like systems.
It's quite flexible, and can be used in interactive mode, or to run queries directly from the command-line.
We'll use both methods below.
See the sqlite3 command shell documentation for a full list of options.
Inspecting the contents of the results file
sqlite files can be inspected using the sqlite3 command shell. Open the file by typing:
$ sqlite3 -column -header bingwa.sqlite
You should see the sqlite prompt (sqlite3>
). Let's see what tables are stored in this file:
sqlite3> .tables Analysis BingwaCounts BingwaMetaView AnalysisProperty BingwaCountsView Variant AnalysisPropertyView BingwaDetail VariantIdentifier AnalysisStatus BingwaDetailView VariantView AnalysisStatusView BingwaMeta
Here, the main meta-analysis results are stored in the BingwaMeta
table,
and bingwa has also created the BingwaMetaView
view which provides a nicer view of the results.
The BingwaCounts
and BingwaDetail
tables contain, respectivelty,
genotype counts taken from the input files, and the raw summary statistics (beta and standard error)
that bingwa operated on.
The Analysis*
tables are used to store metadata about the analyses you have run.
Let's see what's stored in this file:
sqlite> SELECT * FROM Analysis ; id name chunk ---------- --------------- ---------- 1 bingwa analysis NA sqlite> SELECT COUNT(*) AS count FROM BingwaMetaView count ------- 200
So this file stores meta-analysis results for 200 variants from a single analysis called "bingwa analysis".
In a large, real analysis, it's often useful to use the -analysis-name
and -analysis-chunk
options to give the analysis a
more descriptive name and explain what part of the data it corresponds to. It's possible to store several analyses in the same sqlite file
(or even in the same table, provided analysis columns are compatible), so this information becomes important to understand the results.
Let's have a look at what the results actually look like. Because there are lots of columns we'll switch sqlite3 to line-based output:
sqlite3> .mode line sqlite3> SELECT * FROM BingwaMetaView LIMIT 1 ; rsid = RSID_2 alleleA = A alleleB = - analysis = bingwa analysis analysis_id = 1 variant_id = 2 chromosome = NA position = 2 cohort 1:bf = 0.685505148530258 cohort 2:bf = 0.754326805029774 FixedEffectMetaAnalysis:included_betas = 11 FixedEffectMetaAnalysis:N =<PHONE_NUMBER>27515 FixedEffectMetaAnalysis:beta_1:add/bin2=1 = -0.048782749136173 FixedEffectMetaAnalysis:se_1 = 0.130323119437487 FixedEffectMetaAnalysis:wald_pvalue_1 = 0.708165117723267 FixedEffectMetaAnalysis:pvalue = 0.708165117723267 fixed:bf = 0.573458567964815 independent:bf = 0.517094908522291 mean_bf = 0.545276738243553 max_bf_model = fixed max_bf = 0.573458567964815 best_posterior_model = fixed best_posterior = 0.525841767807702 2nd_best_posterior_model = independent 2nd_best_posterior = 0.474158232192298
This analysis contains the results of both a fixed-effect frequentist and a bayesian analysis of two cohorts,
by default called "cohort 1" and "cohort 2". (The -cohort-names
option could have been used to change these names).
The first eight columns reflect metadata, that tells us the variant being tested and a link to the Analysis table (which useful if several analyses are stored in the same table).
The chromosome information here is unspecified (the -assume-chromosome
option could have been used
to fill in chromosome information during the analysis).
The next two columns contain Bayes factors (BFs) computed based on the data in each cohort independently. These are not strictly meta-analysis results, but are stored here for comparison with the meta-analysis Bayes factors below. (This might change in a future version of the software.)
The columns labelled 'FixedEffectMetaAnalysis' reflect the frequentist analysis. They include 'N'
a variable ('included_betas') which here indicates that data from both cohorts informed the analysis, and the
combined effect size estimate and standard error from meta-analysis. Here, because there is only one
effect size being estimed, the two p-value columns (pvalue
and wald_pvalue_1
) are
the same.
The following columns reflect the bayesian meta-analysis. In order, they represent the BF for each model, the model average BF, the maximum BF and the model with the max BF, details of the model with the highest posterior mass (which might be different from the maximum BF if the weighting is not uniform). Similarly, the last two columns reflect the model with the 2nd highest posterior mass.
These particular results don't look very interesting (i.e. a p-value of P=0.7, or a Bayes factor less than one, suggest very little evidence that the indel is associated). Nevertheless, if we were interested we could take a look at the data underlying this meta-analysis:
sqlite3> SELECT * FROM BingwaDetail WHERE analysis_id == 1 AND variant_id == 2; analysis_id = 1 variant_id = 2 chromosome = NA position = 2 cohort 1:beta_1:add/bin2=1 = 0.0237287990748882 cohort 1:se_1 = 0.186789005994797 cohort 1:pvalue = 0.898887991905212 cohort 2:beta_1:add/bin2=1 = -0.117560997605324 cohort 2:se_1 = 0.181916996836662 cohort 2:pvalue = 0.517305016517639
Estimated effects have opposite directions in the two cohorts. Or we could look at the genotype counts that SNPTEST reported for this test:
sqlite3> SELECT * FROM BingwaCounts WHERE analysis_id == 1 AND variant_id == 2; analysis_id = 1 variant_id = 2 chromosome = NA position = 2 cohort 1:A = 0.0 cohort 1:B = 0.0 cohort 1:AA = 24.1889991760254 cohort 1:AB =<PHONE_NUMBER>42773 cohort 1:BB =<PHONE_NUMBER>37109 cohort 1:NULL = 3.98792002025139e-13 cohort 1:N =<PHONE_NUMBER>55908 cohort 1:B_allele_frequency = 0.802034063901899 cohort 1:trusted = 1 cohort 2:A = 0.0 cohort 2:B = 0.0 cohort 2:AA = 28.2371997833252 cohort 2:AB =<PHONE_NUMBER>32422 cohort 2:BB =<PHONE_NUMBER>55859 cohort 2:NULL = 5.11590986587707e-13 cohort 2:N =<PHONE_NUMBER>71606 cohort 2:B_allele_frequency = 0.800169017777426 cohort 2:trusted = 1
Processing bingwa sqlite output files
Below are some example commands that process bingwa output in the command-line or in R. See above for a full description of bingwa's sqlite output.
01
, 02
, etc.
> library( RSQLite )
> db = dbConnect( dbDriver( "SQLite" ), "bingwa.sqlite" )
> D = dbGetQuery( db, "SELECT * FROM BingwaMetaView" )
Input file formats
.txt
, .csv
or .tsv
).
Output file formats
Bingwa can either output to a flat file or to a table in a sqlite database. Both have pros and cons.
Flat files are simple and easy to use. However, they can become difficult to read from for very large analyses (such as genome-wide analyses of datasets imputed into recent reference panels) which may require writing special file-handling code.
Flat files are written when the -flat-file
option is specified.
Sqlite files are easy to use via the sqlite3 command shell, which is installed on most UNIX-like systems. They can also be read directly from programming languages, e.g. by using the RSQLite package in R or the sqlite3 module in python. An attractive feature is that they are indexed, so that data for specific regions of the genome or specific variants can be easily found. See the examples page for code snippets for processing bingwa-produced sqlite files.
Sqlite is the default output format for bingwa.
Specifying priors
The file format used for the -priors
option follows the following rules.
- Blank lines and lines starting with # (comment lines) are ignored.
- Every other line is part of a prior specification.
- Each prior must start with a name specification of the form '
<name>:
'. - Two forms of prior specification are permissible, full and shorthand prior specification.
-
A full prior specification is of the form
sd=a,b,c,.../cor=1,x,y,...
. Herea,b,c,...,x,y,...
are real numbers. The number of sds specified must equal the combined number of parameters in all cohorts put together, denoted d; the number of correlations specified must then be equal tod×(d+1)/2
. Conceptually, suppose the valuesa,b,c,...
specify the diagonal entries of a matrix denoted σ, and suppose the values1,x,y,...
specify the upper triangle of the correlation matrix Ρ (which should have 1s on the diagonal as in the example). The prior matrix used for analysis is then σ×Ρ×σ. -
A shorthand prior specification is of the form
tau=z/sd=a,b,c,d,.../cor=1,x,y,...
. In this form, the number of sds specified must equal the number of parameters in each cohort (e.g. 1 for univariate analysis), denoted d; the number of correlations specified must then be equal tod×(d+1)/2
.
Bingwa is available as source code.
Binaries
Pre-compiled binaries are available for the following platforms. (See here for other builds.)
| Version | Platform | File |
|---|---|---|
| v0.9-dev† | Ubuntu 12.04 x86-64 | bingwa_v0.9-dev-linux-x86_64.tgz |
| v0.9-dev† | CentOS6.5 x86-64 | bingwa_v0.9-dev-CentOS6.5-x86_64.tgz |
| v0.9-dev† | Mac OS X | bingwa_v0.9-dev-osx.tgz |
†This version of bingwa is considered experimental.
To run bingwa, download the relevant file and extract it as follows.
$ tar -xzf bingwa_v0.9-dev-[machine].tgz $ cd bingwa_v0.9-dev-[machine] $ ./bingwa_v0.9-dev -help
Source
The source code to bingwa can be found on the bingwa page on bitbucket.


OurSejahtera
Volunteer
Logged in as: username
2000 points
Premium Grade Watch
Buy
1500 points
Digital Single-Lens Reflex Camera
1000 points
High Grade Audio Headphones
200 points
Shin Ramen
400 points
Rubik's Cube Toy


FAQ
Q: What’s with the name?
A: kpt
was inspired by apt
, but with a Kubernetes focus. We wanted to
uphold the tradition of naming tools to start with k
, and also be short
enough that you don’t have to alias it. It is pronounced “kept”.
Q: What does kpt provide that git clone doesn’t
A: kpt
enables out-of-the-box workflows that git clone
does not such as:
cloning and versioning git subdirectories, updating from upstream by
performing structured merges on resources, programmatically editing
configuration (rather than with an editor), etc
Q: How is kpt
different from other solutions?
A: Rather than expressing configuration as code, kpt
represents configuration
packages as data, in particular as YAML or JSON objects adhering to the
kubernetes resource model
Q: Why resource configuration as the artifact rather than templates or configuration DSLs?
A: As explained in Declarative application management in Kubernetes, using resource configuration provides a number of desirable properties:
-
it clearly represents the intended state of the infrastructure – no for loops, http calls, etc to interpret
-
it aligns with how tools developed by the Kubernetes project are written –
kubectl
,kustomize
, etc -
it enables composition of different types of tools written in different languages
- any modern language can manipulate YAML / JSON structures, no need to
adopt
go
- any modern language can manipulate YAML / JSON structures, no need to
adopt
-
it supports static analysis and validation
- develop tools and processes to perform validation and linting
-
it supports programmatic modification
- develop CLIs and UIs for working with configuration rather than using
vim
- develop CLIs and UIs for working with configuration rather than using
-
it supports customizing generated resources so the templates don’t need to be modified
- artifacts generated from templates or DSLs may be modified directly, and then merged when they are regenerated to keep the modifications.
-
it supports display in UI and tools which use either OpenAPI or the YAML/JSON directly.
Q: Isn’t writing YAML hard?
A: kpt
offers a collection of utilities which enable working with
configuration programmatically to simplify the experience. Using vi
to edit
YAML should be necessary only for bootstrapping, and the common cases should
use setters or functions to generate or modify YAML configuration.
Q: I really like DSL / templating solution X. Can I use it with kpt
?
A: Yes. kpt
supports plugging in solutions which generate or manipulate
configuration, e.g. from DSLs and templates. This may be performed using
source functions from our catalog. The generated output may be modified
directly, and merged when regenerated.
Q: I want to write high-level abstractions like CRDs, but on the client-side. Can I do this with kpt
?
A: Yes. kpt
's architecture facilitates the developing programs which may
generate or modify configuration. See the Functions User Guide for how to
compose multiple programs together.
Q: How do I roll out changes throughout my organization using kpt
?
A: This can be done one of several ways, including: 1) using semantic versioning or release channels with functions, or 2) updating packages.
Q: Is there a container image that contains kpt?
A: Yes. gcr.io/kpt-dev/kpt contains the kpt
binary.
Q: How do I run source or sink functions?
A: All kpt functions, including source and sink functions, should be run using
kpt fn run
. The kpt fn source
and kpt fn sink
commands run builtin source
and sink functions.
Q: I still have questions. How do I contact you?
Next Steps
- Learn about kpt architecture including major influences and a high-level comparison with kustomize.
- Consult the command reference for how to use kpt.
- Read kpt guides for how to produce and consume packages and integrate with a wider ecosystem of tools.


Dr. Norman Borlaug
The man who saved a billion lives
Dr. Norman Borlaug, third from the left, trains biologists in Mexico on how to increase wheat yields - part of his life-long war on hunger.
1914 - Born in Cresco, Iowa
1933 - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"
1935 - Has to stop school and save up more money. Works in the Civilian Conservation Corps, helping starving Americans. "I saw how food changed them", he said. "All of this left scars on me."
1937 - Finishes university and takes a job in the US Forestry Service
"Borlaug's life and achievement are testimony to the far-reaching contribution that one man's towering intellect, persistence and scientific vision can make to human peace and progress."
-- Indian Prime Minister Manmohan Singh
If you have time, you should read more about this incredible human being on his Wikipedia entry.


Raise your little Kaiju to become strong and undefeatable. A Kaiju/Tamagotchi crossover. With hats.
TAMAKAIJU was made during the GMTK Game Jam 2023, on a team of 4. I was the:


Meet our team
yugsf gf weifgwjs uiwe fcuywsgfiwesf gw
Asibul Islam Abir
Student
B.Sc Engineering, 4th Year
Shahjalal University of Science & Technology
Facebook
Linked in
Asibul Islam Abir
Student
B.Sc Engineering, 4th Year
Shahjalal University of Science & Technology
Facebook
Linked in


Key projects from our github repositories.
ADA1
Stock Market Forecast API
Iris
Image Recognition App for iOS and Android
Sneakers API
An API with more than 100,000 sneakers.
MVED
Research on modeling a multi-variate approach on Earning Dynamics.
The ones who runs this company
CEO & Founder
Phasellus eget enim eu lectus faucibus vestibulum. Suspendisse sodales pellentesque elementum.
CEO & Founder
The man behind the machine.
CTO
A mastermind of web-dev.
Designer


PASSWORD
If oh have difficulty placing your order, please call us on the following number.
Saturday & Public Holiday:9am-4pm


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Posting Comments
In order to post comments to stories, you will have to
create an account.
Accounts will generally be validated within 24 hours, and of
course will be disabled if there is abuse.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Boners
Home
Make Dailyrotten your start page
|
|
|
December 31, 2002
Burning semen haunts Gulf War vets
Chicago Sun-Times | Submitted by: JON BLAST
"As the military prepares for a possible war with Iraq, researchers have
identified a new malady among veterans of the first Gulf War: burning semen
syndrome. In these veterans, exposure to semen causes burning, pain and
swelling at the tip of the penis and in the vaginal areas of their partners."
|
|
Read article...
|
|
Lab grown steaks nearing the menu
New Scientist | Submitted by: SeMeN SPeRmS
"According to Mironov, the simplest meat to grow is seafood because the
myoblasts can be coaxed to divide better, but "chicken is nice", he says. His
dream is that we will eventually be able to grow and cook fresh sausage
overnight at home in special machine, just like a home bread maker."
|
|
Read article...
|
|
Police seize bail money, say it smells like marijuana
Rutland Herald | Submitted by: ADESN
"Police confiscated $50,000 in cash from a Vermont couple who had come to bail
their daughter out of jail, claiming the money smelled like marijuana.
Police said they thought the cash could be the proceeds of drug deals...
The district attorney’s office is seeking to keep the $50,000 brought to bail
out Santor, who remains in jail. A hearing on the matter is scheduled for
Jan. 16." We are unaware of any precedent to this, or any law granting such
power to the government.
|
|
Read article...
|
|
Governor demands apology after college skit
CNN | Submitted by: jonsl
"At halftime, Virginia's student-run pep band staged a parody of "The
Bachelor," with a male Virginia student choosing between two female
contestants. The contestant said to be from West Virginia wore blue overalls
and pigtails, had a talent for square dancing and declared a dream to move
to Beverly Hills, California, a reference to "The Beverly Hillbillies...
The pep band poked fun at West Virginia at halftime of the last Virginia
West Virginia football game, in 1985. That performance, a parody of "Family
Feud," included derogatory references to indoor plumbing and birth control."
|
|
Read article...
|
|
Whisky cure for antifreeze poisoning
BBC | Submitted by: Ann Onymous
"A woman who drank anti-freeze was prescribed whisky as an antidote after
her potentially life-threatening mistake. Glennis Middleton, from Forfar in
Angus, was told that anti-freeze can cause kidney failure, blindness and
even death. Doctors at Ninewells Hospital in Dundee told her that alcohol
was the antidote and gave her a choice of gin, vodka or whisky."
|
|
Read article...
|
|
Son of Star Wars has Canadians in tizzy
Globe and Mail | Submitted by: Tim Howard
"U.S. President George W. Bush recently ordered his military to install the
first phase of a missile shield, nicknamed "Son of Star Wars," because it could
include space-based components. Foreign Affairs Minister Bill Graham has warned
that putting weapons in space could be "illegal." At the moment, however,
experts say Canada doesn't have enough surveillance technology to verify
whether the U.S. program violates any of the few international treaties that
govern space."
|
|
Read article...
|
|
Reports of my death...
Hartford Courant | Submitted by: nordridge
"Hartford police admitted Monday they strayed from their normal procedures
when they misidentified Denison, 37, as the victim of a drive-by shooting and
broke the news to his parents during a pre-dawn visit Sunday. After 12 hours
of grieving and a call to a local funeral home, George and Jane Denison of
Middletown learned that their son was alive and told police."
|
|
Read article...
|
|
Diana Ross supremely plastered
The Smoking Gun | Submitted by: Boat6float
"Diana Ross was so plastered when pulled over by Arizona police yesterday
(12/30), the singer could not accurately write down the alphabet, list numbers
sequentially, or tell officers the time or date. And when the star was asked to
perform a "one leg stand," she "fell over" after only seven seconds, and even
panned her own balancing act to arresting officers: "Ha Ha Ha. Great."
|
|
Read article... and
This article...
|
|
Pig jaws a New Year's tradition in South
CNN | Submitted by: jonsl
"It's the side of the pig's jaw," said James Dixon, market manager at
Sawyer's Affiliated Food Store in Little Rock. "You gotta have it every
year, if you don't have your beans and Joe (black-eyed peas and hog jowl)
you won't have good luck." One word: Arkansas.
|
|
Read article...
|
|
Did Rumsfeld help arm Saddam?
Washington Post | Submitted by: Ann Onymous
"Among the people instrumental in tilting U.S. policy toward Baghdad during
the 1980-88 Iran-Iraq war was Donald H. Rumsfeld, now defense secretary, whose
December 1983 meeting with Hussein as a special presidential envoy paved the
way for normalization of U.S.-Iraqi relations. Declassified documents show that
Rumsfeld traveled to Baghdad at a time when Iraq was using chemical weapons on
an "almost daily" basis in defiance of international conventions."
|
|
Read article...
|
|
Americans fatter, drunker
MSNBC | Submitted by: GM Boink
"More than one in five American adults could be classified as obese in 2001,
up almost 6 percent from the year before. And more than one in four Americans
engage in bouts of binge drinking, defined as five or more drinks at one
sitting with the goal of getting drunk, up 35 percent from 1995."
|
|
Read article...
|
|
Decacia
New York Times | Submitted by: Soylent
"His film, Decasia, was fashioned entirely out of snippets of severely
distressed and heart-rendingly decomposed nitrate film stock: decades-old
footage, taken from archives all around the country, and at the last possible
moment... For all the sorry ugliness of the situation, the actual pictures that
this relentless disintegration was producing could be more than just pretty.
Sometimes, indeed, they were ravishingly, achingly beautiful."
|
|
Read article... and
This article...
|
|
|
|
|


This site was made using fullpage.js and Materialize, enjoy!
A Seattle based plant lover, skier & tech nerd.
An innovative match-3 puzzle game shipped on the Google Play Store & the App Store that showcased at the Boston Festival of Indie Games in the fall of 2018.Discoveryarrow_forward
With only 12 weeks to create a complete game, our original design goals were to create a unique mobile game with (1) simple game mechanics with (2) addictive, "I can't put this game down" qualities.
We began by researching popular games with low learning thresholds. We found five games that utilized (1) match-3 puzzling as a combat mechanic, (2) a turn-based system, and (3) careful positioning of the player's board.Definearrow_forward
After brainstorming several ideas, we settled on our core game mechanic. Players drag any tile to slide entire rows or columns of tiles. Making matches with the tiles deals damage to the pieces standing on top of the matched tiles. Different types of enemies have different movement and attack patterns that's moves are turn-based.
Players win when all enemies are destroyed. Players lose when enemies attack the player via melee or ranged attacks.Prototypearrow_forward
After brainstorming several ideas, we settled on our core game mechanic. Players drag any tile to slide entire rows or columns of tiles. Making matches with the tiles deals damage to the pieces standing on top of the matched tiles. Different types of enemies have different movement and attack patterns that's moves are turn-based.
Players win when all enemies are destroyed. Players lose when enemies attack the player via melee or ranged attacks.Iteratearrow_forward
For the next few weeks we tested several additional mechanics. Players destroy enemies by matching three or more elemental tiles with the tile the enemy is currently standing on. We decided on four enemy types: patrolling melee (Cat), smart melee (Skeleton), patrolling range (Dragon), and locking (Plant). The enemies were designed by our lead artist, Rowena Chen.Refinearrow_forward
In the spring of 2018, Arcane Tectonics was released at the Game Design Initiative at Cornell's spring showcase where it won Most Innovative and 2nd place People's Choice. In September, the game was invited to participate in the Boston Festival of Indie Games at Massachusetts Insititute of Technology. Arcane Tectonics is currently available for download on Android via the Google Play Store in the beta section, and the team has plans to release for iOS on the App Store in 2019.
In the spring of 2018, Arcane Tectonics was released at the Game Design Initiative at Cornell's spring showcase where it won Most Innovative and 2nd place People's Choice. In September, the game was invited to participate in the Boston Festival of Indie Games at Massachusetts Insititute of Technology. Arcane Tectonics is currently available for download on Android via the Google Play Store in the beta section, and the team has plans to release for iOS on the App Store in 2019.
Does this site make you hungry? Thought so! Since January 2018 I have been Sarah K's web designer. Sarah wanted a site where current and potential customers could go to learn more about her business and make orders.Functionalityarrow_forward
We started by having a conversation about the nature of her business, it's operations, and goals. From there I showed her a few competitor sites to learn about her tastes. After a few sketches and a couple more conversations, I refined the information architecture shown in the site map.Visual Designarrow_forward
For the visual design I decided to go with a very simple black/off-white color scheme with hints of the hot-pink she uses in her branding. She uses many different colored pictures on her social media, so I wanted the site's color scheme to not compete for visual attention with the pictures of her product. I want the site to feel simple, professional, with a splash of fun!Websitearrow_forward
A food discovery app designed and prototyped as part of the 2017 CHI Student Design Competition's theme of Leveling the Playing Field: designing technology for populations that are usually left out of HCI.Discoveryarrow_forward
From our stakeholder interviews we constructed a user persona with four goals: (1) to reduce food discovery time through better accessibility of reliable resources, (2) to increase user health in diet through better variety, (3) to minimize social barriers and effects of stigmas towards users, and (4) to reduce cost.Prototypearrow_forward
After brainstorming 80 design ideas and sketches ranging from tablets on shopping carts to wearable technology, the team decided designing an app would be the most feasbile and useful solution for our stakeholders. The initial idea for the app had four main features: food discovery, social interaction, price comparison, and meal planning.User Testingarrow_forward
After creating a low-fi prototype of the wireframes using Balsamiq, we tested it with 8 stakeholders. We used Nielsen's Heuristics to evaluate our prototype's painpoints. From this feedback we created a hi-fi prototype using InVision. After more user interviews, we recognized three major UX problem groups: use of features, visibility, and colors & options.Resultsarrow_forward
After making several changes we presented our final design. Overall, the app functions similarly to several food discovery apps. If we were to launch an app like this, we would have many challenges in creating a safe, trustworthy platform for users with extreme food sensitivities. Ideally, we'd have access to an FDA database on approved food brands for specific allergies.
An ominous slide until blocked puzzle game in which the player takes on the role of a hacker. OpBit introduces an interesting cooperation mechanic where the player controls Vi and Russ who must work together to reach their respective goals.Mechanicsarrow_forward
Each puzzle has the same primary challenge of getting Vi (WASD) and Russ (arrow keys) from their start positions to their goal blocks. Players must use blocks in their enviroment and each other to get to their goal blocks. They can avoid getting stuck in dead ends by thinking “steps ahead” to evaluate possible consequences of every move, or by reverse engineering the solution starting from the goals rather than the positions of Vi and Russ.Resultsarrow_forward
At the Game Design Initiative at Cornell spring 2017 showcase, over 1,000 community members played our game. It was awarded 'Best Gameplay' by the game design department.
Programmers: Alejandro De Vore, Tyler Thompson, Brandon Walker, David Ma
Designers: Sophia Deng, Annie Hughey
Girl4Girl is a tech organization driven to empower and encourage femme identifying groups in STEM. We are a group of four current Cornell students and alumni that are passionate about gender inclusivity in STEM fields. Our goal is to create femme success in traditionally exclusive environments.Websitearrow_forward
While researching gender based discrimination in STEM and in general, our team found that most work that has been done is focused on the top of the pyramid of discrimination, on the most obvious, offensive acts of discrimination. But from in our experience, the small acts of discimination are more pervasive and potentially more dangerous due to the normalization of gender based supremacy.Websitearrow_forward


[§340E-4.6] Inspection of premises. The director, in accordance with rules adopted pursuant to chapter 91, may enter and inspect any facility of a supplier of water to determine whether such supplier is acting in compliance with this part. [L 1987, c 165, pt of §1]
Revision Note
"Part" substituted for "chapter".


Class Formatter
Represents code used to format a value into a IBufferWriter(char).
Wraps either a static method or a delegate.
Inheritance
System.Object
Formatter
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Cesil
Assembly: Cesil.dll
public sealed class Formatter : IEquatable<Formatter>, ICreatesCacheableDelegate<Formatter.DynamicFormatterDelegate>, IElseSupporting<Formatter>
Methods
|
Improve this Doc
View Source
Returns a Formatter that differs from this by explicitly allowing
null values to be passed to it.
If the backing method, or delegate does not expect null values, this may lead
to errors at runtime.
Declaration
public Formatter AllowNullValues()
Returns
|
Improve this Doc
View Source
Create a new Formatter that will try this formatter, but if it returns false
it will then try the given fallback Formatter.
Declaration
public Formatter Else(Formatter fallbackFormatter)
Parameters
| Type |
Name |
Description |
| Formatter |
fallbackFormatter |
|
Returns
|
Improve this Doc
View Source
Compares for equality to another Formatter.
Declaration
public bool Equals(Formatter formatter)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Compares for equality to another Formatter.
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
Returns a new Formatter that differs from this by explicitly forbidding
null values to be passed to it.
If the .NET runtime cannot guarantee the absense of null values, null checks
will be injected.
Declaration
public Formatter ForbidNullValues()
Returns
|
Improve this Doc
View Source
Create a Formatter from the given delegate.
Declaration
public static Formatter ForDelegate<TValue>(FormatterDelegate<TValue> del)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
Create a formatter from a method.
Formatter needs to:
- the type to be formatter (or one it is assignable to)
- an in (or by ref) WriteContext
-an IBufferWriter(char)
- return bool (false indicates value could not be formatted)
Declaration
public static Formatter ForMethod(MethodInfo method)
Parameters
| Type |
Name |
Description |
| MethodInfo |
method |
|
Returns
|
Improve this Doc
View Source
Returns the default formatter for the given type, if one exists.
Declaration
public static Formatter GetDefault(TypeInfo forType)
Parameters
| Type |
Name |
Description |
| TypeInfo |
forType |
|
Returns
|
Improve this Doc
View Source
Returns a hash code for this Getter.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
Describes this Formatter.
This is provided for debugging purposes, and the format is not guaranteed to be stable between releases.
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.Object.ToString()
Operators
|
Improve this Doc
View Source
Compare two Formatters for equality
Declaration
public static bool operator ==(Formatter a, Formatter b)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Convenience operator, equivalent to calling Formatter.ForDelegate if non-null.
Returns null if del is null.
Declaration
public static explicit operator Formatter(Delegate del)
Parameters
| Type |
Name |
Description |
| System.Delegate |
del |
|
Returns
|
Improve this Doc
View Source
Convenience operator, equivalent to calling Formatter.ForMethod if non-null.
Returns null if method is null.
Declaration
public static explicit operator Formatter(MethodInfo? method)
Parameters
| Type |
Name |
Description |
| System.Nullable<MethodInfo> |
method |
|
Returns
|
Improve this Doc
View Source
Compare two Formatters for inequality
Declaration
public static bool operator !=(Formatter a, Formatter b)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Implements
System.IEquatable<T>


|
Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
|
Classes | |
| class | Satori.ApiResponseException |
An exception generated for HttpResponse objects don't return a success status. More... | |
| interface | Satori.IApiAuthenticateLogoutRequest |
| Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. More... | |
| class | Satori.ApiAuthenticateLogoutRequest |
| interface | Satori.IApiAuthenticateRefreshRequest |
| Authenticate against the server with a refresh token. More... | |
| class | Satori.ApiAuthenticateRefreshRequest |
| interface | Satori.IApiAuthenticateRequest |
| Authentication request. More... | |
| class | Satori.ApiAuthenticateRequest |
| interface | Satori.IApiEvent |
| A single event. Usually, but not necessarily, part of a batch. More... | |
| class | Satori.ApiEvent |
| interface | Satori.IApiEventRequest |
| Publish an event to the server. More... | |
| class | Satori.ApiEventRequest |
| interface | Satori.IApiExperiment |
| An experiment that this user is partaking. More... | |
| class | Satori.ApiExperiment |
| interface | Satori.IApiExperimentList |
| All experiments that this identity is involved with. More... | |
| class | Satori.ApiExperimentList |
| interface | Satori.IApiFlag |
| Feature flag available to the identity. More... | |
| class | Satori.ApiFlag |
| interface | Satori.IApiFlagList |
| All flags available to the identity. More... | |
| class | Satori.ApiFlagList |
| interface | Satori.IApiIdentifyRequest |
| Enrich/replace the current session with a new ID. More... | |
| class | Satori.ApiIdentifyRequest |
| interface | Satori.IApiLiveEvent |
| A single live event. More... | |
| class | Satori.ApiLiveEvent |
| interface | Satori.IApiLiveEventList |
| List of Live events. More... | |
| class | Satori.ApiLiveEventList |
| interface | Satori.IApiProperties |
| Properties associated with an identity. More... | |
| class | Satori.ApiProperties |
| interface | Satori.IApiSession |
| A session. More... | |
| class | Satori.ApiSession |
| interface | Satori.IApiUpdatePropertiesRequest |
| Update Properties associated with this identity. More... | |
| class | Satori.ApiUpdatePropertiesRequest |
| interface | Satori.IProtobufAny |
| class | Satori.ProtobufAny |
| interface | Satori.IRpcStatus |
| class | Satori.RpcStatus |
| class | Satori.ApiClient |
| The low level client for the Satori API. | |
Namespaces | |
| namespace | Satori |


On Building This Site
The joys, pains, and future of building phdewitte.github.io
The joys, pains, and future of building phdewitte.github.io
The basic process of Test Driven Development and why this method ensures success at every step in the development process
The similarities and differences of JavaScript Objects and Ruby hashes
The benefits of classes and their method grouping abilities
A breakdown of Ruby's .map method within Enumerables, its uses, and its difference from .each
Basic information on containter objects within Ruby, their differences, their advantages, and potential uses.
A brief rundown of positioning options within CSS, their uses, and how to manipulate them for an effectively organized site.
Git, GitHub, and version control - Essential tools of web development
They can start by acknowledging that YouTube is a music retailer (which they kinda sorta not exactly have - YT Red anyone???)...
They've made the entire history of recorded music available at the click of a button, but they can't keep track of metadata?
Brisket, ribs, and chicken all need different amounts of time in the smoker. Read on for the magic time table of bbq success.


Checkbox as iPhone-Style
Default
Default On
Default
Another Independent iPhone-Style Checkbox
Default
Default On
Default
Another Group of Acts as Radio Buttons
Water
Beer
Wine
Simple On Off checkbox
Checkbox with function callback
CSS Sized Container and Handle
Long and short labels
Checkbox status is
...
.


This section describes some of the GrADS commands and functions that are available for analyzing and displaying station data. Please refer to the companion section About Station Data for information on the structure of station data files, how to create them, and how to instruct GrADS to interpret them properly.
Here are some quick links for skipping through this section:
Currently, station data operations and display are supported for three distinct dimension environments:
Operations may be done on station data as with gridded data. Operations between grids and station data are not supported.
Operations between station data are defined as being the operation performed on data points that have exactly the same varying dimension values.
For example, if T is the only varying dimension, the expression:
display ts-ds
would result in a time series of station data reports being retrieved for two separate variables. Then, for station reports having exactly the same time, the operation is performed. Note that duplicates are ignored, with the operation being performed between the first occurrences encountered.
When both X and Y are both fixed dimensions, the variable specification may include a station identifier, which specifies a local override for both lat and lon.
The syntax for this would be:
varname(stid=ident)
The station identifiers are case insensitive.
Some functions do not support station data types. These are:
hdivg
hcurl vint maskout ave aave tloop
When X and Y are varying, station data values are displayed as
numbers centred at their locations. If two expressions are
supplied on the display
command
(ie,
display
ts;ds) then two
values are displayed, above and below the station location. The
display is controlled by the following set
commands:
set ccolor color
set dignum digits
set digsiz size
set stid on|off
The set stid
command
controls whether the station identifier is displayed with each value.
GrADs will plot station models from station data. This is enabled by:
set gxout
modelThe appropriate display command is:
display u;v;t;d;slp;delta;cld;wx;vis
where:
u
and v
are the wind components. A wind barb will
be drawn using
these values. If either is missing, the station model will not
be plotted at all.
t, d, slp
, and delta
are plotted numerically
around the station model
cld
is the value of the symbol desired at the center of the
station model. Values 1
to 9
are assumed to be the
marker types
(ie, circle, square, crosshair, etc). Values 20
to 25
are assumed
to be cloudiness values:
20
-clear 21
-scattered
22
-broken 23
-overcast 24
-obscured 25
-missing (M plotted)
wx
is the
value
of the wx
symbol (see draw wxsym
) to be plotted
in the wx
location.
vis
is the visibility as a real number. It will be
plotted as a whole number and a fraction.
When any of these items are missing (other than u
and
v
), the
model is plotted without that element. To represent a globally
missing value, enter a constant in the display
command. For
example, if the delta
were always missing, use:
display u;v;t;d;slp;0.0;cld
The station models respond to the usual set commands such as
set digsiz
, set dignum
, set cthick
, set ccolor
.
In addition, there is:
set stnopts
which will cause the model to plot the number in the slp location
as a three digit number, with only the last three digits of the
whole number plotted. This allows the standard 3 digit sea
level pressure to be plotted by enabling dig3
and plotting
slp*10.
Drawing arbitrary vertical cross sections based on a collection of station data profiles involves transforming station data (scattered observations) into gridded data so as to take advantage of the GrADS grid display and analysis features.
The first step is to form a collection of 1-D data (Z or T
varying). The collect
command saves station data profiles or time series in memory as a
set. The 1-D data may be either real station data or
gridded data converted to station data using
gr2stn
.
The second stop is to convert the collection of station data into
a grid for display or analysis purposes. This is accomplished by
the new function coll2gr
.
coll2gr
does not yet
support time slices; currently, it will only work when the collection
of stations is a collection of vertical profiles.
coll2gr
produces an
output grid that varies in X and Z; the dimension environment used
when coll2gr
is
invoked must also be X and Z varying. The X axis of the output grid
will contain the equally spaced station profiles and will span the
range of the current X dimension environment. The Z axis of the output
grid will span the range of the current Z dimension environment and
will have either the specified number of levels or a union of the
levels. Data points outside of the range of levels will be used for
interpolating to within the range if appropriate.
The X axis of the output grid from coll2gr
is artificial in
terms of the world coordinates -- it doesn't really represent
longitudes. A way to completely control the labelling of the display
output is provided:
set xlabs lab1 | lab2 | lab3 ...
set ylabs lab1 | lab2 | lab3 ...
Each label string may include blanks. The labels will be plotted equally spaced along the indicated axis. Spacing can be modified by adding blank strings:
set xlabs | | | | lab1 | ...
Here is a sample script written by M. Fiorino that uses these features:
*********************************************************************
* The following lines will display an arbitrary X section
* from one specified point to another.
*
* lon1 is the westernmost longitude point
* lon2 is the easternmost longitude point
* lat1 is the latitude that corresponds to lon1
* lat2 is the latitude that corresponds to lon2
*
* The loop is used to interpolate between points in
* the arbitrary cross section. This code will plot
* any cross section as long as you specify the points.
* My code plots cross sections of PV after I calculated
* PV on 11 pressure surfaces. I have another script
* that plots cross sections of potential temperature, and
* the code is very similar to this, except theta is substituted
* for PV.
*
* Many thanks to Brian Doty at COLA for his help with this code.
*
********************************************************************
'open pv.ctl'
'set grads off'
'set zlog on'
'set x 1'
'set y 1'
'set lev 1000 100'
lon1 = -95.0
lon2 = -90.0
lat1 = 55.0
lat2 = 15.0
lon = lon1
'collect 1 free'
while (lon <= lon2)
lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
'collect 1 gr2stn(pv,'lon','lat')'
lon = lon + 1
endwhile
'set x 14 16'
'set xaxis 'lon1' 'lon2
'set clab on'
'set gxout shaded'
'set clevs 0 .5 15'
'set ccols 0 0 7 0'
'd coll2gr(1,-u)'
'set gxout contour'
'set cint .5'
'd coll2gr(1,-u)'


Former world number four Tomas Berdych announces retirement
by ReutersHighlights
- Tomas Berdych announced his retirement from tennis on Saturday
- The Czech, who won 13 ATP singles titles in a 17-year-long career, was a fixture in the world's top 10 between 2010 and 2016
- Berdych's one Grand Slam final came in 2010 when he was beaten by Rafael Nadal at the All England Club
LONDON: Former world number four and Wimbledon runner-up Tomas Berdych announced his retirement from tennis on Saturday.
The Czech, who won 13 ATP singles titles in a 17-year-long career, was a fixture in the world's top 10 between 2010 and 2016.
Berdych's one Grand Slam final came in 2010 when he was beaten by Rafael Nadal at the All England Club.
He was part of the Czech team that won back-to-back Davis Cup titles in 2012 and 2013.
The 34-year-old Berdych, who has not played since losing in the first round of the U.S. Open in August, announced his decision at the ATP Finals.
Berdych said it was his defeat by qualifier Jenson Brooksby in New York that convinced him it was time to quit.
"I don't know exactly the day and date, but it was very soon or very quickly after the U.S. Open this year, because really, just the feeling that I went through on my last official match, it's been just one that told me, that's it," he said.
"You tried absolutely everything and the result is how it is. I was always chasing the top results and being in the top positions, and then you are almost really fighting for the first match to win, really like badly, fighting with yourself."


This is a very, very simple set of themes that you can choose to apply to the screens. Select one and click Apply and it will be used, even through restarts of the App.
One day I'll add the ability to create your own themes, but it's not a high priority right now.


Few more questions!
Have you served for US military?
Did you know, if you have served for US military, you might be eligible for $0 downpayment?


Seattle Playland
Adult Rides (60" and over)
Roller Coaster
Death Drop
Children Rides (Must be less than 60" to take this ride.)
Teacups
Toddler Train


Preparation time
less than 30 mins
Cooking time
less than 10 mins
Serves
Serves 4
For the crab patties, place the crab, potato, ginger and lime juice into a bowl and mix thoroughly.
Add the coriander and season well with salt and freshly ground black pepper and mix well.
Roll a golf ball-sized piece of crab mix and form it into a flat patty shape. Repeat with the rest of the mixture.
Heat a frying pan until hot and add the olive oil. Add the patties and fry on both sides until golden brown all over and heated through. Set aside on kitchen paper and keep warm.
For the salad, place the chillies, sugar, vinegar and water into a pan over a medium heat and bring to a boil. Reduce the heat and simmer the mixture for 5-6 minutes to make the dressing.
Place the mizuna leaves, sweetcorn, spring onions and toasted coconut into a bowl and stir gently to combine. Add a little dressing and stir to coat.
To serve, place equal portions of the salad onto plates and top each with two or three crab patties.


Individual Empowerment
Remove geographic and demographic barriers, and empower your employees with a transparent network to create their own career path within the company.
Networking
Whether it is collaborating on new projects or learning about new growth oppoortunities, Acquainted makes it easy to discover individuals or teams based on skills and experiences.
Smart Analytics
Gather real-time data about employee and team engagements, skills anad performance.
Integration
Works easily with existing office tools such as Outlook or Lotus Note
Open Data
Employee skills and experiences are made transparent. Personal profiles are updated during the onboarding and performance review process.
Discover
Search and discover individuals within the orgnization by skills, experiences and teams.


Natural language in its textual form may be represented as a sequence of tokens. The specific granularity of the tokens in these sequences varies from the coarsest word level, to individual characters, to different variations of subword morphemes, token metadata tags, and punctuation. A Language Model (LM) is a statistical model of natural language that generates a probability distribution for these sequences .
In particular, given a sequence of words \(w_{1:n}\), we wish to estimate the probability \(P(w_{1:n})\). In the general case, we can use the probability chain rule
\[\displaystyle P(w_{1:n}) = P(w_n \mid w_{1:n - 1}) \cdot P(w_{n - 1} \mid w_{1:n - 2}) \cdots P(w_2 \mid w_1) \cdot P(w_1)\]
to confirm our intuition that a language model's understanding of a given word in a sequence relies on an understanding of the full context from the current word all the back to the first word in the sequence. That is, understanding future tokens in a sequence requires understanding not only the present, but also the entire past history of the sequence.
Of course, with any probabilistic model, we must have a method of scoring the model. In Shannon's seminal work on information theory he discussed modeling an information source inherent information using entropy . In the discrete case, Shannon entropy is defined as
\[\displaystyle\entropy(p) = - \sum_{i=1}^n p(x_i) \log_b p(x_i) \]
where \(p(x_i)\) is the probability of state \(x_i\), and \(\sum_i p(x_i) = 1\). Entropy can be interpreted as the information content of the modeled information source.
Then the cross entropy of two distributions \(p\) and \(q\) can be defined in the discrete case as
\[\displaystyle\entropy(p, q) = - \sum_{i=1}^n p(x_i) \log_b q(x_i) \]
Cross entropy can be thought of as a measure of the difference between two probability distributions . Thus, cross entropy is often used as an objective function in optimization tasks, because we want to minimize the difference between the probability distribution of the training set (as an estimate of the true probability distribution of the whole), and the distribution of the statistical model's output.
Perplexity is defined as
\[\displaystyle\perplexity(p) = b^{- \sum_{i=1}^n p(x_i) \log_b p(x_i)} \]
which is precisely \(b^{\entropy(p)}\), or the exponentiation of Shannon entropy ! Due to its similarity, supposes that perplexity is preferred over cross-entropy as a performance metric due to the more impressive nature of being able to claim large reductions in perplexity as opposed to a cross-entropy loss of a fraction of a bit.
However, when scoring a language model, we rarely (if ever) know the true probability distribution of the language a dataset it sampled from. So we modify the equation above to approximate the perplexity of a language model from the training set probability distribution \(\tilde p\), and the language model's output distribution
\[\displaystyle\widetilde{\perplexity}(\tilde p, \model) = b^{- \sum_{i=1}^{n} \tilde{p}(w_i) \log_b \model(w_i)}\]
where our training dataset is formed of \(n\) words \(w_1, \dots, w_n\). But the word \(w_i\) is sampled uniformly from the dataset, so \(\tilde p(w_i) = \frac{1}{n}\), which results in the definition of perplexity that gives.
\[\displaystyle\perplexity(\model) = 2^{-\frac{1}{n}\sum_{i=1}^n \log_2 \model(w_i \mid w_{1:i-1})} \]
Notice that the worst possible language model would be a random choice of the next token in a sequence with a uniform distribution. Such a model would have each \(\model(w_i \mid w_{1:i-1}) = \frac{1}{n}\), which would result in a high perplexity score. A good language model — one that is reflective of "real" language — will assign high probabilities to observed events in the test corpus, which results in minimizing the perplexity score . Notice, however, that perplexities are corpus specific — rendering it impossible to compare scores between two language models trained on different datasets.


Unvaccinated students unenroll from school due to outbreak
RENO, Nev. (AP) - Nineteen unvaccinated students were forced to temporarily unenroll from a Reno high school to avoid exposure during an outbreak of whooping cough.
Unenrolling during the disease’s 21-day incubation period allows the Damonte Ranch High School students to avoid being classified as chronically absent.
The 19 affected students claimed a religious exemption from the vaccine for whooping cough. The Washoe County Health Department says they should avoid going to school until 21 days after the last student was diagnosed.
TOP STORIES
Franklin Graham calls on nation to pray for Trump as impeachment effort gains speed
Nancy Pelosi goes for slam dunk -- and crashes to court
Attorney General Barr blasts progressives' anti-Trump 'resistance'
A school district official tells the Reno Gazette Journal that the students will be in touch with their teachers and won’t be held back. She says absences because of a lack of vaccination can’t be excused under federal law.
Three students at the school have been diagnosed with whooping cough.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Feature request: highlight matching
-
gimmick66
After playing with Sublime Text 2's file finder, I think it would be a great improvement to highlight which letters Command-T matches in a file name. It would make scanning the list much easier, and it looks better in general. For example, have non-matched letters slightly grayed out, while displaying matched letters in white. This feature would be A+ supertown.
-
Greg Hurrell
I agree this would be a neat feature. There is an existing ticket for this issue: feature request #1492.
Reply
This topic is now closed.


object
MessagesActors
Type Members
-
case class
CanVote(tuiId: Long, name: String, lastName: String, career: String) extends MessageOk with Product with Serializable
-
trait
MessageOk extends AnyRef
-
trait
Vote extends AnyRef
-
case class
VoteError(error: String) extends vError with Product with Serializable
-
case class
VoteReady() extends MessageOk with Product with Serializable
-
case class
VoteRut(rut: String, senderId: String, eventId: Long, folio: Long) extends Product with Serializable
-
case class
VoteWithFolio(rut: String, senderId: String, eventId: Long, folio: Long, tuiId: String = "0") extends Vote with Product with Serializable
-
case class
VoteWithoutFolio(rut: String, senderId: String, eventId: Long, tuiId: String = "0") extends Vote with Product with Serializable
-
trait
vError extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Created by Nicolas on 20-06-2016.


In this experiment, your task is to decide how well different sentences describe what happened in a video clip.
The image below shows you an example of the kinds of clips you are going to see.
All of the clips feature two billiard balls, a black ball, and a red ball. Some clips also feature a box (here it was placed in the middle of the scene).
You will judge for each clip how well the following three sentences describe the clip:
Please click Start to begin the experiment.
Note: The video is played in a loop. If it stops playing, just click the 'reload video' button.


NFS4_ACL
Section: NFSv4 Access Control Lists (5)Updated: version 0.3.3, August 2008
Index Return to Main Contents
NAME
nfs4_acl - NFSv4 Access Control ListsDESCRIPTION
An ACL is a list of permissions associated with a file or directory and consists of one or more Access Control Entries (ACEs). NFSv4 ACLs provide finer granularity than typical POSIX read/write/execute permissions and are similar to CIFS ACLs.
A sample NFSv4 file ACL might look like the following (see the ACL FORMAT section for detailed information):
-
A::OWNER@:rwatTnNcCy A::alice@nfsdomain.org:rxtncy A::bob@nfsdomain.org:rwadtTnNcCy A:g:GROUP@:rtncy D:g:GROUP@:waxTC A::EVERYONE@:rtncy D::EVERYONE@:waxTC
Some observations:
- -
- In the example output above, the user<EMAIL_ADDRESS>has the equivalent of "read" and "execute" permissions<EMAIL_ADDRESS>has "read" and "write", and both `GROUP@' and `EVERYONE@' have "read".
- -
- NFSv4 ACLs are "default-deny"; that is, if a permission is not explicitly granted by an Allow ACE, it is denied. Because of this, the two Deny ACEs above are superfluous and could be excluded by the server. See the A WARNING ABOUT DENY ACES section for more information.
- -
- NFSv4 servers may return an ACL slightly different than one you set. For example, a server that always allows reading the attributes of a file may silently turn on the read-attributes permission, and a server that does not support separate write-data and append-data permissions, e.g., may choose to turn off both if you set only one. In extreme cases the server may also reorder or combine ACEs. As a general rule, however, servers will attempt to ensure that the ACLs they return are no more permissive than the ones you set.
ACL FORMAT
An NFSv4 ACL is written as an acl_spec, which is a comma- or whitespace-delimited string consisting of one or more ace_specs. A single NFSv4 ACE is written as an ace_spec, which is a colon-delimited, 4-field string in the following format:
- type:flags:principal:permissions
ACE TYPES:
There are four types of ACEs, each represented by a single character. An ACE must have exactly one type.- A Allow - allow principal to perform actions requiring permissions.
- D Deny - prevent principal from performing actions requiring permissions.
- U Audit - log any attempted access by principal which requires permissions. Requires one or both of the successful-access and failed-access flags. System-dependent; not supported by all servers.
- L Alarm - generate a system alarm at any attempted access by principal which requires permissions. Requires one or both of the successful-access and failed-access flags. System-dependent; not supported by all servers.
ACE FLAGS:
There are three kinds of ACE flags: group, inheritance, and administrative. An Allow or Deny ACE may contain zero or more flags, while an Audit or Alarm ACE must contain at least one of the successful-access and failed-access flags. Note that ACEs are inherited from the parent directory's ACL at the time a file or subdirectory is created. Accordingly, inheritance flags can be used only in ACEs in a directory's ACL (and are therefore stripped from inherited ACEs in a new file's ACL). Please see the INHERITANCE FLAGS COMMENTARY section for more information.- GROUP FLAG - can be used in any ACE
- g
- group - indicates that principal represents a group instead of a user.
- INHERITANCE FLAGS - can be used in any directory ACE
- d
- directory-inherit - newly-created subdirectories will inherit the ACE.
- f
- file-inherit - newly-created files will inherit the ACE, minus its inheritance flags. Newly-created subdirectories will inherit the ACE; if directory-inherit is not also specified in the parent ACE, inherit-only will be added to the inherited ACE.
- n
- no-propagate-inherit - newly-created subdirectories will inherit the ACE, minus its inheritance flags.
- i
- inherit-only - the ACE is not considered in permissions checks, but it is heritable; however, the inherit-only flag is stripped from inherited ACEs.
- ADMINISTRATIVE FLAGS - can be used in Audit and Alarm ACEs
- S
- successful-access - trigger an alarm/audit when principal is allowed to perform an action covered by permissions.
- F
- failed-access - trigger an alarm/audit when principal is prevented from performing an action covered by permissions.
ACE PRINCIPALS:
A principal is either a named user (e.g<EMAIL_ADDRESS>or group (provided the group flag is also set), or one of three special principals: `OWNER@', `GROUP@', and `EVERYONE@', which are, respectively, analogous to the POSIX user/group/other distinctions used in, e.g., chmod(1).ACE PERMISSIONS:
There are a variety of different ACE permissions (13 for files, 14 for directories), each represented by a single character. An ACE should have one or more of the following permissions specified:- r
- read-data (files) / list-directory (directories)
- w
- write-data (files) / create-file (directories)
- a
- append-data (files) / create-subdirectory (directories)
- x
- execute (files) / change-directory (directories)
- d
- delete - delete the file/directory. Some servers will allow a delete to occur if either this permission is set in the file/directory or if the delete-child permission is set in its parent direcory.
- D
- delete-child - remove a file or subdirectory from within the given directory (directories only)
- t
- read-attributes - read the attributes of the file/directory.
- T
- write-attributes - write the attributes of the file/directory.
- n
- read-named-attributes - read the named attributes of the file/directory.
- N
- write-named-attributes - write the named attributes of the file/directory.
- c
- read-ACL - read the file/directory NFSv4 ACL.
- C
- write-ACL - write the file/directory NFSv4 ACL.
- o
- write-owner - change ownership of the file/directory.
- y
-
synchronize - allow clients to use synchronous I/O with the server.
INHERITANCE FLAGS COMMENTARY
Inheritance flags can be divided into two categories: "primary" (file-inherit and directory-inherit); and "secondary" (no-propagate-inherit and inherit-only), which are significant only insofar as they affect the two "primary" flags.The no-propagate-inherit and inherit-only flags can be tricky to remember: the former determines whether or not a new child directory's inherited ACE is itself heritable by a grandchild subdirectory; the latter determines whether or not a heritable ACE affects the parent directory itself (in addition to being heritable). They can be used in-tandem.
When a subdirectory inherits an ACE from its parent directory's ACL, this can happen in one of two different ways, depending on the server implementation:
- -
- In the simple case, that exact same ACE is set in the subdirectory's ACL.
- -
- In the other case, two different ACEs will instead be set in the subdirectory's ACL: one with all inheritance flags removed, and one with the inherit-only flag added. The former is the "effective" inherited ACE (used in the subdirectory's own permissions checks); the latter is the "heritable" inherited ACE (when the subdirectory has directories created within it, they inherit it). This approach makes it easier to modify access rights to the subdirectory itself without modifying its heritable ACEs.
A WARNING ABOUT DENY ACES
Deny ACEs should be avoided whenever possible. Although they are a valid part of NFSv4 ACLs, Deny ACEs can be confusing and complicated. This stems primarily from the fact that, unlike POSIX ACLs and CIFS ACLs, the ordering of ACEs within NFSv4 ACLs affects how they are evaluated.First, it is important to note that (despite some unfortunate ambiguity in RFC3530) NFSv4 ACLs are "default-deny" in practice. That is, if a permission is not explicitly granted, it is denied.
In general, when a principal is attempting to perform an action over NFSv4 which requires one or more permissions, an access check is performed. The NFSv4 ACL (assuming one is present) is evaluated ACE-by-ACE until every one of those permissions has been addressed, or until the end of the ACL is reached. If every requisite permission was granted by Allow ACEs and was not forbidden by Deny ACEs (see next paragraph), the action is allowed to proceed. Otherwise, the action is forbidden.
Note that each requisite permission is only addressed once -- that is, after a permission has been explicitly Allowed or Denied once during an access check, any subsequent ACEs in the ACL which affect that permission are no longer considered. This often introduces problematic ordering issues when Deny ACEs are present.
Additionally, in some cases Group-Deny ACEs can be difficult (if not impossible) to enforce, since a server might not know about all of a given principal's memberships in remote groups, e.g.
Because NFSv4 ACLs are "default-deny", the use of Deny ACEs can (and should) be avoided entirely in most cases.
AUTHORS
Tools for viewing and manipulating NFSv4 ACLs, nfs4_getfacl and nfs4_setfacl, were written by people at CITI, the Center for Information Technology Integration (http://www.citi.umich.edu). This manpage was written by David Richter and J. Bruce Fields.CONTACT
Please send bug reports, feature requests, and comments to<EMAIL_ADDRESS>ALSO
nfs4_getfacl(1), nfs4_setacl(1), RFC3530 (NFSv4.0), NFSv4.1 Minor Version Draft.
Index
- NAME
- DESCRIPTION
- ACL FORMAT
- INHERITANCE FLAGS COMMENTARY
- A WARNING ABOUT DENY ACES
- AUTHORS
- CONTACT
- SEE ALSO
This document was created by man2html, using the manual pages.
Time: 05:34:00 GMT, December 24, 2015


Nicholas Graff
I am Nicholas Graff. I am 29 years old and have lived in St. Louis almost my entire life.
Places I Have Visited
Philadelphia
Mexico
Colorado
New York
Florida
New Orleans


Currently part of Cloud Monitoring at Rackspace Previously at SuSE on Kernel team Saw a talk at Linux Plumbers Conference (Tunneling Monster)
Transparent to the cloud machines Multi-tenant on a single IP network Tenant networks can't see/talk to each other
An extension to ethernet frames 12 bits of VLAN ID, only 4096 (tenant) Requires physical switch participation Lots of different hardware to configure Hard to do quickly on-demand Conclusion: Built for a different era
You want a private L2 network between VMs You already have working IP between the members of the network Use that "underlay" IP network and overlay a private ethernet on top
Network Virtualization using Generic Routing Encapsulation (nvgre) Uses the GRE for encapsulation 24 bits of tenant space (16 million) Microsoft/HP/Intel/Broadcom
Virtual eXtensible Local Area Network (vxlan) Encapsulates in a UDP packet 24 bits of tenant space (16 million) VMWare/Cisco/Broadcom/Red Hat
Stateless Transport Tunneling (stt) Uses a "cute" hack to get performance from network gear Use the TCP header "syntax" Take advantage of hardware TCP offload on existing server hardware Large 64 bit context id (16 million)
ACK is used as an identification field SEQ upper is used for STT frame length SEQ lower is used for STT frame offset of this packet
Firewalls inspecting L3 traffic will be grumpy TCP state machine isn't used Could confuse the network in the middle
Essentially all standards rely on IP multicast Mapping of virtual network to multicast group is left undefined Out of scope for these tunneling protocols
Multicast between virtual machines Less burden on 100% secure firewalls Can be built in a secure manner Much more sophisticated attacks required
VM ethernet can be spoofed and inspected by any attacker at the IP level Virtual Network ID must be properly communicated automically without reuse All three RFCs recommend considering IPSec for underlay network
Are you lazy? A Cloud Network would be a big step up Keep backend servers off of public IPs Running old insecure OSes for building packages Creating isolated dev/qe machines environments
L2 in L3 is probably here to stay in the cloud Three emerging standards: VXLAN/NVGRE/STT In its raw form these protocols give a level of privacy but not security You should still use SSL/IPSec/etc between backend services


Posts about “Podcast”
Get your science and techie news served up with a healthy dose of Brit witticisms. Check out The Register, a highly readable site out of the UK that dishes the sarcasm along with the geek factor.
Also, alive - in conjunction with The Good Life Network has just launched their podcast page. You can here my boss Terry-Lynn being interviewed by the silver-tongued Jesse Dylan at aliveonair.com.
I’m administering a new podcast for Rev. Craig Vance at my church. Craig’s sermons are really insightful and quite intellectual. Anyway, the technical side of things has hardly been cutting edge as I’ve been recording onto cassette tapes that get chewed up in my 1990 cassette player before they even get turned into an MP3. Nevertheless, I’ve managed two so far and plan to keep that site updated every week. Check it out if you’re interested.


--- author: admin blogger_id: tag:blogger.com,1999:blog-15525201.post-2413630009575276330 blogger_orig_url: https://asmaier.blogspot.com/2010/09/tipp-fur-itunes-10.html date: "2010-09-12T19:52:00Z" modified_time: "2011-05-19T19:07:14.144+02:00" tags: - old_blog - german title: Tipp für iTunes 10 ---


Nitrogen 2.x Documentation
Home | Getting Started | API | Elements | Actions | Validators | Handlers | Configuration Options | Advanced Guides | Troubleshooting | About
Table of Contents
1 Index
2 AJAX Updates
TargetID can refer to the name of an element, or it can be a JQuery selector path. See Element Paths for more information.
For every one of these functions which offer a Priority
argument,
Priority
can be either the atom eager
, normal
, or defer
. eager
will
always execute before normal
, which will always execute before defer
.
Any wiring which does not explicitly specify a priority will wire at normal
priority.
wf:set(TargetID, Value) -> ok
wf:set(Priority, TargetID, Value) -> ok
Update a form element (textbox, dropdown, checkbox, etc) to set text value
of TargetID. Can also be used to set the src
attribute of an image tag.
wf:enable(Target) -> ok
wf:enable(Priority, Target) -> ok
Enables the target form field or button.
wf:disable(Target) ->
wf:disable(Priority, Target) ->
Disables the target form field or button.
wf:update(TargetID, Elements) -> ok
wf:update(Priority, TargetID, Elements) -> ok
Update the contents of TargetID with a new set of Nitrogen Elements.
wf:replace(TargetID, Elements) -> ok
wf:replace(Priority, TargetID, Elements) -> ok
Replace TargetID with a new set of Nitrogen Elements.
wf:remove(TargetID) -> ok
wf:remove(Priority, TargetID) -> ok
Remove TargetID from the DOM.
wf:insert_top(TargetID, Elements) -> ok
wf:insert_top(Priority, TargetID, Elements) -> ok
Insert Nitrogen Elements at the top of TargetID (within the contents of TargetID), shifting the existing contents downward.
wf:insert_bottom(TargetID, Elements) -> ok
wf:insert_bottom(Priority, TargetID, Elements) -> ok
Insert Nitrogen Elements at the bottom of the TargetID (within the contents of TargetID), below the existing contents.
wf:insert_before(TargetID, Elements) -> ok
wf:insert_before(Priority, TargetID, Elements) -> ok
Insert Nitrogen Elements before TargetID in the DOM, shifting the existing contents downward.
wf:insert_after(TargetID, Elements) -> ok
wf:insert_after(Priority, TargetID, Elements) -> ok
Insert Nitrogen Elements after TargetID in the DOM, below the existing contents.
wf:flash(Elements) -> ok
Insert the Nitrogen Elements as a new flash message.
3 Convenience Functions
wf:f(Format, Data) -> String or Binary
Convenience function to format a string similar to io_lib:format(Format, Data). Returns a flattened list.
Note, if Format
is a binary, the return type will be a binary, and if
Format
is a string, the return type will be a string.
wf:coalesce([List]) -> Item
Return the first element in the list that is not 'undefined'.
wf:is_string(Term) -> Bool
Return true if the Term is an Erlang string. That is, a flat list of integers.
wf:to_list(Term) -> List
Convert the supplied term to a flat list, if possible. Useful for turning Integers, Atoms, Binaries into Strings.
wf:to_atom(Term) -> Atom
Convert the supplied term into an Atom, if possible. Useful for turning Integers, Binaries, and Strings into Atoms.
wf:to_existing_atom(Term) -> Atom
Convert the supplied term to an Atom that already exists in the Erlang VM.
Same as wf:to_atom/1
but safer when in doubt. (see
the advanced section of the Erlang docs pertaining to atoms).
wf:to_binary(Term) -> Binary
Convert the supplied term into a Binary, if possible. Useful for turning Integers, Atoms, and Strings into Binaries.
wf:to_integer(Term) -> Integer
Convert the supplied term into an Integer, if possible. Useful for turning Atoms, Strings, and Binaries into Integers.
wf:html_encode(String) -> EncodedString
HTML encode the supplied String, converting things like < and > into < and >.
wf:html_decode(String) -> DecodedString
HTML decoding decode the supplied String, converting things like < and > into < and >.
wf:url_encode(String) -> EncodedString
URL encode the supplied String, converting potentially URL-breaking characters into percent notation (%XX).
wf:url_decode(String) -> DecodedString
URL decode the supplied String, converting a percent-encoded String into a normal String.
wf:to_qs(PropList) -> EncodedQueryString
Encode a PropList (a list of {Key, Value}
tuples) into a URL-encoded query string (returned as an IOList).
wf:hex_encode(String) -> EncodedString.
Hex-encode the supplied String.
wf:hex_decode(String) -> DecodedString
Convert a hex-encoded String to a normal String.
wf:temp_id() -> String
Return a temp id. Useful for naming an Element so that you can refer to it during a postback later, without giving it a specific name.
wf:js_escape(String) -> EscapedString
Convert a String to a JS-safe string by adding backslashes to quotes and newlines.
wf:json_encode(Data) -> JsonEncodedString
Convert a data structure (Proplist, list, etc) to a JSON encoded string.
wf:json_decode(JsonEncodedString) ->
Convert a JSON-encoded string back to an Erlang data structure.
wf:join([Terms],Delimiter) -> [Terms]
Because Erlang doesn't provide a means to join a list in a non-string fashion, this will join the Terms
on the delimiter, regardless of the type of Delimiter
.
wf:join([Line1,Line2,Line2],#br{}).
4 Event Wiring
wf:wire(Actions) -> ok
Wire actions to the page. The Actions are applied against the entire page unless a trigger or target are specified within the action itself.
For example, show a Javascript alert:
wf:wire(#alert { text="Hello, World!" })
wf:wire(TargetID, Actions) -> ok
Wire actions to the page, targeted against supplied TargetID. For example, hide a Panel:
wf:wire(PanelID, #hide {})
wf:wire(TriggerID, TargetID, Actions) -> ok
Wire actions to the page, triggering on the supplied TriggerID and targeting against the supplied TargetID. This allows you to wire actions (such as #event) that listen to a click on one element and modify a different element.
For example, when a button is clicked, hide a panel:
wf:wire(ButtonID, PanelID, #event { type=click, actions=#hide {} })
wf:eager(Actions) -> ok
wf:eager(TargetID, Actions) -> ok
wf:eager(TriggerID, TargetID, Actions) -> ok
Wire actions to the page, however, execute the actions before any normal or deferred priority wired actions.
wf:defer(Actions) -> ok
wf:defer(TargetID, Actions) -> ok
wf:defer(TriggerID, TargetID, Actions) -> ok
Wire actions to the page, however, execute these actions after any normal or eager priority wired actions.
wf:continue(Tag, Function, IntervalInMS, TimeoutInMS) -> ok
Spawn the provided function (arity 0) and tell the browser to poll for the results at the specified interval, with a timeout setting. so See continuations example for usage.
5 Asynchronous Page Updates (Comet, Continuations)
wf:comet(Function) -> {ok, Pid}
wf:comet(Function, LocalPool) -> {ok, Pid}
Spawn a function connected to the specified local pool.
wf:comet_global(Function, GlobalPool) -> {ok, Pid}
Spawn a function connected to the specified global pool.
wf:send(LocalPool, Message)
Send the specified message to all comet functions connected to the specified local pool.
wf:send_global(GlobalPool, Message)
Send the specified message to all comet function connected to the specified GlobalPool.
wf:flush() -> ok
Normally, the results of a comet function are sent to the browser when the function exits.
flush/0
pushes results to the browser immediately, useful for a looping comet function.
wf:async_mode()
Return the current async mode, either comet
or {poll, IntervalInMS}
.
wf:async_mode(Mode)
Set the current async mode, either comet
or {poll, IntervalInMS}
.
wf:switch_to_comet()
Run all current and future async processes in comet mode. This uses more resources on the server, as HTTP connections stay open.
wf:switch_to_polling(IntervalInMS)
Run all current and future async processes in polling mode. This
uses more resources on the client, as the application must issue a
request every IntervalInMS
milliseconds.
wf:continue(Tag, Function) -> ok
Spawn the provided function (arity 0) and tell the browser to poll for the results. See continuations example for usage.
wf:continue(Tag, Function, Interval) -> ok
Spawn the provided function (arity 0) and tell the browser to poll for the results at the specified interval. See continuations example for usage.
6 Redirect
wf:redirect(URL) -> ok
Redirect to the provided URL
.
wf:redirect_to_login(URL) -> ok
See Below.
wf:redirect_to_login(URL, PostLoginURL)= -> ok
Redirect to the provided URL, attaching a token on the end. The receiving
page can subsequently call wf:redirect_from_login(DefaultURL)
to send
the user to PostLoginURL
.
If PostLoginURL
is not provided, it will default to the current page's
URL.
wf:redirect_from_login(DefaultURL) -> ok
Redirect the user back to a page that called wf:redirect_to_login(URL)
or
to the PostLoginURL
provided to wf:redirect_to_login(URL, PostLoginURL)
If the user came to the page for some other reason, then the user is
redirected to the provided DefaultURL
.
7 Session State
wf:session(Key) -> Value or 'undefined'
Retrieve the session value stored under the specified key.
For example, retrieve the value of 'count' for the current user:
Count = wf:session(count)
wf:session_default(Key, DefaultValue) -> Value.
Retrieve the session value stored under a specific key. If not found, return the supplied default value.
wf:session(Key, Value) -> OldValue
Store a session variable for the current user. Key and Value can be any Erlang term.
For example, store a count: wf:session(count, Count)
Returns the previous value associated with Key.
wf:clear_session() -> ok
Clear the current user's session.
wf:logout() -> ok
Clear session state, page state, identity, and roles.
8 Page State
wf:state(Key) -> Value
Retrieve a page state value stored under the specified key. Page State is different from Session State in that Page State is scoped to a series of requests by one user to one Nitrogen Page.
wf:state_default(Key, DefaultValue) -> Value.
Retrieve a page state value stored under the specified key. If the value is not set, then return the supplied default value.
wf:state(Key, Value) -> ok
Store a page state variable for the current user. Page State is different from Session State in that Page State is scoped to a series of requests by one user to one Nitrogen Page.
wf:clear_state() -> ok
Clear a user's page state.
9 Authentication and Authorization
wf:user() -> User or 'undefined'
Return the user value that was previously set by wf:user(User)
wf:user(User) -> ok
Set the user for the current session.
wf:clear_user() -> ok
Same as wf:user(undefined)
.
wf:role(Role) -> 'true' or 'false'
Check if the current user has a specified role.
wf:role(Role, IsInRole) -> ok
Set whether the current user is in a specified role. IsInRole
should be a
boolean (true
or false
)
wf:clear_roles() -> ok
Remove the user from all roles.
10 Web Request and Response
wf:q(AtomKey) -> String | undefined
Get all query string and POST values for the provided key. If more than one
AtomKey matches, then this will throw an error, use wf:qs(AtomKey)
instead. Returns the atom undefined
if there's no matching value.
Mnemonic: Think q
as "Query".
wf:mq(ListOfAtomKeys) -> [ListOfStrings]
Get the list of query string and POST values for the provided keys, and return the list of values for the keys. Syntactical sugar equivilant of:
[wf:q(AtomKey) || AtomKey <- ListOfAtomKeys]
Mnemonic: Think mq
as "Multi Query".
wf:q_pl(ListOfAtomKeys) -> [{Key,Values},…]
Takes a list of keys returns a proplist of keys and respective values from query string and POST values.
Mnemonic: Think q_pl
as "Query Proplist"
Example:
wf:qs_pl([favorite_robot,favorite_dinosaur,favorite_hobbit])
Returns something like:
[ {favorite_robot,"Optimus Prime"}, {favorite_dinosaur,"Velociraptor"}, {favorite_hobbit,"Samwise"} ].
wf:qs(AtomKey) -> [String]
Get a list of query string and POST values for the provided
key. (This acts like wf:q(AtomKey)
in Nitrogen 1.0.)
Mnemonic: Think qs
as "Query Plural"
wf:mqs(ListOfAtomKeys) -> [ListOfStrings]
Get a list of query string and POST values for the provided list of keys. Syntactical sugar equivilant of:
[wf:qs(AtomKey) || AtomKey <- ListOfAtomKeys]
Mnemonic: Think mqs
as "Multi Query Plural"
wf:qs_pl(ListOfAtomKeys) -> [{Key,ListOfValues},…]
Takes a list of keys and returns a proplist of keys and respective list of values from the query string and POST values.
Mnemonic: Think qs_pl
as "Query Plurals into a Proplist"
Example:
wf:qs_pl([fruit,veggie,meat])
Returns something like:
[ {fruit,["Apple","Peach"]}, {veggie,["Broccoli"]}, {meat,["Pork","Beef","Venison"]} ].
wf:request_body() -> String
Return the complete text of the request body to the server. Note, this value will use the context of the current request. For example, the result of calling this during the page's initial request will be different than calling it within a postback event.
wf:encoding(Encoding) -> ok
Set the encoding to be applied just before sending to the client. Valid values are:
- none
- No encoding. Send the response as an iolist of bytes. This is what you would want to use if you were returning binary data (like if you were generating an image file on the fly).
- unicode
- This runs the return value through Erlang's
unicocde:characters_to_binary/1
before sending to the client. - Function/1
- Run the response through this particular function before sending, such as if you have a custom encoding you wish to use.
- {Module, Function}
- Run this through
Module:Function/1
. This is merely an alternative to the previous option, but one that is configuration-file friendly. - auto (Default)
- Reads the specified response header to attempt to
determine which encoding should be provided. It's quite naive, however,
in the name of speed. If the header starts with "text/" or is set to
"application/json" or "application/javascript", it will use
unicode
, otherwise, it will usenone
. For example, if your page you had setwf:content_type("image/png")
, it Encoding would apply asnone
.
wf:encoding() -> Encoding
Return the current encoding that will be applied to the response. It's worth
noting that this will return auto
if it's currently set to such.
wf:status_code(IntegerCode) -> ok
Set the HTTP response code. Default is 200.
wf:content_type(ContentType) -> ok
Set the HTTP content type. Defaults is "text/html". This can be used to return text images or other files to the browser, rather than returning HTML.
wf:download_as(Filename) -> ok
Set the HTTP Content-Disposition header in such a way that the browser will
treat the page as a download with the specified Filename
.
wf:request_method() -> atom()
Return the HTTP request method used (POST
, GET
, PUT
, etc), as a
lower-case atom (example: post
, get
, and put
).
wf:url() -> String
Return the complete requested URL for the page. For exaple, if the request
is for http://myapp.com/some/file?some_qs
, the return is
="http://myapp.com/some/file?some_qs".
wf:uri() -> String
Return the complete requested URI for the page. Note, this does not include
the protocol (http/https) or the hostname. For example, if the request is for
http://myapp.com/some/file?some_qs
, the return is ="/some/file?someqs"=).
wf:path() -> String
Return the string of the requested path. This excludes any querystring
information. For example, if the request is for
http://myapp.com/some/file?some_qs
the return value is ="/some/file"=
wf:path_info() -> String
Return only the path info for the requested page module. In other words, if
the module web_my_page is requsted with the path
="/web/my/page/some/extra/stuff= then wf:path_info()
would return
="some/extra/stuff"=.
wf:page_module() -> Atom
Return the requested page module. Useful information to know when writing a custom element or action.
wf:protocol() -> http | https
Return whether the request to the server is made by HTTP or HTTPS. Note, that if the request is made behind a proxy, this will only return whether the request from the proxy to the server is in HTTP or HTTPS, so the protocol seen by Nitrogen might not be the same protocol used by the client.
wf:peer_ip() -> IPAddress (4-tuple or 8-tuple)
Return the IP address of the client. Note that Erlang IP Addresses are
4-tuples (IPv4) or 8-tuples (IPv6). For example: {127,0,0,}
or
{8193,3512,51966,47806,0,0,0,1}
wf:peer_ip(ListOfProxies) -> IPAddress (4-tuple or 8-tuple)
Shortcut method for wf:peer_ip(ListOfProxies, x_forwarded_for)
wf:peer_ip(ListOfProxies, ForwardedHeader) -> IPAddress (4-tuple or 8-tuple)
This will compare the peer_ip address against the provided list of proxies,
and if any of them match the connected IP, then return the IP address from
the ForwardedHeader
.
11 Cookies
wf:cookies() -> [{AtomKey, StringValue}].
Return a proplist of all cookies.
wf:cookie(Key) -> String
Get the value of a cookie.
wf:cookie_default(Key, Default) -> String.
Get the value of a cookie, if it doesn't exist, return the default.
wf:cookie(Key, Value) -> ok
Tell Nitrogen to set a cookie on the browser. Uses \"/\" for the Path, and Nitrogen's session timeout setting for the MinutesToLive value.
wf:cookie(Key, Value, Path, MinutesToLive) -> ok
Tell Nitrogen to set a cookie on the browser under the specified Path that is valid for a certain number of minutes.
wf:delete_cookie(Key) -> ok
Tell Nitrogen to set the cookie to expire immediately, effectively deleting it from
the browser. Is a shortcut for wf:cookie(Key,"","/",0)
.
12 HTTP Headers
wf:headers() -> [{AtomKey, StringValue}, …]
Return a proplist of all HTTP headers.
wf:header(AtomKey) -> Value
Get the value of an HTTP header.
wf:header_default(AtomKey, Default) -> Value.
Get the value of an HTTP header, if it doesn't exist, return the default.
wf:header(StringKey, HeaderValue) -> ok
Set an HTTP header during the next response.
13 Serialization
wf:pickle(Term) -> PickledBinary
Serialize a term into a web-safe hex string, with checksumming. (Not encrypted!)
wf:depickle(PickledBinary) -> Term
Turn a pickled binary back into the original term.
wf:depickle(PickledBinary, SecondsToLive) -> Term or 'undefined'
Turn a pickled binary back into the original term, checking to see if the term was pickled more than SecondsToLive second ago. Returns the Term if it is still 'fresh' or the atom 'undefined'.
14 Logging
wf:info(String)
Log an informational message.
wf:info(Format, Args)
Log an informational message.
wf:warning(String)
Log a warning message.
wf:warning(Format, Args)
Log a warning message.
wf:error(String)
Log an error message.
wf:error(Format, Args)
Log and error message.
wf:console_log(Terms)
Send a console.log()
to the browser with Terms
as the value. (See Console Log Action)