Documentation
Convert CSV to JSON
Delimited data can be parsed out of strings or files. Files that are parsed can be local or remote. Local files are opened with FileReader, and remote files are downloaded with XMLHttpRequest.
Parse string
Papa.parse(csvString[, config])
csvString
is a string of delimited text to be parsed.config
is an optional config object.- Returns a parse results object (if not streaming or using worker).
Parse local files
Papa.parse(file, config)
file
is a File object obtained from the DOM.config
is a config object which contains a callback.- Doesn't return anything. Results are provided asynchronously to a callback function.
Parse remote file
Papa.parse(url, {
download: true,
// rest of config ...
})
url
is the path or URL to the file to download.- The second argument is a config object where
download: true
is set. - Doesn't return anything. Results are provided asynchronously to a callback function.
Using jQuery to select files
$('input[type=file]').parse({
config: {
// base config to use for each file
},
before: function(file, inputElem)
{
// executed before parsing each file begins;
// what you return here controls the flow
},
error: function(err, file, inputElem, reason)
{
// executed if an error occurs while loading the file,
// or if before callback aborted for some reason
},
complete: function()
{
// executed after all files are complete
}
});
- Select the file input elements with files you want to parse.
-
before
is an optional callback that lets you inspect each file before parsing begins. Return an object like:
to alter the flow of parsing. Actions can be{ action: "abort", reason: "Some reason", config: // altered config... }
"abort"
to skip this and all other files in the queue,"skip"
to skip just this file, or"continue"
to carry on (equivalent to returning nothing).reason
can be a reason for aborting.config
can be a modified configuration for parsing just this file. - The
complete
callback shown here is executed after all files are finished and does not receive any data. Use the complete callback in config for per-file results.
Convert JSON to CSV
Papa's unparse
utility writes out correct delimited text strings given an array of arrays or an array of objects.
Unparse
Papa.unparse(data[, config])
- Returns the resulting delimited text as a string.
-
data
can be one of:- An array of arrays
- An array of objects
- An object explicitly defining
fields
anddata
-
config
is an optional config object
Default Unparse Config with all options
{
quotes: false, //or array of booleans
quoteChar: '"',
escapeChar: '"',
delimiter: ",",
header: true,
newline: "\r\n",
skipEmptyLines: false, //other option is 'greedy', meaning skip delimiters, quotes, and whitespace.
columns: null //or array of strings
}
Unparse Config Options
| Option | Explanation |
|---|---|
quotes
|
If true , forces all fields to be enclosed in quotes. If an array of true/false values, specifies which fields should be force-quoted (first boolean is for the first column, second boolean for the second column, ...). A function that returns a boolean values can be used to determine the quotes value of a cell. This function accepts the cell value and column index as parameters. Note that this option is ignored for undefined , null and date-object values. The option escapeFormulae also takes precedence over this.
|
quoteChar |
The character used to quote fields. |
escapeChar |
The character used to escape quoteChar inside field values.
|
delimiter
|
The delimiting character. Multi-character delimiters are supported. It must not be found in Papa.BAD_DELIMITERS. |
header
|
If false , will omit the header row. If data is an array of arrays this option is ignored. If data is an array of objects the keys of the first object are the header row. If data is an object with the keys fields and data the fields are the header row.
|
newline
|
The character used to determine newline sequence. It defaults to "\r\n" .
|
skipEmptyLines
|
If true , lines that are completely empty (those which evaluate to an empty string) will be skipped. If set to 'greedy' , lines that don't have any content (those which have only whitespace after parsing) will also be skipped.
|
columns
|
If data is an array of objects this option can be used to manually specify the keys (columns) you expect in the objects. If not set the keys of the first objects are used as column.
|
escapeFormulae
|
If true , field values that begin with = , + , - , @ , \t , or \r , will be prepended with a ' to defend against injection attacks, because Excel and LibreOffice will automatically parse such cells as formulae. You can override those values by setting this option to a regular expression
|
Examples
// Two-line, comma-delimited file
var csv = Papa.unparse([
["1-1", "1-2", "1-3"],
["2-1", "2-2", "2-3"]
]);
// With implicit header row
// (keys of first object populate header row)
var csv = Papa.unparse([
{
"Column 1": "foo",
"Column 2": "bar"
},
{
"Column 1": "abc",
"Column 2": "def"
}
]);
// Specifying fields and data explicitly
var csv = Papa.unparse({
"fields": ["Column 1", "Column 2"],
"data": [
["foo", "bar"],
["abc", "def"]
]
});
The Parse Config Object
The parse
function may be passed a configuration object. It defines settings, behavior, and callbacks used during parsing. Any properties left unspecified will resort to their default values.
Default Config With All Options
{
delimiter: "", // auto-detect
newline: "", // auto-detect
quoteChar: '"',
escapeChar: '"',
header: false,
transformHeader: undefined,
dynamicTyping: false,
preview: 0,
encoding: "",
worker: false,
comments: false,
step: undefined,
complete: undefined,
error: undefined,
download: false,
downloadRequestHeaders: undefined,
downloadRequestBody: undefined,
skipEmptyLines: false,
chunk: undefined,
chunkSize: undefined,
fastMode: undefined,
beforeFirstChunk: undefined,
withCredentials: undefined,
transform: undefined,
delimitersToGuess: [',', '\t', '|', ';', Papa.RECORD_SEP, Papa.UNIT_SEP]
}
Config Options
| Option | Explanation |
|---|---|
delimiter
|
The delimiting character. Leave blank to auto-detect from a list of most common delimiters, or any values passed in through delimitersToGuess . It can be a string or a function. If a string, it can be of any length (so multi-character delimiters are supported). If a function, it must accept the input as first parameter and it must return a string which will be used as delimiter. In both cases it cannot be found in Papa.BAD_DELIMITERS.
|
newline
|
The newline sequence. Leave blank to auto-detect. Must be one of \r, \n, or \r\n. |
quoteChar
|
The character used to quote fields. The quoting of all fields is not mandatory. Any field which is not quoted will correctly read. |
escapeChar
|
The character used to escape the quote character within a field. If not set, this option will default to the value of quoteChar , meaning that the default escaping of quote character within a quoted field is using the quote character two times. (e.g. "column with ""quotes"" in text" )
|
header
|
If true, the first row of parsed data will be interpreted as field names. An array of field names will be returned in meta, and each row of data will be an object of values keyed by field name instead of a simple array. Rows with a different number of fields from the header row will produce an error.
Warning: Duplicated field names will be automatically renamed to avoid values in previous fields having the same name to be overwritten. Renamed fields with original (or transformed by transformHeader ) are stored in ParseResult.meta.renamedHeaders
|
transformHeader
|
A function to apply on each header. Requires header to be true . The function receives the header as its first argument and the index as second.Only available starting with version 5.0. |
dynamicTyping
|
If true, numeric and boolean data will be converted to their type instead of remaining strings. Numeric data must conform to the definition of a decimal literal. Numerical values greater than 2^53 or less than -2^53 will not be converted to numbers to preserve precision. European-formatted numbers must have commas and dots swapped. If also accepts an object or a function. If object it's values should be a boolean to indicate if dynamic typing should be applied for each column number (or header name if using headers). If it's a function, it should return a boolean value for each field number (or name if using headers) which will be passed as first argument.
|
preview
|
If > 0, only that many rows will be parsed. |
encoding
|
The encoding to use when opening local files. If specified, it must be a value supported by the FileReader API. |
worker
|
Whether or not to use a worker thread. Using a worker will keep your page reactive, but may be slightly slower. |
comments
|
A string that indicates a comment (for example, "#" or "//"). When Papa encounters a line starting with this string, it will skip the line. |
step
|
To stream the input, define a callback function:
Streaming is necessary for large files which would otherwise crash the browser. You can call parser.abort() to abort parsing. And, except when using a Web Worker, you can call parser.pause() to pause it, and parser.resume() to resume.
|
complete
|
The callback to execute when parsing is complete. It receives the parse results. If parsing a local file, the File is passed in, too:
When streaming, parse results are not available in this callback.
|
error
|
A callback to execute if FileReader encounters an error. The function is passed two arguments: the error and the File. |
download
|
If true, this indicates that the string you passed as the first argument to parse() is actually a URL from which to download a file and parse its contents.
|
downloadRequestHeaders
|
If defined, should be an object that describes the headers, example:
|
downloadRequestBody
|
Use POST request on the URL of the download option. The value passed will be set as the body of the request. |
skipEmptyLines
|
If true, lines that are completely empty (those which evaluate to an empty string) will be skipped. If set to 'greedy' , lines that don't have any content (those which have only whitespace after parsing) will also be skipped.
|
chunk
|
A callback function, identical to step, which activates streaming. However, this function is executed after every chunk of the file is loaded and parsed rather than every row. Works only with local and remote files. Do not use both chunk and step callbacks together. For the function signature, see the documentation for the step function. |
chunkSize
|
Overrides Papa.LocalChunkSize and Papa.RemoteChunkSize . See configurable section to know the usage of both parameters.
|
fastMode
|
Fast mode speeds up parsing significantly for large inputs. However, it only works when the input has no quoted fields. Fast mode will automatically be enabled if no " characters appear in the input. You can force fast mode either way by setting it to true or false .
|
beforeFirstChunk
|
A function to execute before parsing the first chunk. Can be used with chunk or step streaming modes. The function receives as an argument the chunk about to be parsed, and it may return a modified chunk to parse. This is useful for stripping header lines (as long as the header fits in a single chunk). |
withCredentials
|
A boolean value passed directly into XMLHttpRequest's "withCredentials" property. |
transform
|
A function to apply on each value. The function receives the value as its first argument and the column number or header name when enabled as its second argument. The return value of the function will replace the value it received. The transform function is applied before dynamicTyping. |
delimitersToGuess
|
An array of delimiters to guess from if the delimiter option is not set.
|
The Parse Result Object
A parse result always contains three objects: data, errors, and meta. Data and errors are arrays, and meta is an object. In the step callback, the data array will only contain one element.
Result Structure
{
data: // array of parsed data
errors: // array of errors
meta: // object with extra info
}
data
is an array of rows. If header is false, rows are arrays; otherwise they are objects of data keyed by the field name.errors
is an array of errors.meta
contains extra information about the parse, such as delimiter used, the newline sequence, whether the process was aborted, etc. Properties in this object are not guaranteed to exist in all situations.
Data
// Example (header: false)
[
["Column 1", "Column 2"],
["foo", "bar"],
["abc", "def"]
]
// Example (header: true)
[
{
"Column 1": "foo",
"Column 2": "bar",
"Column 1": "foo1",
},
{
"Column 1": "abc",
"Column 2": "def",
"Column 1": "abc1",
}
]
- If header row is enabled and more fields are found on a row of data than in the header row, an extra field will appear in that row called
__parsed_extra
. It contains an array of all data parsed from that row that extended beyond the header row.
Errors
// Error structure
{
type: "", // A generalization of the error
code: "", // Standardized error code
message: "", // Human-readable details
row: 0, // Row index of parsed data where error is
}
- The error
type
will be one of "Quotes", "Delimiter", or "FieldMismatch". - The
code
may be "MissingQuotes", "UndetectableDelimiter", "TooFewFields", or "TooManyFields" (depending on the error type). - Just because errors are generated does not necessarily mean that parsing failed. The worst error you can get is probably MissingQuotes.
Meta
{
delimiter: // Delimiter used
linebreak: // Line break sequence used
aborted: // Whether process was aborted
fields: // Array of field names
truncated: // Whether preview consumed all input
renamedHeaders: // Headers that are automatically renamed by the library to avoid duplication. {Column 1_1: 'Column 1' // the later header 'Column 1' was renamed to 'Column 1_1'}
}
- Not all meta properties will always be available. For instance,
fields
is only given when header row is enabled.
Extras
There's a few other things that Papa exposes to you that weren't explained above.
Read-Only
| Read-Only Property | Explanation |
|---|---|
Papa.BAD_DELIMITERS |
An array of characters that are not allowed as delimiters (\r, \n, ", \ufeff ).
|
Papa.RECORD_SEP |
The true delimiter. Invisible. ASCII code 30. Should be doing the job we strangely rely upon commas and tabs for. |
Papa.UNIT_SEP |
Also sometimes used as a delimiting character. ASCII code 31. |
Papa.WORKERS_SUPPORTED |
Whether or not the browser supports HTML5 Web Workers. If false, worker: true will have no effect.
|
Configurable
| Configurable Property | Explanation |
|---|---|
Papa.LocalChunkSize |
The size in bytes of each file chunk. Used when streaming files obtained from the DOM that exist on the local computer. Default 10 MB. |
Papa.RemoteChunkSize |
Same as LocalChunkSize, but for downloading files from remote locations. Default 5 MB. |
Papa.DefaultDelimiter |
The delimiter used when it is left unspecified and cannot be detected automatically. Default is comma. |


Infomaster
Relative Actions
Absolute Actions
Toplevel
Topdoor
Makedoor
Frontdoor
Sidedoor
Backdoor
Seek
Search
Inspect
View
Create
Change
Searcher
Inspector
Creator
Updater
Displayclass
Displaytable
Examine
Assert
QBEView
QBE
Ask
Xform
Transform
ACL
SQL
Apropos
Keysearch
Copyagentdata
Dropagentdata
Moveagentdata
Copyclassdata
Dropclassdata
Moveclassdata
Copytabledata
Droptabledata
Movetabledata
Rename
Duplicate
Move
MaterializeSchema
RematerializeSchema
DematerializeSchema
MaterializeTree
RematerializeTree
DematerializeTree
MaterializeClass
RematerializeClass
DematerializeClass
MaterializeTable
RematerializeTable
DematerializeTable
BackwardRules
ForwardRules
TriggerRules
EvertRules
SeparateRules
ConsolidateRules
TabulateRules
ReifyRules
InterrelateRules
IncorporateRules
IntegrateRules
Introspect
ApplyTransforms
Concordance
RemoveDuplicateData
CountRows
CountCells
CountBytes
CheckClass
CheckPredicate
CheckAttribute
CheckRelation
CheckData
CheckRules
LoadFile
UnloadFile
DumpAgent
DumpClass
DumpRelation
DumpRules
Load
Dump
Initialize
ResetAgent
ResetSystem
Relative actions are relative to the agent performing them, e.g. where data is found or stored.
Absolute actions have the same effect no matter who executes them.
However, usually only the Manager has information about the possible arguments.


FCC Bars Huawei, ZTE From Billions in Federal Subsidies
by msmashThe US Federal Communications Commission on Friday voted to bar use of its $8.5 billion a year Universal Service Fund to purchase equipment and services from Huawei and ZTE. The government fund is used by multiple programs to subsidize US broadband deployment and services. From a report: In a unanimous vote during its November open meeting, the FCC approved an order that blocks the use of USF funds to purchase equipment and services from companies that pose a national security threat. The order also establishes a process for barring more companies in the future. So far, just Huawei and ZTE are on the list. "Given the threats posed by Huawei and ZTE to America's security and our 5G future, this FCC will not sit idly by and hope for the best," said FCC Chairman Ajit Pai in a statement Friday.


Using Quaqua
Creating Layouts
Component-specific features
Special components
Other features
Overviews


Archive of our Own - Haikyuu Fanwork Data Visualisation
The "Archive of Our Own" (AO3), a nonprofit open source
repository for
fanworks, has become one of the most popular archives for transformative works since its founding in
2008.
Haikyuu!! (ハイキュー!!) is a Japanese manga series written and illustrated by Haruichi Furudate.
On this page I have collected several statistics about the fanfictions of the Haikyuu!! series. This
was achieved by going through the tag "Haikyuu!!" on
AO3. This means that any work not tagged with this was not considered. Works that are only viewable when
logged in are also not considered as they cannot be saved with my script.
To explore the visualizations just start scrolling down! :)
▼
This table shows how many works were finished per day. Only complete works are counted this way :)
This graph shows how many works exist with certain characters. Hover over the bars to check the exact
number!
This graph shows how many works exist with certain relationships. Hover over the bars to check the exact
number!
This graph shows how many fanfictions were written per month about certain ships. The last counted month
was April 2021 so it's only full months displayed. Only completed works were counted in this graph.
This graph shows how many works exist with certain tags. Hover over the bars to check the exact
number!
You have reached the end! Thank you very much for looking through this. I really enjoy making
visualizations
so there might come a few more in the future. I have a full database with statistics about Haikyuu
works.
And there are a lot of interesting things I could make graphics with.
If you have anything specific you are curious about why don't you head over to twitter and ask me? :)
Some more technical details:
Used JavaScript libraries:skrollr
and D3
I used python and postgresql for scraping AO3 and the creation of the database.
This project of mine is already a few years old but I recently remade some parts of it.
Visit the github project page for the code
:)
Fun statistics:
645,360,220 words total
17,879,275 kudos total
2,249,836 bookmarks total
224,278,538 hits total
More fun statistics:
The most common title is "Home" with 72 works!
Works with 0 and with 1000 words are the most common ones!
The author with most Haikyuu!! fanworks on AO3 seems to be karasunovolleygays! note: this might not be accurate as my data is only counting works that are available while not
logged in


