public final class DataFrameWriter<T>
extends Object
Dataset
to external storage systems (e.g. file systems,
key-value stores, etc). Use Dataset.write
to access this.
| Modifier and Type | Method and Description |
|---|---|
DataFrameWriter<T> |
bucketBy(int numBuckets,
String colName,
scala.collection.Seq<String> colNames)
Buckets the output by the given columns.
|
DataFrameWriter<T> |
bucketBy(int numBuckets,
String colName,
String... colNames)
Buckets the output by the given columns.
|
void |
csv(String path)
Saves the content of the
DataFrame in CSV format at the specified path. |
DataFrameWriter<T> |
format(String source)
Specifies the underlying output data source.
|
void |
insertInto(String tableName)
Inserts the content of the
DataFrame to the specified table. |
void |
jdbc(String url,
String table,
java.util.Properties connectionProperties)
Saves the content of the
DataFrame to an external database table via JDBC. |
void |
json(String path)
Saves the content of the
DataFrame in JSON format at the specified path. |
DataFrameWriter<T> |
mode(SaveMode saveMode)
Specifies the behavior when data or table already exists.
|
DataFrameWriter<T> |
mode(String saveMode)
Specifies the behavior when data or table already exists.
|
DataFrameWriter<T> |
option(String key,
boolean value)
Adds an output option for the underlying data source.
|
DataFrameWriter<T> |
option(String key,
double value)
Adds an output option for the underlying data source.
|
DataFrameWriter<T> |
option(String key,
long value)
Adds an output option for the underlying data source.
|
DataFrameWriter<T> |
option(String key,
String value)
Adds an output option for the underlying data source.
|
DataFrameWriter<T> |
options(scala.collection.Map<String,String> options)
(Scala-specific) Adds output options for the underlying data source.
|
DataFrameWriter<T> |
options(java.util.Map<String,String> options)
Adds output options for the underlying data source.
|
void |
orc(String path)
Saves the content of the
DataFrame in ORC format at the specified path. |
void |
parquet(String path)
Saves the content of the
DataFrame in Parquet format at the specified path. |
DataFrameWriter<T> |
partitionBy(scala.collection.Seq<String> colNames)
Partitions the output by the given columns on the file system.
|
DataFrameWriter<T> |
partitionBy(String... colNames)
Partitions the output by the given columns on the file system.
|
void |
save()
Saves the content of the
DataFrame as the specified table. |
void |
save(String path)
Saves the content of the
DataFrame at the specified path. |
void |
saveAsTable(String tableName)
Saves the content of the
DataFrame as the specified table. |
DataFrameWriter<T> |
sortBy(String colName,
scala.collection.Seq<String> colNames)
Sorts the output in each bucket by the given columns.
|
DataFrameWriter<T> |
sortBy(String colName,
String... colNames)
Sorts the output in each bucket by the given columns.
|
void |
text(String path)
Saves the content of the
DataFrame in a text file at the specified path. |
public DataFrameWriter<T> partitionBy(String... colNames)
- year=2016/month=01/ - year=2016/month=02/
Partitioning is one of the most widely used techniques to optimize physical data layout. It provides a coarse-grained index for skipping unnecessary data reads when queries have predicates on the partitioned columns. In order for partitioning to work well, the number of distinct values in each column should typically be less than tens of thousands.
This was initially applicable for Parquet but in 1.5+ covers JSON, text, ORC and avro as well.
colNames
- (undocumented)public DataFrameWriter<T> bucketBy(int numBuckets, String colName, String... colNames)
This is applicable for Parquet, JSON and ORC.
numBuckets
- (undocumented)colName
- (undocumented)colNames
- (undocumented)public DataFrameWriter<T> sortBy(String colName, String... colNames)
This is applicable for Parquet, JSON and ORC.
colName
- (undocumented)colNames
- (undocumented)public DataFrameWriter<T> mode(SaveMode saveMode)
SaveMode.Overwrite
: overwrite the existing data.
- SaveMode.Append
: append the data.
- SaveMode.Ignore
: ignore the operation (i.e. no-op).
- SaveMode.ErrorIfExists
: default option, throw an exception at runtime.
saveMode
- (undocumented)public DataFrameWriter<T> mode(String saveMode)
overwrite
: overwrite the existing data.
- append
: append the data.
- ignore
: ignore the operation (i.e. no-op).
- error
: default option, throw an exception at runtime.
saveMode
- (undocumented)public DataFrameWriter<T> format(String source)
source
- (undocumented)public DataFrameWriter<T> option(String key, String value)
key
- (undocumented)value
- (undocumented)public DataFrameWriter<T> option(String key, boolean value)
key
- (undocumented)value
- (undocumented)public DataFrameWriter<T> option(String key, long value)
key
- (undocumented)value
- (undocumented)public DataFrameWriter<T> option(String key, double value)
key
- (undocumented)value
- (undocumented)public DataFrameWriter<T> options(scala.collection.Map<String,String> options)
options
- (undocumented)public DataFrameWriter<T> options(java.util.Map<String,String> options)
options
- (undocumented)public DataFrameWriter<T> partitionBy(scala.collection.Seq<String> colNames)
- year=2016/month=01/ - year=2016/month=02/
Partitioning is one of the most widely used techniques to optimize physical data layout. It provides a coarse-grained index for skipping unnecessary data reads when queries have predicates on the partitioned columns. In order for partitioning to work well, the number of distinct values in each column should typically be less than tens of thousands.
This was initially applicable for Parquet but in 1.5+ covers JSON, text, ORC and avro as well.
colNames
- (undocumented)public DataFrameWriter<T> bucketBy(int numBuckets, String colName, scala.collection.Seq<String> colNames)
This is applicable for Parquet, JSON and ORC.
numBuckets
- (undocumented)colName
- (undocumented)colNames
- (undocumented)public DataFrameWriter<T> sortBy(String colName, scala.collection.Seq<String> colNames)
This is applicable for Parquet, JSON and ORC.
colName
- (undocumented)colNames
- (undocumented)public void save(String path)
DataFrame
at the specified path.
path
- (undocumented)public void save()
DataFrame
as the specified table.
public void insertInto(String tableName)
DataFrame
to the specified table. It requires that
the schema of the DataFrame
is the same as the schema of the table.
Note: Unlike saveAsTable
, insertInto
ignores the column names and just uses position-based
resolution. For example:
scala> Seq((1, 2)).toDF("i", "j").write.mode("overwrite").saveAsTable("t1")
scala> Seq((3, 4)).toDF("j", "i").write.insertInto("t1")
scala> Seq((5, 6)).toDF("a", "b").write.insertInto("t1")
scala> sql("select * from t1").show
+---+---+
| i| j|
+---+---+
| 5| 6|
| 3| 4|
| 1| 2|
+---+---+
Because it inserts data to an existing table, format or options will be ignored.
tableName
- (undocumented)public void saveAsTable(String tableName)
DataFrame
as the specified table.
In the case the table already exists, behavior of this function depends on the
save mode, specified by the mode
function (default to throwing an exception).
When mode
is Overwrite
, the schema of the DataFrame
does not need to be
the same as that of the existing table.
When mode
is Append
, if there is an existing table, we will use the format and options of
the existing table. The column order in the schema of the DataFrame
doesn't need to be same
as that of the existing table. Unlike insertInto
, saveAsTable
will use the column names to
find the correct column positions. For example:
scala> Seq((1, 2)).toDF("i", "j").write.mode("overwrite").saveAsTable("t1")
scala> Seq((3, 4)).toDF("j", "i").write.mode("append").saveAsTable("t1")
scala> sql("select * from t1").show
+---+---+
| i| j|
+---+---+
| 1| 2|
| 4| 3|
+---+---+
When the DataFrame is created from a non-partitioned HadoopFsRelation
with a single input
path, and the data source provider can be mapped to an existing Hive builtin SerDe (i.e. ORC
and Parquet), the table is persisted in a Hive compatible format, which means other systems
like Hive will be able to read this table. Otherwise, the table is persisted in a Spark SQL
specific format.
tableName
- (undocumented)public void jdbc(String url, String table, java.util.Properties connectionProperties)
DataFrame
to an external database table via JDBC. In the case the
table already exists in the external database, behavior of this function depends on the
save mode, specified by the mode
function (default to throwing an exception).
Don't create too many partitions in parallel on a large cluster; otherwise Spark might crash your external database systems.
url
- JDBC database url of the form jdbc:subprotocol:subname
table
- Name of the table in the external database.connectionProperties
- JDBC database connection arguments, a list of arbitrary string
tag/value. Normally at least a "user" and "password" property
should be included. "batchsize" can be used to control the
number of rows per insert.public void json(String path)
DataFrame
in JSON format at the specified path.
This is equivalent to:
format("json").save(path)
You can set the following JSON-specific option(s) for writing JSON files:
compression
(default null
): compression codec to use when saving to file. This can be
one of the known case-insensitive shorten names (none
, bzip2
, gzip
, lz4
,
snappy
and deflate
). dateFormat
(default yyyy-MM-dd
): sets the string that indicates a date format.
Custom date formats follow the formats at java.text.SimpleDateFormat
. This applies to
date type.timestampFormat
(default yyyy-MM-dd'T'HH:mm:ss.SSSZZ
): sets the string that
indicates a timestamp format. Custom date formats follow the formats at
java.text.SimpleDateFormat
. This applies to timestamp type.path
- (undocumented)public void parquet(String path)
DataFrame
in Parquet format at the specified path.
This is equivalent to:
format("parquet").save(path)
You can set the following Parquet-specific option(s) for writing Parquet files:
compression
(default is the value specified in spark.sql.parquet.compression.codec
):
compression codec to use when saving to file. This can be one of the known case-insensitive
shorten names(none, snappy
, gzip
, and lzo
). This will override
spark.sql.parquet.compression.codec
.path
- (undocumented)public void orc(String path)
DataFrame
in ORC format at the specified path.
This is equivalent to:
format("orc").save(path)
You can set the following ORC-specific option(s) for writing ORC files:
compression
(default snappy
): compression codec to use when saving to file. This can be
one of the known case-insensitive shorten names(none
, snappy
, zlib
, and lzo
).
This will override orc.compress
.path
- (undocumented)public void text(String path)
DataFrame
in a text file at the specified path.
The DataFrame must have only one column that is of string type.
Each row becomes a new line in the output file. For example:
// Scala:
df.write.text("/path/to/output")
// Java:
df.write().text("/path/to/output")
You can set the following option(s) for writing text files:
compression
(default null
): compression codec to use when saving to file. This can be
one of the known case-insensitive shorten names (none
, bzip2
, gzip
, lz4
,
snappy
and deflate
). path
- (undocumented)public void csv(String path)
DataFrame
in CSV format at the specified path.
This is equivalent to:
format("csv").save(path)
You can set the following CSV-specific option(s) for writing CSV files:
sep
(default ,
): sets the single character as a separator for each
field and value.quote
(default "
): sets the single character used for escaping quoted values where
the separator can be part of the value.escape
(default \
): sets the single character used for escaping quotes inside
an already quoted value.escapeQuotes
(default true
): a flag indicating whether values containing
quotes should always be enclosed in quotes. Default is to escape all values containing
a quote character.quoteAll
(default false
): A flag indicating whether all values should always be
enclosed in quotes. Default is to only escape values containing a quote character.header
(default false
): writes the names of columns as the first line.nullValue
(default empty string): sets the string representation of a null value.compression
(default null
): compression codec to use when saving to file. This can be
one of the known case-insensitive shorten names (none
, bzip2
, gzip
, lz4
,
snappy
and deflate
). dateFormat
(default yyyy-MM-dd
): sets the string that indicates a date format.
Custom date formats follow the formats at java.text.SimpleDateFormat
. This applies to
date type.timestampFormat
(default yyyy-MM-dd'T'HH:mm:ss.SSSZZ
): sets the string that
indicates a timestamp format. Custom date formats follow the formats at
java.text.SimpleDateFormat
. This applies to timestamp type.path
- (undocumented)


