I am currently a professor at the Laboratoire J.-L. Lagrange, a joint laboratory between Université Côte d’Azur, CNRS and Observatoire de la Côte d’Azur.
My current research activity is centered around statistical data processing, inverse problems and machine learning. I have a particular interest in applications to Astrophysics, such as radio interferometry, and hyperspectral imaging.
My recent interests include processing of streamed measurements with complex structures which can be encoded in a graph. An example of application is the detection of changes in a stream of images.
Machine learning methods for the very large arrays in radio astronomy.
Methodological Aspects of Hyperspectral Imaging Workshop
Distributed processing for very large arrays in radioastronomy
Processing of polychromatic interferometric data for Astrophysics
Statistical Signal Processing Workshop
High dynamics and planet detection workshops
the historical 2001 matis webpage


clusterSEs: Calculate Cluster-Robust p-Values and Confidence Intervals
Calculate p-values and confidence intervals using cluster-adjusted
t-statistics (based on Ibragimov and Muller (2010) <doi:10.1198/jbes.2009.08046>, pairs cluster bootstrapped t-statistics, and wild cluster bootstrapped t-statistics (the latter two techniques based on Cameron, Gelbach, and Miller (2008) <doi:10.1162/rest.90.3.414>. Procedures are included for use with GLM, ivreg, plm (pooling or fixed effects), and mlogit models.
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=clusterSEs
to link to this page.


If, like me, you simply follow the common tutorials and walthroughs to setup your production environment, you may start wondering after some weeks where this leak on your server’s disk space is coming from…
Just ask yourself this question: did you configure your logs rotation?
(Well, that was when I was still a young CTO…)
The ugly
You’ve installed your nginx server, it proxies some well-coded Rails applications served by the nice-and-fast thin app server. All good.
But you know, these are verbose people. They like to talk. A lot. And as obedient software, they write every character of their chatter. So this is where your leak is coming from.
As a matter of fact, if you don’t tell somebody to clean their mess, nobody won’t… and you’re server will soon die of low-disk-space agony.
The bad
You will have to tell logrotate
to do some work for these guys to keep their chatter under control.
logrotate
is the cowboy which will rule the land ;) Tell it which log has to be rotated and it will automatically does the job for you. So now, get into this configuration stage…
The logrotate
configuration file should be /etc/logrotate.conf
.
You can add your instructions for log rotation by adding the following lines in this file, or you can create a new file under /etc/logrotate.d
if you think this is a more organized way (I think). This latter option mimics the way packages configure logrotate
. You will find several examples in this directory, so you may just look at them too.
1 2 3 4 5 6 7 8 9 |
|
If you want to force logrotate
to run right now instead of waiting until tomorrow to see if your configuration is OK, you can run this command:
/usr/sbin/logrotate -f /etc/logrotate.conf
Else you can just wait a little.
The good
If you got through all this useless blabber about bad guys chatting and cowboys, you’ll be happy to know that some seriously boring (no no, just kidding, I don’t even know him) guy has written a far more efficient tutorial on the subject, and you can find it here.
This guide will help you understand how logrotate
works and the purpose of each line in the code above.


Demo: jquery-linear-navigation
Set focus on dummy widget, then use ARROW keys to update model. This plugin does not do any focus management, it only handles state, and triggers an event on state change. Autowrap is set to false by default.
This plugin consolidates common functionality and state of jquery-roving-tabindex and jquery-active-descendant. You probably don't need to use this plugin directly.


Hong Kongers await Beijing olive branch
by AFPIn Summary
- Monday marks the sixth month anniversary of a movement that has upended the semi-autonomous Chinese hub's reputation for stability and blanketed its streets with unprecedented scenes of political violence.
- The question on many lips now is whether chief executive Carrie Lam -- and Beijing -- will take the opportunity to reach out before anger explodes once more.
- Beijing has stuck by her even as she languishes with record low approval ratings and the city police force's reputation takes a hammering.
Hong Kong,
Hong Kongers have delivered a clarion call for change over the last fortnight with a landslide local election defeat for the government and more than one in 10 hitting the streets peacefully on Sunday -- but will Beijing listen?
Monday marks the sixth month anniversary of a movement that has upended the semi-autonomous Chinese hub's reputation for stability and blanketed its streets with unprecedented scenes of political violence.
But the last two weeks has seen a dramatic drop-off in clashes and vandalism -- something the city's pro-Beijing leadership has insisted must be a precursor to any meaningful dialogue.
The question on many lips now is whether chief executive Carrie Lam -- and Beijing -- will take the opportunity to reach out before anger explodes once more.
"Ignoring our voices will only make the snowball get bigger and bigger and there will be consequences to that," Bonnie Leung, a prominent figure within the pro-democracy movement's more moderate wing, told AFP.
ELECTION
The rare period of calm began in the run up to city-wide local polls in late November -- the only election with universal suffrage.
Millions turned out tipping pro-establishment parties out of office and flipping all but one of the city's 18 local councils to the pro-democracy camp.
The vote shattered government claims that a "silent majority" opposed the protests.
MASS RALLY
Then on Sunday the city witnessed its largest mass rally in months with organisers estimating some 800,000 people turned out, a vivid illustration of the public frustration that still seethes under the surface.
The rally, which received rare permission, was almost entirely peaceful. Small fires were lit outside two major courts and police pepper sprayed bystanders during an argument.
But no tear gas was fired -- the first time a mass rally has been smoke free since the middle of August.
Jimmy Sham, from rally organiser the Civil Human Rights Front, said the ball was now firmly in the government's court.
"We have to remind the SAR government that 800,000 people is still a very, very large number," he told reporters.
"Carrie Lam should listen to our Hong Kongers' demand as soon as possible," he added.
NO CONCESSIONS
Semi-autonomous Hong Kong has been battered by increasingly violent demonstrations in the starkest challenge the city has presented to Beijing since its 1997 handover from Britain.
Millions have marched in protests fuelled by years of growing fears that authoritarian China is stamping out the city's liberties.
The movement's demands include an independent inquiry into the police's handling of the protests, an amnesty for those arrested, and fully free elections.
But there is little sign Lam is willing to budge.
Since the electoral drubbing, her administration has made vague commitments to listen to people's demands, but no concrete concessions.
Beijing has stuck by her even as she languishes with record low approval ratings and the city police force's reputation takes a hammering.
HARDCORE
The movement's more radical wing -- which has embraced violent tactics -- appears to have faded into the background for now.
Hardcore protesters had vowed to restart widespread travel disruptions at dawn on Monday if there was no response from Lam. But the threats did not emerge.
On LIHKG, a Reddit-like web forum that serves as a virtual command centre for frontliners, discussion abounded on whether a resumption of tactics that disrupted ordinary Hong Kongers for much of October and November might backfire.
"Many people think the dawn action has devolved into just disturbing residents while having no effect pressuring the government," one popular post read, referring to the tactic of paralysing the transport network.
Some are looking to more traditional labour action.
Mung Siu-tat, head of Hong Kong's pro-democracy Federation of Trade Unions, said more than 30 newly founded unions have reached out for help in recent weeks.
"Quite a number of them are formed by white-collar workers, professionals and executives, who in the past might find it less necessary to unionise but have been politically awakened by the movement," Mung told AFP.
ARRESTS
Arrests skyrocketed in October and early November, especially after thousands of more hardline activists were surrounded by police on a university campus.
"The scale (of violence) may go down a bit because of the massive arrests over the last few weeks," political analyst Dixon Wong told AFP.
But there are growing fears unrest may return if Lam and Beijing do not offer some sort of olive branch.
On Sunday evening, organisers called on marchers to go home, one black-clad protester took off his mask.
"You have been leading marches for 30 years but what have you achieved?" he shouted.
"We still have plans for a lot of things we want to do for Hong Kong."


When we talk about classes in Ruby, we're really talking about types of objects we're using. For example, a number such as 1 is an instance of the Fixnum class, a string such as "I am a string" is an instance of the String class, and an array such as [1,2,3] is an instance of the Array class. Classes allow us to group similar objects, and automatically give them functions that are useful for that type of object. For example, Fixnums can be added together easily just by typing + in between them, because Ruby recognizes them as integers automatically. However, one of the most useful things about classes is that we can create our own classes to suit our needs.
For a clear example, we're going back to the grocery store again. As you can see here, I've created a class called StockList, which is capitalized so that we know it's a class and not just a variable. Under the initalize method, I've given each instance of StockList three parameters: name, price, and quantity. This means that every time we create a new instance of StockList, we can customize it with the item's name, price, and quantity from the getgo. I've also created a method called status, which will print to the terminal those same values we put in, once #status is called. Here's how they work:
cookies = StockList.new('Chocolate Chip', 5.00, 20) cookies.status #=> We have 20 of Chocolate Chip, and it costs $5.00 each.
Now, while it may seem that we only have these two methods, if you look back up to the top you'll see three attr methods. They may not seem like much, but they will allow us to do functions just by calling their names. Attr_reader allows us to assign a value to the parameter through initialize, and once it is called as a method it will display the value. However, once initialized it cannot be rewritten later. Attr_writer on the other hand, can be rewritten later on, but not called upon as a method to read. Fortunately, attr_accessor covers both bases by allowing us to both read and write to it. This can get a bit confusing, so we'll look at examples:
p cookies.price #=> 5.00 p cookies.quantity #=> 20 p cookies.name #=> undefined method 'name'(NoMethodError)
As you can see, just by typing the methods cookies.price and cookies.quantity, we have been given the price and quantity of cookies! However, when we did the same with name, we got a method error. This is due to the fact that attr_writer can't be read outside the class! Now what happens when we try to rewrite the attr_reader quantity?
cookies.quantity = 15 #=> undefined method 'quantity=' (NoMethodError)
Just like when we tried to read the writer attribute "name", we got a method error when we tried to write the reader attribute "quantity". But now let's look at the good examples of what happens when we rewrite the writer and accessor attributes:
cookies.name = 'Oatmeal Raisin' cookies.price = 6.00 cookies.status #=> We have 20 of Oatmeal Raisin, and it costs $6.00 each.
The name and price have been printed to reflect the changes we made! Hopefully now you can see how useful classes are, and how we can use attribute methods as a simple way to call our values!


I started to take St John's Wort by making it into a herbal tea for my obsessive-compulsive disorder. I take between 1 and 2 cups of tea a day, and I've found that while the obsessions have gone down, I've had odd mood changes. At first I was just quite aggravated at shit, and now I've been feeling strangely unemotional, sometimes like all my emotions are blocked in or non-existent (I can usually tell my friends what's on my mind, but now...!!!)
I went to a GP a couple of weeks ago, just as I was first taking it (he recommended the same thing) and he said this was just the body getting used to St John's Wort, and something like that it takes three to four weeks for the therapeutic effects to start (it's been about two weeks now I've been taking it). Sometimes my heart has raced a bit as well.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


amazon-chime-sdk / com.amazonaws.services.chime.sdk.meetings.audiovideo.metric / ObservableMetric / videoAvailableReceiveBandwidth
videoAvailableReceiveBandwidth
videoAvailableReceiveBandwidth
Estimated downlink bandwidth from perspective of video client


The beautiful city of Portland, Oregon will be the host city for Full Stack Conf!
Explore the future of JavaScript with a lineup of industry professionals. Discover new techniques to advance your career as a web developer.
Our expert speaker lineup was just announced, so don't wait too long before grabbing your tickets!
Want to meet the international JavaScript community and share skills with some of the world's top experts, hackers, and makers? Be the first to know what to expect for the future of JavaScript.
Full Stack Conf is committed to being inclusive and welcoming for everyone. We look forward to another intensive day of learning and sharing.
Vivianne is a web developer and teacher who is passionate about building scalable, data-driven web apps, especially ones that address old problems with new tech!
"NodeStra" is a software engineer and philosopher trying to leave the world better than he found it. He codes for non-profits, eCommerce, and large-scale web apps.
Robbie is a JavaScript developer working on large-scale applications. He's also a teacher who strives to support students in removing barriers to learning code.
Ecma found her passion for programming and teaching over 15 years ago. She is excited to introduce you to all of the wonders of JavaScript.
Jay is a developer, author of CSS: The Missing Manual, JavaScript & jQuery: The Missing Manual, and web development teacher.
All of his professional life, Json has worked with computers online; he is a polyglot programmer and likes using the right tools for the job.
NodeStradamus
Vivianne McVue
Jay Query
Free pizza for everyone!
Ecma Scriptnstuff
Robbie Redux
Json Babel
About Treehouse
Treehouse brings affordable technology education to people everywhere to help them achieve their dreams and change the world.
Stay up-to-date on Full Stack Conf


Parallel 3D frequency domain full waveform inversion
This software release includes a demonstration of 3D frequency-domain FWI inversion using a stencil-based Helmholtz matrix-vector multiply, Multi-level GMRES preconditioner, automatic parallelization over source/frequency, and a stochastic LBFGS scheme, described in
[1] "A unified 2D/3D software environment for large scale time-harmonic full waveform inversion", Curt Da Silva and Felix Herrmann, SEG 2016 (Submitted).
Author: Curt Da Silva Date : April, 2016
Contents
Downloading & Dependencies
The code can be found in the SLIM sofware release under /applications/WaveformInversion/3DParallelBatching.
The code has been tested with Matlab R2015b and requires the Parallel Computing Toolbox for some of the functionality.
This code uses the following packages, also found in the tools part of the SLIM software release.
- utilities/SPOT - object oriented framework for matrix-free linear algebra.
- utilities/pSPOT - parallel extension of SPOT.
- algorithms/3DFreqModeling - 3D time-harmonic acoustic modeling
- algorithms/CommonFreqModeling - general tools for 2D/3D time-harmonic FWI
- _solvers/Krylov - linear system methods + options
- _solvers/Multigrid - Multigrid preconditioner for the Helmholtz equation
- _solvers/QuasiNewton - Quasi Newton optimization methods
- operators/misc - Misc. operators such as interpolation, smoothing and splines
- functions/misc - Misc. functions.
Running & Parallelism
All the examples and results are produced by the scripts found in this software release under applications/WaveformInversion/3DParallelBatching/. Start matlab from that directory or run startup in that directory to add the appropriate paths.
To run the scripts follow the instrictions in the README file enclosed with the code. Most scripts can be run in serial mode.
Read more about SLIM's approach to parallel computing in Matlab.
Functions
The functions specific to this package can be found in the mbin directory.
- dload_fslices - Load frequency slices in a distributed fashion
- fwi_exp## - Parameter files corresponding to different FWI experiments
- fwi_exp - Main driver code for running inversion with different experiment settings
- getoption - Option parsing
- load_geometry - Loads the acquisition geometry corresponding to a particular model
- load_model - Loads the velocity associated to a particular model
- minfunc_frugal - Stochastic optimization with various sub-problem optimization kernels
- plot_fwi_exp - Results plotting
- rand_set - Get a binned random vector
- vel_plot - Velocity plotting
Examples and results
Scripts to generate results of examples can be found in the scripts directory. The results are shown here.


The Diversify team first met on a weekend in January 2018. From Georgia to Sweden, California to Ohio, the team come from far and wide to convene and code a creative solution for political polarization in America today.
Why We Care
In our experience, if you're friends with people who
Our team created Diversify My Feed to mitigate this confirmation bias. We believe that education is the most powerful tool available to limit political polarization, specifically education of the position of the opposing view.


HTML is Hypertext Mark-Up Language. The vast majority of documents on the web are written in HTML.
What are the major pieces of the Web?The Web connects the computers of individual users and their browsers to the internet, which is in turn connected to servers through http.
What are HTML tags?HTML tags are commands that govern the look, style, and links of webpages written in HTML. Their syntax is usually of the form name contents /name, with greater than-less than signs around the name of the tag.
Some tags, especially those that insert links into webpages, have attributes as part of their command. These attributes can specify the address of the webpage, picture, or video. This video link is an example of an anchor tag with an attribute, and it does happen to be about html tags!. What are the basic categories of HTML tags?Most complete "elements" have both an opening and closing tag, but void tags have only the opening tag. Two examples of void tags are img, the image tag, and br, the break tag, which is kind of like a carriage return.
Another specialized category of tag is the block tag. The block tag appears to combine a command with a carriage return. This seems to follow from the fact that block tags create "invisible boxes" around the text or content they envelope.The last (and perhaps largest?) category of tag is the inline tag. These tags apply their formatting to the document within the line in which they were inserted without adding any extra space. Some examples of these are a, span, br, img, and strong. This video link is a summary of inline vs. block elements.


MapAgora is an R package that helps researchers and practitioners to collect the most comprehensive data on nonprofit organizations in the U.S. Nonprofit organizations are vital in understanding civic activities and their economic, political, and social causes and consequences in the U.S. Despite their importance, it is difficult to analyze their characteristics systematically at a large scale because information about these organizations is scattered across different sources, such as their tax reports, websites, and social media posts. MapAgora addresses all of these problems. It helps researchers and practitioners systematically collect information on nonprofit organizations in the U.S. based on nonprofit organizations’ tax reports, websites, and social media posts with little technical understanding of the underlying unstructured data formats.
The package is available on GitHub and can be installed in the following way:
if (!require("devtools")) install.packages("devtools")
install_github("snfagora/MapAgora")
These use cases explain the best workflow for using the functions in the package to extract information from a particular data source (IRS/websites/social media posts).
IRS data provide comprehensive demographic and financial information on civic organizations.
To begin, load the IRS index for a selected year.
# load 2018 index file from the IRS Amazon Web Server
idx_2018 <- import_idx(2018)
Digitized 990 data are available as XML files in an Amazon Web Server (AWS) repository. The yearly index file organizes these files. The year, in this case, refers to the year the IRS processed the file. For example, all the files in the 2018 index were processed in 2018. However, the tax filing itself can be from any previous date. This discrepancy makes it challenging to locate a specific filing for a given organization and year.
To remedy this, we rebuilt a comprehensive index file for this package. This index, included in the package, contains the additional fields TaxPeriodBeginDt,
TaxPeriodEndDt,
and (importantly) Tax_Year.
Tax_Year
refers to the tax year of the 990 form the organization submitted, but IRS_Year
refers to the year the IRS converted the submission into digitized form. Note that organizations can choose to adhere to either a calendar or a fiscal year. TaxPeriodBeginDt
and TaxPeriodEndDt
refer to the beginning and end dates of that filing’s year.
The location of a given digitized filing can be found with the get_aws_url
function. This function returns the location of the XML file in the AWS repository.
# this organization's 2018 990 filing can be found here
aws_url <- get_aws_url("061553389", 2018)
To parse fields from filings, first load an XML file of interest. Note that because this function calls get_aws_url()
, there is no need to find the URL location. The first step for most uses of this package is get_990()
.
## load an XML for this organization's 2018 filing.
xml_root <- get_990("221405099", year = 2018)
## see name of this organization
organization_name <- get_organization_name_990("221405099")
Nonprofit organizations can file different versions of the 990 form depending on their specific status. Knowledge of the specific form type is not required to extract values with this package, but the type of a given form can be seen with the following:
## see form type of a filing
filing_type <- get_filing_type_990(xml_root)
Available parsed fields can be seen in the irs_fields
table. The package_variable
column lists the variable names to be used in functions. Other columns show both the XML path and the physical form location for that variable. These variables are grouped by category and subcategory.
## see available variables
names(irs_fields)
## get total revenue for this org
revenue_total <- get_single_value_990(xml_root, "revenue_total")
Organizations report descriptive information about their primary mission and main activities in 990 filings. The concatenated responses to these fields can be extracted.
# mission statement
mission_desc <- get_value_990(xml_root, "mission_desc")
# program description
program_desc <- get_value_990(xml_root, "program_desc")
To help track the information on nonprofits not captured by their tax filings, we developed code to extract the text that organizations use to describe themselves on their websites.
The most common place to find informative text about an organization is on its website, particularly its About Page. The About Page often contains information about the group’s mission, notable activities, and history.
There is no single standard way to find an About Page, but many common patterns predominate. Our strategy is to begin by extracting all the links from an organization’s home page. Then, we look for links containing the string “about” or “who.” If we fail to find these patterns, we try to identify other less direct common patterns.
Websites can have multiple About Pages, often nested under a common heading. We first need to identify all About Pages for a selected website.
# find this site's about pages
about_pages <- extract_about_links("http://www.ibew567.com")
Websites typically contain a great deal of code that is not directly displayed in the use case. In addition, displayed text often includes menus, headers, footers, or other small text snippets. Using natural language processing (NLP) can help clean up the text, but it is tedious and often produces low-quality output.
Our approach is to filter out text that is not in sentences with at least a certain threshold to extract salient text. Also, when extracting text from multiple pages, we look for and remove shared header and footer language to avoid duplicating it in the final corpus.
# find the combined text of about pages and home page
org_web_text <- get_all_texts("http://www.ibew567.com")
If you would like to report bugs, suggest features, or leave comments, please create issues.
If you would like to contribute code, please fork the source code, modify, and issue a pull request.
Social media handles
Social media posts help to investigate the public presence of organizations. However, there is no standard way of identifying the social media handles belonging to a given organization.
Here, we approach this problem by extracting social media handles from an organization’s website. As a secondary strategy, we provide the functionality to search for social media handles using the Bing search application programming interface (API).
Twitter handle
Twitter handles are identified on a page by extracting all links on the page and then filtering for possible Twitter handles. If a handle can be found, some link cleanup is attempted before returning it.
Facebook page
The
find_facebook_page_from_org_page()
function works similarly but looks for a Facebook page instead of a handle.


Home / Overview / Histograms
NOTE: Only the top 5 values for each day are shown
Underlying data: dist.csv
Plot Help: Drag horizontally to zoom to selection. Double click to zoom out. Shift + drag to pan.
Underlying data: status.csv


Week One Blog Post: Version Control & GitHub
How to screw up everything you've done all week and not even want to kill yourself
December 4, 2015
So, since I'm pretty new to this coding thing, I was really happy that this week's challenges were basically about making me feel like I could jump in and hack away without worrying that I might break the whole internet.
The whole idea of version control gives me a lovely sense of security. I can work at something until I get it functioning the way I want it to, save it in that state, and then keep fiddling with it knowing that if my later work introduces errors, I can always go back to that earlier, WORKING version, and start fresh. Also, starting fresh might actually be my last resort since I'll be able to see exactly what I've changed between that older version and the newer, buggy one.
I'm thinking of this as putting a copy of the work up on a high shelf somewhere (that's the commit and push to GitHub) and then pulling a ghost copy of it off that shelf to work on. I can do what I want with the ghost copy (my new branch) without having any impact on the master up there on the shelf until I decide I'm ready to merge the two.
Git lets me create that ghost copy by making a new branch, which is just a exact duplicate of the original work (the master), then I can add directories and/or files, make changes to the what was already there or whatever. I save those changes locally and get them ready to save copy to the master copy out in the cloud on GitHub.
There's a multi-step process to get from two versions of the work back to one. First I have to use git add to "stage" my changes. Entering git status lets me see a list of the things that are ready to go. Once I'm satisfied that I've got them all, enter git commit -m "commit message" to save the lot of them.
At this point, I've saved changes locally but not back up to GitHub, where my full working copy lives. Now I have to git push origin branch_name to make that happen. (Note to self: remember the name of the branch you created! It was a while ago so make that name something logical or bloody write it down!)
I should be able to see my new branch on GitHub available to pull. I can create a new pull request, compare my updated work to the master and merge the two back into one, updated version. Storing my code on GitHub allows others to view it and even edit it and also ensures that there's a clean copy of it, including a record of past changes, somewhere other than my own hard drive.
Ahhh, peace of mind. :)