"""
standard.py:
This file contains the necessary functions used to setup a standard pipeline that will pull data from the middle-ware
layer into the python system. This layer is designed to setup the base necessary to running Gds objects up-to the layer
of decoding. This enables users to generate add-in that function above the decoders, and run on a standard pipeline
below.
:author: lestarch
"""
import datetime
import os.path
import fprime.common.models.serialize.time_type
import fprime_gds.common.client_socket.client_socket
import fprime_gds.common.data_types.cmd_data
import fprime_gds.common.distributor.distributor
import fprime_gds.common.logger.data_logger
# Local imports for the sake of composition
from . import dictionaries, encoding, files, histories
[docs]class StandardPipeline:
"""
Class used to encapsulate all of the components of a standard pipeline. The life-cycle of this class follows the
basic steps:
1. setup: creates objects needed to read from middle-ware layer and provide data up the stack
2. register: consumers from this pipeline should register to receive decoder callbacks
3. run: this pipeline should either take over the standard thread of execution, or be executed on another thread
4. terminate: called to shutdown the pipeline
This class provides for basic log files as a fallback for storing events as well. These logs are stored in a given
directory, which is created on the initialization of this class.
"""
def __init__(self):
"""
Set core variables to None or their composition handlers.
"""
self.distributor = None
self.client_socket = None
self.logger = None
self.__dictionaries = dictionaries.Dictionaries()
self.__coders = encoding.EncodingDecoding()
self.__histories = histories.Histories()
self.__filing = files.Filing()
[docs] def setup(
self, config, dictionary, down_store, logging_prefix=None, packet_spec=None
):
"""
Setup the standard pipeline for moving data from the middleware layer through the GDS layers using the standard
patterns. This allows just registering the consumers, and invoking 'setup' all other of the GDS support layer.
:param config: config object used when constructing the pipeline.
:param dictionary: dictionary path. Used to setup loading of dictionaries.
:param down_store: downlink storage directory
:param logging_prefix: logging prefix. Defaults to not logging at all.
:param packet_spec: location of packetized telemetry XML specification.
"""
# Loads the distributor and client socket
self.distributor = fprime_gds.common.distributor.distributor.Distributor(config)
self.client_socket = (
fprime_gds.common.client_socket.client_socket.ThreadedTCPSocketClient()
)
# Setup dictionaries encoders and decoders
self.dictionaries.load_dictionaries(dictionary, packet_spec)
self.coders.setup_coders(
self.dictionaries, self.distributor, self.client_socket
)
self.histories.setup_histories(self.coders)
self.files.setup_file_handling(
down_store,
self.coders.file_encoder,
self.coders.file_decoder,
self.distributor,
logging_prefix,
)
# Register distributor to client socket
self.client_socket.register_distributor(self.distributor)
# Final setup step is to make a logging directory, and register in the logger
if logging_prefix:
self.setup_logging(logging_prefix)
@classmethod
[docs] def get_dated_logging_dir(cls, prefix=os.path.expanduser("~")):
"""
Sets up the dated subdirectory based upon a given prefix
:param prefix:
:return: Path to new directory where logs will be stored for this pipeline
"""
# Setup log file location
dts = datetime.datetime.now()
log_dir = os.path.join(prefix, dts.strftime("%Y-%m-%dT%H:%M:%S.%f"))
# Make the directories if they do not exit
if not os.path.exists(log_dir):
os.makedirs(log_dir)
return log_dir
[docs] def setup_logging(self, log_dir):
"""
Setup logging based on the logging prefix supplied
:param prefix: logging prefix to use
"""
# Setup the logging pipeline (register it to all its data sources)
logger = fprime_gds.common.logger.data_logger.DataLogger(
log_dir, verbose=True, csv=True
)
self.logger = logger
self.coders.register_channel_consumer(self.logger)
self.coders.register_event_consumer(self.logger)
self.coders.register_command_consumer(self.logger)
self.coders.register_packet_consumer(self.logger)
self.client_socket.register_distributor(self.logger)
[docs] def connect(self, address, port):
"""
Connects to the middleware layer
:param address: address of middleware
:param port: port of middleware
"""
self.client_socket.connect(address, port)
self.client_socket.register_to_server(
fprime_gds.common.client_socket.client_socket.GUI_TAG
)
[docs] def disconnect(self):
"""
Disconnect from socket
"""
self.client_socket.disconnect()
self.files.uplinker.exit()
[docs] def send_command(self, command, args):
"""
Sends commands to the encoder and history.
:param command: command id from dictionary to get command template
:param args: arguments to process
"""
if isinstance(command, str):
command_template = self.dictionaries.command_name[command]
else:
command_template = self.dictionaries.command_id[command]
cmd_data = fprime_gds.common.data_types.cmd_data.CmdData(
tuple(args), command_template
)
cmd_data.time = fprime.common.models.serialize.time_type.TimeType()
cmd_data.time.set_datetime(datetime.datetime.now(), 2)
self.coders.send_command(cmd_data)
@property
[docs] def dictionaries(self):
"""
Get a dictionaries object
:return: dictionaries composition
"""
return self.__dictionaries
@property
[docs] def coders(self):
"""
Get a coders object
:return: coders composition
"""
return self.__coders
@property
[docs] def histories(self):
"""
Get a histories object
:return: histories composition
"""
return self.__histories
@property
[docs] def files(self):
"""
Files member property
:return: filing compositions
"""
return self.__filing


{% extends "layout.html" %} {% block content %}
jlbry:/var/mobile root#
Interactive table of the latest jailbreak releases, iOS versions, iOS version features, devices, device features, and more.


Stackdigest
Monitor your favorite questions at all StackExchange sites
Receive updates via email
Sign in with
StackExchange
Digest emails are sent to
Save
Your StackExchange sites