When running this sample on two devices with Proximity devices installed, you can use the ProximityDevice to publish messages to the other device and/or subscribe to messages from the other device. Click 'Publish message' on one device, and click 'Subscribe for message' on the other and enter proximity with the two devices. The published message will be received on the device that subscribed.


TITLE FIXME
SUBTITLE FIXME
| Author: | GIT-NAME |
| Updated: | 2022-07-11 09:44:13 |
| Generated: | 2022-07-23 17:04:44 |
Copyright © 2022 Mitch Richling. All rights reserved.
Table of Contents
- 1. Introduction
- 2. Math
- 3. Markup
- 4. Images
- 5. Including external code
- 6. Inline Code
- 7. Code Blocks
- 8. Fancy Code Block Stuff
- 9. dot
- 10. R
- 10.1. Just run some R code in a new session
- 10.2. Access a table in this document as a data.frame
- 10.3. Output from R as a org-mode table
- 10.4. Run some code in a R persistent session (the someData variable is available for later blocks)
- 10.5. Use the someData variable in the session, and draw a graph.
- 10.6. We can use org-mode to make the file too.
- 11. Reproduciblity
- 12. Publishing
- 13. Meta
1. Introduction
I use this files as a template & cut-n-paste source for org-mode documents. As such, it demonstrates most of the stuff I do with org-mode.
2. Math
Here is some math \(5+3^4\).
Reminder: toggle inline preview of an expression with C-c C-x C-l
Here is some display math \[\sum 4\]
3. Markup
3.1. Inline stuff
Some bold text.
Some italics text.
Some underlined text.
Some verbatim
text.
Some code
text.
Some strike-through text.
3.2. Structural stuff
3.2.1. Special Paragraphs
Here we have a quote:
A human being is a part of a whole, called by us universe, a part limited in time and space. He experiences himself, his thoughts and feelings as something separated from the rest… a kind of optical delusion of his consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from this prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty. – Albert Einstein
We can also keep newlines intact in an indented paragraph:
Whales Weep Not!
They say the sea is cold, but the sea contains
the hottest blood of all, and the wildest, the most urgent.
…
– D.H. Lawrence
We can have a "verbatim" section with an "EXAMPLE" block.
Here is some text. Note that everything is just as typed.
3.2.2. Tables
<IP_ADDRESS>. With formatting & a formula
| col 1 | col 2 | col 3 | Col 4 |
|---|---|---|---|
| another | bit | 1 | 1.00 |
| a | b | 2 | 4.00 |
<IP_ADDRESS>. Tables used to hold data
We can use tables to hold data for other blocks to read in the document. The section 10.2 shows how to access the table below from R. Note some specifics for R:
- We have no "top line" on the table – otherwise the row of titles is not recognized!!
- Spaces in column titles are transformed into periods for
data.frame
column names. - Empty data cells will be
NA
in thedata.frame
- Non-numeric columns will be "characters" not "factors"
| factor 1 | factor 2 | value 1 | value 2 |
|---|---|---|---|
| a | z | 1 | 5 |
| a | x | 2 | 6 |
| a | y | 3 | 7 |
| b | x | 4 |
3.2.3. Lists
Here is itemized list:
- first
- second
- third
Here is enumerated list:
- First
- Second
- Third
A bit of both:
- First
- Second
- first
- second
- third
- Third
3.3. Todo/action items
3.3.1. TODO:NEW This is a todo
3.3.2. ACTION:DONE This is an action item – work speak. ;)
3.3.3. ACTION:NEW This is an item with sub-items [1/2]
<IP_ADDRESS>. ACTION:DONE A subitem
<IP_ADDRESS>. ACTION:NEW Another subitem
3.3.4. ACTION:NEW Here is an action item with list compoents [2/3]
[ ]
Step 1[X]
Step 2[X]
Step 3
4. Images
4.1. PDFs in LaTeX and Raster Image in HTML
In this Section you will see one image. A PNG for HTML, and a PDF for LaTeX!
4.2. Links to images and converting PDFs to high quality raster images
Here we have a pretty graph (in a PNG file):
The above file was generated from a high quality PDF file: example.pdf. Note that the link in the previous sentence is a link in both HTML and LaTeX because the link has a 'display text' component.
The conversion was done like so:
convert -density 600 -resize 1024 -background white -flatten example.pdf example.png
5. Including external code
Some Ruby code is the file example.rb. It's contents are listed below:
#!/usr/bin/env -S ruby # -*- Mode:ruby-mode; Coding:us-ascii-unix; fill-column:158 -*- #########################################################################################################################################################.H.S.## ## # @file example.rb # @author Mitch Richling http://www.mitchr.me/ # @brief The classic hello world program the Ruby way.@EOL # @keywords ruby example hello world # @std Ruby 1.8 # @Copyright Copyright 2006 by Mitch Richling. All rights reserved. # @filedetails # # The methods puts, print, printf & putc are all in the IO class as # well so that they can be used to write to different IO streams. As # used here, they write to STDOUT. # #########################################################################################################################################################.H.E.## puts("Hello, World!") print("Hello, World!\n") printf("Hello, World!\n") STDOUT << "Hello, World!\n" STDOUT.write("Hello, World!\n") "Hello, World!\n".each_byte {|b| putc(b) }
We can include just the stuff after the top comment like this:
puts("Hello, World!") print("Hello, World!\n") printf("Hello, World!\n") STDOUT << "Hello, World!\n" STDOUT.write("Hello, World!\n") "Hello, World!\n".each_byte {|b| putc(b) }
6. Inline Code
Here is a number, 6
6
, that comes from a bit of elisp code.
7. Code Blocks
7.1. Text code blocks
Text code blocks can be used as a kind of verbatum environment instead of BEGIN_EXAMPLE. This gives more control over formatting. See the Email example next.
> Some Mail >> Some More >>> Even More >>>> Even more
7.2. Email code blocks
This is nice because we get some highlighting for quoted e-mails and threads.
> Some Mail >> Some More >>> Even More >>>> Even more
7.3. Emacs Lisp
While you can use "value
" insead of "output
" for code blocks, it really is very usefull for Emacs Lisp.
Note that if you leave off the :wrap
header argument, the result will be emacs-lisp
. In this case the result will be an executable and eligible for
tangle. When evaluating an entire document this can be used to advantage to sequentially evaluate code that geneates new code and then evaluatg eth enew code
– you can even create an infinite loop with self printing code. ;)
(+ 1 2 3 5)
11
7.4. Emacs Calc
For more complex mathematical computations done with just Emacs (no outside tools) we can use calc.
deriv(3*x^2+log(x), x)
6 x + 1 / x
7.5. Maxima
For super complex math, we can use maxima.
Here we see a pretty printed result
programmode:false; d:diff(3*x^2+log(x), x); print(d);
1 6 x + - x
Same answer, but 2D printed
programmode:false; display2d:false; d:diff(3*x^2+log(x), x); print(d);
6*x+1/x
We can also output things in LaTeX so that the result is typeset on export!
programmode:false; d:diff(3*x^2+log(x), x); tex(d);
\[6\,x+{{1}\over{x}}\]
Lastly we can use maxima to write code in other langauges for us. How some LaTeX exported as a code block?
programmode:false; d:diff(3*x^2+log(x), x); tex(d);
Or FORTRAN:
programmode:false; d:diff(3*x^2+log(x), x); fortran(d);
6*x+1/x
7.6. Shells
date "+%Y-%m-%d %H:%M:%S"
2022-05-08 13:12:40
7.7. Ruby
puts("HI MOM")
HI MOM
8. Fancy Code Block Stuff
8.1.  Code links & Suppress Output
You can link to a target inside a code block: Visible Link Text
In the following example we also suppress output with the silent
option to :results
. The code still runs when executed, but the output is not placed in
the buffer.
(cl-loop for f in '("foo" "bar") ;; (foo) do (message "This will appear in the Emacs *Messages* buffer: %s!!" f))
You can remove the visable refrences from the source listings with the -r option in the babel header. Otherwise they will appear in the listing – fontlocked white.
8.3. Line Numbers
This will include line numbers in the block when exported
(cl-loop for f in '("a" "b" "c") do (princ (message "mv %s %s.bak\n" f f)))
9. dot
Here we do not export the code, just the results – as an image. This results in a nice rendering.
10. R
10.1. Just run some R code in a new session
print("HI MOM")
[1] "HI MOM"
10.2. Access a table in this document as a data.frame
someData
factor.1 factor.2 value.1 value.2 1 a z 1 5 2 a x 2 6 3 a y 3 7 4 b x 4 NA
10.3. Output from R as a org-mode table
someData
| a | z | 1 | 5 |
| a | x | 2 | 6 |
| a | y | 3 | 7 |
| b | x | 4 | nil |
10.4. Run some code in a R persistent session (the someData variable is available for later blocks)
someData <- data.frame(a=1:10, b=rnorm(10))
print(someData)
10.5. Use the someData variable in the session, and draw a graph.
No speical org-mode stuff for graphics. Just saved the output in files via R. Add link text later.
g <- ggplot(someData, aes(x=a, y=b)) + geom_line() ggsave("rOut1.png", width=8, height=6, dpi=100, units='in', plot=g); ggsave("rOut1.pdf", width=8, height=6, dpi=600, units='in', plot=g);
The graph:
A high quality PDF version is here – note the "here" is a link for both LaTeX and HTML.
10.6. We can use org-mode to make the file too.
Note: :session is required for this to work – otherwise we must "print" the graphic.
ggplot(someData, aes(x=a, y=b)) + geom_line()
11. Reproduciblity
This section is here to help anyone wishing to reproduce the results above, or to understand the mechanics of how the results were obtained..
Reminder: All blocks in the entire tree can be evaluated with C-C C-V C-S
11.1. FILES
Documented in this section are (for each file in this archive):
- SHA1
- Output from an 'ls -l' command
- Output from the 'wc' command – byte, word, and line counts
The use cases are two fold:
- Insure that the input data files being used are the same
- Check if reproduced results match
Replace the `find ./ -type f`
with a list of files and/or wildcards to explicitly select the desired files.
date for c in wc 'openssl sha1' 'ls -l' ; do echo $c; $c `find ./ -type f` done
11.2. ENVIRONMENT
The input files are only part of the reproduciblity equation. It is also important to understand the tools and computational environment used for the original analysis. This section contains various bits of meta-data about the tools and system I used for this analysis.
11.2.1. Embedded Ruby Version
puts(RUBY_VERSION)
11.2.2. Embedded Perl Version
print $]
11.2.3. Embedded R Information
<IP_ADDRESS>. R version
R.version
<IP_ADDRESS>. Session Information
sessionInfo()
<IP_ADDRESS>. Loaded Package Versions
installed.packages()[(loadedNamespaces()),c('Version', 'LibPath')]
11.2.4. Emacs Information
<IP_ADDRESS>. Emacs Version
(emacs-version)
<IP_ADDRESS>. org-mode Version
org-version
<IP_ADDRESS>. ESS Version
(ess-version)
<IP_ADDRESS>. Process Environment
process-environment
<IP_ADDRESS>. System Type
system-type
<IP_ADDRESS>. System Configuration
system-configuration
11.2.5. System Information
for e in date whoami groups id hostname domainname dnsdomainname 'ifconfig -a' 'uname -a' 'openssl version' locale 'ldconfig -p' 'dpkg-query -l'; do c=`echo $e | awk '{print $1}'`; if hash $c 1>/dev/null 2>/dev/null; then ruby -e 'puts("="*90)' echo $e sh -c "$e" fi done
11.2.6.  Publishing
By "publishing" I mean simply copying stuff from the current directory tree to a new location – usually one shared by a web/file server or to a staging area to be later uploaded to a web server.
To control very precicely what gets published, put the files in the file files_to_publish. One way to do that is like so:
EXT2PUB='.org .html .png .gif .jpeg .pdf .ps .sh .rb .R .c .cpp .h .hpp .csv .csv.gz' if test -e files_to_publish; then cp files_to_publish files_to_publish_before; wc -l files_to_publish_before; fi for e in $EXT2PUB; do find ./ -name "*$e" done | sed 's/^\.\///' | egrep -v '^(#|\.)' > files_to_publish sort files_to_publish | uniq > files_to_publish~ mv files_to_publish~ files_to_publish wc -l files_to_publish
PUB_DIR=/tmp/foo HTML_NAME= PUB_MODES=a+rX VERBOSE=-ii if test -z "$HTML_NAME" -o 0 -eq `find ./ -cnewer "$HTML_NAME" -a -type f 2>/dev/null | wc -l `; then RSYNC_OPTS='--delete -a' if test -n "$VERBOSE"; then RSYNC_OPTS="$RSYNC_OPTS $VERBOSE"; fi if test -e '.rsync-filter'; then RSYNC_OPTS="$RSYNC_OPTS -F"; fi if test -e 'files_to_publish'; then RSYNC_OPTS="$RSYNC_OPTS --files-from=files_to_publish"; fi date rsync $RSYNC_OPTS ./ "$PUB_DIR" date else echo "ERROR: $HTML_NAME is not the newest file here. Please regenerate it (C-c C-e h h)!" fi
13. Meta
Publication Site: https://www.mitchr.me/FIXME/
Publication URL: https://www.mitchr.me/FIXME/FIXME.html


toggled.js
GitHub | npm | donate | @craigbuckler | craigbuckler.com
Toggles a class to the HTML body
when an element is clicked.
Please use the code as you wish. Tweet me @craigbuckler if you find it useful and donate toward development if you use it commercially.
- easily add a toggle switch to any HTML element
- state is remembered between page loads
- works in all modern browsers
- no external dependencies - works with any framework
- fast and lightweight: 630 bytes of JavaScript
(click any list item to toggle font weight)
Usage
The page must load the JavaScript. It can be placed anywhere but, typically, it is loaded just before the closing </body>
tag:
<script src="https://cdn.jsdelivr.net/npm/toggled.js/dist/toggled.js"></script>
The CDN URL is shown above but you can also npm i toggled.js
to install via npm and use a bundler.
Add a data-toggled="NAME"
attribute to any HTML element. When that element is clicked, the NAME class is added to or removed from the HTML body.
<button data-toggled="buttonsize">CLICK ME</button>
When the button is clicked for the first time, a buttonsize
class is added to the HTML body. CSS or JavaScript can respond to the change, e.g. change the font size:
.buttonsize button {
font-size: 2em;
}
The class is removed when the button is clicked for a second time and the state is retained between page loads.
Advanced options:
- Any clickable element can be used as a toggle.
- Any number of space-separated classes can be defined, e.g.
data-toggled="NAME1 NAME2 NAME3"
. - Set
data-toggled=""
to apply the element's classes, e.g. when<button class="one two" data-toggled="">button</button>
is clicked, the classesone
andtwo
are toggled on the HTML body.


Thirsty for more about #drinkmorewasteless?
We have collected recipes, awesome advises, quotes and "facts" which will let you drink more water and waste less water - just click the button below. You can also add your own ones
here
.
Give me more!
made by @kerstinsa & @christianheise for
go/h2o


OSWf Concepts
OSWf is fairly different from most other workflow systems available, both commercially and in the open source world. What makes OSWf different is that it is application devloper oriented and hence extermely flexible. However, this can be hard to grasp at first.
For example, OSWf does not have a graphical tool for developing workflows, and the recommended approach is to write the XML workflow descriptors 'by hand' with your favorite text or XML editor.
It is up to the application developer to provide this sort of integration, as well as any integration with existing code and databases. These may seem like problems to someone who is looking for a quick "plug-and-play" workflow solution, but we've found that such a solution never provides enough flexibility to properly fulfill all requirements in a full-blown application.
OSWf gives the developer flexibility
OSWf can be considered a "low level" workflow
implementation. Situations like "loops" and "conditions" that might be represented by a
graphical icon in other workflow systems are "coded" in OSWf. That's not to
say that actual code is needed to implement situations like this, but a scripting
language must be employed to specify these conditions.
It is not expected that a
non-technical user modify workflow. We've found that although some systems provide GUIs
that allow for simple editing of workflows, the applications surrounding the workflow
usually end up damaged when changes like these are made. We believe it is best for
these changes to be made by a developer who is aware of each change.
OSWf is based heavily on the concept of the finite state
machine. Each state in represented by the combination of a step ID and a status. A
transition from one state to another cannot happen without an action occuring.
There are always at least one or more active states during the lifetime of a
workflow. These simple concepts are what lie at the core of the OSWf process engine and
allow a simple XML file to be translated in to business workflow
processes.
At the heart of OSWf is the workflow definition descriptor, also know as the process
descriptor. The descriptor is an XML file.
This descriptor describes all the steps, states, transitions, and functionality for a
given workflow.
Workflow Descriptor
OSWf is very unique compared to other workflow engines one might be familiar
with. In order to completely grasp OSWf and properly harness the features
available, it is important that one understand the core concepts that form the
foundation for OSWf.
Steps, Status & Actions
Any particular process instance can have one or more current steps at any given moment. Every current step has a status associated to it. The statuses of all of the current steps constitute workflow status for that process instance. The actual statuses are entirely up to the application developer and/or project manager. A status is string and can be, for example, "Underway" "Ready" or "Pending".
For the workflow to progress, a transition must take place in the finite state machine that represents a workflow instance. Once a step is completed it can not be current. Usually a new current step is created immediately thereafter, which keeps the workflow going. The final status of the completed step is set by the exit-status attribute. It happens just before the transition to another step. exit-status must already be defined when a new transition takes place in the workflow. It can be any value you please, but "Finished" or "Completed" usually works for most applications.
Transition itself is a result of an action. A step may have many actions connected to it. Which particular action will be launched is determined by the end user, external event or automatically by a trigger. Depending on the action accomplished, a certain transition takes place. Actions can be restricted to particular groups and users or current state of the workflow. Each action must have one unconditional result (default) and zero or more conditional results.
So, to summarize, a workflow consists of a number of Steps. A step has a current status (for example, Queued, Underway, or Finished). A step has a number of Actions that can be performed in it. An action has Conditions under which it is available, as well as Functions that are executed. Actions have results that change the state and current step of the workflow.
Results, Joins & Splits
Default Result
Default Result
For every action, it is required that there exist at least one result, called the
default-result
. A result is nothing more than a series of conditions which determine
the next step to move to. This involves making a transition from one
step to the next step(s) in the state machine that makes up a given workflow.
In OSWf the tag default-result
replaced the tag unconditional-result
from OSWf.
Conditional Results
A conditional-result
is similiar to default-result
except that it requires one or more additional conditions
. The first conditional-result
that evaluates to true (using the types
AND or OR) will dictate which transition to execute. Additional information regarding conditions can be found below.
There are three different results (conditional or default) that can occur:
- A transition to a single step
- A transition to a
split
which creates two or more steps - A
join
that combines together this transition and other transitions to a single step
One caveat regarding transitions, currently a split or a join cannot result in an immediate split or join again. However, this is not a major issue, simply insert a step with a single automatic action default action between the join and the next split.
A single step result can be specified simply by taking all of the default attributes, for example:
<default-result step='2' />
Alternatively, the optional attributes can be specified as in this exampe:
<default-result exit-status='Finished' status='Pending' step='2' owner='${actor}' />
In certain cases the result of an action does not require a transition to another step. Such a result may be specified by setting the step value to -1. For example, we can change the above example to remain in the current step (or steps) as follows:
<default-result status='Repeat' step='-1' />
Splitting from one step to multiple steps can be achieved as shown below.
<default-result split='1'/> . . . <splits> <split id='1'>; <default-result step='200' owner='${someActor}' /> <default-result step='300' owner='${someOtherActor}' /> </split> </splits>
Joins are the most complex but interesting cases. A typical join might look like:
<splits> <split id='1'>; <default-result exit-status='Finished' join='1' /> . . . <default-result exit-status='Finished' join='1' /> </split> </splits> . . . <joins> <join id="1"> <conditions type="AND"> <condition type="beanshell"> <arg name="script"> "Finished".equals(jn.getStep(200).getStatus()) && "Finished".equals(jn.getStep(300).getStatus()) </arg> </condition> </conditions> <default-result step="400" /> </join> </joins>
The above might seem somewhat cryptic, but the main thing to notice is that the condition XML element uses a special variable "jn" that can be used to make up expressions that determine when the join actually occurs. Essentially, this expression statement says "proceed to step 400 only when the steps with IDs 200 and 300 have transitioned into this join have a status of 'Finished'".
Being able to write code in order to determine how a join should proceed is on the greatest strenghts of OSWf. Besides using the jn variable to look at the status of incoming steps one can also use the name/value pairs stored in the PropertSet to create very flexible join logic.
Functions
OSWf defines a standard way for external business logic and services to be defined and executed. This is accomplished by using "functions". A function usually encapsulates functionality that is external to the workflow instance itself, perhaps related to updating an external entity or system with workflow information, or notifying an external system regarding a change in workflow status.
There are two types of functions: pre and post step functions.
Pre functions are functions that are executed before the workflow makes a particular transition. An example is a pre function that sets up the name of the caller to use as the result for the state change that is about to take place. Another example of a pre-function is a function that updates the most recent caller of an action. Both of these are provided as standard utility functions that are very useful for practical workflows.
Post functions have the same range of applicability as pre functions, except that they are executed after the state change has taken place. An example of a post function is one that sends out an email to interested parties that the workflow has had a particular action performed on it. For example, when a document in the 'research' step has a 'markReadyForReview' action taken, the reviewers group is emailed.
There are many reasons for including pre and post functions. One is that if the user were to click the "done" button twice and to send out two "execute action" calls, and that action had a pre function that took a long time to finish, then it is possible the long function could get called multiple times, because the transition hasn't been made yet, and OSWf thinks the second call to perform the action is valid. So changing that function to be a post function is what has to happen. Generally pre functions are for simple, quick executions, and post functions are where the "meat" goes.
Functions can be specified in two separate locations; steps and actions.
Usually, a pre or post function is specified in an action. The general case is that along with transitioning the workflow, a functions is used to 'do something', whether it be notifying a third party, sending an email, or simply setting variables for future use. The following diagram will help illustrate action level functions:
In the case of pre and post functions being specified on steps, the usage is slightly different. Pre-functions specified on a step will be executed before the workflow is transitioned to that step. Note that these functions will be applied indiscriminantly to ALL transitions to the step, even those that originate in the step itself (for example, moving from Queued to Underway within the same step will cause the invocation of any step pre-functions specified).
Similarly, step post-functions will be called prior to the workflow transitioning out of the step, even if it's to change state and remain within the step.
The following diagram illustrates the invocation order. Note that the action box is abbreviated and could well contain pre and post functions of its own.
You can find more information on Functions.
Validators
A validator is nothing more than some code that validates the input that can be paired with an action. If the input is deemed to be valid, according to the validator, the action will be executed. If the input is invalid, the InvalidInputException will be thrown back to the calling client - usually a JSP or servlet.
Validators follow many of the same rules as Functions. You can find out more about Validators.
Registers
A register is a helper function that returns an object that can be used in Functions for easy access to common objects, especially entities that revolve around the workflow. The object being registered can be any kind of object. Typical examples of objects being registered are: Document, Metadata, Issue, and Task. This is strictly for convenience and does not add any extra benefit to OSWf besides making the developer's life much simpler. Here is an example of a register:
<registers> <register name="doc" class="com.acme.DocumentRegister"/> </registers> . . . <results> <result condition="doc.priority == 1" step="1" status="Underway" owner="${someManager}"/> <unconditional-result step="1" status="Queued"/> </results>
Conditions
Conditions, just like validators, registers, and functions, can be implemented in a variety of languages and technologies. Conditions can be grouped together using AND or OR logic. Any other kind of complex login must be implemented by the workflow developer. Conditions usually associated with conditional results, where a result is executed based on the conditions imposed on it being satisfied.
Conditions are very similar to functions except that they return boolean instead of void. You can find out more about Conditions.
Variable Interpolation
In all functions, conditions, validators, and registers it is possible to provide a set of args to the code of choice. These args are translated to the args Map that is discussed in further detail later on. Likewise the status, old-status, and owner elements in the workflow descriptor are also all parsed for variables to be dynamically converted. A variable is identified when it looks like ${foo}. OSWf recognizes this form and first looks in the transientVars for the key foo. If the key does not exist as a transient variable, then then typedMap is searched. If the propertyset does not contain the specified key either, then the entire variable is converted to an empty String.
One thing of particular importance is that in the case of args, if the variable is the only argument, the argument will not be of type String, but instead whatever the variable type is. However, if the arg is a mix of characters and variables, the entire argument is converted to String no matter what. That means the two arguments below are very different in that foo is a Date object and bar is a String:
<arg name="foo">${someDate}</arg> <arg name="bar"> ${someDate} </arg> <!-- note the extra spaces -->
Permissions and Restrictions
Permissions can be assigned to users and/or groups based on the state of the workflow instance. These permissions are unrelated to the functionality of the workflow engine, but they are useful to have for applications that implement OSWf. For example, a document management system might have the permission name "file-write-permission" enabled for a particular group only during the "Document Edit" stage of the workflow. That way your application can use the API to determine if files can be modified or not. This is useful as there could be a number of states within the workflow where the "file-write-permission" is applicable, so instead of checking for specific steps or conditions, the check can simply be made for a particular permission.
Permissions and actions both use the concept of restrictions. A restriction is nothing more than one or more conditions embedded inside a restrict-to element.
Auto Actions
Sometimes it is desirable to have an action performed automatically, based on specific conditions. This is useful for example when trying to add automation to a workflow. In order to achieve this, an attribute of auto="true" will have to be added to the specific action. The workflow engine will then evaluate the conditions and restrictions on the action, and if they are matched and the workflow could perform the action, then it automatically does so. The auto action executes with the current caller, so the permissions checks and so on are performed against the user who called the action that initiated the auto action.
TypedMap - Name/Value Pairs
At any point in the workflow, you will likely want to persist small pieces of data. This is made possible in OSWf by the use of the OpenSymphony TypedMap library. A TypedMap is basically a persistent, type-safe Map. You can add items to the propertyset (one is created per workflow) and later on retrieve them. The propertyset is not emptied or deleted unless you explicitly do so yourself. Every function and condition has access to this propertyset, as well as any inline scripts, where it is added to the script context with the name 'typedMap'. So, to illustrate an inline script accessing the property set, let's add the following to our 'Start First Draft' actions' pre-functions.
<function type="beanshell"> <arg name="script">typedMap.setString("foo", "bar")</arg> </function>
We've now added a persistent property called 'foo', with the value of 'bar'. At any point in the workflow from now on, we will be able to retrieve the value assigned to 'foo' with the following peice of code.
<function type=>"beanshell"> <arg name="script">String value = typedMap.getString("foo")</arg> </function>
Transient variables
As well as the propertyset variable, the other important variable made available to workflow scripts, functions, and conditions is the 'transientVars' map. This map is simply a transient map that contains context specific information for the current workflow invocation. It includes the current workflow instance being manipulated, as well as the current workflow store and the workflow descriptor being used as well as other relevant values. You can see a list of all the available keys in the javadocs for FunctionProvider and Condition.
Inputs
Every invocation of a workflow action takes an optional input map. This map can contain any arbitrary data that you might want to make available to your functions or conditions. It is not persisted anywhere, and is simply a data-passing mechanism.
Validators
In order to allow for the workflow to validate inputs, we have the concept of Validators. A Validator is very similarly implemented as a function or condition (ie, it can be a class or script or EJB). For the purposes of this tutorial, we'll define a validator that checks that the input to 'finish first draft' includes a 'working.title' input that is not greater than 30 characters. Our validator will look something like this:
package com.mycompany.validators; public class TitleValidator implements Validator { public void validate(Map<String,Object> transientVars, Map<String,String> args, TypedMap ps) throws InvalidInputException, WorkflowException { String title = (String)transientVars.get("workingTitle"); if (title == null) throw new InvalidInputException("Missing workingTitle"); if(title.length() > 30) throw new InvalidInputException("workingTitle too long"); } }
Next, we register the validator in our workflow definition, by adding a validators element after our restrict-to element:
<validators> <validator type="class"> <arg name="class.name"> com.mycompany.validators.TitleValidator </arg> </validator> </validators>
So now, when we try to execute action 2, the validator above will be called to validate the input we had specified. So in our test case, if we now add:
Map inputs = new HashMap(); inputs.put("workingTitle", "the quick brown fox jumped over the lazy dog," + " thus making this a very long title"); workflow.doAction(piid, 2, inputs);
We will get an InvalidInputException thrown, and the action will not be executed. Shortening the title will result in a successful execution of the action.
Now that we have covered inputs and validators, let us move on to registers.
Registers
A register is a global variable in a workflow. Similar to a propertyset, it can be accessed anywhere in the workflow, for as long as it is active. The difference however is that a register is not a persistent value, it is a calculated value that is created or looked up anew with every workflow invocation.
How is this useful? Well, in our document management system, it would be useful to have a 'document' register that allows functions, conditions, and scripts to access the document being edited.
Registers are placed in the transientVars map, and so can be accessed from almost anywhere.
Defining a register is very similar to defining a function or condition, with one important difference. Since a register is not invocation-specific (ie, it doesn't care about the current step, or what the inputs are; all it does is expose something), it does not have access to transientVars.
Registers must implement the Register interface, and are specified at the top of the workflow definition, before initial actions.
For our example, we'll specify one of the built-in registers, LogRegister. This register simply adds a 'log' variable that allows you to log messages using Jakarta's commons-logging. The advantage of using it is that it will also add the instance ID to every log message.
<registers> <register type="class" variable-name="log"> <arg name="class.name"> com.opensymphony.workflow.util.LogRegister </arg> <arg name="addInstanceId">true></arg> <arg name="Category">workflow></arg> </register> </registers>
Now we have a 'log' variable available, we can use it in an inline script by adding another pre-function:
<function type="beanshell"> <arg name="script">transientVars.get("log").info("executing action 2")></arg> </function>
The logging output will now contain the workflow process instance ID (piid).
Process Instance State
Sometimes it is helpful to specify a state to the process instance as a whole, independent to its progression or its steps. OSWf offers a number of such "meta-states" that a process instance can be in. These are CREATED, ACTIVATED, SUSPENDED, KILLED, and COMPLETED. When a process instance is first created, it is in the CREATED state. Then as soon as an action is performed on it, it moves automatically to the ACTIVATED state. If the caller does not explicitly alters the instance state, the process instance will remain in this state until it is unambigiously completed. This is defined to be the case when the process instance cannot possibly perform any further actions. In this case, the process instance will automatically move to the COMPLETED state.
However, while the process instance is in the ACTIVATED state, a caller can termined or suspend the process instance (set the state to KILLED or SUSPENDED). A terminated process instance will not be able to progress any further, and will remain in the state it was in at the time of termination forever. A process instance that has been suspended will be 'frozen' and no actions can be performed on it, until it is explicitly returned back to the ACTIVATED state.
Conclusion
This overview has hopefully illustrated the some of the major ideas in OSWf. You should feel comfortable enough now with the API and descriptor syntax to explore further on your own. There are many more advanced features that are not mention here, like splits, joins, nested conditions, auto steps, and others. Feel free to browse the manual to get a stronger grasp on what is available.
Take a look at an simple example in First Workflow.


public class BigInteger extends Number implements Comparable<BigInteger>
Semantics of arithmetic operations exactly mimic those of Java's integer
arithmetic operators, as defined in The Java Language Specification.
For example, division by zero throws an ArithmeticException
, and
division of a negative by a positive yields a negative (or zero) remainder.
All of the details in the Spec concerning overflow are ignored, as
BigIntegers are made as large as necessary to accommodate the results of an
operation.
Semantics of shift operations extend those of Java's shift operators
to allow for negative shift distances. A right-shift with a negative
shift distance results in a left shift, and vice-versa. The unsigned
right shift operator (>>>
) is omitted, as this operation makes
little sense in combination with the "infinite word size" abstraction
provided by this class.
Semantics of bitwise logical operations exactly mimic those of Java's
bitwise integer operators. The binary operators (and
,
or
, xor
) implicitly perform sign extension on the shorter
of the two operands prior to performing the operation.
Comparison operations perform signed integer comparisons, analogous to those performed by Java's relational and equality operators.
Modular arithmetic operations are provided to compute residues, perform
exponentiation, and compute multiplicative inverses. These methods always
return a non-negative result, between 0
and (modulus - 1)
,
inclusive.
Bit operations operate on a single bit of the two's-complement representation of their operand. If necessary, the operand is sign- extended so that it contains the designated bit. None of the single-bit operations can produce a BigInteger with a different sign from the BigInteger being operated on, as they affect only a single bit, and the "infinite word size" abstraction provided by this class ensures that there are infinitely many "virtual sign bits" preceding each BigInteger.
For the sake of brevity and clarity, pseudo-code is used throughout the
descriptions of BigInteger methods. The pseudo-code expression
(i + j)
is shorthand for "a BigInteger whose value is
that of the BigInteger i
plus that of the BigInteger j
."
The pseudo-code expression (i == j)
is shorthand for
"true
if and only if the BigInteger i
represents the same
value as the BigInteger j
." Other pseudo-code expressions are
interpreted similarly.
All methods and constructors in this class throw
NullPointerException
when passed
a null object reference for any input parameter.
BigInteger must support values in the range
-2Integer.MAX_VALUE
(exclusive) to
+2Integer.MAX_VALUE
(exclusive)
and may support values outside of that range.
The range of probable prime values is limited and may be less than
the full supported positive range of BigInteger
.
The range must be at least 1 to<PHONE_NUMBER>.
BigDecimal
,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static BigInteger |
ONE
The BigInteger constant one.
|
static BigInteger |
TEN
The BigInteger constant ten.
|
static BigInteger |
ZERO
The BigInteger constant zero.
|
| Constructor and Description |
|---|
BigInteger(byte[] val)
Translates a byte array containing the two's-complement binary
representation of a BigInteger into a BigInteger.
|
BigInteger(int signum,
byte[] magnitude)
Translates the sign-magnitude representation of a BigInteger into a
BigInteger.
|
BigInteger(int bitLength,
int certainty,
Random rnd)
Constructs a randomly generated positive BigInteger that is probably
prime, with the specified bitLength.
|
BigInteger(int numBits,
Random rnd)
Constructs a randomly generated BigInteger, uniformly distributed over
the range 0 to (2
numBits - 1), inclusive. |
BigInteger(String val)
Translates the decimal String representation of a BigInteger into a
BigInteger.
|
BigInteger(String val,
int radix)
Translates the String representation of a BigInteger in the
specified radix into a BigInteger.
|
| Modifier and Type | Method and Description |
|---|---|
BigInteger |
abs()
Returns a BigInteger whose value is the absolute value of this
BigInteger.
|
BigInteger |
add(BigInteger val)
Returns a BigInteger whose value is
(this + val) . |
BigInteger |
and(BigInteger val)
Returns a BigInteger whose value is
(this & val) . |
BigInteger |
andNot(BigInteger val)
Returns a BigInteger whose value is
(this & ~val) . |
int |
bitCount()
Returns the number of bits in the two's complement representation
of this BigInteger that differ from its sign bit.
|
int |
bitLength()
Returns the number of bits in the minimal two's-complement
representation of this BigInteger, excluding a sign bit.
|
byte |
byteValueExact()
Converts this
BigInteger to a byte , checking
for lost information. |
BigInteger |
clearBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger
with the designated bit cleared.
|
int |
compareTo(BigInteger val)
Compares this BigInteger with the specified BigInteger.
|
BigInteger |
divide(BigInteger val)
Returns a BigInteger whose value is
(this / val) . |
BigInteger[] |
divideAndRemainder(BigInteger val)
Returns an array of two BigIntegers containing
(this / val)
followed by (this % val) . |
double |
doubleValue()
Converts this BigInteger to a
double . |
boolean |
equals(Object x)
Compares this BigInteger with the specified Object for equality.
|
BigInteger |
flipBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger
with the designated bit flipped.
|
float |
floatValue()
Converts this BigInteger to a
float . |
BigInteger |
gcd(BigInteger val)
Returns a BigInteger whose value is the greatest common divisor of
abs(this) and abs(val) . |
int |
getLowestSetBit()
Returns the index of the rightmost (lowest-order) one bit in this
BigInteger (the number of zero bits to the right of the rightmost
one bit).
|
int |
hashCode()
Returns the hash code for this BigInteger.
|
int |
intValue()
Converts this BigInteger to an
int . |
int |
intValueExact()
Converts this
BigInteger to an int , checking
for lost information. |
boolean |
isProbablePrime(int certainty)
Returns
true if this BigInteger is probably prime,
false if it's definitely composite. |
long |
longValue()
Converts this BigInteger to a
long . |
long |
longValueExact()
Converts this
BigInteger to a long , checking
for lost information. |
BigInteger |
max(BigInteger val)
Returns the maximum of this BigInteger and
val . |
BigInteger |
min(BigInteger val)
Returns the minimum of this BigInteger and
val . |
BigInteger |
mod(BigInteger m)
Returns a BigInteger whose value is
(this mod m ). |
BigInteger |
modInverse(BigInteger m)
Returns a BigInteger whose value is
(this -1 mod m) . |
BigInteger |
modPow(BigInteger exponent,
BigInteger m)
Returns a BigInteger whose value is
(thisexponent mod m).
|
BigInteger |
multiply(BigInteger val)
Returns a BigInteger whose value is
(this * val) . |
BigInteger |
negate()
Returns a BigInteger whose value is
(-this) . |
BigInteger |
nextProbablePrime()
Returns the first integer greater than this
BigInteger that
is probably prime. |
BigInteger |
not()
Returns a BigInteger whose value is
(~this) . |
BigInteger |
or(BigInteger val)
Returns a BigInteger whose value is
(this | val) . |
BigInteger |
pow(int exponent)
Returns a BigInteger whose value is (thisexponent).
|
static BigInteger |
probablePrime(int bitLength,
Random rnd)
Returns a positive BigInteger that is probably prime, with the
specified bitLength.
|
BigInteger |
remainder(BigInteger val)
Returns a BigInteger whose value is
(this % val) . |
BigInteger |
setBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger
with the designated bit set.
|
BigInteger |
shiftLeft(int n)
Returns a BigInteger whose value is
(this << n) . |
BigInteger |
shiftRight(int n)
Returns a BigInteger whose value is
(this >> n) . |
short |
shortValueExact()
Converts this
BigInteger to a short , checking
for lost information. |
int |
signum()
Returns the signum function of this BigInteger.
|
BigInteger |
subtract(BigInteger val)
Returns a BigInteger whose value is
(this - val) . |
boolean |
testBit(int n)
Returns
true if and only if the designated bit is set. |
byte[] |
toByteArray()
Returns a byte array containing the two's-complement
representation of this BigInteger.
|
String |
toString()
Returns the decimal String representation of this BigInteger.
|
String |
toString(int radix)
Returns the String representation of this BigInteger in the
given radix.
|
static BigInteger |
valueOf(long val)
Returns a BigInteger whose value is equal to that of the
specified
long . |
BigInteger |
xor(BigInteger val)
Returns a BigInteger whose value is
(this ^ val) . |
byteValue, shortValue
public static final BigInteger ZERO
public static final BigInteger ONE
public static final BigInteger TEN
public BigInteger(byte[] val)
val
- big-endian two's-complement binary representation of
BigInteger.NumberFormatException
- val
is zero bytes long.public BigInteger(int signum, byte[] magnitude)
signum
- signum of the number (-1 for negative, 0 for zero, 1
for positive).magnitude
- big-endian binary representation of the magnitude of
the number.NumberFormatException
- signum
is not one of the three
legal values (-1, 0, and 1), or signum
is 0 and
magnitude
contains one or more non-zero bytes.public BigInteger(String val, int radix)
Character.digit
. The String may not contain any extraneous
characters (whitespace, for example).val
- String representation of BigInteger.radix
- radix to be used in interpreting val
.NumberFormatException
- val
is not a valid representation
of a BigInteger in the specified radix, or radix
is
outside the range from Character.MIN_RADIX
to
Character.MAX_RADIX
, inclusive.Character.digit(char, int)
public BigInteger(String val)
Character.digit
.
The String may not contain any extraneous characters (whitespace, for
example).val
- decimal String representation of BigInteger.NumberFormatException
- val
is not a valid representation
of a BigInteger.Character.digit(char, int)
public BigInteger(int numBits, Random rnd)
numBits
- 1), inclusive.
The uniformity of the distribution assumes that a fair source of random
bits is provided in rnd
. Note that this constructor always
constructs a non-negative BigInteger.numBits
- maximum bitLength of the new BigInteger.rnd
- source of randomness to be used in computing the new
BigInteger.IllegalArgumentException
- numBits
is negative.bitLength()
public BigInteger(int bitLength, int certainty, Random rnd)
It is recommended that the probablePrime
method be used in preference to this constructor unless there
is a compelling need to specify a certainty.
bitLength
- bitLength of the returned BigInteger.certainty
- a measure of the uncertainty that the caller is
willing to tolerate. The probability that the new BigInteger
represents a prime number will exceed
(1 - 1/2certainty
). The execution time of
this constructor is proportional to the value of this parameter.rnd
- source of random bits used to select candidates to be
tested for primality.ArithmeticException
- bitLength < 2
or bitLength
is too large.bitLength()
public static BigInteger probablePrime(int bitLength, Random rnd)
bitLength
- bitLength of the returned BigInteger.rnd
- source of random bits used to select candidates to be
tested for primality.bitLength
bits that is probably primeArithmeticException
- bitLength < 2
or bitLength
is too large.bitLength()
public BigInteger nextProbablePrime()
BigInteger
that
is probably prime. The probability that the number returned by this
method is composite does not exceed 2-100. This method will
never skip over a prime when searching: if it returns p
, there
is no prime q
such that this < q < p
.BigInteger
that
is probably prime.ArithmeticException
- this < 0
or this
is too large.public static BigInteger valueOf(long val)
long
. This "static factory method" is
provided in preference to a (long
) constructor
because it allows for reuse of frequently used BigIntegers.val
- value of the BigInteger to return.public BigInteger add(BigInteger val)
(this + val)
.val
- value to be added to this BigInteger.this + val
public BigInteger subtract(BigInteger val)
(this - val)
.val
- value to be subtracted from this BigInteger.this - val
public BigInteger multiply(BigInteger val)
(this * val)
.val
- value to be multiplied by this BigInteger.this * val
public BigInteger divide(BigInteger val)
(this / val)
.val
- value by which this BigInteger is to be divided.this / val
ArithmeticException
- if val
is zero.public BigInteger[] divideAndRemainder(BigInteger val)
(this / val)
followed by (this % val)
.val
- value by which this BigInteger is to be divided, and the
remainder computed.(this / val)
is the initial element, and the remainder (this % val)
is the final element.ArithmeticException
- if val
is zero.public BigInteger remainder(BigInteger val)
(this % val)
.val
- value by which this BigInteger is to be divided, and the
remainder computed.this % val
ArithmeticException
- if val
is zero.public BigInteger pow(int exponent)
exponent
is an integer rather than a BigInteger.exponent
- exponent to which this BigInteger is to be raised.ArithmeticException
- exponent
is negative. (This would
cause the operation to yield a non-integer value.)public BigInteger gcd(BigInteger val)
abs(this)
and abs(val)
. Returns 0 if
this == 0 && val == 0
.val
- value with which the GCD is to be computed.GCD(abs(this), abs(val))
public BigInteger abs()
abs(this)
public BigInteger negate()
(-this)
.-this
public int signum()
public BigInteger mod(BigInteger m)
(this mod m
). This method
differs from remainder
in that it always returns a
non-negative BigInteger.m
- the modulus.this mod m
ArithmeticException
- m
≤ 0remainder(java.math.BigInteger)
public BigInteger modPow(BigInteger exponent, BigInteger m)
pow
, this
method permits negative exponents.)exponent
- the exponent.m
- the modulus.ArithmeticException
- m
≤ 0 or the exponent is
negative and this BigInteger is not relatively
prime to m
.modInverse(java.math.BigInteger)
public BigInteger modInverse(BigInteger m)
(this
-1 mod m)
.m
- the modulus.this
-1 mod m
.ArithmeticException
- m
≤ 0, or this BigInteger
has no multiplicative inverse mod m (that is, this BigInteger
is not relatively prime to m).public BigInteger shiftLeft(int n)
(this << n)
.
The shift distance, n
, may be negative, in which case
this method performs a right shift.
(Computes floor(this * 2n).)n
- shift distance, in bits.this << n
shiftRight(int)
public BigInteger shiftRight(int n)
(this >> n)
. Sign
extension is performed. The shift distance, n
, may be
negative, in which case this method performs a left shift.
(Computes floor(this / 2n).)n
- shift distance, in bits.this >> n
shiftLeft(int)
public BigInteger and(BigInteger val)
(this & val)
. (This
method returns a negative BigInteger if and only if this and val are
both negative.)val
- value to be AND'ed with this BigInteger.this & val
public BigInteger or(BigInteger val)
(this | val)
. (This method
returns a negative BigInteger if and only if either this or val is
negative.)val
- value to be OR'ed with this BigInteger.this | val
public BigInteger xor(BigInteger val)
(this ^ val)
. (This method
returns a negative BigInteger if and only if exactly one of this and
val are negative.)val
- value to be XOR'ed with this BigInteger.this ^ val
public BigInteger not()
(~this)
. (This method
returns a negative value if and only if this BigInteger is
non-negative.)~this
public BigInteger andNot(BigInteger val)
(this & ~val)
. This
method, which is equivalent to and(val.not())
, is provided as
a convenience for masking operations. (This method returns a negative
BigInteger if and only if this
is negative and val
is
positive.)val
- value to be complemented and AND'ed with this BigInteger.this & ~val
public boolean testBit(int n)
true
if and only if the designated bit is set.
(Computes ((this & (1<<n)) != 0)
.)n
- index of bit to test.true
if and only if the designated bit is set.ArithmeticException
- n
is negative.public BigInteger setBit(int n)
(this | (1<<n))
.)n
- index of bit to set.this | (1<<n)
ArithmeticException
- n
is negative.public BigInteger clearBit(int n)
(this & ~(1<<n))
.)n
- index of bit to clear.this & ~(1<<n)
ArithmeticException
- n
is negative.public BigInteger flipBit(int n)
(this ^ (1<<n))
.)n
- index of bit to flip.this ^ (1<<n)
ArithmeticException
- n
is negative.public int getLowestSetBit()
(this == 0? -1 : log2(this & -this))
.)public int bitLength()
(ceil(log2(this < 0 ? -this : this+1)))
.)public int bitCount()
public boolean isProbablePrime(int certainty)
true
if this BigInteger is probably prime,
false
if it's definitely composite. If
certainty
is ≤ 0, true
is
returned.certainty
- a measure of the uncertainty that the caller is
willing to tolerate: if the call returns true
the probability that this BigInteger is prime exceeds
(1 - 1/2certainty
). The execution time of
this method is proportional to the value of this parameter.true
if this BigInteger is probably prime,
false
if it's definitely composite.public int compareTo(BigInteger val)
(x.compareTo(y)
<op> 0)
, where
<op> is one of the six comparison operators.compareTo
in interface Comparable<BigInteger>
val
- BigInteger to which this BigInteger is to be compared.val
.public boolean equals(Object x)
equals
in class Object
x
- Object to which this BigInteger is to be compared.true
if and only if the specified Object is a
BigInteger whose value is numerically equal to this BigInteger.Object.hashCode()
,
HashMap
public BigInteger min(BigInteger val)
val
.val
- value with which the minimum is to be computed.val
. If they are equal, either may be returned.public BigInteger max(BigInteger val)
val
.val
- value with which the maximum is to be computed.val
. If they are equal, either may be returned.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString(int radix)
Character.MIN_RADIX
to Character.MAX_RADIX
inclusive,
it will default to 10 (as is the case for
Integer.toString
). The digit-to-character mapping
provided by Character.forDigit
is used, and a minus
sign is prepended if appropriate. (This representation is
compatible with the (String,
int)
constructor.)radix
- radix of the String representation.Integer.toString(int, int)
,
Character.forDigit(int, int)
,
BigInteger(java.lang.String, int)
public String toString()
Character.forDigit
is used, and a minus sign is
prepended if appropriate. (This representation is compatible
with the (String)
constructor, and
allows for String concatenation with Java's + operator.)toString
in class Object
Character.forDigit(int, int)
,
BigInteger(java.lang.String)
public byte[] toByteArray()
(ceil((this.bitLength() +
1)/8))
. (This representation is compatible with the
(byte[])
constructor.)BigInteger(byte[])
public int intValue()
int
. This
conversion is analogous to a
narrowing primitive conversion from long
to
int
as defined in section 5.1.3 of
The Java™ Language Specification:
if this BigInteger is too big to fit in an
int
, only the low-order 32 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.intValue
in class Number
int
.intValueExact()
public long longValue()
long
. This
conversion is analogous to a
narrowing primitive conversion from long
to
int
as defined in section 5.1.3 of
The Java™ Language Specification:
if this BigInteger is too big to fit in a
long
, only the low-order 64 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.longValue
in class Number
long
.longValueExact()
public float floatValue()
float
. This
conversion is similar to the
narrowing primitive conversion from double
to
float
as defined in section 5.1.3 of
The Java™ Language Specification:
if this BigInteger has too great a magnitude
to represent as a float
, it will be converted to
Float.NEGATIVE_INFINITY
or Float.POSITIVE_INFINITY
as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigInteger value.floatValue
in class Number
float
.public double doubleValue()
double
. This
conversion is similar to the
narrowing primitive conversion from double
to
float
as defined in section 5.1.3 of
The Java™ Language Specification:
if this BigInteger has too great a magnitude
to represent as a double
, it will be converted to
Double.NEGATIVE_INFINITY
or Double.POSITIVE_INFINITY
as appropriate. Note that even when
the return value is finite, this conversion can lose
information about the precision of the BigInteger value.doubleValue
in class Number
double
.public long longValueExact()
BigInteger
to a long
, checking
for lost information. If the value of this BigInteger
is out of the range of the long
type, then an
ArithmeticException
is thrown.BigInteger
converted to a long
.ArithmeticException
- if the value of this
will
not exactly fit in a long
.longValue()
public int intValueExact()
BigInteger
to an int
, checking
for lost information. If the value of this BigInteger
is out of the range of the int
type, then an
ArithmeticException
is thrown.BigInteger
converted to an int
.ArithmeticException
- if the value of this
will
not exactly fit in a int
.intValue()
public short shortValueExact()
BigInteger
to a short
, checking
for lost information. If the value of this BigInteger
is out of the range of the short
type, then an
ArithmeticException
is thrown.BigInteger
converted to a short
.ArithmeticException
- if the value of this
will
not exactly fit in a short
.Number.shortValue()
public byte byteValueExact()
BigInteger
to a byte
, checking
for lost information. If the value of this BigInteger
is out of the range of the byte
type, then an
ArithmeticException
is thrown.BigInteger
converted to a byte
.ArithmeticException
- if the value of this
will
not exactly fit in a byte
.Number.byteValue()
Dracula Javadoc Sample, Made with Allan Im.


PostgreSQL Flow
Trigger Flow
ERD Diagram
Example Processes
Log Process
Task Process
Mail Process
HTTP Process
Parallel Process
Conditional Process


{% blocktrans with username=comment.user.username %}posted by {{ username }}{% endblocktrans %}
{% blocktrans with since=comment.created|timesince %}{{ since }} ago{% endblocktrans %}
{% if comment.edit_log.count %}
{% blocktrans with since=comment.edited|timesince total=comment.edit_log.count %}last edited {{ since }} ago with total {{ total }} edits{% endblocktrans %}
{% endif %}


After graduating from VCU with a degree in music and Information Systems, I moved into retail management and music instruction. I spent my time with Starbucks Coffee and Trader Joe’s coaching and mentoring crew members as well as teaching drum lessons. During this time I learned a lot about breaking things down and helping others understand new concepts by tailoring lessons around individual learning styles. I also learned the success of a business depends on connecting with your customers and understanding their needs. I started coding because I like to build things. I enjoy problem solving and the process of putting things together and seeing what happens. I work with HTML, CSS, Bootstrap, JavaScript, WordPress, Ajax, Firebase, MySQL, Mongodb, APIs, and more!
Tune Saver with Cheerio, Mongoose, and Mongo. Check it out at https://arcane-gorge-50694.herokuapp.com/ or on Github at https://github.com/jhbarnum/Portfolio
Close ProjectUsing JavaScript, HTML, CSS, JQuery, MySQL, Node.js, MVC, and Handlebars, my Burger app allows you to keep track of burgers you would like to eat, and mark those you have eaten. Check it out in action on Heroku at https://protected-crag-90712.herokuapp.com/ and Github at https://github.com/jhbarnum/Burger
Close ProjectUsing the giphy.com api, jQuery, HTML, Bootstrap and JavaScript, I dynamically create the content on this page. Check it out at https://jhbarnum.github.io/GifTastic/
Close ProjectThis Clicky Game uses React to manage the front end user experience. Try it out here on Github https://jhbarnum.github.io/React/
Close Project


A method to explore the treatment-covariate interactions in survival or generalized linear model (GLM) for continuous, binomial and count data arising from two or more treatment arms of a clinical trial. A permutation distribution approach to inference is implemented, based on permuting the covariate values within each treatment group. Bonetti M, Gelber RD (2004) <doi:10.1093/biostatistics/5.3.465>. Marco Bonetti, David Zahrieh, Bernard F. Cole, and Richard D. Gelber (2009) <doi:10.1002/sim.3524>. Ann A. Lazar, Bernard F. Cole, Marco Bonetti, and Richard D. Gelber (2010) <doi:10.1200/JCO.2009.27.9182>. Lazar AA,Bonetti M,Cole BF,Yip WK,Gelber RD (2016) <doi:10.1177/1740774515609106>. Wai-Ki Yip,Marco Bonetti,Bernard F Cole,William Barcella,Xin Victoria Wang,Ann Lazar,and Richard D Gelber (2016) <doi:10.1177/1740774516643297>. Wang XV, Cole B, Bonetti M, Gelber RD (2016) < doi:10.1002/sim.6958>. Wai-Ki Yip (2017, ISBN:978-3-319-48846-2).
| Version: | <IP_ADDRESS> |
| Depends: | methods, car, survival, splines |
| Published: | 2018-07-26 |
| Author: | Wai-ki Yip, with contributions from Ann Lazar, David Zahrieh, Chip Cole, Ann Lazar, Marco Bonetti, Victoria Wang, William Barcella and Richard Gelber |
| Maintainer: | Wai-ki Yip <yuser86 at yahoo.com> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | https://www.r-project.org |
| NeedsCompilation: | yes |
| CRAN checks: | stepp results |
| Reference manual: | stepp.pdf |
| Package source: | stepp_<IP_ADDRESS>.tar.gz |
| Windows binaries: | r-devel: stepp_<IP_ADDRESS>.zip, r-release: stepp_<IP_ADDRESS>.zip, r-oldrel: stepp_<IP_ADDRESS>.zip |
| OS X binaries: | r-release: stepp_<IP_ADDRESS>.tgz, r-oldrel: stepp_<IP_ADDRESS>.tgz |
| Old sources: | stepp archive |
Please use the canonical form https://CRAN.R-project.org/package=stepp to link to this page.


MEDICO
LOGIN
REGISTER
ABOUT US
CONTACT US
Get started
Time to feel like home
Already a member?
Sign in and be fit always


{% extends "wall-wrapper.html" %} {% block content %}
Fill out this form to add your session idea to the list. You are automatically added to the list of presenters, but you can add others as well. Please select at least one tag to categorize your session. Anyone listed as a presenter can edit a session from the session ideas page by clicking the "Edit" link.


Welcome to SigmaF, the Program Language of the future for the Functional Programming and a lot more.
What is SigmaF
SigmaF is a new open source and functional paradigm programming language, inspired by languages like Haskell, Python, JavaScript, and Rust.
SigmaF is an interpreted language fully built using Python.
What is the propouse
This language is designed to be a multipurpose functional programming language, focus on been able to write programs that are easy to understand and easy to write. Using a syntax similar to programming languages of imperative paradigm. Of way that be a bridge between imperative and functional paradigm.
How is builting
The language was built using Python 3.8 version.
For the future
The language is still in development, and it is expected that it will be able to support more features and be more powerful, implementing parallelism, concurrency, and more.
At this moment, this is an interpreted language, so it is not possible to compile it, but it is possible to build a compiler for it or use a JIT compiler.


Bihar Board 10th, 12th exam date sheet 2020 released, check schedule
Bihar Board BSEB 10th, 12th Exam Date Sheet 2020: The Madhyamik (Class 10) examinations will commence on February 17, 2020, while Intermediate (Class 12) is scheduled to be held from February 3 to 13, 2020
by Education DeskBihar Board BSEB 10th, 12th Exam Date Sheet 2020: The Bihar School Examination Board (BSEB) has released the date sheet for matric or class 10 and class 12 exams on Monday, November 18, 2019. The Madhyamik (Class 10) examination will be commenced on February 17, 2020, while Intermediate (Class 12) examination is scheduled to be held from February 3 to 13, 2020.
Both the examinations will be held in two shifts — first shift (9.30 am to 12.45 pm), and the second shift from 1:45 pm to 5 pm.
Bihar board Intermediate Class 12 datesheet 2020
February 3, 2020
Morning shift- Physics
Afternoon shift- History, R.B. Hindi
February 4, 2020
Morning- Chemistry
Afternoon- Political Science, English
February 5
Morning- Biology
Afternoon
Economics, Foundation Course
February 6
Afternoon- Computer Science, Multi Media and Web Tech, Yoga and Physical Education
February 7
Morning- Mathematics
Afternoon- M.B, Vocational Trade-I
February 8
Morning- Agriculture, Music
Afternoon- Entrepreneurship, Geography
February 10
Morning- Language subject
Afternoon
Psychology, Vocational Trade-II
February 11
Afternoon shift- Philosophy, Vocational Trade- III
February 12
Morning- Language subject
Afternoon- Sociology, Business Studies, Related Subjects
February 13
Morning- Home Sciences, Economics
Afternoon- Accountancy
Bihar Board Matric Class 10 datesheet 2020
February 17- Science
February 18- Mathematics
February 19- Social Science
February 21- Vernacular subject
February 22- Second Indian Language
February 24- Additional subjects.
Students have to reach the exam centre about half an hour before the scheduled time. They’ll be given 15 minutes to read the paper.


#include <system.h>
Public Attributes | |
| ulong | controlKeyState |
| ushort | keyCode |
| CharScanType | charScan |
The KeyDownEvent structure is a union of keyCode (a ushort) and charScan (of type struct CharScanType). These two members represent two ways of viewing the same data: either as a scan code or as a key code.
Scan codes are what your program receives from the keyboard, while key codes are usually needed in a switch statement.
See file `tkeys.h' for a list of keycodes.
Definition at line 239 of file system.h.
|
|
The same as above, but splitted in its two components.
|
|
|
Stores the status of the control keys when the event happened. The following values define keyboard states, and can be used when examining the keyboard shift state:
Constant Value Meaning kbRightShift 0x0001 Set if the Right Shift key is currently down kbLeftShift 0x0002 Set if the Left Shift key is currently down kbCtrlShift 0x0004 Set if the Ctrl key is currently down kbAltShift 0x0008 Set if the Alt key is currently down kbScrollState 0x0010 Set if the keyboard is in the Scroll Lock state kbNumState 0x0020 Set if the keyboard is in the Num Lock state kbCapsState 0x0040 Set if the keyboard is in the Caps Lock state kbInsState 0x0080 Set if the keyboard is in the Ins Lock state Its value is 0 if none of these keys was pressed. Warning: this information is not reliable. Its value depends on your operating system and libraries (gpm, ncurses). Usually only a subset of these flags are detected. See file `system.cc' for details. |
|
|
This is the key code. It is the concatenation of the scan code and the character code.
|


FMOD Event Component
The FMOD event component creates an instance of an FMOD event. An event is usually a 2D or 3D sound, but can also be an environmental effect that changes how other sounds are perceived. FMOD events are very powerful, which is why ezEngine doesn't need to have a large feature set of audio features. No matter what you want to do, pretty much anything is available through FMOD events.
A description of FMOD events is out of scope for this documentation. Please see Using FMOD Studio for learning resources.
FMOD event components reference sound event assets. The component plays the referenced sound. If the FMOD event has looping regions, the sound will play indefinitely, until it is stopped programmatically, or the component is deleted. There is no looping option on the component, since this feature controlled through FMOD Studio.
Advanced FMOD features, like sound cues and adjusting event parameters are only accessible programmatically (C++ or TypeScript). For details please see the API Docs about ezFmodEventComponent
.
Sound Occlusion
By default sounds are only attenuated by distance. FMOD doesn't have a representation of the 3D geometry and therefore can't muffle or disable sounds when they are (visually) occluded.
The event component allows you to enable a simple physics raycast based heuristic to determine whether a sound source is occluded by a wall or larger obstacle. If enabled, the occlusion factor is computed and the FMOD event parameter Occlusion
is passed into the event. It is your responsibility to set up the FMOD event such that this parameter exists and is used to adjust the event's volume.
Component Properties
Paused
: If set, the referenced sound won't start playing at start. Toggling this value programmatically will pause/resume a playing sound.Volume
: Adjusts the volume for this sound.Pitch
: Higher pitch means the sound plays faster, a lower pitch makes it play slower (and at lower frequency).SoundEvent
: The sound event asset that will be played by this component.UseOcclusion
: If enabled, the component will use physics raycasts to determine whether the sound source is occluded by geometry. The occlusion factor is passed to the FMOD event as the event parameterOcclusion
.OcclusionThreshold
: How strongly the sound source must be occluded, before the occlusion value will be larger than zero.OcclusionCollisionLayer
: The physics collision layer to use for the occlusion raycasts.OnFinishedAction
: For sounds that end by themselves, this option allows you to specify whether the component should delete itself or its entire object afterwards.ShowDebugInfo
: If enabled, the component displays some statistics about its state.


TableFilter
A Javascript library making HTML tables filterable
TableFilter is a modernised version of the HTML Table Filter generator javascript plugin. This library adds to any html table a "filter by column" feature that enables users to filter and limit the data displayed within a long table. By default, the script automatically adds a filter grid bar at the top of the desired table.
Features
- Convert a regular HTML table into an advanced grid component providing:
- Advanced columns filtering model
- Sorting and pagination capabilities
- Complete selection model (ezEditTable extension)
- Extended keyboard navigation (ezEditTable extension)
- Inline cell or row editing (ezEditTable extension)
- Row insertion or deleting (ezEditTable extension)
- And even more features...
- Attach to an existing HTML table
- Integration with any server-side technology as this is a pure client-side solution
- Exhaustive documentation and poweful API
Getting started
Clone the repo using Git:
git clone https://github.com/koalyptus/TableFilter.git
You can download this repository.
TableFilter is available on npm repository, you can install it from the command line using the following command:
npm install tablefilter --save-dev
- or get the future features from the
next
release channel:npm install tablefilter@next --save-dev
- Alternatively you can also access these files from unpkg CDN, download them or point your package manager to them.
Setup
Using modules
Require TableFilter
:
// ES2015 modules
import TableFilter from 'tablefilter';
// CommonJS or AMD modules
var TableFilter = require('tablefilter');
Using distribution scripts
If you are not using a module system, you can reference the distribution scripts directly in your html pages:
<script src="path_to/node_modules/tablefilter/dist/tablefilter/tablefilter.js"></script>
Placing manually the distribution scripts in your project
Copy the tablefilter
directory under dist
and place it at desired location in your project. Then include the main js file in your page:
<script src="path/to/my/scripts/tablefilter/tablefilter.js"></script>
Usage
Place the following snippet just under the HTML table and always define a base_path
property in the configuration object to reflect the path to the script
<script>
var tf = new TableFilter(document.querySelector('.my-table'), {
base_path: 'path/to/my/scripts/tablefilter/'
});
tf.init();
</script>
If the base_path
property is not specified, it will default to /tablefilter
directory:
your-page.html
|— tablefilter
Development
This project requires node.js and Grunt to be installed:
- install node.js v8.9.4 or higher
- install Grunt from the command line using npm (comes with node.js):
Oncenpm install -g grunt-cli
Grunt
is sorted out you can follow the instructions below. Start by installing any dependencies.
npm install
Use
npm run dev
command to launch a build / watch cycle and start the local
sever on port 8080
.
Use
npm run build
command to generate a production build.
The
npm run dist
command will create a production build, run the tests and finally generate the demos:
To run all the tests and generate the coverage report:
npm test
or to run specific test(s):
grunt test-only:test.html
grunt test-only:test.html,test-sort.html
to view the coverage report(s), open the index.html
under the
report/coverage
folder or
online.
Demos
Check out the online examples or generate the demos locally:
npm run build:demos
then run the local webserver:
npm start
then pick a demo from:
http://localhost:8080/demos/
Documentation
Find exhaustive documentation on the configuration options in the WIKI section.
Autogenerated documentation of the ES6 modules is available on the website: docs
If you previously used the HTML Table Filter Generator plugin, verify the configuration options you are using are still supported: Obsolete
Run this task to generate the documentation in the docs/docs
directory:
npm run esdoc
Support
- GitHub for reporting bugs and feature requests.


Sorter for jump maps on the Tempus Network. Pick your sources, and hit the Start button.
Certain options have details that you can hover to read.
Click on the map you like better from the two, or tie them if you like them equally or don't know them.
Depending on what filters you're using, you may get a LOT of picks (expect well over 2000+ picks without any filters), so set aside a good few cups of tea for this.
Keyboard controls during sorting: H/LeftArrow (pick left) J/DownArrow (undo) K/UpArrow (tie) L/RightArrow (pick right) S (save progress).
Before sorting: S/Enter (start sorting) L (load progress).
1/2/3 always correspond to the first/second/third buttons.
Based on this project.
Special thanks to Hona for providing a datasheet with the intended classes for all maps.
If anyone is curious, here is the shoddy C++ code I used to parse the map data.


One person asks:
I am looking at Jenkins from time to time and this time I got as far as reading up on creating plugins for Jenkins. What I am wondering is why one would need Maven to build Jenkin's plugins? Isn't this more complicated for a "simple" Java developer to have to read up on and set up Maven rather than just implementing an interface, adding registration of the custom class and dumping a jar with it into a lib folder?
I do realize that Maven can be a real pain to work with. It is especially so if you are new to Maven, and your concern is understandable. But this is a conscious decision. There are several reasons why I felt the benefits of Maven outweighs its problems when it comes to Jenkins plugins:
- Jenkin's build process involves a certain amount of source code pre-processing. If you are to do this with Ant, your build script will get a bit more complicated.
- The packaging of the plugin .hpi file involves a certain amount of conventions, such as listing other plugin dependencies. Doing this manually is error prone, and again, your build script will get a bit more complicated.
- Doing this as a Maven plugin makes it possible for us to provide the "hpi:run" goal. This is a critical piece of a faster edit/build/debug experience. Without Maven, this is highly non-trivial.
I think an interesting possibility might be to let a scripting language define a plugin, so that you can do some simple things very easily.


Polarization is easy to achieve, but it’s hard to undo. Education is riddled with polarizing issues, both political and practical, and the issue of homework is one of the worst.
The central argument: Homework doesn’t benefit students, and you shouldn’t be giving it.
Aside from pushing buttons and for increasing retweets, search hits, and Klout scores, the homework argument doesn’t go much farther than that. Unfortunately, it’s also gotten to the point where teachers who do give homework feel ostracized in the popular education social spheres.
It’s a tragedy that we can’t talk about teaching without diving into our camps.
This girl is in every blog post or slide deck about homework…including this blog post. Creative commons licensed (BY-NC) flickr photo by Cayusa: http://flickr.com/photos/cayusa/2194119780
Homework in and of itself is no more a “bad” thing than giving multiple choice tests or lecturing in class. What’s bad is when we do those things – or any thing – without thinking through what we’re doing and why we’re doing it. Rather than pushing for ideological conformity, why don’t we take time to discuss what the real issues are behind each action?
Let’s consider some valid reasons to have work done outside school hours:
Students need time to process their learning individually. This isn’t always done best in the classroom. Time to reflect, process, or otherwise chew on information alone should be done outside of school because it is more conducive to finding insight.
Practice. Don’t shoot the messenger, but skills need to be practiced. Again, corporate time in the classroom is not necessarily the best place for individual practice to take place.
Teaching time management. If we had unlimited and unscripted time during the school day, maybe I wouldn’t use this one in particular. But, when we get down to nuts and bolts, we can’t give unlimited time to accomplishing a task – and before you get all “real-world” on me, yes, it happens in places other than school.
Exploration of ideas. I would love to provide a fully immersive environment for my students, but I can’t replicate a forest in the building. Sending students out to take a walk and experience their environment requires that they do it outside of school.
We get so hung up on where this stuff happens that we miss the bigger point. Yes, I had students who took care of siblings, played sports, or worked. I did my best to limit the volume of work outside of school, but I think it’s a bigger adjustment to change what kind of work happens outside of school. Perhaps it isn’t the fact that homework exists but rather the homework we give tends to suck.
Written on November 29th, 2014 by Brian Bennett Categorized in: All Teaching
Leave a comment


Plague: 4th case reported in China, according to Taiwan CDC
by News DeskBy NewsDesk @infectiousdiseasenews
In a follow-up on our recent reports on plague cases in China (HERE and HERE), the Taiwan Department of Disease Control reported on a fourth human plague case. The patient from Jiuquan City, Gansu Province was diagnosed with septicemic plague in September.
This follows reports of two pneumonic plague cases reported from Inner Mongolia in northern China that were diagnosed this month in a Beijing hospital and a bubonic plague case reported in a Inner Mongolia man who contracted the bacterial infection via exposure to wild rabbit last week.
This has prompted Taiwan officials to ramp up screening and health assessments of inbound fever passengers at international ports. Health officials note that Taiwan has not seen a plague case in nearly 7 decades. Mainland China reports plague naturally in certain areas of the country.
Related
Plague is an infectious disease caused by the bacterium, Yersinia pestis. It is found in animals throughout the world, most commonly rats but other rodents like ground squirrels, prairie dogs, chipmunks, rabbits and marmots in China. Fleas typically serve as the vector for plague.
People can also get infected through direct contact with an infected animal, through inhalation and in the case of pneumonic plague, person to person.
Yersinia pestis is treatable with antibiotics if started early enough.
There are three forms of human plague; bubonic, septicemic and pneumonic.