WITNESS LIST Administration Committee May 19, 2005 - 4:00P HCR 108 FOR: Riley, Marlo (Lacy Family Descendants), San Antonio, TX


Select an appropriate response.
1. Walk up to the customer. Greet her and ask her if she needs any help.
2. Ignore the customer; it is not my job to attend to customers as other employees in the store will attend them.
Select an appropriate response.
By proactively reaching out to our customers, we deliver an excellent experience to our customers.


News / About
Welcome back! Here is some of your most recent information.
Your most recent deck: |
{{ most_recent_deck }} |
Last time logged in: |
{{ last_time_logged_in }} |
Search for a Deck
Enter in keywords to search for a public deck to clone
How - To
Thank you for logging in! Take a look below to learn more about our features!


{% extends path+"/layout.html" %} {% block page %}
You can agree to let DWP access your latest doctor’s note directly from the NHS.
No other details about you or your medical records will be accessed.
Continue


Setup¶
This page describes a few practical ways to setup the necessary computing resources needed for Secout on different hardware / platforms.
By design, Secout utilizes the distributed platform provided by Dask. You could deploy Dask on your local machine or on a distributed cluster.
Deploy on Local Machine¶
It is quite easy to use Dask on local machine.
from dask.distributed import Client
client = Client() # start a new client that uses local client
The detailed documentation for Dask client could be found here
Deploy on Distributed cluster¶
Here we are showing a way of deploying a Dask cluster with 1 scheduler node, 3 worker node, and 1 jupyter notebook node on Google Cloud Platform (GCP). We use the Active Cloud Shell provided in the GCP Console Workspace.
Start a Kubernetes Cluster from Kubernetes Engine. Tweak the options if you want.
Use the graphical interface provided of GCP Kubenetes Engine
- Use the gcloud command-line tool.
gcloud container clusters create MY_KUBERNETES_CLUSTER \ --enable-cloud-logging \ --enable-cloud-monitoring \ --subnetwork default --num-nodes 5
You must also obtain the credentials to the cluster you just created.
# obtain the cluster credentials so that you could operate with kubectl and helm gcloud container clusters get-credentials MY_KUBERNETES_CLUSTER
Setting up helm with your cluster.
# add a service account within a namespace to segregate tiller kubectl --namespace kube-system create sa tiller # create a cluster role binding for tiller kubectl create clusterrolebinding tiller \ --clusterrole cluster-admin \ --serviceaccount=kube-system:tiller echo "initialize helm" # initialized helm within the tiller service account helm init --service-account tiller # updates the repos for Helm repo integration helm repo update
Install dask using helm.
You could install at default setting by
helm install stable/dask
This will create a dask compute cluster that contains 1 scheduler, 3 worker, and 1 jupyter notebook.