{% load static %}
last updated on {{ timestamp }}
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC
IIM-Resrved
NON-AC
NON-AC
NON-AC
NON-AC
AC
AC
IIM-Resrved
IIM-Resrved
IIM-Resrved
IIM-Resrved
NON-AC
NON-AC
NON_AC
NON-AC
oReserved for IIM or other pourposes
oBooked or there is already a faculty living in that apartment


| A Certain Ratio | |
| Ash | |
| The Bangles | |
| Biffy Clyro | |
| bis | |
| Blood Red Shoes | |
| Blossoms | |
| The Blow Monkeys | |
| Bluedot 2023 | |
| Blur | |
| Bombay Bicycle Club | |
| The Charlatans | |
| CHVRCHES | |
| The Coral | |
| The Cribs | |
| The Cure | |
| David Bowie | |
| Dexys Midnight Runners | |
| DMA\'s | |
| Doves | |
| Dutch Uncles | |
| Echo And The Bunnymen | |
| Elliott Smith | |
| Embrace | |
| EMF | |
| Everything Everything | |
| The Fall | |
| Field Music | |
| Frankie Goes To Hollywood | |
| Friendly Fires | |
| Gilbert O\'Sullivan | |
| Glass Animals | |
| The GO! Team | |
| The Hold Steady | |
| The Horrors | |
| Hot Chip | |
| Ian Prowse | |
| John Lennon | |
| Joy Division | |
| Kendal Calling 2023 | |
| Ladytron | |
| Lanterns On The Lake | |
| The Lathums | |
| Liam Frost | |
| Lightning Seeds | |
| Lloyd Cole | |
| LoneLady | |
| Love | |
| Madness | |
| Mercury Rev | |
| Metronomy | |
| Michael Giacchino | |
| Mogwai | |
| The Music | |
| Nada Surf | |
| New Order | |
| Oasis | |
| OMD | |
| Pixies | |
| The Pogues | |
| Public Service Broadcasting | |
| Ride | |
| Rufus Wainwright | |
| Róisín Murphy | |
| Sea Power | |
| She Drew The Gun | |
| Shed Seven | |
| Sleaford Mods | |
| The Slow Readers Club | |
| Spear Of Destiny | |
| Steven Wilson | |
| Suede | |
| Sunstack Jones | |
| Supergrass | |
| Taffy | |
| Tears For Fears | |
| Teenage Fanclub | |
| The The | |
| Tim Burgess | |
| Trampolene | |
| The Twilight Sad | |
| The Vaccines | |
| Various Artists | |
| The War On Drugs | |
| The Waterboys | |
| We Are Scientists | |
| Whyte Horses |