Bootswap
Themes
Bootswatch Themes
Default
About
Download
Blog
Default
Official Bootstrap Theme
Default
Primary
Success
Info
Warning
Danger


| Jump to DART Documentation Main Index |
Utility program to compute the time-mean ensemble error and spread in the same manner that the DART MATLAB diagnostic routine 'plot_total_err' does. It runs from the command line, opens no windows, and outputs several types of numerical results on standard output. Grep for 'Total' to get the 2 lines with total error and total spread. Intended for scripts where only the numeric results are wanted instead of a time-series plot. This routine does not do any weighted computations.
The default is to compare a True_State.nc file output from perfect_model_obs to a Prior_Diag.nc file output from filter. Other filenames can be specified in the namelist. These files must have at least one overlapping value in the 'time' array. The statistics will be done on the overlapping time region only.
The output includes the min and max error and spread values, and the time index and time value where that occurs. There is also an option to recompute the time mean ensemble error and spread after skipping the first N times. This can be useful to skip an initial error spike while the model is spinning up which can result in a larger than expected total error.
Namelist interface &compute_error_nml is read from file input.nml.
This namelist is read from the file input.nml. Namelists start with an ampersand '&' and terminate with a slash '/'. Character strings that contain a '/' must be enclosed in quotes to prevent them from prematurely terminating the namelist.
&compute_error_nml truth_file_name = 'true_state.nc' diag_file_name = 'preassim.nc' skip_first_ntimes = 0 /
| Item | Type | Description |
|---|---|---|
| truth_file_name | character(len=256) | State-space diagnostic file from the 'perfect_model_obs' program. |
| diag_file_name | character(len=256) | State space diagnostic file output from the 'filter' program. |
| skip_first_ntimes | integer | If set to a value greater than 0, the error values will be recomputed a second time, skipping the first N times. This can be useful when running an experiment that has an initial error spike as the model spins up and then decays down to a more steady state. |
types_mod utilities_mod
| Routine | Message | Comment |
|---|---|---|
| time dimension error | files must have overlapping time series | The unlimited 'time' dimension must values in common between both files. |
none
The matlab script has an option for doing weighted statistics. This code does not.
DART software - Copyright UCAR. This open source software is provided by UCAR, "as is", without charge, subject to all terms of use at http://www.image.ucar.edu/DAReS/DART/DART_download


pytz-convert
Timezone conversion functions for Python.
Thursday, 2016 November 17, 2016 08:00:00 UTC
Version: 2016.0
Extension of python package pytz by providing timezone conversion functions.
Available functions:
validate_tz_abbrev()
validate_tz_name()
convert_tz_abbrev_to_tz_hours()
convert_tz_abbrev_to_tz_offset()
convert_tz_abbrev_to_tz_seconds()
convert_tz_hours_to_tz_offset()
convert_tz_name_to_date_tz_abbrev()
convert_tz_name_to_date_tz_offset()
convert_tz_name_to_now_tz_abbrev()
convert_tz_name_to_now_tz_offset()
convert_tz_offset_and_date_to_tz_name()
convert_tz_offset_to_now_tz_abbrev()
convert_tz_offset_to_tz_hours()
convert_tz_offset_to_tz_minutes()
convert_tz_offset_to_tz_seconds()
parse_gmt_offset_timezone()
License: Apache 2.0