--- layout: post title: "Type-level DI Container prototype" description: "A fairly pointless Haskell exercise." date: 2022-01-24 6:48 UTC tags: [Haskell, Dependency Injection] --- {% include JB/setup %}
{{ page.description }}
This article is part of a series called Type-safe DI composition.
People sometimes ask me how to do Dependency Injection (DI) in Functional Programming, and the short answer is that you don't. DI makes everything impure, while the entire point of FP is to write as much referentially transparent code as possible. Instead, you should aim for the Functional Core, Imperative Shell style of architecture (AKA impureim sandwich).
Occasionally, someone might point out that you can use the contravariant Reader functor with a 'registry' of services to emulate a DI Container in FP.
Not really, because even if you make the dependencies implicitly available as the Reader 'environment', they're still impure. More on that in a future article, though.
Still, what's a DI Container but a dictionary of objects, keyed by type? After I read Thinking with Types I thought I'd do the exercise and write a type-level container of values in Haskell.
The TLContainer
module requires a smorgasbord of extensions and a few imports:
{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE UndecidableInstances #-} module TLContainer (Container (), nil, insert, get) where import Data.Kind import Data.Proxy import GHC.TypeLits import Fcf import Unsafe.Coerce (unsafeCoerce)
Notice that the module only exports the Container
type, but not its data constructor. You'll have to use nil
and insert
to create values of the type.
The Container
should be able to store an arbitrary number of services of arbitrary types. This doesn't sound like a good fit for a statically typed language like Haskell, but it's possible to do this with existential types. Define an existential type that models a container registration:
data Reg where Reg :: a -> Reg
The problem with existential types is that the type argument a
is lost at compile time. If you have a Reg
value, it contains a value (e.g. a service) of a particular type, but you don't know what it is.
You can solve this by keeping track of the types at the type level of the container itself. The Container
data type is basically just a wrapper around a list of Reg
values:
data Container (ts :: [k]) where UnsafeContainer :: [Reg] -> Container ts
The name of the data constructor is UnsafeContainer
because it's unsafe. It would enable you to add multiple registrations of the same type. The container shouldn't allow that, so the module doesn't export UnsafeContainer
. Instead, it defines sufficient type-level constraints to guarantee that if you try to add two registrations of the same type, your code isn't going to compile.
This is the principal feature that distinguishes Container
from the set of tuples that Haskell already defines.
The module exports an empty Container
:
nil :: Container '[] nil = UnsafeContainer []
Not only is this container empty, it's also statically typed that way. The type Container '[]
is isomorphic to ()
.
The nil
container gives you a container so that you can get started. You can add a registration to nil
, and that's going to return a new container. You can add another registration to that container, and so on.
The distinguishing feature of Container
, however, is that you can only add one registration of a given type. If you want to register multiple services of the same type, register a list of them.
Code like insert readReservations $ insert readReservations nil
shouldn't compile, because it tries to insert
the same service (readReservations
) twice. To enable that feature, the module must be able to detect type uniqueness at the type level. This is possible with the help from the first-class-families package:
type UniqueType (t :: k) (ts :: [k]) = Null =<< Filter (TyEq t) ts
This type models the condition that the type t
must not be in the list of types ts
. It almost looks like regular Haskell code at the term level, but it works at the type level. Null
is a type that can be evaluated to Boolean types at compile-time, depending on whether a list is empty or not.
This enables you to define a closed type family that will produce a compile-time error if a candidate type isn't unique:
type family RequireUniqueType (result :: Bool) (t :: k) :: Constraint where RequireUniqueType 'True t = () RequireUniqueType 'False t = TypeError ( 'Text "Attempting to add the type " ':<>: 'ShowType t ':<>: 'Text " to the container, but this container already contains that type.")
Combined with the UniqueType
alias, you can now define the insert
function:
insert :: RequireUniqueType (Eval (UniqueType t ts)) t => t -> Container ts -> Container (t ': ts) insert x (UnsafeContainer xs) = UnsafeContainer (Reg x : xs)
This function enables you to register multiple services, like this:
container :: Container '[LocalTime -> IO [Reservation], Reservation -> IO ()] container = insert readReservations $ insert createReservation nil
If, on the other hand, you attempt to register the same service multiple times, your code doesn't compile. You might, for example, attempt to do something like this:
container' = insert readReservations container
When you try to compile your code, however, it doesn't:
* Attempting to add the type LocalTime -> IO [Reservation] to the container, but this container already contains that type. * In the expression: insert readReservations container In an equation for container': container' = insert readReservations container | 36 | container' = insert readReservations container | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As a proof of concept, that's good enough for me. A type-safe set of uniquely typed registrations.
Given that Container
is a wrapper over a list of existential types, it seems as though the type information is lost. It isn't, though. Consider the type of the above container
value. At the type level, you can see that it contains two services: one with the type LocalTime -> IO [Reservation]
, and another with the type Reservation -> IO ()
. Not only that, but the compiler can see the position of each of those types. Due to the way insert
is implemented, that order corresponds to the order of Reg
values.
First, define a type alias to find the index of a type t
in a list of types ts
:
type FindElem (t :: k) (ts :: [k]) =
FromMaybe Stuck =<< FindIndex (TyEq t) ts
This is again the first-class-families package in action. FindIndex
finds a Nat
that represents the index if the type is there. If it isn't there, the type is equivalent to Stuck
, which is the type-level equivalent of undefined
. Nat
is a KnownNat
instance, whereas Stuck
isn't, which now enables you to define a constraint:
type IsMember t ts = KnownNat (Eval (FindElem t ts))
The IsMember
constraint limits t
to belong to ts
. With it, you can now define a helper function to find the index of a type t
in a list of types ts
:
findElem :: forall t ts. IsMember t ts => Int findElem = fromIntegral . natVal $ Proxy @(Eval (FindElem t ts))
Because of the IsMember
constraint, we know that t
must be a member of ts
. You can't call findElem
if that's not the case; your code wouldn't compile.
You can now define a function to retrieve a service from a Container
:
get :: forall t ts. IsMember t ts => Container ts -> t get (UnsafeContainer xs) = unReg $ xs !! findElem @t @ts where unReg (Reg x) = unsafeCoerce x
The get
function first finds the index of the type t
in ts
. It then uses the (unsafe) list index operator !!
to get the correct Reg
value out of x
. While the use of !!
is generally considered unsafe (or, at least, partial) in Haskell, we know that the element is there because of the IsMember
constraint.
Furthermore, because of the way insert
builds up the container, we know that the service inside the existential type Reg
must be of the type t
. Thus, it's safe to use unsafeCoerce
.
Imagine that you've created the above container
. You can now retrieve services from it as necessary.
For example, to implement a HTTP GET resource that returns a list of reservations for a given date, you could do something like this:
getReservations :: LocalTime -> IO (HTTPResult [Reservation]) getReservations date = do let svc = get container :: LocalTime -> IO [Reservation] reservations <- svc date return $ OK reservations
Nothing much happens here. You could imagine that proper input validation of date
is done before the service is invoked, or that some mapping operation is done on reservations
before the function returns them. I omitted those steps, since they're not what matters. What matters is that that you can use get
to safely get a service of the type LocalTime -> IO [Reservation]
.
Likewise, you could implement an HTTP POST resource that clients can use use to create new reservations:
postReservation :: Reservation -> IO (HTTPResult ()) postReservation dto = do let svc = get container :: Reservation -> IO () svc dto return $ OK ()
Since the compiler knows that container
also contains a service of the type Reservation -> IO ()
, this still compiles.
If, on the other hand, you attempted to implement a single HTTP GET resource, the following wouldn't compile:
getSingleReservation :: LocalTime -> String -> IO (HTTPResult Reservation) getSingleReservation date email = do let svc = get container :: LocalTime -> String -> IO (Maybe Reservation) mres <- svc date email case mres of Just r -> return $ OK r Nothing -> return $ NotFound
The get container
line doesn't compile because container
doesn't contain a service of the type LocalTime -> String -> IO (Maybe Reservation)
, and the compiler can tell.
If you truly want to add that feature, you'll have to first register that service with the container:
container :: Container '[ LocalTime -> String -> IO (Maybe Reservation), LocalTime -> IO [Reservation], Reservation -> IO ()] container = insert readReservation $ insert readReservations $ insert createReservation nil
Notice that the type of container
has now changed. It now contains three services instead of two. The getSingleReservation
action now compiles.
The Container
shown here is essentially just a glorified tuple. The only distinguishing trait is that you can define a tuple where two or more elements have the same type, such as (String, Bool, String)
, whereas this isn't possible with Container
. You can define a Container '[String, Bool]
, but not Container '[String, Bool, String]
.
Why is this desirable?
This stems from a short and (friendly, I hope) Twitter discussion initiated by Bogdan Galiceanu. We were discussing whether it'd be more appropriate to use SingleOrDefault to manipulate a service in a DI Container, or foreach
.
"Yeah, I wasn't explicit and clarified in a second tweet. I didn't mean in the services example, but in general where it helps if the reader's mental model of the code has 1 item from the collection, because that's how it is in real life. SingleOrDefault would enforce this."
The point being made here is that while you have a dictionary of collections, you expect certain (if not all) of these collections to be singleton sets.
I'm so happy that people like Bogdan Galiceanu share their thoughts with me, because it gives me a wider perspective on how programmers interact with APIs. If you take the API of the .NET Core DI Container as given, you almost have to think of its entries in this way.
I think, on the other hand, that this indicates a missed opportunity of API design. I replied:
"Yes, this could be a requirement. I think, though, that if that's the case, you've unearthed another invariant. That's what object-oriented design is about.
"Different invariants imply a change of type. If there can only be one of each element, then a set is more appropriate."
Twitter isn't a medium that makes it easy to elaborate on ideas, but what I meant was that if a container should contain only a single instance of, say, IFoo
, it'd be clearer if the type system reflected that. Thus, when resolving IFoo
, the return type should be IFoo
, and not IEnumerable<IFoo>
.
On the other hand, if you meant to register a collection of IBar
services, when resolving IBar
, the return type should be IEnumerable<IBar>
(or, even better, IReadOnlyCollection<IBar>
).
The Container
shown here has this desired property: You can't insert
the same type more than once. If you want to insert
multiple IBar
values, you must insert
a [IBar]
(list of IBar
). Thus, you can't get
a single IBar
, but you can get
a list: [IBar]
.
That was my motivation for the rule that each type can only appear once. In Haskell it's possible to implement such a rule at the type level. I don't think it'd be possible in a language like C# or F#, but you could implement it as a run-time check.
You can implement a type-level container of values in Haskell. The contents are completely parametrically polymorphic, so while you can insert pure values like String
, Bool
, or Reservation
into it, you can also add functions and impure actions like Reservation -> IO ()
.
Why is this interesting? It really isn't, apart from that I found it an interesting exercise in type-level programming.
The idea of a type-safe DI Container is, however, marginally more compelling, so I'll return to that topic in a future article.


?HERBARIUM
OF
IOWA
STATE
UNIVERSITY
fis
sorghoidea
(Desv,
ex
Hamilt.)
ase
var.
patentiflora
(Hitchc.
&
dse
Determined
by
Gerrit
Davidse
197
2
Hitchc.
Chase)
New
York
Botanical
Garden
lbST7S5
L
£
PLANTS
OF
HAITI
Miragoane
and
vicinity
No.
i'fV
W.
J.
EYERDAM,
Collector
1*0
.9
1659755
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


This option only becomes available if you have a multirooted project, that is there are several Git repositories
within a single project.
Select this option if you want branch operations (such as
checkout
, merge
, and so on.)
to be applied synchronously to all repositories within your project.


XSServer is an easy-to-use web API for serverless cross site scripting. This API is a response to seeing cross site scripting challenges in cybersecurity CTFs, but having no quick and easy serverless tools. I hope this tool helps people in similar situations as well as people who want easy cross site scripting for other ethical reasons.
This is a very young project whose interface is not stable yet. Don't make applications you expect to use without changing or you expect other people to use which involve XSServer.
(curl -d '{"key": "deadbeef"}' -H 'Content-Type: application/json' -X POST 'http://www.xsserver.org/poll' | base64 -d &) curl -d 'Hello, World' -H 'Content-Type: application/octet-stream' -X POST 'http://www.xsserver.org/message?key=deadbeef'
The output from the above commands should echo back "Hello, World" in the command line (albeit in a weird way). They also must be done fairly quickly, as the endpoint uses long polling.
There will be more endpoints which include Websockets and Server-Sent Events. The object sent to such endpoints may also have optional fields. What those fields are is to be determined.


Bolivia ousts foreigners over unrest
Bolivia's interim government says it has asked Venezuelan officials to leave the country, and accused Cubans, including doctors, of instigating unrest in the wake of the resignation of former president Evo Morales.
New Foreign Minister Karen Longaric said Cuba would fly home 725 of its citizens, mostly medical doctors, after she raised concerns about their alleged involvement in recent protests.
She had also asked all Venezuelan diplomats to leave for similar reasons.
The foreign policy shake-up in Bolivia comes as protests against the four-day-old government of conservative interim President Jeanine Anez roil the country amid its biggest political upheaval in over a decade.
Venezuela and Cuba were key allies for leftist Morales, who swept to office as the country's first indigenous president in 2006 and resigned under pressure on Sunday over a disputed October 20 election.
The vote gave him an outright win but was tarnished by allegations of fraud, sparking widespread anti-government protests that often turned violent.
Morales and his vice president fled the country earlier this week, and were given asylum in Mexico. But protests by Morales' supporters have continued in capital La Paz, nearby El Alto, and the central city of Cochabamba.
In a statement, Cuba's foreign ministry denied its doctors had supported any protests. Venezuela's foreign ministry did not immediately respond to requests for comments.
Both countries have backed Morales' assertion that he was toppled in a foreign-backed coup.
Other countries in the region, including Brazil and Ecuador, have acted similarly against Cubans in recent months.
Police fired tear gas at protesters in La Paz on Friday, while schools remained closed and fuel deliveries were disrupted by road blocks.
Local media reports showed violent standoffs between coca farmers and police in the region of Cochabamba. Bolivia's official ombudsman said there had been at least four people killed in the region on Friday and put total deaths so far in the protests at 18.


Vape tumeric hoodie, pour-over poke iPhone brooklyn banjo butcher meggings green juice microdosing mumblecore. You probably haven't heard of them dreamcatcher shabby chic, aesthetic kombucha taiyaki photo booth. Scenester YOLO drinking vinegar forage offal sustainable, pop-up chartreuse chia art party cloud bread slow-carb. Mlkshk small batch disrupt, paleo fashion axe ethical narwhal 90's vexillologist chillwave copper mug cold-pressed poke bicycle rights. Cloud bread messenger bag glossier succulents. Mumblecore glossier bitters, chillwave blog umami squid. Bespoke next level tote bag mixtape thundercats succulents biodiesel poutine typewriter small batch. Meditation microdosing brunch, pickled brooklyn irony banh mi. Deep v truffaut vaporware 8-bit glossier neutra. Activated charcoal bushwick skateboard edison bulb mumblecore green juice. Pitchfork man bun XOXO squid truffaut portland. Pop-up locavore neutra af woke, fanny pack kale chips. 90's sriracha taxidermy, neutra tacos kogi pok pok food truck vice. Brunch forage humblebrag gochujang chia blog man braid tbh. Master cleanse normcore adaptogen raclette. Prism ennui deep v cornhole tumblr drinking vinegar crucifix yr enamel pin ethical post-ironic. Dummy text? More like dummy thicc text, amirite?


1024B landscape generator (JS1K submission)
Pointillist representation of an animated landscape: watch Spring comes and passes, and moving shadows casted by clouds.
If you let go the click while moving too fast,you will probably get some glitches: wait a tenth of second after dragging to prevent it. ;-) Also, if you keep zooming, you will eventually reach a negative distance, inverting the controls.
The canvas is regularly reset (~40s), to prevent the page to crash because of the growing memory size of the more and more detailed display.
Final entry for JS1K Spring'13 edition. (see it here)
This time I use the same landscape generation method than in my previous demo, but with a totally different rendering algo, inspired by romancortes' 2012 demo (romancortes.com/blog/1k-rose/).
This pointillist method gives a result a bit less "clean" than with the Painter's algo, but is much lighter, in terms of processing time and bytes. And that's how I've been able to add some animations...
This demo features:
_='dgX=R=r2;Y=.6;JL=l=0&[TN,5,Z=9,h=8];(D9>l;){i=p*oO;dh/;(++l]i)(j=p;jv= N@iP|0jP|0],w=i*p+j,l][w&&(i%2?*2++p]+/4:(v+ +oP:+ P:vh@Y-&6>]?6:;o=i=pir/}g;setInterval(m=-Zw=-KZz=Yx=KYb=J;J%290*Tg=[],); (j=1e4;jtw,k=@R-2*ri=l,lL/r+.5|0,p=h,hL/r%1,F=h>p,F=N*i+l]+(C(!Cv=F-X*z-3,Um,f=z*v+(I=m*U+w*t)*x,v=(v*x-z*I^H+H,I=(w*U-m*t^W+W,f<p=v*2*W+I]p&f,p=],F-=t+(p-h*]-(1-h)**52,Style="hsla("+[p?25Q+bQ*4:7pA*3Q:FG(u=F-bA:5.2<FA*t/5:6.05<pAQ*2:6<pA:1.6+*.8b*l*i/47*f/3J/13)*17G.6]+")",$I,v,t=u/50+3-T,t)));++J},16)down=0}up}moveZ*X/W,Y=Y/H)}NnX+=f.dE|-f.DE}$0,0,W=c.wV#WVO8,H=c.hB#HB-21W/function(f){Math.;onmousecos(+orandom()=[]; lO][u]-*F-F@d[wa.fill25@6<=2),--;wheelLO1-X*f.client)+for||(d[u=T/87)g[+1])j%2?(v#=inner$Rect(&]=@*(A?tBeightCF?p:hEeltaYG"%",Ksin(L=kN=oO-1P/2Q/pVidth^)/f*';for(Y in $='^VQPONLKGECBA@&$# ')with(_.split($[Y]))_=join(pop());eval(_)
Take a look at the comments in the running script, or at my JS1K submission, to see the beautified source and get more technical explanations.
Spring is coming, The mountains take off their white mantle, Random mesh of life and ice, lakes and rocks.
Made for JS1K Spring'13 edition, this demo didn't make it to the board, being replaced by my final one.
It uses the same rendering method as my other submission (see here too), the Painter's algorithm, simplistic but quite light.
The landscape is generated using a mix between the Midpoint displacement and the Diamond-square algorithms, starting with a 2x2 matrix to get a detailed 257x257 heightmap, which is then used to build the 3D mesh.
Colors are applied taking into account the height (water < beach < vegetation < snow) and an rough estimation of the incline for the luminosity. By playing with those parameters and using the flexibility of the HSL color system, it is thus possible to create various nuances of vegetation (meadows for the sun-bathed hills, forests in the coombs, alpines above - imagination can be required here) or to simulate the effect of the sun on the snow (only found in the shadows for the lower altitudes).
By the way, don't fly to close to the surface or you might get entangled in the mesh and unravel the whole world (well, you will actually just get some threads spoiling the view)... Also, if you keep zooming, you will eventually reach a negative distance, inverting the controls. Both are harmless, but now you won't be surprised. I hadn't enough bytes left to better handle the zoom, sorry. As for "why only stroking and not filling the faces?", the answer is simple: I couldn't afford to do both. I found the gaps left by stroking interesting, like a reminder of the "substantial" part of emptiness in the universe fabric. ;-)
_='d g R=r2;Y=.6;=0[o,5,Z=9,T=h=8];D 8>l;){i=p*o@;d hg[++v=CQ_)+j_Aw=i*p+j,$wQ%2?&*2++p]+]!4:(v++o`&+`v)+h*(Y#6>]?6:]o=i=pirD[)k;kDZ++[ijECi+jAQ+kO-k)z=E+k*pAQO)y=E+oAy-=x+(z-y!r,"hsla("+[z?R/z:6#F*2/y:y)+"%",y@?x/Y:6.05<F*x/7:6<F:2/3)]+"%,"]}e^BfillRect(0,0,h=c.widUKWidU@8,r=c.hGKHG-21m=-LZw=-~Zo=LYx=~Yg hq){] j=9;j;vo,um,tw,].push(pCv+(k=m*u+w*t)*x,(v*x-o*k!p*r+r,(w*u-m*t!p*h+h)$910]}p=-l*p/40;g.sort(return f[3]-n[3]}qg)Style=$9]+l/p+")",BbegPaU(#BmovN87215487]#Vdown5,i=sete,9)up8,eVmove^ZX/h;YY/r=on^R+=f.dJ|-f.DJ/80};eVfunction(f,n){[l][-randomV]#BlN*r@1,for(};onmouse=--j]-R* =[];^cleari#T=MaU.l] i)j=p;j@][ud[w32*(6<A$);--;wheel/;Interval(=f.clientinBstroke+1g[lD[T]=2]=!)/#),$g&j%2?(v@-1A],Ba.C=o*Ed[uFz?xGeightJeltaYK=nerLcos(NeTo($O)(jQ(iUthV()^=_/2|0`]!2:ql ~s(';for(Y in $='~q`_^VUQONLKJGFECBA@&$#! ')with(_.split($[Y]))_=join(pop());eval(_)
Take a look at the comments in the running script to see the beautified source and get more technical explanations.
1024B 3D demo (JS1K submission)
"They said I could be anything..." - 3D Mesh
First JS1K entry for the Spring'13 edition. (see it here)
This demo uses the Painter's algorithm to render the 3D mesh: after projecting each face on the coordinate system defined by the camera, we sort them by decreasing depth to get the painting order. Simple, but quite light (and it is possible to use this painting order to apply effects such as a depth fog).
The displayed shape is the result of a chaotic tweening between two pre-generated meshes, a cube and a sphere. To get a smooth tweening for the faces, the sphere geometry is created by mapping each vertex of the cube (cube-mapping method).
To reduce the "collision" effect when the camera enters the shape and to make the whole demo looks more "unreal", I decided to invert the depth order during the rendering process. You can still observe the original order by pressing any keys.
Alas, this demo wasn't running as smoothly with Firefox and Opera as with Chrome (and I couldn't apply most of the optimization tricks because of the specificity of this scene or the lack of bytes). So I decided to add a simple browser detector, to reduce the shape details for Firefox and Opera. I'm not fond of this exception, but I found the render lags even worse (and it was interesting to search a trick to detect the browsers in a minimal number of bytes...). Now that you're aware of the difference, I just invite you to give it a try on Chrome, if you want more details.
_='X=navigatK.vendK?1:2;SCTt=Z=Y=F=U=4,Vv=[eg2-4f%2)x=v[fBy$1)Bz$2)BC x,y,zd=sqrLx*x+y!+z*zS x/d,y/d,z/d)Of=6;fi&ij&jkQ;kS C E,jE+1,j+1E+k,j+^k_=d,F++;V*eR-`97*g*2^(R)},Py=abs(g-e)/g;1>"hsl("+[263i/s),"47%",F*X*X/77]+"%)",Abeg#Path(Amov@87542187](()clickT97)mousemoveZX/W,YY/HkeypressU=-UOsetInterval(M,16)function(e,g){ [Math.=V(C--fSf])+e*]Al#@fK(cos(=[ [F]),.push(+.5|0return ;F # 9]AfillOb.onQ*e.client],--;)`47s#(Astroke=+i)s/4*X-2,Z+`31*(!*y#in$=v[(f+&=16/X;>Style=@eTo(sAa.B%3EV(iG=#nerJeightKorLt(O};Q=2^1-_S`t/';for(Y in $='`_^QOLKJGEBA@>&$#! ')with(_.split($[Y]))_=join(pop());eval(_)
Intoxicated Bezier curves
Intoxicated Bézier curves tracer
Some time ago, I read with great interest a presentation made by Steven Wittens, aka Acko, and I like "making things with Maths" too... Following his explanations and adding a personal touch, I made my own Bézier plotter.
This is in fact a direct graphic interpretation of De Casteljau's algorithm to evaluate Bézier curves.
Given a polyline P0 made of n segments (n+1 points). Every iteration #i of our algorithm, we take, for each oriented segment, the point situated at (i / MAX_ITE)% of the segment length, and we connect these points to build a new polyline P1 of n-1 segments. We recursively repeat this operation on the polyline and its descendants (P2 with n-2 segments, P3 with n-3 segments,etc), until we get a polyline of 0 segment, ie. a single point.
If we follow the path of this point through the consecutive iterations, we get a Bézier curve of degree n (while the moving segments extremities of a polyline PX follow Bézier curves of degree X).
The specificity here is that I use close polylines: the overlapping effect (by adding a segment to close them) allows me to virtually avoid the segments decrease every iteration (it thus could be possible to iterate infinitely, until reaching the limit state.
The Kinetic.js library is used here to handle various canvas layers easily.
#404 CSS animation
A simple experiment using CSS animations and 3D transforms. JS is only used beforehand to randomize the animations durations.
Don't search for any meaning here, I'm not sure either what I wanted to represent...
At first I was trying to implement a function to alter the text content of a DOM tree by inserting new node inside... (It is indeed a bit more complicated than it sounds, since you can't use directly innerHTML or innerText without breaking the tree by also affecting the HTML nodes it may already contain. You have to iterate through the whole tree to find every text-node leaf.) ... and the tests I was using slowly drift toward that... (Why am I sharing this, btw?)


Span Class
Definition
Line
10
of
System.Lex/Span.cm
Constructors & Destructor
public
Span
()
public
Span
(
int
fileIndex_,
int
line_,
int
start_)
public
Span
(
int
fileIndex_,
int
line_,
int
start_,
int
end_)
Member Functions
public
bool
Valid
()
const
Member Variables
public
int
end
public
int
fileIndex
public
int
line
public
int
start
Constructor& Destructor Details
Span Constructor
public
Span()
Definition
Line
12
of
System.Lex/Span.cm
Span Constructor
public
Span(
int
fileIndex_,
int
line_,
int
start_)
Definition
Line
16
of
System.Lex/Span.cm
Span Constructor
public
Span(
int
fileIndex_,
int
line_,
int
start_,
int
end_)
Definition
Line
20
of
System.Lex/Span.cm
Member Function Details
Valid Member Function
public
bool
Valid()
Definition
Line
24
of
System.Lex/Span.cm


Maybe-crazy
things to do with inline SVG Drupal 8
Audrey Brockhaus
|
FE Developer at meltmedia |
|
CSS, SVG, and doing questionable things in Twig templates |
Differences between SVG and other web image formats
| jpeg, png, gif |
SVG |
|
Raster (resolution dependent)
|
Vector (resolution independent)
|
|
Binary
|
Test-based, XML markup, human readable-ish and human writable-ish
|
|
Elements within the image not selectable in browser
|
Selectable in browser (drawn by browser, can be changed in browser!)
|
SVG can do some wild stuff.
SVG interactive web by Blaz Kemperle
See the Pen
Svg Interactive Web by Blaz Kemperle (@blazicke)
on CodePen.
Using SVG: Easy Mode

Using SVG: Fun Mode

<svg viewBox="0 0 200 200" width="400" height="400"
xmlns="http://www.w3.org/2000/svg">
<circle cx="102" cy="100" fill="#ff0" r="78"
stroke="#000" stroke-width="3"/>
...etc.
Twig Includes
{% include (‘path/to/file/picture.svg’) %}
↑ points to docroot
{% include<EMAIL_ADDRESS>%}
↑ points to theme’s templates folder
{% include<EMAIL_ADDRESS>%}
↑ points to theme’s images folder
Anatomy of an SVG
See the Pen
Simple SVG Smiley Face by Audrey Brockhaus (@audreybrockhaus)
on CodePen.
Animate your inline SVG with CSS
“Propertunities” & “Attribilities”
I’m so sorry
Common SVG Presentation Attributes for Shapes
| Properties |
Values |
Examples |
|
fill
Default: black
|
Color: defined as hex code, rgb, or even as a color keyword like `green`
Pattern or Gradient: Defined in the “defs” region of your SVG
|
fill=”none”
fill=”#eeeeee”
fill=”rgb(0,0,255)”
fill=”peachPuff”
fill=”url(#rainbow)”
|
|
opacity
Default: 1 |
Decimal value between 0 and 1.
Can also separately set “fill-opacity” and “stroke-opacity”
|
opacity="0.6"
|
|
stroke
Default: none
|
Color, Pattern, or Gradient, same as Fill values above
|
stroke=”green”
stroke=”url(#rainbow)”
|
|
stroke-width
Default: 1
|
A number, in viewport units or a % of viewport
|
stroke-width=”5”
stroke-width=”20%”
|
Super-average icons
....not so easy to implement
(icons changed to protect the guilty)
Super-average icons: Potential structure
| Taxonomy term: |
Product category (Example: Camping) |
| |
|
Example values |
| Taxonomy fields: |
Product category color
(using Color Field module)
Trash icon
Download icon
Picture icon
Share icon
Idea icon
|
#008000
trash-green.png
download-green.png
picture-green.png
share-green.png
idea-green.png
|
Using variables in SVG
<path fill="{{ node.field_product_line_color|field_value }}"
d="M256,512C114.842,512,0,397.158,0,256c0-62.431,22.727-
122.565,63.994-169.326c5.504-6.237,15....12z"/>
Example code using Color Field Module and Field Value module
Super-average Icons: Structure with inline SVG
| Taxonomy term: |
Product category (Example: Camping) |
| |
|
Example values |
| Taxonomy fields: |
Product category color
(using Color Field module)
Trash icon
Download icon
Picture icon
Share icon
Idea icon
|
#008000
trash-green.png
download-green.png
picture-green.png
share-green.png
idea-green.png
|
Custom Avatars
SVG Filters
SVG Filters
<filter id="lightenAndSaturate">
<feColorMatrix type="matrix" result="lightened"
values=" 2 0 0 0 0
0 2 0 0 0
0 0 2 0 0
0 0 0 2 0 "/>
<feColorMatrix type="saturate" result="saturated" values="1.3" />
</filter>
filter: url(#lightenAndSaturate);
SVG Text and Raster Images
Text in SVG
<text x="50%" y="50%" font-size="300px" text-anchor="middle">
Here’s some vertically-centered text!</text>
SVG Text Mask w/ Video Fill by Dudley Storey
See the Pen
SVG Text Mask w/ Video Fill by Dudley Storey (@dudleystorey)
on CodePen.
Raster Images in SVG
<image xlink:href="logo.png" height="200" width="200"
x="0" y="0" />
Bringing it all together
more is more and less is a bore
Resources & References from this talk:
Handy Modules:
Thank you
Design love from:
Adrienne Hodges & Abby Blue
Support & encouragement from:
meltmedia
Icons from:
icons8.com
Join us tomorrow!
Contribution Opportunities
Friday, April 13, 2018
Mentored
Contribution
|
First Time
Contributor Workshop
|
General Contribution
|
9:00-18:00
Room: 602
|
9:00-12:00
Room: 606
|
9:00-18:00
Room: 6A
|
What did you think?
Locate this session at the DrupalCon Seattle website:
http://seattle2019.drupal.org/schedule
Take the Survey
https://www.surveymonkey.com/r/DrupalConSeattle


[gecode-users] algorithm used in sequence constraint
Kish Shen
kisshen at cisco.com
Wed Aug 18 14:31:38 CEST 2010
David Rijsman wrote:
> Hi Kish,
>
> I implemented the algorithm and it is the simple reason you mention. Perhaps we can port the Eclipse version into Gecode?
>
> David
Hi David,
I should say first that I am not very familiar with the implementation
of sequence done by Helmut.
It probably doesn't make too much sense to port the ECLiPSe code -- it
is written entirely in ECLiPSe (i.e. basically Prolog), and the code has
to work round the restriction of no multiple edges between two nodes in
the maximum flow code used.
However, I suspect a lot of the infra-structure needed is already in
gecode -- I assume there is already some implementation of the maximum
flow algorithm, needed for implementing other constraints, such as
global cardinality.
Cheers,
Kish
--
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.
More information about the users
mailing list


Snapshots show basic overviews of the existing conditions with layers for hazard exposures, physical vulnerabilities, and social vulnerabilities that reveal hotspots of concern. Participants will “ground- truth” by providing missing or additional points and polygons, which could reveal hotspots of concern.
Scenarios are created by using Snapshots of existing community conditions to generate new layers. These are layers created by your community while using the tool, to show potential areas for future growth, development, and construction - based on the existing built and natural environments, as well as the areas of concern discovered during the snapshot phase.
{{ (event | async)?.description }}
Map drawing tools are unavailable because you are not a registered participant.
Available groups will be displayed as they become available and will be able to join an assigned group.


I am experienced in full stack web development programming frameworks. Collaborative work flow concepts is something I pride myself on, being able to foster critical thinking to further the overall value of productions.
Currently en route to becoming a full stack developer through tech talent south immersion co-hort in Phoenix, Az
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
Podcasting operational change management inside of workflows to establish a framework. Taking seamless key performance indicators offline to maximise the long tail. Keeping your eye on the ball while performing a deep dive on the start-up mentality to derive convergence on cross-platform integration.
Collaboratively administrate empowered markets via plug-and-play networks. Dynamically procrastinate B2C users after installed base benefits. Dramatically visualize customer directed convergence without revolutionary ROI.
GPA: 3.5
GPA: 3.5
Apart from being a web developer, I enjoy most of my time going to concerts and searching for hard to find vinyl records. In the summer I am an avid festival goer. During the cooler months here in Arizona, I enjoy mountain biking, hiking, and kayaking.


Model Version Control¶
Adding Model Artifacts in Pull Requests¶
Model artifacts have the potential to be very large, and we should avoid committing large files directly to Git.
If your model’s files are small enough (<100KB in a given directory), then you may add them directly to Git in a PR to master.
Otherwise, you should add the large files to
RobotLocomotion/models. Please do
not commit files that are generally small, like *.sdf
or *.urdf
files,
in RobotLocomotion/models
; instead, please commit those directly.
Before you decide to submit models, please ensure that you have tests that will need them. Do not submit a PR that adds models but has zero intent to use them, as Drake is not a model repository.
See below for the suggested workflow.
Develop Changes Locally¶
- Clone
RobotLocomotion/models
locally - Create a Git branch in your local checkouts of both
models
anddrake
. - Update
drake/tools/workspace/models/repository.bzl
to point to yourmodels
checkout usinggithub_archive(..., local_repository_override = <path>)
. - Update
drake/tools/workspace/models/files.bzl
to incorporate the models you want. - Update
drake/tools/workspace/models/package.BUILD.bazel
to export the models. - Ensure that you use
forward_files
to make the files available inside the Drake bazel workspace. For an example, see drake/manipulation/models/ycb/BUILD.bazel. - Ensure your tests pass under
bazel test
.
Submit Changes in a Pull Request¶
- Push your changes to your fork of
RobotLocomotion/models
. Make a PR. - Update
drake/tools/workspace/models/models/repository.bzl
to use the commit you pushed. - Submit a PR to Drake, and add a self-blocking discussion thread, such as
"Working temporary SHA1 until the models PR <LINK> is merged."
, where<LINK>
references yourmodels
PR. - Get review on your Drake PR first. Once it is generally approved, then
request review for your
models
PR. - Once both PRs are approved:
- Merge your
models
PR. - Update
drake/tools/workspace/models/repository.bzl
to the latest merge commit onmaster
forRobotLocomotion/models
. - Merge your
drake
PR.
- Merge your


Track Order
Track
Login to Stores
Remember me on this computer
Forgot your password?
Click here to reset it
.


(defun serialize-previous-version-pointer (previous-pointer stream)
;; The previous version pointer is a fixed-width field, so we
;; serialize it 'by hand'.
(if previous-pointer
(progn
;; 1 marker octet plus 6 octets for the 'pointer'.
(serialize-marker +positive-byte-48+ stream)
(serialize-byte-48 previous-pointer stream))
(progn
(serialize-marker +nil+ stream)
;; Fill up with dummy octets to ensure fixed width.
(loop repeat 6
do (serialize-marker +ignore+ stream)))))
Source Context


Diriyah Formula E: Bird fastest in practice as season gets underway
by Alex KalinauckasEnvision Virgin Racing's Sam Bird set the fast time across the practice sessions for the 2019-20 Formula E season-opening Diriyah E-Prix, as drivers struggled with the new low-grip surface.
As Autosport reported on Thursday, the sand sitting on top of the new asphalt at the Riyadh track created very low-grip conditions - which were exaggerated by the low temperatures at the start of the day on Friday.
In FP1, which was topped by Bird's Virgin team-mate Robin Frijns on a 1m16.137s, NIO 333 driver Ma Qing Hua crashed on his out-lap - bringing out the session's first red flag.
Brendon Hartley (Dragon) later caused the session's second practice red flag when he lost the rear of his car at the looping left of Turn 4 after running over a crumbling asphalt patch and clouting the wall with the left-rear of his car and breaking its suspension.
Ahead of FP2, the wall on the inside of Turn 4 was moved further onto the track to cover up a manhole cover - which had been added to improve drainage at the track following the wet weather that affected the inaugural event last year - where the asphalt was breaking apart.
That change meant the 30-minute second session started with the first two laps - around four minutes in duration - run under full-course yellow conditions.
When the drivers were allowed to return to normal speeds, they were severely struggling for grip all the way around the lap - with the sandy surface off-line particularly perilous.
New DS Techeetah recruit Antonio Felix da Costa, Bird, Oliver Rowland (Nissan e.dams) and Mercedes driver Stoffel Vandoorne all enjoyed time at the head of the standings during the early running, during which laps were slower than Frijns's best from FP1.
But just after halfway through FP2, Bird set a time of 1m16.033s to usurp his team-mate's lap from the day's initial 45-minute running, before Frijns hit back with the first sub 1m16s effort - a 1m15.824s.
That remained the benchmark until the closing moments of FP2, where a flurry of fast times were set.
Rowland and his Nissan team-mate Sebastien Buemi both took hold of top spot before Venturi Racing's Edoardo Mortara moved ahead and looked to have that position locked down when the chequered flag fell.
But Bird was among the drivers still on a flying lap and he shot back to the top spot with a 1m14.353s - the only sub 1m15s lap of the session.
That put Bird 0.949 seconds clear of the pack, before da Costa arrived to trim his advantage to 0.794s with a 1m15.147s.
Mortara held onto third ahead of Buemi and Rowland, with Daniel Abt (Audi) and Mahindra Racing's Jerome D'Ambrosio taking sixth and seventh ahead of Frijns.
Porsche driver Andre Lotterer and Pascal Wehrlein (Mahindra) rounded out the top 10.
Reigning champion Jean-Eric Vergne finished 11th in FP2, but had a bizarre end to the session when he clipped the back of Alexander Sims's BMW-Andretti-run car at Turn 18 - the race's first corner - on his final flying lap.
Sims ended the session in 14th ahead of Jaguar's Mitch Evans, who also lost out due to an incident at Turn 18.
Evans looked set to jump up the order when he encountered Nyck de Vries and Buemi battling for track position at the left-hander and had to back out of his lap.
Mercedes pair Vandoorne and de Vries sandwiched the second Porsche-run car of Neel Jani, with that trio 19th, 20th and 21st.
James Calado ended up 22nd for Jaguar but he also looked set to improve before being hampered by an issue in traffic.
As Calado approach the right-hand kink of Turn 20 he encountered Abt running slowly on the racing line and had to take the corner wider than usual, going onto the slippery off-line route and striking the wall on the exit, picking up a puncture.
Calado returned to the track at the end of session, with Ma making a brief FP2 appearance late-on to take P23.
Hartley did get out early in FP2 after repairs were made to his car, but he came in again without setting a representative time after reporting braking issues.
FP1 times
| Pos | Driver | Team | Car | Time | Gap | Laps |
|---|---|---|---|---|---|---|
| 1 | Robin Frijns | Virgin | Audi | 1m16.137s | - | 21 |
| 2 | Nico Muller | Dragon | Penske | 1m17.401s | 1.264s | 20 |
| 3 | Sam Bird | Virgin | Audi | 1m17.561s | 1.424s | 21 |
| 4 | Stoffel Vandoorne | Mercedes | Mercedes | 1m17.693s | 1.556s | 19 |
| 5 | Sebastien Buemi | e.dams | Nissan | 1m17.847s | 1.710s | 20 |
| 6 | Antonio Felix da Costa | DS Techeetah | DS | 1m17.996s | 1.859s | 22 |
| 7 | Mitch Evans | Jaguar | Jaguar | 1m18.347s | 2.210s | 22 |
| 8 | Daniel Abt | Audi | Audi | 1m18.406s | 2.269s | 19 |
| 9 | Nyck de Vries | Mercedes | Mercedes | 1m18.426s | 2.289s | 20 |
| 10 | Lucas di Grassi | Audi | Audi | 1m18.441s | 2.304s | 18 |
| 11 | Jerome d'Ambrosio | Mahindra | Mahindra | 1m18.581s | 2.444s | 22 |
| 12 | Felipe Massa | Venturi | Mercedes | 1m18.618s | 2.481s | 21 |
| 13 | Edoardo Mortara | Venturi | Mercedes | 1m18.749s | 2.612s | 18 |
| 14 | Alexander Sims | BMW | BMW | 1m18.839s | 2.702s | 21 |
| 15 | Andre Lotterer | Porsche | Porsche | 1m18.873s | 2.736s | 18 |
| 16 | Oliver Turvey | NIO | NIO | 1m19.185s | 3.048s | 20 |
| 17 | Jean-Eric Vergne | DS Techeetah | DS | 1m19.310s | 3.173s | 18 |
| 18 | Neel Jani | Porsche | Porsche | 1m19.327s | 3.190s | 20 |
| 19 | Oliver Rowland | e.dams | Nissan | 1m20.045s | 3.908s | 16 |
| 20 | Max Guenther | BMW | BMW | 1m20.303s | 4.166s | 20 |
| 21 | James Calado | Jaguar | Jaguar | 1m20.701s | 4.564s | 21 |
| 22 | Brendon Hartley | Dragon | Penske | 1m21.536s | 5.399s | 15 |
| 23 | Ma Qing Hua | NIO | NIO | - | - | 1 |
| 24 | Pascal Wehrlein | Mahindra | Mahindra | - | - | 8 |
FP2 times
| Pos | Driver | Team | Car | Time | Gap | Laps |
|---|---|---|---|---|---|---|
| 1 | Sam Bird | Virgin | Audi | 1m14.353s | - | 14 |
| 2 | Antonio Felix da Costa | DS Techeetah | DS | 1m15.147s | 0.794s | 17 |
| 3 | Edoardo Mortara | Venturi | Mercedes | 1m15.302s | 0.949s | 16 |
| 4 | Sebastien Buemi | e.dams | Nissan | 1m15.329s | 0.976s | 18 |
| 5 | Oliver Rowland | e.dams | Nissan | 1m15.430s | 1.077s | 19 |
| 6 | Daniel Abt | Audi | Audi | 1m15.446s | 1.093s | 15 |
| 7 | Jerome d'Ambrosio | Mahindra | Mahindra | 1m15.578s | 1.225s | 16 |
| 8 | Robin Frijns | Virgin | Audi | 1m15.824s | 1.471s | 14 |
| 9 | Andre Lotterer | Porsche | Porsche | 1m15.961s | 1.608s | 17 |
| 10 | Pascal Wehrlein | Mahindra | Mahindra | 1m15.962s | 1.609s | 19 |
| 11 | Jean-Eric Vergne | DS Techeetah | DS | 1m16.019s | 1.666s | 15 |
| 12 | Felipe Massa | Venturi | Mercedes | 1m16.166s | 1.813s | 17 |
| 13 | Lucas di Grassi | Audi | Audi | 1m16.582s | 2.229s | 17 |
| 14 | Alexander Sims | BMW | BMW | 1m16.609s | 2.256s | 13 |
| 15 | Mitch Evans | Jaguar | Jaguar | 1m16.765s | 2.412s | 15 |
| 16 | Max Guenther | BMW | BMW | 1m16.871s | 2.518s | 17 |
| 17 | Nico Muller | Dragon | Penske | 1m16.919s | 2.566s | 11 |
| 18 | Oliver Turvey | NIO | NIO | 1m17.119s | 2.766s | 14 |
| 19 | Stoffel Vandoorne | Mercedes | Mercedes | 1m17.340s | 2.987s | 16 |
| 20 | Neel Jani | Porsche | Porsche | 1m17.474s | 3.121s | 19 |
| 21 | Nyck de Vries | Mercedes | Mercedes | 1m17.998s | 3.645s | 17 |
| 22 | James Calado | Jaguar | Jaguar | 1m19.843s | 5.490s | 15 |
| 23 | Ma Qing Hua | NIO | NIO | 1m24.830s | 10.477s | 5 |
| 24 | Brendon Hartley | Dragon | Penske | - | - | 2 |


Here are some of our awesome activities!
Snorkeling
Destruction Derby
Snowboarding
Rock Climbing
Back to homepage


Farage: Johnson must change Brexit deal to win my backing
Brexit Party leader Nigel Farage has said changes must be made to the government's political declaration for his party to back Boris Johnson's deal.
Mr Farage said his party will stand at least 600 candidates in the General Election unless the prime minister removes the allowance for the Brexit transition period to last until 2022.
"Boris Johnson is offering something that is not Brexit and does not get Brexit done," he told BBC Radio 4's Today programme.
Mr Farage had previously said the prime minister had to scrap the Withdrawal Agreement for the Brexit Party to stand down candidates.
Last week at the Brexit Party's election campaign launch, Mr Farage said his party would contest every seat unless Mr Johnson agreed to a "Leave alliance".
But he told the BBC he wanted to see changes to the political declaration agreed with the EU.
"Boris Johnson needs to make it clear that he will fundamentally change the political declaration in two ways," he said.
"Firstly that he will get rid of an extension that will allow it to go on until at least 2022. We need to have the clause in the political declaration removed so we have a hard deadline.
"The second point is that we simply cannot, absolutely cannot, bind ourselves to a trade deal that gives us regulatory alignment that would prevent us from doing trade deals with the rest of the world and would mean we are not making our own laws."
Mr Farage added that his party also needed to see any promises on regulatory alignment removed so Britain was not "prevented from doing trade deals and making our own laws".
Pushed on Brexit Party candidates pulling out to back Conservatives, Mr Farage said it is usual for candidates to withdraw at the last minute due to the "huge amount of pressure".
Mr Farage added: "I've never fought an election at which at the last minute candidates didn't pull out because they realise firstly the full responsibility of doing it and secondly they are coming under a huge amount of pressure."


TreeSelect is a form component to choose from hierarchical data.
TreeSelect component requires an array of TreeNode objects as its options and keys of the nodes as its value.
In example below, nodes are retrieved from a remote data source.
| Name | Type | Default | Description |
|---|---|---|---|
| label | string | null | Label of the node. |
| data | any | null | Data represented by the node. |
| icon | string | null | Icon of the node to display next to content. |
| expandedIcon | string | null | Icon to use in expanded state. |
| collapsedIcon | string | null | Icon to use in collapsed state. |
| children | TreeNode[] | null | An array of treenodes as children. |
| leaf | boolean | null | Specifies if the node has children. Used in lazy loading. |
| style | string | null | Inline style of the node. |
| styleClass | string | null | Style class of the node. |
| expanded | boolean | null | Whether the node is in an expanded or collapsed state. |
| type | string | null | Type of the node to match ng-template type. |
| parent | TreeNode | null | Parent of the node. |
| draggable | boolean | null | Whether to disable dragging for a particular node even if draggableNodes is enabled. |
| droppable | boolean | null | Whether to disable dropping for a particular node even if droppableNodes is enabled. |
| selectable | boolean | null | Used to disable selection of a particular node. |
| key | string | null | Unique key of the node.(more) |
TreeSelects offers "single", "multiple" and "checkbox" alternatives for the selection behavior that is defined by the selectionMode option.
In multiple mode or checkbox mode, selection property should be an array. In multiple mode, items can either be selected using metaKey or toggled individually depending on the value of metaKeySelection property value which is true by default. On touch enabled devices metaKeySelection is turned off automatically. In checkbox mode, when inititing a tree with preselections, also set partialSelected property on node so that minus icon can be displayed when necessary.
A comma separated list is used by default to display selected items whereas alternative chip mode is provided using the display property to visualize the items as tokens.
Label of an option is used as the display text of an item by default, for custom content support define a value template that gets the selected nodes as a parameter. In addition header, footer and empty slots are provided for further customization.
| Name | Type | Default | Description |
|---|---|---|---|
| selection | any | null | Value of the component. |
| options | array | null | An array of treenodes. |
| scrollHeight | string | 400px | Height of the viewport, a scrollbar is defined if height of list exceeds this value. |
| placeholder | string | null | Label to display when there are no selections. |
| disabled | boolean | false | When present, it specifies that the component should be disabled. |
| tabindex | string | null | Index of the element in tabbing order. |
| inputId | string | null | Identifier of the underlying input element. |
| ariaLabelledBy | string | null | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| selectionMode | string | null | Defines the selection mode, valid values "single", "multiple", and "checkbox". |
| panelClass | string | null | Style class of the overlay panel. |
| appendTo | string | body | A valid query selector or an HTMLElement to specify where the overlay gets attached. Special keywords are "body" for document body and "self" for the element itself. |
| emptyMessage | string | No results found | Text to display when there are no options available. Defaults to value from PrimeVue locale configuration. |
| display | string | comma | Defines how the selected items are displayed, valid values are "comma" and "chip". |
| propagateSelectionUp | boolean | true | Whether checkbox selections propagate to ancestor nodes. |
| propagateSelectionDown | boolean | true | Whether checkbox selections propagate to descendant nodes. |
| metaKeySelection | boolean | true | Defines how multiple items can be selected, when true metaKey needs to be pressed to select or unselect an item and when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically. |
| Name | Parameters | Description |
|---|---|---|
| onShow | - | Callback to invoke when the overlay is shown. |
| onHide | - | Callback to invoke when the overlay is hidden. |
| onNodeSelect | node: Node instance | Callback to invoke when a node is selected. |
| onNodeUnselect | node: Node instance | Callback to invoke when a node is unselected. |
| onNodeExpand | node: Node instance | Callback to invoke when a node is expanded. |
| onNodeCollapse | node: Node instance | Callback to invoke when a node is collapsed. |
| Name | Parameters |
|---|---|
| value | $implicit: Value of the component |
| header | $implicit: Value of the component options: TreeNode options |
| footer | $implicit: Value of the component options: TreeNode options |
| empty | - |
Following is the list of structural style classes, for theming classes visit theming page.
| Name | Element |
|---|---|
| p-treeselect | Container element. |
| p-treeselect-label-container | Container of the label to display selected items. |
| p-treeselect-label | Label to display selected items. |
| p-treeselect-trigger | Dropdown button. |
| p-treeselect-panel | Overlay panel for items. |
| p-treeselect-items-wrapper | List container of items. |
None.


{% include "includes/header.html" %}
{% include "includes/navbar.html" %} {% load static %}The coronavirus is thought to spread mainly from person to person. This can happen between people who are in close contact with one another.
A person can get COVID-19 by touching a surface or object that has the virus on it and then touching their own mouth, nose, or possibly their eyes.
The coronavirus is thought to spread mainly from person to person. This can happen between people who are in close contact with one another.
Although N-95 masks are the recommened mask to wear during the coronavirus pandemic, any mask available at your nearest medical store is better than not wearing a mask at all!
Stay at home and only go outside if it is very necessary. Avoid meeting other people and maintain 6ft. distance in cases you have to be near others.
Wash your hands for 20 seconds with a handwash or soap and in cases when water and soap are not readily available, use a sanitizer with at least 62% alcohol content.
Hands touch many surfaces and can pick up viruses.
Chances of getting infected by an already ifected person is ten-fold in crowded regions. If your region is under a lockdown, then do not form a crowd or leave your home!
Snzeeing/Coughing in a handkerchief/tissue is the best practice. In cases when neither is avaiable, sneeze into your elbow to prevent droplet infection to the people around you.
This means coughing a lot for more than an hour, or 3 or more coughing episodes in 24 hours (if you usually have a cough, it may be worse than usual).
Around 1 out of every 6 people who gets COVID-19 becomes seriously ill and develops difficulty breathing or shortness of breath.
This means you feel hot to touch on your chest or back (you do not need to measure your temperature). It is a common sign and also may appear in 2-10 days if you affected.


Mybaits 大于小于号需要转译 SELECT EDU_TEACHER.ID as teacherId,EDU_TEACHER.NAME as teacherName FROM LINE_COURSE_TEACHER LEFT JOIN EDU_TEACHER ON EDU_TEACHER.ID = LINE_COURSE_TEACHER.TEACHER_ID WHERE LINE_COURSE_TEACHER.COURSE_ID=#{value} and user_expand.realname like concat('%',#{e.realname},'%') insert into edu_course_kpoint_atlas ( ) values (#{item.id},#{item.kpointId},#{item.url}) update edu_course_kpoint set status = 1 WHERE id in #{item}


We provide a very large variety of rice in and around Tamil Nadu which are handpicked and of best quality. This comes with secure packaging, ready to be shipped to your doorstep.
View ProjectOur coconuts are picked up from local farms, which are graded and cleaned before packaging. We also offer tender coconuts and coconut copra.
View ProjectWe are also a major exports in a variety of spices. The quality of our spices are appreciated by a wide range of our customers both in India and oversees, thanks to our efficient processing, packaging and shipping.
View ProjectWe collect our vegetables from the farm lands near us and we assure you that all of them are handpicked and packed for our buyers.
View ProjectWe export highly quality ghee made from pure butter and fresh milk of cattle like cow and buffalo. It has a golden yellow colour with a rich aroma.
View ProjectWe are considered as a prime areca palm leaf plates exporters in overseas market. We export areca palm leaf plates from superior quality areca bark.
View ProjectWell we are not done we our range of products yet. Presenting our other pillar that's been a part of our company since inception, our very own range of Home Textiles.
View Project


I can help you with..
I’m a front end developer with 3 years of experience in both Web and mobile development on angular. I’ve been in charge of releasing company websites, designing and developing enterprise and consumer applications, give technical and professional advice on process and system architecture design, with experience in UX/UI, neuromarketing and customer service.
On my free time I like to read, cook, ride on my bicycle, meditating and learning about philosophy.
“Programming isn’t about what you know; it’s about what you can figure out.”
Chris Pine


Enter your zip code in the search bar below to find pumping companies in your area.
We enable septic service businesses to run more efficiently and engage in a new kind of conversation with the 25 million homeowners in the US with septic systems.
Owning a home with a septic system is irritating, difficult, and a nuisance for homeowners. PumperPal is a platform that allows homeowners to easily take care of their septic systems and improve the life of their systems. For pumpers, running a pumping company is a tough job. From customer phone calls in the middle of the night to digging several feet for septic tank covers, PumperPal deploys an array of tactics to help pumpers avoid spending too many hours at work, by creating well-defined solutions that empower pumpers to be part of shaping the way service is delivered.
Get a free and convenient way to stay in touch with your pumping company, request appointments, access service records and even set pumping reminders to prevent an emergency.
Price: $350
Gone are the days of waiting hours to get quotes. PumperPal scans the real-time availability and pricing directly from operators to give you the best pumping options in seconds, including inspection, excavation, and repair rates.
PumperPal built in the first high-value payments network specifically designed for pumping businesses. Select your preferred payment method, such as directly from your bank, your favorite credit card, or even Apple Pay.
Our modern and intuitive pumper management and ESR solutions help you streamline your day, so you spend less time fighting technology and more time pumping. Automate many of the tedious tasks that can slow your business down, and let our advanced analytics provide real time feedback on performance so you can easily manage your business.
For pumpers, customer service is priority one. Along the way, paperwork too often detracts from time with homeowners. PumperPal can help. Our easy-to-use, integrated pumper management, electronic septic records and revenue cycle solutions will help your business to prosper, so you can focus on what matters most – caring for your homeowner's septic systems..
Need help with billing and collections? PumperPal Concierge, our revenue cycle management solution, does the heavy lifting so you get peace of mind in this era of complexity. The expertise of our team of billing and collections specialists get you paid more, faster, and with less work on your end.
San Francisco - CA
<EMAIL_ADDRESS>Tel:<PHONE_NUMBER>


string strftime ( string $format [, int $timestamp = time() ] )
Format the time and/or date according to locale settings. Month and weekday names and other language-dependent strings respect the current locale set with setlocale(). Not all conversion specifiers may be supported by your C library, in which case they will not be supported by PHP's strftime(). Additionally, not all platforms support negative timestamps, so your date range may be limited to no earlier than the Unix epoch. This means that %e, %T, %R and, %D (and possibly others) - as well as dates prior to Jan 1, 1970 - will not work on Windows, some Linux distributions, and a few other operating systems. For Windows systems, a complete overview of supported conversion specifiers can be found at » MSDN.
Returns a string formatted according format using the given timestamp or the current local time if no timestamp is given. Month and weekday names and other language-dependent strings respect the current locale set with setlocale().


Connect
0
users on FlappyBit
Logged in as
.
Log out
Balance:
Bits
FAUCET
6.0
x
5.0
x
4.0
x
3.0
x
2.0
x
1.0
x
0.8
x
0.1
x
0.8
x
1.0
x
2.0
x
3.0
x
4.0
x
5.0
x
6.0
x
Deposit
Withdraw
BET
Id
User
Bet
Multiplier
Profits


Student Enrollment Form
Name
Looks good!
Email
Please provide a valid email.
Website
Please provide a valid website link.
Image Link
Please provide a valid image link.
Gender
Male
Female
Please select one of the genders.
Skills
Java
HTML
CSS
Please select at least one of the skills.
Enroll Student
Enrolled Students
Description
Image


Surname
First Name
Middle name
You are male female
Age
Country of Residence Russia USA Canada
City Ryzan Moscow
Photography
Title Web Master Database Administrator Computer-aided Disign Economic Planing Managment accounting Budgeting and planing
Salary
Site
Email
Phone
Password


--- layout: post title: Helping Your Child Choose a “Just Right” Book date: 2010-04-24 09:01:14.000000000 -07:00 type: post parent_id: '0' published: true pd: '' status: publish categories: - Classroom Talk - Guest Posts - Reading Instruction tags: - choosing the right book - reading - reading levels author: login: k email: k@k display_name: mcary first_name: '' last_name: '' ---
Often times parents have difficulty determining if a book is at the right reading level for their child. When in doubt, I recommend using the Five Finger Rule.
The Five Finger Rule
You want the book to have a few challenging words, but not so many that your child becomes frustrated with reading and fails to comprehend what has been read. Eventually, your child should be able to use this tool to help him choose books independently. So the next time you are in the library or the book store and your child picks up a book to read, ask him to use the Five Finger Rule to determine if it’s at the right reading level for your child.
Dawn Little (@linkstoliteracy on Twitter) blogs at www.teachingwithpicturebooks.wordpress.com where she provides educators with picture book lessons based on comprehension strategies and the Six Traits of Writing. In addition, she blogs at www.literacytoolbox.wordpress.com where she provides educators and parents with tips and tools to enhance the literacy lives of children. She is the founder and owner of Links to Literacy, a company dedicated to providing interactive literacy experiences for children and families. Find out more at www.linkstoliteracy.com


Fashionably late entrance, thanks for sticking around! So, a mouse cursor and a chicken drumstick walk into a bar...wait wait wait, that's not right. Wrong show.
Did you know your mouse has a lot more to offer than being "just" a cursor? Think about FPS games, and you'll know what we mean. Until recently, we could not really properly take advantage of the mouse in that way, but with the new Pointer Lock API we can.
Start the show!
These examples will only work in Chrome and Firefox.
How does it work?
To activate PointerLock on an element. you call element.requestPointerLock()
. The pointerlockchange
event will be
triggered on the document
element, if the pointer gets locked. If it fails the pointerlockerror
will be triggered.
Once we've got the pointer locked, the cursor will disappear. As we want to do stuff with the actual mouse movement, we attach a mousemove
eventlisterener to the document
element. The screenX
, screenY
, clientX
, and clientY
components of the mousemove event will all be constants
now, as there is no more pointer to move around a defined grid. Instead we get the movementX
and movementY
values which are deltas of the X
and Y movement of your mouse. Note: these values are not constrained by anything, this means that the mouse movement isn't constrained
by the browser window. Depending on mouse acceleration curve of the system, the deltas are bigger when you move your mouse faster
Useful?
If you're building games or other 3D-stuff that requires different mouse handling, this is a must have. The examples above are just some of the things you can do with this. But in general, if you'd wanted to build a game like Quake, you couldn't have done it without the Pointer Lock API.
Great, but can I use it today?
The Pointer Lock API is currently only supported in Chrome and Firefox. In Firefox it only works in fullscreen mode. It also somehow crashes Firefox Aurora when requesting fullscreen mode. So we're quite some time away from actually using it (safely).
What's behind the curtain?
Feel free to snoop around the different source files we used for this example.


| Category: algorithms | Component type: function |
template <class InputIterator, class OutputIterator, class UnaryFunction> OutputIterator transform(InputIterator first, InputIterator last, OutputIterator result, UnaryFunction op); template <class InputIterator1, class InputIterator2, class OutputIterator, class BinaryFunction> OutputIterator transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryFunction binary_op);
The first version of transform performs the operation op(*i) for each iterator i in the range [first, last), and assigns the result of that operation to *o, where o is the corresponding output iterator. That is, for each n such that 0 <= n < last - first, it performs the assignment *(result + n) = op(*(first + n)). The return value is result + (last - first).
The second version of transform is very similar, except that it uses a Binary Function instead of a Unary Function: it performs the operation op(*i1, *i2) for each iterator i1 in the range [first1, last1) and assigns the result to *o, where i2 is the corresponding iterator in the second input range and where o is the corresponding output iterator. That is, for each n such that 0 <= n < last1 - first1, it performs the assignment *(result + n) = op(*(first1 + n), *(first2 + n). The return value is result + (last1 - first1).
Note that transform may be used to modify a sequence "in place": it is permissible for the iterators first and result to be the same. [1]
const int N = 1000; double A[N]; iota(A, A+N, 1); transform(A, A+N, A, negate<double>());
Calculate the sum of two vectors, storing the result in a third vector.
const int N = 1000; vector<int> V1(N); vector<int> V2(N); vector<int> V3(N); iota(V1.begin(), V1.end(), 1); fill(V2.begin(), V2.end(), 75); assert(V2.size() >= V1.size() && V3.size() >= V1.size()); transform(V1.begin(), V1.end(), V2.begin(), V3.begin(), plus<int>());
[1] The Output Iterator result is not permitted to be the same as any of the Input Iterators in the range [first, last), with the exception of first itself. That is: transform(V.begin(), V.end(), V.begin(), fabs) is valid, but transform(V.begin(), V.end(), V.begin() + 1, fabs) is not.


Just want to take some high level notes about my project architecture. No tech details, no code.
PHP code, input is the raw social post extracted from our Chrome extensioin. It will send this data to the NLP server via socket and wait for the result.
Main thread is listening on WORK_PORT and waiting for the input data. It will create a new thread to handle the input request when received the new data.
For the processing part, there are two steps: preprocessing and classification.
I have already talked something about the preprocessing. Basically there are three steps:
The details can be found in the previous blog.
Load the binay file of classifier and some other objects, read the preprocessed input, classify it.
Well, seems very simple, ah? Just like Howard Wolowitz said:
how to fly an airplane: get in the airplane, know where you want to go and fly it.
Come on…
Since I have told my manager that our online service don’t need any third party library, I have to save all the objects depending on NLTK or sklearn as a binary file.
Basically what we need are the following objects:
When I am trying to load the training set in my local machine, it will always run into some problem. But it works fine if I run it on the server. The result may be the .DS_Store
file created by Mac.
LinearSVM, SVM, Naive Bayes (sklearn, nltk), SGDClassifier,
max_df: 0.0 - 1.0
stopwords: none, english
max_feature: none, 5000, 10000, 50000
ngram: 1, 2, 3
sublinear_tf: true, false
tokenizer: stem, lemma, other
classifier parameters:


Agreement reached to suspend female footballers' strike in Spain
MADRID: Top-flight female footballers in Spain have agreed to suspend a playing strike after securing an agreement to reopen negotiations over pay, it was announced on Monday (Nov 18).
All eight Primera Division matches on Saturday and Sunday had to be postponed as players chose to boycott fixtures following more than a year of unsuccessful talks with Spanish unions and clubs.
But the Association of Women's players (AFE) has confirmed negotiations will resume until Dec 20.
"After the success of the strike, an agreement has been reached to work on the proposal," said the AFE.
Players are demanding part-time salaries be worth a minimum of €12,000 (US$13,297), which is 75 per cent of the minimum amount for full-time contracts.
Clubs had proposed part-time salaries of €8,000 but the AFE has suggested the Association of Women's Football Clubs (ACFF) is prepared to give way.
"Due to the strike, the footballers have managed to remove the red lines around the 75 per cent for part-time contracts and €16,000 minimum salary," the AFE added.
Ainhoa Tirapu, goalkeeper for Athletic Bilbao and the Spanish national team, said last month: "We are footballers 24 hours a day, 100 per cent of the time.
"We hope to reach an agreement at some point but we had to take drastic action because the time for women's football is now."


3 references to s_instanceMethodCacheTable
System.Management.Automation (3)
engine\ManagementObjectAdapter.cs (3)
451
lock (
s_instanceMethodCacheTable
)
459
typeTable = (CacheTable)
s_instanceMethodCacheTable
[key];
479
s_instanceMethodCacheTable
[key] = typeTable;


app
/
cz.palda97.lpclient.model.entities.execution
/
ExecutionStatus
/
CANCELLING
CANCELLING
CANCELLING