This document contains the LLVM Developer Policy which defines the project's policy towards developers and their contributions. The intent of this policy is to eliminate miscommunication, rework, and confusion that might arise from the distributed nature of LLVM's development. By stating the policy in clear terms, we hope each developer can know ahead of time what to expect when making LLVM contributions. This policy covers all llvm.org subprojects, including Clang, LLDB, libc++, etc.
This policy is also designed to accomplish the following objectives:
This policy is aimed at frequent contributors to LLVM. People interested in contributing one-off patches can do so in an informal way by sending them to the llvm-commits mailing list and engaging another developer to see it through the process.
This section contains policies that pertain to frequent LLVM developers. We always welcome one-off patches from people who do not routinely contribute to LLVM, but we expect more from frequent contributors to keep the system as efficient as possible for everyone. Frequent LLVM contributors are expected to meet the following requirements in order for LLVM to maintain a high standard of quality.
Developers should stay informed by reading at least the "dev" mailing list for the projects you are interested in, such as llvmdev for LLVM, cfe-dev for Clang, or lldb-dev for LLDB. If you are doing anything more than just casual work on LLVM, it is suggested that you also subscribe to the "commits" mailing list for the subproject you're interested in, such as llvm-commits, cfe-commits, or lldb-commits. Reading the "commits" list and paying attention to changes being made by others is a good way to see what other people are interested in and watching the flow of the project as a whole.
We recommend that active developers register an email account with LLVM Bugzilla and preferably subscribe to the llvm-bugs email list to keep track of bugs and enhancements occurring in LLVM. We really appreciate people who are proactive at catching incoming bugs in their components and dealing with them promptly.
When making a patch for review, the goal is to make it as easy for the reviewer to read it as possible. As such, we recommend that you:
When sending a patch to a mailing list, it is a good idea to send it as an attachment to the message, not embedded into the text of the message. This ensures that your mailer will not mangle the patch when it sends it (e.g. by making whitespace changes or by wrapping lines).
For Thunderbird users: Before submitting a patch, please open Preferences → Advanced → General → Config Editor, find the key mail.content_disposition_type, and set its value to 1. Without this setting, Thunderbird sends your attachment using Content-Disposition: inline rather than Content-Disposition: attachment. Apple Mail gamely displays such a file inline, making it difficult to work with for reviewers using that program.
LLVM has a code review policy. Code review is one way to increase the quality of software. We generally follow these policies:
Developers should participate in code reviews as both reviewers and reviewees.  Note that anyone is welcome to review and give feedback on a patch, but only people with Subversion write access can approve it.
The LLVM Project relies on two features of its process to maintain rapid development in addition to the high quality of its source base: the combination of code review plus post-commit review for trusted maintainers. Having both is a great way for the project to take advantage of the fact that most people do the right thing most of the time, and only commit patches without pre-commit review when they are confident they are right.
The trick to this is that the project has to guarantee that all patches that are committed are reviewed after they go in: you don't want everyone to assume someone else will review it, allowing the patch to go unreviewed. To solve this problem, we have a notion of an 'owner' for a piece of the code. The sole responsibility of a code owner is to ensure that a commit to their area of the code is appropriately reviewed, either by themself or by someone else. The current code owners are:
Note that code ownership is completely different than reviewers: anyone can review a piece of code, and we welcome code review from anyone who is interested. Code owners are the "last line of defense" to guarantee that all patches that are committed are actually reviewed.
Being a code owner is a somewhat unglamorous position, but it is incredibly important for the ongoing success of the project. Because people get busy, interests change, and unexpected things happen, code ownership is purely opt-in, and anyone can choose to resign their "title" at any time. For now, we do not have an official policy on how one gets elected to be a code owner.
Developers are required to create test cases for any bugs fixed and any new features added. Some tips for getting your testcase approved:
Note that llvm/test and clang/test are designed for regression and small feature tests only. More extensive test cases (e.g., entire applications, benchmarks, etc) should be added to the llvm-test test suite. The llvm-test suite is for coverage (correctness, performance, etc) testing, not feature or regression testing.
The minimum quality standards that any change must satisfy before being committed to the main development branch are:
Additionally, the committer is responsible for addressing any problems found in the future that the change is responsible for. For example:
We prefer for this to be handled before submission but understand that it isn't possible to test all of this for every submission. Our build bots and nightly testing infrastructure normally finds these problems. A good rule of thumb is to check the nightly testers for regressions the day after your change. Build bots will directly email you if a group of commits that included yours caused a failure. You are expected to check the build bot messages to see if they are your fault and, if so, fix the breakage.
Commits that violate these quality standards (e.g. are very broken) may be reverted. This is necessary when the change blocks other developers from making progress. The developer is welcome to re-commit the change after the problem has been fixed.
We grant commit access to contributors with a track record of submitting high quality patches. If you would like commit access, please send an email to Chris with the following information:
Once you've been granted commit access, you should be able to check out an LLVM tree with an SVN URL of<EMAIL_ADDRESS>instead of the normal anonymous URL of "http://llvm.org/...". The first time you commit you'll have to type in your password. Note that you may get a warning from SVN about an untrusted key, you can ignore this. To verify that your commit access works, please do a test commit (e.g. change a comment or add a blank line). Your first commit to a repository may require the autogenerated email to be approved by a mailing list. This is normal, and will be done when the mailing list owner has time.
If you have recently been granted commit access, these policies apply:
In any case, your changes are still subject to code review (either before or after they are committed, depending on the nature of the change). You are encouraged to review other peoples' patches as well, but you aren't required to.
When a developer begins a major new project with the aim of contributing it back to LLVM, s/he should inform the community with an email to the llvmdev email list, to the extent possible. The reason for this is to:
The design of LLVM is carefully controlled to ensure that all the pieces fit together well and are as consistent as possible. If you plan to make a major change to the way LLVM works or want to add a major new extension, it is a good idea to get consensus with the development community before you start working on it.
Once the design of the new feature is finalized, the work itself should be done as a series of incremental changes, not as a long-term development branch.
In the LLVM project, we do all significant changes as a series of incremental patches. We have a strong dislike for huge changes or long-term development branches. Long-term development branches have a number of drawbacks:
To address these problems, LLVM uses an incremental development style and we require contributors to follow this practice when making a large/invasive change. Some tips:
If you are interested in making a large change, and this scares you, please make sure to first discuss the change/gather consensus then ask about the best way to go about making the change.
We believe in correct attribution of contributions to their contributors. However, we do not want the source code to be littered with random attributions "this code written by J. Random Hacker" (this is noisy and distracting). In practice, the revision control system keeps a perfect history of who changed what, and the CREDITS.txt file describes higher-level contributions. If you commit a patch for someone else, please say "patch contributed by J. Random Hacker!" in the commit message.
Overall, please do not add contributor names to the source code.
NOTE: This section deals with legal matters but does not provide legal advice. We are not lawyers — please seek legal counsel from an attorney.
This section addresses the issues of copyright, license and patents for the LLVM project. The copyright for the code is held by the individual contributors of the code and the terms of its license to LLVM users and developers is the University of Illinois/NCSA Open Source License (with portions dual licensed under the MIT License, see below). As contributor to the LLVM project, you agree to allow any contributions to the project to licensed under these terms.
The LLVM project does not require copyright assignments, which means that the copyright for the code in the project is held by its respective contributors who have each agreed to release their contributed code under the terms of the LLVM License.
An implication of this is that the LLVM license is unlikely to ever change: changing it would require tracking down all the contributors to LLVM and getting them to agree that a license change is acceptable for their contribution. Since there are no plans to change the license, this is not a cause for concern.
As a contributor to the project, this means that you (or your company) retain ownership of the code you contribute, that it cannot be used in a way that contradicts the license (which is a liberal BSD-style license), and that the license for your contributions won't change without your approval in the future.
We intend to keep LLVM perpetually open source and to use a liberal open source license. As a contributor to the project, you agree that any contributions be licensed under the terms of the corresponding subproject. All of the code in LLVM is available under the University of Illinois/NCSA Open Source License, which boils down to this:
We believe this fosters the widest adoption of LLVM because it allows commercial products to be derived from LLVM with few restrictions and without a requirement for making any derived works also open source (i.e. LLVM's license is not a "copyleft" license like the GPL). We suggest that you read the License if further clarification is needed.
In addition to the UIUC license, the runtime library components of LLVM (compiler_rt, libc++, and libclc) are also licensed under the MIT license, which does not contain the binary redistribution clause. As a user of these runtime libraries, it means that you can choose to use the code under either license (and thus don't need the binary redistribution clause), and as a contributor to the code that you agree that any contributions to these libraries be licensed under both licenses. We feel that this is important for runtime libraries, because they are implicitly linked into applications and therefore should not subject those applications to the binary redistribution clause. This also means that it is ok to move code from (e.g.) libc++ to the LLVM core without concern, but that code cannot be moved from the LLVM core to libc++ without the copyright owner's permission.
Note that the LLVM Project does distribute llvm-gcc and dragonegg, which are GPL. This means that anything "linked" into llvm-gcc must itself be compatible with the GPL, and must be releasable under the terms of the GPL. This implies that any code linked into llvm-gcc and distributed to others may be subject to the viral aspects of the GPL (for example, a proprietary code generator linked into llvm-gcc must be made available under the GPL). This is not a problem for code already distributed under a more liberal license (like the UIUC license), and GPL-containing subprojects are kept in separate SVN repositories whose LICENSE.txt files specifically indicate that they contain GPL code.
We have no plans to change the license of LLVM. If you have questions or comments about the license, please contact the LLVM Developer's Mailing List.
To the best of our knowledge, LLVM does not infringe on any patents (we have actually removed code from LLVM in the past that was found to infringe). Having code in LLVM that infringes on patents would violate an important goal of the project by making it hard or impossible to reuse the code for arbitrary purposes (including commercial use).
When contributing code, we expect contributors to notify us of any potential for patent-related trouble with their changes (including from third parties). If you or your employer own the rights to a patent and would like to contribute code to LLVM that relies on it, we require that the copyright owner sign an agreement that allows any other user of LLVM to freely use your patent. Please contact the oversight group for more details.


Code
00
01
for ( int outer = 0; outer < 4; outer++ )
02
{
03
for ( int inner = 0; inner < 3; inner++ )
04
{
05
PRINT( outer, inner );
06
}
07
NEWLINE();
08
}
09
Variables
outer =
out of scope
inner =
out of scope
Output
Visualization by Rachel Morris


Fill out the fields below and we'll tell you your character equivalent.
How do you handle conflicts
What is your favorite animal
What is most important
Where are you from?


?Wumber
Cited
under
this
Namc
BY
A.
H.
HITCHCOCK
?.
AGS--ES
CHA^
SEC
CCNÕP
L
£
.
'
j
-zHa
.l£i
i
f
I
A'
i
0
1
I
rfÑ
,
V\A/
,
CV
iu^thk
KM
J,
'uo*
À££C,
Av^^^u'r£
Òx-'
THE
NEWYORK
BOTANICAL
GARDEN
EXPLORATION
OF
THE
BAHAMAS
Great
Bahama
N.
L
BRITTON
\
o.
F.
MlLLSPAUGH
C
Collectors
Feb.
5-13,
1905
1604586
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


The Adlai Stevenson Memorial APDA Tournament
April 6 - April 7, 2018
Princeton University
| Friday | |
|---|---|
| 2:00 | Registration Opens |
| 3:30 | Registration Closes |
| 4:00 | APDA meeting Drop Deadline |
| 4:30 | Round 1 |
| 5:30 | APDA Meeting |
| 6:30 | Round 2 |
| 7:30 | Dinner |
| 8:30 | Round 3 |
| 9:45 | Housing/Elections |
| Saturday | |
|---|---|
| 8:45 | Breakfast |
| 9:30 | Round 4 |
| 11:00 | Round 5 |
| 12:30 | Lunch
GEI Presentation |
| 1:30 | Octofinals
Novice Semifinals |
| 3:00 | Quarterfinals
Novice Finals |
| 4:30 | Semifinals |
| 6:00 | Finals |
| Food | |
|---|---|
| Friday Dinner | Pizza |
| Saturday Breakfast | Panera Bagels |
| Saturday Lunch | Subway Sandwiches |
Friday: GA is located in McDonnell A02. Tab is located in Jadwin A09.
Saturday: GA is located in McCosh 50. Tab is located in McCosh 48.
To be updated
These are preliminary room arrangements only! They will change after registration.
Room ArrangementsAdlai is a motions tournament.
Please Contact the TDs with any questions prior to the start of Round 1.
Tab Policy     Tournament InfoFor any immediate tournament-related questions, contact the TDs:
| Tournament Directors | |
|---|---|
| An Lanh |<PHONE_NUMBER> |
| Olivia |<PHONE_NUMBER> |
| Stephen |<PHONE_NUMBER> |
For any registration-related issues, contact us at:
| Registration Points of Contact | |
|---|---|
| Registration over Facebook Messanger |
An Lanh Le:<PHONE_NUMBER> |
| Problems with Registration | Sinan:<PHONE_NUMBER> |
| Miscellaneous Questions | Sinan:<PHONE_NUMBER> |
For any questions on finances or team policies, contact the Officers:
| PDP Officers | |
|---|---|
| President |<EMAIL_ADDRESS>|
| Administrative VP |<EMAIL_ADDRESS>|
| Financial VP |<EMAIL_ADDRESS>|


Download
Back
jQuery Simple Form Plugin Demos
Full Name:
*
Email:
*
Phone:
Building Number:
Street:
*
Town:
County:
Postal Code:
Comments:
Slide Transition
Full Name:
*
Email:
*
Phone:
Spouse Full Name:
*
Spouse Email:
*
Phone:
Building Number:
Street:
*
Town:
County:
Postal Code:
Comments:
No Validation, No transition
Full Name:
Email:
Phone:
Extra Name:
Email:
Phone:
Building Number:
Street:
Town:
County:
Postal Code:
Comments:


WITNESS LIST
Finance
February 12, 2019 9:00 AM
FOR:
Cutrer, Dr. Emily President (also providing written testimony) (Texas A&M University -
Texarkana), Texarkana, TX
Elliott, MD, Dr. Tricia C. Family Physician; VP Academic Affairs & Research/CAO (also
providing written testimony) (Texas Academy of Family Physicians), Fort Worth, TX
Fossum, Col Mike COO TX A&M Galveston (also providing written testimony)
(TAMOG), Galveston, TX
Kieffer, Dr. Hilary Resident Physician (also providing written testimony) (Lone Star
Family Health Center), Conroe, TX
ON:
Akey, Bruce L. Veterinarian (also providing written testimony) (Texas A&M Veterinary
Medical Diagnostic Laboratory), College Station, TX
Arenaz, Pablo President (also providing written testimony) (Texas A&M International
University)
Boggus, Tom Director (also providing written testimony) (Texas A&M Forest Service),
College Station, TX
Brock, Colin LBB Staff (also providing written testimony) (LBB)
Byington, Carrie L. Senior VP TAMU HSC (also providing written testimony) (Texas
A&M HSC), Bryan, TX
Coatney, David Agency Director (also providing written testimony) (Texas A&M
Engineering Extension Service (TEEX))
Crawford, John CFO (also providing written testimony) (Tx A&M Engineering
Experiment Station), College Station, TX
DeWitt, Robby CFO (also providing written testimony) (Texas A&M Forest Service),
College Station, TX
Dottavio, Dominic President (also providing written testimony) (Tarleton State
University), Stephenville, TX
Evans, Ken President Lamar University (also providing written testimony) (Lamar
University)
Feyten, Dr Carine Chancellor & President (also providing written testimony) (Texas
Woman's University)
Galasso, Fedora Texas Director (also providing written testimony) (Young Invincibles),
Austin, TX
Hamilton, Billy Deputy Chancellor (also providing written testimony) (TAMUS)
Hernandez, Demetrio LBB Staff (also providing written testimony) (LBB)
Howard, Lonnie President (also providing written testimony) (Lamar Institute of
Technology), Beaumont, TX
Hoyt, Dana G President (also providing written testimony) (Sam Houston State
University), Huntsville, TX
Hussey, Mark A President (also providing written testimony) (Texas A&M University -
Kingsville), Kingsville, TX
Johnson, Thomas President (also providing written testimony) (Lamar State College
Orange)
Jumper, Cynthia Academic Physician (Texas Medical Association)
WITNESS LIST
Finance
February 12, 2019 9:00 AM
Kibler, William L. President, Sul Ross State University (also providing written testimony)
(Sul Ross State University), Alpine, TX
Lane, Dr. Austin A. President (also providing written testimony) (Texas Southern
University), Houston, TX
Matson, Cynthia Teniente President (also providing written testimony) (Texas A&M - San
Antonio), San Antonio, TX
McCall, Brian Chancellor (also providing written testimony) (Tx State University System),
Austin, TX
Mong, Bob President (also providing written testimony) (University of North Texas at
Dallas), Dallas, TX
Nicole Williams, Ashley Policy Analyst (also providing written testimony) (The Center for
Public Policy Priorities), Austin, TX
Niggiazzo, Dr. Marc A. President, Texas A&M University - Central Texas (also providing
written testimony) (Texas A&M University - Central Texas), Killeen, TX
Owens, Greg LBB Staff (also providing written testimony) (LBB)
Paredes, Raymund Commissioner (also providing written testimony) (THECB)
Quintanilla, Kelly President & CEO (also providing written testimony) (TAMU - CC), CC,
TX
Reynard, Betty President (also providing written testimony) (Lamar State College Port
Arthur)
Roe, Lesa Chancellor (also providing written testimony) (University of North Texas
System), Dallas, TX
Rosson, Parr Interim Director (also providing written testimony) (Texas A&M AgriLife
Extension Svc.)
Rudin, Mark President, Texas A&M - Commerce (also providing written testimony)
(Texas A&M - Commerce)
Schmidt, Emily LBB Staff (also providing written testimony) (LBB)
Sharp, John Chancellor (also providing written testimony) (The Texas A&M University
System)
Shipley, Suzanne President (also providing written testimony) (Midwestern State
University), Wichita Falls, TX
Simmons, Ruth J. President, Prairie View A&M (also providing written testimony) (Prairie
View A&M University), Humble, TX
Simmons, Trevor LBB Staff (also providing written testimony) (LBB)
Smatresk, Neal President (also providing written testimony) (University of North Texas),
Denton, TX
Stedman, Stuart Chairman (also providing written testimony) (THECB)
Stover, Patrick J. Dean & Vice Chancellor (also providing written testimony) (Texas A&M
AgriLife)
Teniente Matson, Cynthia President (also providing written testimony) (Texas A&M - San
Antonio), San Antonio, TX
Trauth, Denise M. President (also providing written testimony) (Texas State University),
San Marcos, TX
Wendler, Walter X. President WTAMU (also providing written testimony) (WTAMU),
Cayvyon, TX
WITNESS LIST
Finance
February 12, 2019 9:00 AM
Westbrook, Dr. Steve Interim President (also providing written testimony) (Stephen F.
Austin State University), Nacogdoches, TX
Williams, Michael President (also providing written testimony) (University of North Texas
Health Science Center), Ft. Worth, TX
Winfree, Greg Agency Director (also providing written testimony) (Texas A&M
Transportation Institute), College Station, TX
Young, Michael K. President (also providing written testimony) (Texas A&M University),
College Station, TX
Registering, but not testifying:
FOR:
Shepperd, Ben President (PBPA), Midland, TX
ON:
Bradford, Corey S. CFO (PVAMU)
Burton, Jeff CFO (Texas A&M Health Science Center), Bryan, TX
Dunn, Joseph Chief Financial Officer (Texas A&M Transportation Institute), College
Station, TX
Gordon, Patrick (Self; Rio grande compact commission), El paso, TX
Hinton, Jeff CFO, Texas A&M University Texarkana (Texas A&M University Texarkana),
Texarkana, TX
McGeady, John LBB Staff (LBB)
Melde, Vicki M. Chief of Staff (Texas A&M University - Texarkana), Texarkana, TX
Todd, Charles Chief Financial Officer (Texas A&M Engineering Extension Service
(TEEX)), College Station, TX
Providing written testimony:
FOR:
Gerlach, William Dentist (Texas Dental Association), Austin, TX
Tran, Nhung Dr. (Self; Texas Pediatric Society, Texas Medical Association), Austin, TX
ON:
Milligan, Maureen President and CEO (Teaching hospitals of texas), Austin, TX
Reed, Cyrus Interim Director (Sierra Club, Lone Star Chapter), Austin, TX
Woodland, Wendy Director, Advocacy and Communications (Texas Library Association),
Austin, TX


Reconstructs the vSenal signal from the windows frames created by the function deframe.m Input parameters: mFrames: Matrix of iNumWindows x iLongWindow (number of windows x window length) with the window frames to be reconstructed iLongWindow: Frame length iDisplacement: Displacement between successive windows Output parameters: vSenal: Complete signal reconstructed with the window frames When deconstructing the signal with enframe.m, the last samples that do not enter a new window or frame are discarded. Therefore, this function will not rebuild the vSenal signal exactly except in the case iLongitudSenal = iLongFinalSenal, To avoid this, you must fill the signal with zeros until making iLongitudSenal = iLongitudFinalSenal; when used in combination with calculaVentanas for the calculation of the fine structure of the voice signal, structureFina.m, this is taken into account.


The [DeployedAs] Attribute
You can attach this attribute to elements that produce CSS and Javascript to
control how the CSS and Javascript is incorporated into the website.
Example Usage
[IsRegion("menu_region")]
[Container("ul", "{ns}_menu")]
[ChildContainer("li", "{ns}_menu-item")]
[DeployCss("ul.{ns}_menu", "font-size: 14px;")]
[DeployCss("li.{ns}_menu-tem", "font-size: 12px;")]
[DeployedAs(AssetDeployment.InPage)]
public class MenuRegion
{
}
The [DeployedAs()] attribute has the following
properties you can set.
ModuleName
This defines the name of the Module element
that defines the asset deployment method for this element's assets. By default
elements inherit asset deployment from their parent element. This propagates
up the tree to the Page level where the default is to deploy all assets to
one resource.
By specifying a module name in this attribute, you are saying that the asset
deployment mechanism for this element is going to be determined by the module
instead of being explicitly set on this element. This is a good strategy because
it allows you to change your mind later about how you want assets deployed
without having to revisit all the code.
Deployment
This allows you to explicitly define the asset deployment mechanism for
the element. Generally speaking you probably don't want to explicitly set
this for every element, because using modules is a much better way of
organizing your assets.
The possible values for the Deployment property are:
-
Inherit means that page element will interit
the AssetDeployment property of the containing page
element. If all elements on a page are set to Inherit
(which is the default) then they all follow the asset deployment mechanism set
in the page. Pages default to PerWebsite, so by default
all Javascript and all CSS for the entire website will be combined into a single
asset.
-
InPage means that page element will write its
CSS and Javascript directly into the <head> section
of the page. This option is mainly useful for debugging and generating html for
emails.
-
PerPage means that each page will have a Javascript and
CSS asset that is specific to that page and contains everything that that page
needs to render. If the same page element is used on multiple pages then its
CSS and Javascript will be duplicated in all the page specific assets for the
pages where it is referenced. This option means that the page will only reference
exactly what it needs, but the browser will have to fetch the assets associated
with every page that the user visits.
-
PerModule means that the element should use the
AssetDeployment property of the module it is in.
You can also specify this module by name with the [DeployedAs]
attribute.
-
PerWebsite means that there is a single Javascript
and CSS asset for the entire website and this element will write its CSS and
Javascript into this global asset.


Reports single char alternation (e.g.
a|b|c|d
) in a RegExp. It is simpler to use a character class (
[abcd]
) instead. This usually also provides slightly better matching performance.
New in 2017.1


Cat Chen
How did you set up a web site 10 years ago?
I was working on:
I needed to know:
I need to know:
var http = require('http');
var server = http.createServer(function(request, response) {
response.send('Hello, world!');
});
var port = 3000;
server.listen(port);
It's just like Rails or other MVC framework. It supports:
module.exports
to write modulespackage.json
and index.js
npm publish
(use npm adduser
for the first time)gem install heroku
(for the first time)heroku create --stack cedar
to create an appweb: node web.js
in a file named Procfile
package.json
is correctgit push heroku
heroku ps:scale web=1
to set web process number to 1Please read this guide for more details.
Replacement of Apache, Lighttpd, etc?
Replacement of ASP, PHP, Rails, etc?
No more Python, Ruby, Bash, Make, etc. Just JavaScript.


All the code snippets on this page are live and interactive powered by the klipse plugin.
This is a library of validation transform combinators. The main idea is to produce validation errors in the same shape as the data structure being validated. This way validation errors can be accessed at the same path as the data and can be mechanically associated with the corresponding elements of the validated data structure.
Note that the ▶ links take you to a live version of this page and that there is a playground for sharing examples.

Imagine a UI — or take a look at this live
example — for editing a data
structure that is an array (table) of objects (records) that have a date
field
and an event
field:
[
{"date": "2017-09-11", "event": "EFSA-H"},
{"date": "2017-09-20", "event": "EFSA-T"},
{"date": "", "event": "EFSA-T"}
]
We need to validate that each object has a valid date and an event and that dates and events are unique. Furthermore, we wish to give feedback on all elements with errors so as to guide the user.
Here is a sample set of rules
var rules = V.choose(events => V.arrayIx(V.props({
date: V.and(
[isNonEmpty, 'required'],
[isValidDate, 'yyyy-mm-dd'],
[isUniqueBy('date', events), 'duplicate']),
event: V.and(
[isNonEmpty, 'required'],
[isUniqueBy('event', events), 'duplicate'])
})))
where
var isNonEmpty = R.identity
function isUniqueBy(p, xs) {
const counts = L.counts([L.elems, p], xs)
return x => counts.get(x) <= 1
}
var isValidDate = R.test(/^\d{4}-\d{2}-\d{2}$/)
to give such validation feedback. The rules basically just follow the structure of the data.
Validating with those rules we get a data structure with the potential error feedback at the same location as the offending element:
V.errors(rules, [
{"date": "2017-09-11", "event": "EFSA-H"},
{"date": "2017-09-20", "event": "EFSA-T"},
{"date": "", "event": "EFSA-T"}
])
The result tells us that the first object is valid (i.e. there are no validation
errors in it). The event
in the second object is a duplicate. The third
object is missing a date and the event is a duplicate.
The interface file of this library, partial.lenses.validation.js, uses the library itself to specify the contracts for the exports.
Assuming process.env.NODE_ENV
is not "production"
and you pass invalid
arguments to a function of this library, you will likely get an error message.
For example,
V.validate(
V.casesOf(
'type',
[
R.identical('number'),
V.props({
type: R.is(String),
value: R.isNumber
})
],
[
R.identical('boolean'),
V.props({
type: R.is(String),
value: R.is(Boolean)
})
],
),
{
type: 'boolean',
value: false
}
)
throws an error, because R.isNumber
is not defined. The error is thrown as
soon as the call to V.props
is made.
Examples of other libraries using Partial Lenses Validation for contract checking:
The combinators provided by this library are available as named imports. Typically one just imports the library as:
import * as V from 'partial.lenses.validation'
This library is actually built on top of Partial
Lenses
transforms. It is also
typical to use e.g. Ramda, bound as R
in examples, to
implement predicates.
To use a validation rule one runs it using one of the elimination functions.
In case a validation rule is fully synchronous, it is better to use a synchronous elimination function, because synchronous validation is faster than asynchronous validation.
V.accepts(rule, data) ~> boolean
v0.3.0V.accepts(rule, data)
runs the given validation rule on the given data and
simply returns true
in case the data is accepted and false
if not.
For example:
V.accepts(V.arrayIx(R.is(String)), ['Yes', 'No'])
V.errors(rule, data) ~> errors | undefined
v0.3.0V.errors(rule, data)
runs the given validation rule on the given data. In
case the data is accepted by the rule, the result is undefined
. Otherwise the
result is an object structure in the shape of the data structure containing the
validation errors.
For example:
V.errors(
V.props({
no: R.is(Number),
yes: R.is(String)
}),
{
yes: 101,
}
)
Note that in case a validation error would be undefined
, a null
is reported
instead.
V.validate(rule, data) ~{throws}~> data
v0.3.0V.validate(rule, data)
runs the given validation rule on the given input data.
In case the data is accepted, the validated output data is returned. In case
the data is rejected, an Error
object
is thrown whose message is the stringified validation error and that has an
extra errors
property that has the (non-stringified) validation errors.
For example:
V.validate(
V.props({
missing: R.is(String)
}),
{
unexpected: 'field'
}
)
In case a validation rule contains asynchronous parts, it is necessary to use
one of the asynchronous elimination functions. Functions that are allowed, but
not required, to be asynchronous are indicated in the documentation using the
async
keyword.
The below ghInfoOfAsync
function is a simple asynchronous function that tries
to use the public GitHub search
API to search for
information on a GitHub project of specified name:
async function ghInfoOfAsync(name) {
const q = encodeURIComponent(name)
const res = await fetch(`https://api.github.com/search/repositories?q=${q}`)
const body = await res.json()
return L.get(['items', L.find(R.whereEq({name}))], body)
}
V.acceptsAsync(rule, data) ~> promise(boolean)
v0.3.0V.acceptsAsync(rule, data)
runs the given validation rule on the given data
like V.accepts
except that the validation rule is allowed to
contain asynchronous validation predicates and
transformations. The result will always be returned as a
promise.
V.errorsAsync(rule, data) ~> promise(errors | undefined)
v0.3.0V.errorsAsync(rule, data)
runs the given validation rule on the given data
like V.errors
except that the validation rule is allowed to
contain asynchronous validation predicates and
transformations. The result will always be returned as a
promise.
For example:
V.errorsAsync(
V.arrayId(
R.pipeP(ghInfoOfAsync, L.get('stargazers_count'), R.lte(100))
),
[
'partial.lenses',
'partial.lenses.validation'
]
).catch(R.identity).then(console.log)
V.tryValidateAsyncNow(rule, data) ~{throws}~> data | promise(data)
v0.3.0V.tryValidateAsyncNow(rule, data)
runs the given validation rule on the given
data like V.validateAsync
except that in case the
validation result is synchronously available it is returned or thrown
immediately as is without wrapping it inside a
promise.
In case the result is not available synchronously, a promise is returned.
V.tryValidateAsyncNow
can be used for wrapping asynchronous functions, for
example, because the first stage of validating a function is always synchronous.
For example:
var ghInfoOfAsyncChecked = V.tryValidateAsyncNow(
V.dependentFn(
V.args(R.and(R.is(String), V.not(R.isEmpty))),
name => V.optional(
V.propsOr(V.accept, {
name: R.identical(name),
stargazers_count: R.is(Number)
// ...
})
)
),
ghInfoOfAsync
)
V.validateAsync(rule, data) ~> promise(data)
v0.3.0V.validateAsync(rule, data)
runs the given validation rule on the given data
like V.validate
except that the validation rule is allowed to
contain asynchronous validation predicates and
transformations. The result, whether accepted or rejected, is
returned as a
promise.
For example:
V.validateAsync(
V.arrayId(
V.and(
R.is(String),
V.acceptWith(ghInfoOfAsyncChecked),
V.keep(
'name',
V.propsOr(V.remove, {
name: R.is(String),
stargazers_count: V.and(
R.is(Number),
[R.lte(1000), n => `Only ${n} stars. You know how to fix it!`]
)
})
)
)
),
[
'partial.lenses',
'partial.lenses.validation'
]
).catch(R.identity).then(console.log)
It is also possible to run validation rules with an arbitrary computational monad such as a monad based on observables.
V.run({Monad, onAccept: data => any, onReject: error => any}, rule, data) ~> any
v0.3.0V.run({Monad, onAccept, onReject}, rule, data)
runs the given validation rule
on the given data using the specified computational monad and either calls the
accept callback with the validated data or the reject callback with the
validation errors.
The parameters Monad
, onAccept
, and onReject
are optional and default to
what V.validate
uses. The Monad
parameter needs to be a
Static Land compatible
Monad with all the four functions.
If you specify the Monad
, you will likely want to specify both onAccept
and
onReject
as well.
At the most basic level a rule either accepts or rejects the value in focus.
V.accept ~> rule
v0.3.0V.accept
accepts the current focus as is. V.accept
should be rarely used as
it performs no validation whatsoever.
V.acceptAs(value) ~> rule
v0.3.0V.acceptAs(value)
accepts the current focus and replaces it with the given
value. V.acceptAs
is rarely used alone, because it performs no validation as
such, and is usually combined with e.g. V.and
.
For example:
V.validate(V.and(R.identical(1), V.acceptAs('one')), 1)
V.acceptWith(async (value, index) => value) ~> rule
v0.3.0V.acceptWith(fn)
accepts the current focus and replaces it with the value
returned by the given possibly async function. V.acceptWith
is rarely used alone, because it performs no validation as such, and is usually
combined with e.g. V.and
.
In a logical V.or
each rule gets the same value as input and the
result of the first accepting rule becomes the result. In a logical
V.and
the output of a previous rule becomes the input of the next
rule.
For example:
V.validate(
V.and(
V.or(
V.and(
R.is(Number),
V.acceptWith(n => `number ${n}`)
),
R.is(String)
),
V.acceptWith(R.toUpper)
),
10
)
V.reject ~> rule
v0.3.0V.reject
rejects the current focus as is. In case the focus is undefined
,
the error will be null
instead.
The idea is that the validation error data structure simply contains the parts of the validated data structure that weren't accepted. This usually allows a programmer who is familiar with the system to quickly diagnose the problem.
For example:
V.errors(
V.propsOr(V.reject, {}),
{
thisField: 'is not allowed',
}
)
V.rejectAs(error) ~> rule
v0.3.0V.rejectAs(error)
rejects the current focus as the given error value. In case
the given error value is undefined
, it is replaced with null
instead.
Using V.rejectAs
one can specify what the error should be. This way an error
data structure can be constructed that can, for example, contain error messages
to be displayed in a form that an end user can understand.
For example:
V.errors(
V.propsOr(V.rejectAs('Unexpected field'), {}),
{
thisField: 'is not allowed',
}
)
V.rejectWith(async (value, index) => error) ~> rule
v0.3.0V.rejectWith(fn)
rejects the current focus with the error value returned by
the given possibly async function from the value in focus. In
case the return value is undefined
, the error will be null
instead.
Using V.rejectWith
one can specify what the error should be depending on the
value in focus. This allows detailed error messages to be constructed.
For example:
V.errors(
V.propsOr(
V.rejectWith(value => `Unexpected field: ${JSON.stringify(value)}`),
{}
),
{
thisField: 'is not allowed',
}
)
V.remove ~> rule
v0.3.0V.remove
replaces the not yet rejected value in focus with undefined
,
which means that it is removed from the surrounding array or object. Beware
that V.remove
by itself performs no validation. You usually combine
V.remove
with e.g. V.and
or V.propsOr
.
For example:
V.validate(
V.propsOr(V.remove, {
required: R.is(String)
}),
{
required: 'field',
unexpected: 'and removed'
}
)
Unary (and binary) functions are implicitly treated as predicates and lifted to
validation rules using V.where
.
V.where(async (value, index) => testable) ~> rule
v0.3.0V.where(predicate)
, or using the shorthand notation predicate
, lifts the
given possibly async predicate to a validation rule. In case
the focus does not satisfy the predicate, it is rejected with
V.reject
.
Note that explicitly calling V.where
is typically unnecessary, because unary
(and binary) functions are implicitly treated as predicates and lifted with
V.where
to rules in this library.
For example:
V.validate(
V.props({
isNumber: V.where(R.is(Number)),
alsoNumber: R.is(Number) // <-- implicit `V.where`
}),
{
isNumber: 101,
alsoNumber: 42
}
)
In case the predicate throws an exception, the focus is rejected with the exception as the error value.
It is also possible to modify the error after a rule has rejected the focus.
V.modifyError(async (value, error, index) => error, rule) ~> rule
v0.3.0V.modifyError(fn, rule)
, or using the shorthand notation [rule, fn]
, acts
like rule
except that in case the rule rejects the focus, the error is
computed using the given possibly async function that is given
the value in focus, the error from the rule and the index of the focus. In case
the given function returns undefined
, the error will be null
instead.
Note that the shorthand notation [rule, fn]
can be used instead of a more
verbose function call. This shorthand is provided to make it more convenient to
attach detailed error messages to rules.
For example:
V.errors(
V.choose(data => {
const expectedSum = L.sum(['numbers', L.elems], data)
return V.props({
numbers: V.arrayIx(R.is(Number)),
sum: [ // <-- Implicit `V.modifyError`
R.identical(expectedSum),
actualSum => `Expected ${expectedSum} instead of ${actualSum}`
]
})
}),
{
numbers: [3, 1, 4],
sum: 9
}
)
V.setError(error, rule) ~> rule
v0.3.0V.setError(error, rule)
, or using the shorthand notation [rule, error]
when
error
is not a function, acts like rule
except that in case the rule rejects
the focus, the given error is used instead. In case the given error is
undefined
, it is replaced with null
instead.
Note that the shorthand notation [rule, error]
can be used instead of a more
verbose function call when the error
is not a function. In case error
is a
function, it is called like with V.modifyError
. This
shorthand is provided to make it more convenient to attach detailed error
messages to rules.
For example:
V.errors(
V.choose(data => {
const expectedSum = L.sum(['numbers', L.elems], data)
return V.props({
numbers: V.arrayIx(R.is(Number)),
sum: [ // <-- Implicit `V.setError`
R.identical(expectedSum),
`Expected ${expectedSum}`
]
})
}),
{
numbers: [3, 1, 4],
sum: 9
}
)
Logical connectives provide a simple means to combine rules to form more complex rules.
V.and(...rules) ~> rule
v0.3.0V.and(rule1, ..., ruleN)
validates the value in focus with all of the given
rules one-by-one starting from the first given rule. In case some rule rejects
the focus, that becomes the result of V.and
. Otherwise the result of V.and
is the accepted result produced by passing the original focus through all of the
given rules. Note that V.and
is not curried like V.both
.
V.both(rule, rule) ~> rule
v0.3.3V.both(rule1, rule2)
validates the value in focus with both of the given rules
starting with the first of the given rules. V.both(rule1, rule2)
is
equivalent to V.and(rule1, rule2)
.
V.either(rule, rule) ~> rule
v0.3.3V.either(rule1, rule2)
validates the value in focus with either of the given
rules starting with the first of the given rules. V.either(rule1, rule2)
is
equivalent to V.or(rule1, rule2)
.
V.not(rule) ~> rule
v0.3.0V.not(rule)
validates the value in focus with the given rule. In case the
rule accepts the focus, V.not
rejects it instead. In case the rule rejects
the focus, V.not
accepts it instead.
V.or(...rules) ~> rule
v0.3.0V.or(rule1, ..., ruleN)
tries to validate the value in focus with one of the
given rules starting from the first given rule. In case some rule accepts the
focus, that becomes the result of V.or
. Otherwise the error produced by the
last of the given rules becomes the result of V.or
. Note that V.or
is not
curried like V.either
.
Rules for validating elements can be lifted to rules for validating arrays of elements.
All elements in a uniform array have the same form.
V.arrayId(rule) ~> rule
v0.3.0V.arrayId(rule)
validates the elements of an array with the given rule. In
case one or more elements are rejected, the error is an array containing only
the rejected elements.
The idea is that the elements of the validated array are addressed by some unique identities intrinsic to the elements. Filtering out the accepted elements keeps the error result readable.
V.arrayIx(rule) ~> rule
v0.3.0V.arrayIx(rule)
validates the elements of an array with the given rule. In
case one or more elements are rejected, the error is an array containing the
rejected elements and null
values for the accepted elements.
The idea is that elements of the validated array are addressed only by their
index and it is necessary to keep the rejected elements at their original
indices. The accepted elements are replaced with null
to make the output less
noisy.
Elements at different positions in a varying array may have different forms.
V.args(...rules) ~> rule
v0.3.1V.args(rule1, ..., ruleN)
validates an array by validating each element of the
array with a specific rule. If the array is shorter than the number of rules,
the missing elements are treated as being undefined
and validated with the
corresponding rules. This means that rules for optional elements need to be
explicitly specified as such. If the array is longer than the number of rules,
the extra elements are simply accepted. This is roughly how JavaScript treats
function arguments. See also V.tuple
.
V.tuple(...rules) ~> rule
v0.3.0V.tuple(rule1, ..., ruleN)
validates a fixed length array by validating each
element of the array with a specific rule. See also V.args
.
For example:
V.accepts(
V.tuple(R.is(String), R.is(Number)),
['one', 2]
)
Note that elements cannot be removed from a tuple using V.remove
.
It is also possible to validate functions. Of course, validating a function is different from validating data, because it is not possible to validate the actual arguments to a function before the function is called and likewise it is only possible to validate the return value of a function after the function returns. Therefore validating a function means that the function is wrapped with a function that performs validation of arguments and the return value as the function is called.
V.dependentFn(rule, (...args) => rule) ~> rule
v0.3.0V.dependentFn(argumentsRule, argumentsToResultRule)
wraps the
function at focus with a validating wrapper that validates the arguments to and
return value from the function as it is called. The rule for validating the
return value is constructed by calling the given function with the validated
arguments. In case there is no need for the return value rule to depend on the
actual arguments, one can use the simpler V.freeFn
combinator
instead.
For example:
var sqrt = V.validate(
V.dependentFn(
V.args(R.both(R.is(Number), R.lte(0))),
x => y => Math.abs(y*y - x) < 0.001
),
Math.sqrt
)
sqrt(4)
Note that the wrapped function produced by V.dependentFn
is not curried and
has zero arity. If necessary, you can wrap the produced function with
e.g. R.curryN
or
R.nAry
to change the arity of the function.
V.freeFn(rule, rule) ~> rule
v0.3.0V.freeFn(argumentsRule, resultRule)
wraps the function at
focus with a validating wrapper that validates the arguments to and return value
from the function as it is called. V.freeFn
does not allow the rule for the
return value to depend on the arguments. If you wish to validate the return
value depending on the arguments you need to use the
V.dependentFn
combinator.
For example:
var random = V.validate(
V.freeFn(
V.tuple(),
R.both(R.lte(0), R.gt(1))
),
Math.random
)
random('Does not take arguments!')
Note that the wrapped function produced by V.freeFn
is not curried and has
zero arity. If necessary, you can wrap the produced function with
e.g. R.curryN
or
R.nAry
to change the arity of the function.
Rules for validating objects can be formed by composing rules for validating individual properties of objects.
V.keep('prop', rule) ~> rule
v0.3.0V.keep('prop', rule)
acts like the given rule except that in case the rule
rejects the focus, the specified property is copied from the original object to
the error object. This is useful when e.g. validating arrays of objects with an
identifying property. Keeping the identifying property allows the rejected
object to be identified.
V.optional(rule) ~> rule
v0.3.0V.optional(rule)
acts like the given rule except that in case the focus is
undefined
it is accepted without invoking the given rule. This is
particularly designed for specifying that an object property is optional.
For example:
V.validate(
V.arrayIx(
V.props({
field: V.optional([R.is(Number), 'Expected a number'])
})
),
[
{notTheField: []},
{field: 'Not a number'},
{field: 76}
]
)
V.props({...prop: rule}) ~> rule
v0.3.0V.props({prop: rule, ...})
is for validating an object and is given a template
object of rules with which to validate the corresponding fields. Unexpected
fields are rejected. Note that V.props
is equivalent to
V.propsOr(V.reject)
.
V.propsOr(rule, {...prop: rule}) ~> rule
v0.3.0V.propsOr(otherwise, {prop: rule, ...})
is for validating an object and is
given a rule to apply to fields not otherwise specified and a template object of
rules with which to validate the corresponding fields. Note that
V.props
is equivalent to V.propsOr(V.reject)
.
Rules can be chosen conditionally on the data being validated.
V.cases(...[(value, index) => testable, rule][, [rule]]) ~> rule
v0.3.0V.cases([p1, r1], ..., [pN, rN], [r])
is given [predicate, rule]
-pairs as
arguments. The predicates are called from first to last with the focus. In
case a predicate passes, the corresponding rule is used on the focus and the
remaining predicates are skipped and rules ignored. The last argument to
V.cases
can be a default rule that omits the predicate, [rule]
, in which
case the rule is always applied in case no predicate passes. In case all
predicates fail and there is no default rule, the focus is rejected.
For example:
V.validate(
V.cases(
[
R.whereEq({type: 'a'}),
V.propsOr(V.accept, {
foo: [R.lt(0), 'Must be positive']
})
],
[
V.propsOr(V.accept, {
foo: [R.gt(0), 'Must be negative']
})
]
),
{
type: 'b',
foo: 10
}
)
Note that, like with V.ifElse
, V.cases([p1, r1], ..., [rN])
can
be expressed in terms of the logical operators, but V.cases
has a simpler
internal implementation and is likely to be faster.
V.casesOf(traversal, ...[(value, index) => testable, rule][, [rule]]) ~> rule
v0.3.4V.casesOf(traversal, [p1, r1], ..., [pN, rN], [r])
is like
V.cases
except that subfocuses for the predicates are produced by
the given traversal from the current focus and a case is taken if the predicate
accepts any one of the subfocuses.
For example:
V.validate(
V.casesOf(
'type',
[R.identical('number'), V.props({type: R.is(String), value: R.is(Number)})],
[R.identical('string'), V.props({type: R.is(String), value: R.is(String)})]
),
{
type: 'string',
value: 'foo'
}
)
V.ifElse((value, index) => testable, rule, rule) ~> rule
v0.3.0V.ifElse(predicate, consequent, alternative)
acts like the given consequent
rule in case the predicate is satisfied by the focus and otherwise like the
given alternative rule.
For example:
V.validate(
V.ifElse(R.is(Number), R.lte(0), R.is(String)),
-1
)
Note that V.ifElse(p, c, a)
can be expressed as V.or(V.and(p, c),
V.and(V.not(p), a))
, but V.ifElse
has a simpler internal implementation and
is likely to be faster.
Rules can depend on the data being validated.
V.choose((value, index) => rule) ~> rule
v0.3.0V.choose(fn)
is given a function that gets the current focus and then must
return rules to be used on the focus. This allows rules to depend on the data
and allows rules that examine multiple parts of the data.
For example:
V.validate(
V.choose(({a, b}) => V.props({
a: [R.equals(b), "Must equal 'b'"],
b: [R.equals(a), "Must equal 'a'"]
})),
{
a: 1,
b: 2
}
)
Note that V.choose
can be used to implement conditionals like
V.cases
and V.ifElse
. Also note that code inside
V.choose
, including code that constructs rules, is always run when the
V.choose
rule itself is used. For performance reasons it can be advantageous
to move invariant expressions outside of the body of the function given to
V.choose
. Also, when simpler conditional combinators like
V.cases
or V.ifElse
are sufficient, they can be
preferable for performance reasons, because they are given previously
constructed rules.
Rules for recursive data structures can be constructed with the help of
V.choose
and V.lazy
, which both allow one to refer
back to the rule itself or to delay the invocation of a rule computing function.
V.lazy(rule => rule) ~> rule
v0.3.0V.lazy(fn)
constructs a rule lazily. The given function is passed a
forwarding proxy to its own return value. This allows the rule to use itself as
a subrule and construct a recursive rule.
For example:
V.accepts(
V.lazy(tree => V.arrayId(
V.props({
name: R.is(String),
children: tree
})
)),
[
{
name: 'root',
children: [
{name: '1st child', children: []},
{
name: '2nd child',
children: [{name: 'You got the point', children: []}]
},
]
}
]
)
Rules can modify the value after a rule has accepted the focus.
Rules can include simple ad-hoc post-validation transformations.
V.modifyAfter(rule, async (value, index) => value) ~> rule
v0.3.3V.modifyAfter(rule, fn)
replaces the focus after the given rule has accepted
it with the value returned by the given possibly async
function. V.modifyAfter(rule, fn)
is equivalent to V.both(rule,
V.acceptWith(fn))
.
V.setAfter(rule, value) ~> rule
v0.3.3V.setAfter(rule, value)
replaces the focus after the given rule has accepted
it with the given value. V.setAfter(rule, value)
is equivalent to
V.both(rule, V.acceptAs(value))
.
V.removeAfter(rule) ~> rule
v0.3.3V.removeAfter(rule)
removes the focus after the given rule has accepted it.
V.removeAfter(rule)
is equivalent to V.both(rule, V.remove)
.
Rules can validate versioned data and transform it to another version in the
process. The combinators V.promote
,
V.upgrades
, V.upgradesOf
are designed for
cases where there are multiple versions of data or schema. Using them one can
validate any one of the versions and also convert the data to desired version
— usually to the latest version — so that rest of the program does
not need to deal with different versions.
V.promote(...[rule[, (value, index) => value]]) ~> rule
v0.3.6V.promote
is like V.or
, but the rules given to V.promote
need to
be wrapped inside an array [rule]
and may optionally include a transformation
function, [rule, fn]
. V.promote
tries, like V.or
, to find a rule
that accepts the focus. If no such rule is found, the focus is rejected.
Otherwise if the accepting rule has an associated function, then the function is
used to transform the focus and the same validation process is rerun. This way
any sequence of transformations is also validated.
For example:
V.validate(
V.promote(
[
V.props({
type: R.identical('v2'),
value: R.is(Number)
})
],
[
V.props({
type: R.identical('v1'),
constant: R.is(Number)
}),
({constant}) => ({type: 'v2', value: constant})
]
),
{type: 'v1', constant: 42}
)
Note that V.or(r1, ..., rN)
is equivalent to V.promote([r1], ...,
[rN])
.
V.upgrades(...[(value, index) => testable, rule[, async (value, index) => value]]) ~> rule
v0.3.6V.upgrades
is like V.cases
, but each case may optionally include
a transformation function, [predicate, rule, fn]
. V.upgrades
tries, like
V.cases
, to find the first passing predicate. When no such
predicate is found, the focus is rejected. Otherwise the focus is validated
with the associated rule. If the case also includes a possibly
async transformation function, the function is used to transform
the value in focus and the same validation process is rerun. This way any
sequence of transformations is also validated.
For example:
V.validate(
V.upgrades(
[
L.get(['type', R.identical('v1')]),
V.props({
type: R.is(String),
constant: R.is(Number)
}),
({constant}) => ({type: 'v2', value: constant})
],
[
L.get(['type', R.identical('v2')]),
V.props({
type: R.is(String),
value: R.is(Number)
})
]
),
{type: 'v1', constant: 42}
)
Note that V.cases([p1, r1], ..., [[pN, ]rN])
is equivalent to V.upgrades([p1,
r1], ..., [[pN, ]rN])
.
V.upgradesOf(traversal, ...[(value, index) => testable, rule[, async (value, index) => value]]) ~> rule
v0.3.6V.upgradesOf
is like V.casesOf
, but each case may optionally
include a transformation function, [predicate, rule, fn]
. V.upgradesOf
tries, like V.casesOf
, to find the first predicate that accepts
any one of the the traversed subfocuses. When no such predicate is found, the
focus is rejected. Otherwise the focus is validated with the associated rule.
If the case also includes a possibly async transformation
function, the function is used to transform the value in focus and the same
validation process is rerun. This way any sequence of transformations is also
validated.
For example:
V.validate(
V.upgradesOf(
'type',
[
R.identical('v1'),
V.props({
type: R.is(String),
constant: R.is(Number)
}),
({constant}) => ({type: 'v2', value: constant})
],
[
R.identical('v2'),
V.props({
type: R.is(String),
value: R.is(Number)
})
]
),
{type: 'v1', constant: 42}
)
Note that V.casesOf(t, [p1, r1], ..., [[pN, ]rN])
is equivalent to
V.upgradesOf(t, [p1, r1], ..., [[pN, ]rN])
.
The following subsections give some tips on effective use of this library.
The logical combinators V.or
, V.either
, and also
V.promote
, can be convenient, but it is often preferable to use
conditional combinators like V.cases
and
V.upgrades
, because, once a case predicate has been satisfied,
no other cases are attempted in case the corresponding rule fails and the
resulting error is likely to be of higher quality.
It might be tempting to use V.and
to combine
V.propsOr(V.accept)
rules
V.and(
V.propsOr(V.accept, rules1),
V.propsOr(V.accept, rules2),
// ...
)
but this has a couple of disadvantages:
V.propsOr
rules rejects, then errors from later rules are not
reported.It is usually better to combine rule templates inside V.props
instead:
V.props({
...rules1,
...rules2,
// ...
})
This way additional properties are not accepted and errors from all rules are reported in case of rejection.
Probably the main weakness in the design of this library is that this library specifically tries to avoid having to implement everything. In particular, one of the ideas is to simply allow arbitrary predicates from a library like Ramda to be used as rules. This means that rules do not contain extra information such as a corresponding random value generator of values matching the rule or a traversable specification of the rule for exporting the specification for external tools. One way to provide such features is to pair validation rules with the necessary extra information. It should be possible to do that outside of this library.
The current implementation does not operate
incrementally. Every
time e.g. V.validate
is called, everything is recomputed. This
can become a performance issue particularly in an interactive setting where
small incremental changes to a data structure are being validated in response to
user actions. It should be possible to implement caching so that on repeated
calls only changes would be recomputed. This is left for future work.
This library primarily exists as a result of Stefan Rimaila's work on validation using lenses.
document.querySelector('.loading-message').className = "loading-hidden";
ga('send', 'event', 'completed', 'load', Math.round((Date.now() - startTime)/1000));
accelerate_klipse();


{{(currentUser | async)?.bio}}
cake{{(currentUser | async)?.dob}}
local_phone{{(currentUser | async)?.contact}}
email{{(currentUser | async)?.email}}
{{comments}}


'Quality' - Could Derby County have set this guy on the road to greatness?
Frank Lampard is only in his second season of football management but the former Derby boss is being tipped for great things
by Keith WalesWe all know what a great player Frank Lampard was for Chelsea and England, but what about Lampard the best manager in the world?
The attacking midfielder cut his managerial teeth at Derby County after finally hanging up his boots, guiding the Rams to the Championship play-off final last May at the end of his first season in the dugout.
Derby had taken a chance on Lampard after Gary Rowett walked out on them to join Stoke City, and such was his impact at Pride Park that former club Chelsea also backed the managerial novice to succeed when appointing him to replace Maurizio Sarri in the summer.
Lampard has since guided his team of impressive youngsters to third in the Premier League table, prompting a Blues legend to predict big things for his former Stamford Bridge team-mate.
Derby County latest
This is your round up of all things Derby; the one-stop shop that will keep you updated on the latest goings on at Pride Park and beyond.
Transfers, injuries, match-days and managers, we’ve got you covered.
We’ll be bringing the very latest on the Rams throughout the week and around the clock.
Make sure you keep yourself updated with our handy daily catch up...
Must reads...
- The reason Lawrence is out of Wales squad
- Phillip Cocu's January priorities
- The area Derby County must improve to turn their season around
- 'Punished' - Derby County fans must look at bigger picture when it comes to Jayden Bogle after mistake
- 'I was surprised' - Leeds United star makes this Derby County admission
- Who is Luciano Acosta? Profile on D.C. United star invited to Derby County by Wayne Rooney
For all your latest Rams news, opinion, analysis and transfer gossip, click here
You can follow our Rams reporter Steve Nicholson on Twitter, and his email address is<EMAIL_ADDRESS>Eden Hazard took time out to comment on Lampard’s impact at Chelsea after Belgium's win over Russia on Saturday.
He said: "I know Frank as a player not a manager, but he is a great guy.
"He has shown already in four months that he can be one of the best managers in the world.
"The good thing is they are playing with young English players. They are lucky to have young players with quality. Maybe with two or three more they would be first in the Premier League.”
Chelsea have lost just one of their last 11 fixtures in all competitions, form that has impressed former Liverpool defender Jason McAteer.
He told the Racing Post: "What Brendan Rodgers is doing at (second placed) Leicester is outstanding, but the job Frank Lampard is doing at Chelsea is probably even more impressive.
"I remember speaking to Frank when Chelsea and Liverpool played the Super Cup in Istanbul and you could hear his concerns.
"Where were the goals going to come from? Could Mason Mount do for Chelsea what he had done for Derby? Would he miss Antonio Rudiger?
"But he and his players have answered all those questions and more."
For all your latest Derby County news, opinion, analysis and transfer gossip, click here