public class BigRational extends java.lang.Object implements java.lang.Comparable<BigRational>
Basic calculations with rational numbers (+ - * /) have no loss of precision.
This allows to use BigRational
as a replacement for BigDecimal
if absolute accuracy is desired.
The values are internally stored as BigDecimal
(for performance optimizations) but represented
as BigInteger
(for mathematical correctness)
when accessed with getNumeratorBigInteger()
and getDenominatorBigInteger()
.
The following basic calculations have no loss of precision:
The following calculations are special cases of the ones listed above and have no loss of precision:
Any BigRational
value can be converted into an arbitrary precision
(number of significant digits)
or scale
(number of digits after the decimal point).
| Modifier and Type | Field and Description |
|---|---|
static BigRational |
ONE
The value 1 as
BigRational . |
static BigRational |
TEN
The value 10 as
BigRational . |
static BigRational |
TWO
The value 2 as
BigRational . |
static BigRational |
ZERO
The value 0 as
BigRational . |
| Modifier and Type | Method and Description |
|---|---|
BigRational |
abs()
Returns the absolute value of this rational number.
|
BigRational |
add(java.math.BigInteger value)
Calculates the addition (+) of this rational number and the specified argument.
|
BigRational |
add(BigRational value)
Calculates the addition (+) of this rational number and the specified argument.
|
BigRational |
add(int value)
Calculates the addition (+) of this rational number and the specified argument.
|
static BigRational |
bernoulli(int n)
Calculates the Bernoulli number for the specified index.
|
int |
compareTo(BigRational other) |
BigRational |
decrement()
Calculates the decrement of this rational number (- 1).
|
BigRational |
divide(java.math.BigInteger value)
Calculates the division (/) of this rational number and the specified argument.
|
BigRational |
divide(BigRational value)
Calculates the division (/) of this rational number and the specified argument.
|
BigRational |
divide(int value)
Calculates the division (/) of this rational number and the specified argument.
|
boolean |
equals(java.lang.Object obj) |
BigRational |
fractionPart()
Returns the fraction part of this rational number.
|
java.math.BigDecimal |
getDenominator()
Returns the denominator of this rational number as BigDecimal.
|
java.math.BigInteger |
getDenominatorBigInteger()
Returns the denominator of this rational number as BigInteger.
|
java.math.BigDecimal |
getNumerator()
Returns the numerator of this rational number as BigDecimal.
|
java.math.BigInteger |
getNumeratorBigInteger()
Returns the numerator of this rational number as BigInteger.
|
int |
hashCode() |
BigRational |
increment()
Calculates the increment of this rational number (+ 1).
|
BigRational |
integerPart()
Returns the integer part of this rational number.
|
boolean |
isInteger()
Returns whether this rational number is an integer number without fraction part.
|
boolean |
isZero()
Returns whether this rational number is zero.
|
static BigRational |
max(BigRational... values)
Returns the largest of the specified rational numbers.
|
static BigRational |
min(BigRational... values)
Returns the smallest of the specified rational numbers.
|
BigRational |
multiply(java.math.BigInteger value)
Calculates the multiplication (*) of this rational number and the specified argument.
|
BigRational |
multiply(BigRational value)
Calculates the multiplication (*) of this rational number and the specified argument.
|
BigRational |
multiply(int value)
Calculates the multiplication (*) of this rational number and the specified argument.
|
BigRational |
negate()
Negates this rational number (inverting the sign).
|
BigRational |
pow(int exponent)
Calculates this rational number to the power (xy) of the specified argument.
|
BigRational |
reciprocal()
Calculates the reciprocal of this rational number (1/x).
|
BigRational |
reduce()
Reduces this rational number to the smallest numerator/denominator with the same value.
|
int |
signum()
Returns the signum function of this rational number.
|
BigRational |
subtract(java.math.BigInteger value)
Calculates the subtraction (-) of this rational number and the specified argument.
|
BigRational |
subtract(BigRational value)
Calculates the subtraction (-) of this rational number and the specified argument.
|
BigRational |
subtract(int value)
Calculates the subtraction (-) of this rational number and the specified argument.
|
java.math.BigDecimal |
toBigDecimal()
Returns this rational number as a
BigDecimal . |
java.math.BigDecimal |
toBigDecimal(java.math.MathContext mc)
Returns this rational number as a
BigDecimal with the precision specified by the MathContext . |
double |
toDouble()
Returns this rational number as a double value.
|
float |
toFloat()
Returns this rational number as a float value.
|
java.lang.String |
toIntegerRationalString()
Returns the string representation of this rational number as integer and fraction parts in the form "integerPart fractionNominator/fractionDenominator".
|
java.lang.String |
toPlainString()
Returns a plain string representation of this rational number without any exponent.
|
java.lang.String |
toRationalString()
Returns the string representation of this rational number in the form "numerator/denominator".
|
java.lang.String |
toString() |
static BigRational |
valueOf(java.math.BigDecimal value)
Creates a rational number of the specified
BigDecimal value. |
static BigRational |
valueOf(java.math.BigDecimal numerator,
java.math.BigDecimal denominator)
Creates a rational number of the specified numerator/denominator BigDecimal values.
|
static BigRational |
valueOf(java.math.BigInteger value)
Creates a rational number of the specified
BigInteger value. |
static BigRational |
valueOf(java.math.BigInteger numerator,
java.math.BigInteger denominator)
Creates a rational number of the specified numerator/denominator BigInteger values.
|
static BigRational |
valueOf(boolean positive,
java.lang.String integerPart,
java.lang.String fractionPart,
java.lang.String fractionRepeatPart,
java.lang.String exponentPart) |
static BigRational |
valueOf(double value)
Creates a rational number of the specified double value.
|
static BigRational |
valueOf(int value)
Creates a rational number of the specified int value.
|
static BigRational |
valueOf(int numerator,
int denominator)
Creates a rational number of the specified numerator/denominator int values.
|
static BigRational |
valueOf(int integer,
int fractionNumerator,
int fractionDenominator)
Creates a rational number of the specified integer and fraction parts.
|
static BigRational |
valueOf(java.lang.String string)
Creates a rational number of the specified string representation.
|
BigRational |
withPrecision(int precision)
Returns a rational number with approximatively
this value and the specified precision. |
BigRational |
withScale(int scale)
Returns a rational number with approximatively
this value and the specified scale. |
public static final BigRational ZERO
BigRational
.public static final BigRational ONE
BigRational
.public static final BigRational TWO
BigRational
.public static final BigRational TEN
BigRational
.public java.math.BigInteger getNumeratorBigInteger()
public java.math.BigDecimal getNumerator()
public java.math.BigInteger getDenominatorBigInteger()
Guaranteed to not be 0.
Guaranteed to be positive.
public java.math.BigDecimal getDenominator()
Guaranteed to not be 0.
Guaranteed to be positive.
public BigRational reduce()
public BigRational integerPart()
Examples:
BigRational.valueOf(3.5).integerPart()
returns BigRational.valueOf(3)
public BigRational fractionPart()
Examples:
BigRational.valueOf(3.5).integerPart()
returns BigRational.valueOf(0.5)
public BigRational negate()
The result has no loss of precision.
Examples:
BigRational.valueOf(3.5).negate()
returns BigRational.valueOf(-3.5)
public BigRational reciprocal()
The result has no loss of precision.
Examples:
BigRational.valueOf(0.5).reciprocal()
returns BigRational.valueOf(2)
BigRational.valueOf(-2).reciprocal()
returns BigRational.valueOf(-0.5)
java.lang.ArithmeticException
- if this number is 0 (division by zero)public BigRational abs()
The result has no loss of precision.
Examples:
BigRational.valueOf(-2).abs()
returns BigRational.valueOf(2)
BigRational.valueOf(2).abs()
returns BigRational.valueOf(2)
public int signum()
public BigRational increment()
This is functionally identical to
this.add(BigRational.ONE)
but slightly faster.
The result has no loss of precision.
public BigRational decrement()
This is functionally identical to
this.subtract(BigRational.ONE)
but slightly faster.
The result has no loss of precision.
public BigRational add(BigRational value)
The result has no loss of precision.
value
- the rational number to addpublic BigRational add(java.math.BigInteger value)
This is functionally identical to
this.add(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the BigInteger
to addpublic BigRational add(int value)
This is functionally identical to
this.add(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the int value to addpublic BigRational subtract(BigRational value)
The result has no loss of precision.
value
- the rational number to subtractpublic BigRational subtract(java.math.BigInteger value)
This is functionally identical to
this.subtract(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the BigInteger
to subtractpublic BigRational subtract(int value)
This is functionally identical to
this.subtract(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the int value to subtractpublic BigRational multiply(BigRational value)
The result has no loss of precision.
value
- the rational number to multiplypublic BigRational multiply(java.math.BigInteger value)
This is functionally identical to
this.multiply(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the BigInteger
to multiplypublic BigRational multiply(int value)
This is functionally identical to
this.multiply(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the int value to multiplypublic BigRational divide(BigRational value)
The result has no loss of precision.
value
- the rational number to divide (0 is not allowed)java.lang.ArithmeticException
- if the argument is 0 (division by zero)public BigRational divide(java.math.BigInteger value)
This is functionally identical to
this.divide(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the BigInteger
to divide (0 is not allowed)java.lang.ArithmeticException
- if the argument is 0 (division by zero)public BigRational divide(int value)
This is functionally identical to
this.divide(BigRational.valueOf(value))
but slightly faster.
The result has no loss of precision.
value
- the int value to divide (0 is not allowed)java.lang.ArithmeticException
- if the argument is 0 (division by zero)public boolean isZero()
true
if this rational number is zero (0), false
if it is not zeropublic boolean isInteger()
true
if this rational number is an integer number, false
if it has a fraction partpublic BigRational pow(int exponent)
The result has no loss of precision.
exponent
- exponent to which this rational number is to be raisedpublic BigRational withPrecision(int precision)
this
value and the specified precision.precision
- the precision (number of significant digits) of the calculated result, or 0 for unlimited precisionpublic BigRational withScale(int scale)
this
value and the specified scale.scale
- the scale (number of digits after the decimal point) of the calculated resultpublic double toDouble()
public float toFloat()
public java.math.BigDecimal toBigDecimal()
BigDecimal
.BigDecimal
valuepublic java.math.BigDecimal toBigDecimal(java.math.MathContext mc)
BigDecimal
with the precision specified by the MathContext
.mc
- the MathContext
specifying the precision of the calculated resultBigDecimal
public int compareTo(BigRational other)
compareTo
in interface java.lang.Comparable<BigRational>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toPlainString()
BigDecimal.toPlainString()
public java.lang.String toRationalString()
The resulting string is a valid input of the valueOf(String)
method.
Examples:
BigRational.valueOf(0.5).toRationalString()
returns "1/2"
BigRational.valueOf(2).toRationalString()
returns "2"
BigRational.valueOf(4, 4).toRationalString()
returns "4/4"
(not reduced)valueOf(String)
,
valueOf(int, int)
public java.lang.String toIntegerRationalString()
The integer part is omitted if it is 0 (when this absolute rational number is smaller than 1).
The fraction part is omitted it it is 0 (when this rational number is an integer).
If this rational number is 0, then "0" is returned.
Example: BigRational.valueOf(3.5).toIntegerRationalString()
returns "3 1/2"
.
valueOf(int, int, int)
public static BigRational valueOf(int value)
value
- the int valuepublic static BigRational valueOf(int numerator, int denominator)
numerator
- the numerator int valuedenominator
- the denominator int value (0 not allowed)java.lang.ArithmeticException
- if the denominator is 0 (division by zero)public static BigRational valueOf(int integer, int fractionNumerator, int fractionDenominator)
Useful to create numbers like 3 1/2 (= three and a half = 3.5) by calling
BigRational.valueOf(3, 1, 2)
.
To create a negative rational only the integer part argument is allowed to be negative:
to create -3 1/2 (= minus three and a half = -3.5) call BigRational.valueOf(-3, 1, 2)
.
integer
- the integer part int valuefractionNumerator
- the fraction part numerator int value (negative not allowed)fractionDenominator
- the fraction part denominator int value (0 or negative not allowed)java.lang.ArithmeticException
- if the fraction part denominator is 0 (division by zero),
or if the fraction part numerator or denominator is negativepublic static BigRational valueOf(java.math.BigInteger numerator, java.math.BigInteger denominator)
numerator
- the numerator BigInteger
valuedenominator
- the denominator BigInteger
value (0 not allowed)java.lang.ArithmeticException
- if the denominator is 0 (division by zero)public static BigRational valueOf(java.math.BigInteger value)
BigInteger
value.value
- the BigInteger
valuepublic static BigRational valueOf(double value)
value
- the double valuejava.lang.NumberFormatException
- if the double value is Infinite or NaN.public static BigRational valueOf(java.math.BigDecimal value)
BigDecimal
value.value
- the double valuepublic static BigRational valueOf(java.lang.String string)
The accepted string representations are:
toString()
: "integerPart.fractionPart"toRationalString()
: "numerator/denominator"toString()
of BigDecimal
, BigInteger
, Integer
, ...toString()
of Double
, Float
- except "Infinity", "-Infinity" and "NaN"string
- the string representation to convertjava.lang.ArithmeticException
- if the denominator is 0 (division by zero)public static BigRational valueOf(boolean positive, java.lang.String integerPart, java.lang.String fractionPart, java.lang.String fractionRepeatPart, java.lang.String exponentPart)
public static BigRational valueOf(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
numerator
- the numerator BigDecimal
valuedenominator
- the denominator BigDecimal
value (0 not allowed)java.lang.ArithmeticException
- if the denominator is 0 (division by zero)public static BigRational min(BigRational... values)
values
- the rational numbers to comparepublic static BigRational max(BigRational... values)
values
- the rational numbers to comparemax(BigRational)
public static BigRational bernoulli(int n)
This function calculates the first Bernoulli numbers and therefore bernoulli(1)
returns -0.5
Note that bernoulli(x)
for all odd x > 1 returns 0
n
- the index of the Bernoulli number to be calculated (starting at 0)java.lang.ArithmeticException
- if x is lesser than 0


Welcome to my homepage!
I am an assistant professor in the Institute of Interdisciplinary Information Sciences (IIIS), Tsinghua University. Before that,
I was a postdoctoral research associate at the Statistical Laboratory, which is part of the Department of Pure Mathematics and Mathematical Statistics at the University of Cambridge. My postdoc advisor was Dr. Rajen Shah.
I received my Ph.D. from the Department of Electrical Engineering and Computer Science at MIT. My advisor was Prof. Caroline Uhler. Prior to my Ph.D., I got my bachelor from the Department of Automation in Tsinghua University.
|


Mankato Cricket Club
Minnesota State University, Mankato
Home
About
Recent Matches
Photos
Outdoor
Indoor
Players
Contact Us
Welcome to the MNSU Mankato Cricket Club.
Are you ready for the CRICKET madness?


Getting Started Sub
Getting Started Sub
Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.
Less runs inside Node, in the browser and inside Rhino. There are also many 3rd party tools that allow you to compile your files and watch for changes.
For example:
Getting Started
Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.
Less runs inside Node, in the browser and inside Rhino. There are also many 3rd party tools that allow you to compile your files and watch for changes.
For example:


--- layout: docpage title: "Documentation" is_homepage: false is_sphinx_doc: true doc-parent: "New Features in Apache Cassandra 4.0" doc-title: "Audit Logging" doc-header-links: ' ' doc-search-path: "../search.html" extra-footer: ' ' ---
Audit Logging is a new feature in Apache Cassandra 4.0 (CASSANDRA-12151). All database activity is logged to a directory in the local filesystem and the audit log files are rolled periodically. All database operations are monitored and recorded. Audit logs are stored in local directory files instead of the database itself as it provides several benefits, some of which are:
Audit logging logs:
More specifically an audit log entry could be one of two types:
Each of these types comprises of several database operations. The CQL Audit Log Entry Type could be one of the following; the category of the CQL audit log entry type is listed in parentheses.
The Common Audit Log Entry Type could be one of the following; the category of the Common audit log entry type is listed in parentheses.
Audit logging does not log:
cassandra.yaml
Audit logging is flexible and configurable in cassandra.yaml
as follows:
Audit Logging is configured on each node separately. Audit Logging is configured in cassandra.yaml
in the audit_logging_options
setting.
The settings may be same/different on each node.
Audit logging is enabled by setting the enabled
option to true
in the audit_logging_options
setting.
audit_logging_options:
enabled: true
The audit logger is set with the logger
option.
logger: BinAuditLogger
Two types of audit loggers are supported: FileAuditLogger
and BinAuditLogger
.
BinAuditLogger
is the default setting. The BinAuditLogger
is an efficient way to log events to file in a binary format.
FileAuditLogger
is synchronous, file-based audit logger; just uses the standard logging mechanism. FileAuditLogger
logs events to audit/audit.log
file using slf4j
logger.
The NoOpAuditLogger
is a No-Op implementation of the audit logger to be used as a default audit logger when audit logging is disabled.
The audit logs directory is set with the audit_logs_dir
option. A new directory is not created automatically and an existing directory must be set. Audit Logs directory can be configured using cassandra.logdir.audit
system property or default is set to cassandra.logdir + /audit/
. A user created directory may be set. As an example, create a directory for the audit logs and set its permissions.
sudo mkdir –p /cassandra/audit/logs/hourly
sudo chmod -R 777 /cassandra/audit/logs/hourly
Set the directory for the audit logs directory using the audit_logs_dir
option.
audit_logs_dir: "/cassandra/audit/logs/hourly"
Set the keyspaces to include with the included_keyspaces
option and the keyspaces to exclude with the excluded_keyspaces
option. By default all keyspaces are included. By default, system
, system_schema
and system_virtual_schema
are excluded.
# included_keyspaces:
# excluded_keyspaces: system, system_schema, system_virtual_schema
The categories of database operations to be included are specified with the included_categories
option as a comma separated list. By default all supported categories are included. The categories of database operations to be excluded are specified with excluded_categories
option as a comma separated list. By default no category is excluded.
# included_categories:
# excluded_categories:
The supported categories for audit log are:
Users to audit log are set with the included_users
and excluded_users
options. The included_users
option specifies a comma separated list of users to include explicitly and by default all users are included. The excluded_users
option specifies a comma separated list of users to exclude explicitly and by default no user is excluded.
# included_users:
# excluded_users:
The roll_cycle
option sets the frequency at which the audit log file is rolled. Supported values are MINUTELY
, HOURLY
, and DAILY
. Default value is HOURLY
, which implies that after every hour a new audit log file is created.
roll_cycle: HOURLY
An audit log file could get rolled for other reasons as well such as a log file reaches the configured size threshold.
The archiving options are for archiving the rolled audit logs. The archive
command to use is set with the archive_command
option and the max_archive_retries
sets the maximum # of tries of failed archive commands.
# archive_command:
# max_archive_retries: 10
Default archive command is "/path/to/script.sh %path"
where %path
is replaced with the file being rolled:
The other audit logs settings are as follows.
# block: true
# max_queue_weight: 268435456 # 256 MiB
# max_log_size:<PHONE_NUMBER>4 # 16 GiB
The block
option specifies whether the audit logging should block if the logging falls behind or should drop log records.
The max_queue_weight
option sets the maximum weight of in memory queue for records waiting to be written to the file before blocking or dropping.
The max_log_size
option sets the maximum size of the rolled files to retain on disk before deleting the oldest.
The nodetool enableauditlog
command may be used to enable audit logs and it overrides the settings in cassandra.yaml
. The nodetool enableauditlog
command syntax is as follows.
nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
[(-pp | --print-port)] [(-pw <password> | --password <password>)]
[(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
[(-u <username> | --username <username>)] enableauditlog
[--excluded-categories <excluded_categories>]
[--excluded-keyspaces <excluded_keyspaces>]
[--excluded-users <excluded_users>]
[--included-categories <included_categories>]
[--included-keyspaces <included_keyspaces>]
[--included-users <included_users>] [--logger <logger>]
| --excluded-categories <excluded_categories> | |
| Comma separated list of Audit Log Categories to be excluded for audit log. If not set the value from cassandra.yaml will be used | |
| --excluded-keyspaces <excluded_keyspaces> | |
| Comma separated list of keyspaces to be excluded for audit log. If not set the value from cassandra.yaml will be used | |
| --excluded-users <excluded_users> | |
| Comma separated list of users to be excluded for audit log. If not set the value from cassandra.yaml will be used | |
| -h <host>, --host <host> | |
| Node hostname or ip address | |
| --included-categories <included_categories> | |
| Comma separated list of Audit Log Categories to be included for audit log. If not set the value from cassandra.yaml will be used | |
| --included-keyspaces <included_keyspaces> | |
| Comma separated list of keyspaces to be included for audit log. If not set the value from cassandra.yaml will be used | |
| --included-users <included_users> | |
| Comma separated list of users to be included for audit log. If not set the value from cassandra.yaml will be used | |
| --logger <logger> | |
| Logger name to be used for AuditLogging. Default BinAuditLogger. If not set the value from cassandra.yaml will be used | |
| -p <port>, --port <port> | |
| Remote jmx agent port number | |
| -pp, --print-port | |
| Operate in 4.0 mode with hosts disambiguated by port number |
| -u <username>, --username <username> | |
| Remote jmx agent username |
The nodetool disableauditlog
command disables audit log. The command syntax is as follows.
nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
[(-pp | --print-port)] [(-pw <password> | --password <password>)]
[(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
[(-u <username> | --username <username>)] disableauditlog
| -h <host>, --host <host> | |
| Node hostname or ip address | |
| -p <port>, --port <port> | |
| Remote jmx agent port number | |
| -pp, --print-port | |
| Operate in 4.0 mode with hosts disambiguated by port number |
| -u <username>, --username <username> | |
| Remote jmx agent username |
An audit log event comprises of a keyspace that is being audited, the operation that is being logged, the scope and the user. An audit log entry comprises of the following attributes concatenated with a “|”.
type (AuditLogEntryType): Type of request
source (InetAddressAndPort): Source IP Address from which request originated
user (String): User name
timestamp (long ): Timestamp of the request
batch (UUID): Batch of request
keyspace (String): Keyspace on which request is made
scope (String): Scope of request such as Table/Function/Aggregate name
operation (String): Database operation such as CQL command
options (QueryOptions): CQL Query options
state (QueryState): State related to a given query
Some of these attributes may not be applicable to a given request and not all of these options must be set.
To demonstrate audit logging enable and configure audit logs with following settings.
audit_logging_options:
enabled: true
logger: BinAuditLogger
audit_logs_dir: "/cassandra/audit/logs/hourly"
# included_keyspaces:
# excluded_keyspaces: system, system_schema, system_virtual_schema
# included_categories:
# excluded_categories:
# included_users:
# excluded_users:
roll_cycle: HOURLY
# block: true
# max_queue_weight: 268435456 # 256 MiB
# max_log_size:<PHONE_NUMBER>4 # 16 GiB
## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
# archive_command:
# max_archive_retries: 10
Create the audit log directory /cassandra/audit/logs/hourly
and set its permissions as discussed earlier. Run some CQL commands such as create a keyspace, create a table and query a table. Any supported CQL commands may be run as discussed in section What does Audit Logging Log?. Change directory (with cd
command) to the audit logs directory.
cd /cassandra/audit/logs/hourly
List the files/directories and some .cq4
files should get listed. These are the audit logs files.
[ec2-user@ip-10-0-2-238 hourly]$ ls -l
total 28
-rw-rw-r--. 1 ec2-user ec2-user 83886080 Aug 2 03:01 20190802-02.cq4
-rw-rw-r--. 1 ec2-user ec2-user 83886080 Aug 2 03:01 20190802-03.cq4
-rw-rw-r--. 1 ec2-user ec2-user 65536 Aug 2 03:01 directory-listing.cq4t
The auditlogviewer
tool is used to dump audit logs. Run the auditlogviewer
tool. Audit log files directory path is a required argument. The output should be similar to the following output.
[ec2-user@ip-10-0-2-238 hourly]$ auditlogviewer /cassandra/audit/logs/hourly
WARN 03:12:11,124 Using Pauser.sleepy() as not enough processors, have 2, needs 8+
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564711427328|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE AuditLogKeyspace;
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564711427329|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE "auditlogkeyspace"
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564711446279|type :SELECT|category:QUERY|ks:auditlogkeyspace|scope:t|operation:SELECT * FROM t;
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564713878834|type :DROP_TABLE|category:DDL|ks:auditlogkeyspace|scope:t|operation:DROP TABLE IF EXISTS
AuditLogKeyspace.t;
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:42382|timestamp:1564714618360|ty
pe:REQUEST_FAILURE|category:ERROR|operation:CREATE KEYSPACE AuditLogKeyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};; Cannot add
existing keyspace "auditlogkeyspace"
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564714690968|type :DROP_KEYSPACE|category:DDL|ks:auditlogkeyspace|operation:DROP KEYSPACE AuditLogKeyspace;
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:42406|timestamp:1564714708329|ty pe:CREATE_KEYSPACE|category:DDL|ks:auditlogkeyspace|operation:CREATE KEYSPACE
AuditLogKeyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
Type: AuditLog
LogMessage:
user:anonymous|host:<IP_ADDRESS>:7000|source:/<IP_ADDRESS>|port:46264|timestamp:1564714870678|type :USE_KEYSPACE|category:OTHER|ks:auditlogkeyspace|operation:USE auditlogkeyspace;
[ec2-user@ip-10-0-2-238 hourly]$
The auditlogviewer
tool usage syntax is as follows.
./auditlogviewer
Audit log files directory path is a required argument.
usage: auditlogviewer <path1> [<path2>...<pathN>] [options]
--
View the audit log contents in human readable format
--
Options are:
-f,--follow Upon reaching the end of the log continue indefinitely
waiting for more records
-h,--help display this help message
-r,--roll_cycle How often to roll the log file was rolled. May be
necessary for Chronicle to correctly parse file names. (MINUTELY, HOURLY,
DAILY). Default HOURLY.
Any native transport enabled client is able to subscribe to diagnostic events that are raised around authentication and CQL operations. These events can then be consumed and used by external tools to implement a Cassandra user auditing solution.


In order to use this website, please log in to canvas
URL:https://thevillageschool.instructure.com
You are also welcome to visit villagechemcats.com!


Solving Partial Autocorrelation Functions
I've been studying time series through TSA. The book presents a structured approach to time series analysis, and covers the material fairly well; I was impressed with the description of what a partial autocorrelation function (PACF) is, as the book explained it more intuitively than the lecture notes did. I did find the description of how to actually solve for the PACF a bit confusing, so I wrote my own explanation.
Partial Autocorrelation Functions
What are PACFs, and why would one want to use one? As explained in TSA, the PACF is useful as it provides an analog to the autocorrelation function, or ACF, but for autoregressive processes. The ACF is particularly useful as for an \(MA(q)\), the autocorrelation function \(\gamma(m)\) has the nice property that
\[\begin{align*} \gamma(m) = 0 \text{ for } m > q. \end{align*}\]Consequently, by plotting the ACF (as can be done easily in R), we can detect the order of the \(MA(q)\) process.
The property fails for the ACF of an \(AR(p)\) process. However, the PACF is here to step in and save the day. With the PACF defined as
\[\begin{align*} \phi_{mm} := \alpha^{\star}_{m, m}, \end{align*}\]where the \(\alpha^{\star}_{j, k}\) are defined as
\[\begin{align*} \alpha_{1, m}, \cdots, \alpha_{m, m} = \text{argmin} E(X_{t} - \alpha_{1, m} X_{t-1} - \cdots - \alpha_{m, m} X_{t-m})^2. \end{align*}\]Then, the PACF exhibits the property that for an \(AR(p)\) process, \(\phi_{pp} = \phi_{p}\), and \(\phi_{mm} = 0\) for \(m > p\); consequently, by calculating the PACF of a process, we can easily detect the order of it if it is autoregressive.
Example 1
Suppose we have the process
\[\begin{align*} X_{t} = \phi_1 X_{t-1} + \phi_2 X_{t-2} + w_t, \end{align*}\]where \(w_t\) is a sequence of uncorrelated variables with zero mean and constant variance. What is the PACF for this process? As the AR polynomial \(\phi(B)\) has no roots with \(|B| \leq 1,\) \(X_{t}\) is a weakly stationary process; consequently, we know that \(\phi_{22} = \phi_2, \phi_{mm} = 0\) for \(m > p\). Consequently, we only need to figure out \(\phi_{11}\). To find it, we must solve
\[\begin{align*} \text{argmin} E(X_{t} - \phi_{11} X_{t-1})^2\\ \end{align*}\]To do so, we take the derivative with respect to \(\phi_{11}\) and set it equal to zero:
\[\begin{align*} &E[-2X_{t-1}(X_{t} - \phi_{11} X_{t-1})] = 0 \\ \iff &-2 \gamma(1) + 2 \phi_{11} \gamma(0) = 0 \\ \iff & \phi_{11} = \rho(1) \end{align*}\]Now, we need to solve for \(\rho\) in terms of \(\phi_{1}, \phi_{2}\). To do this, we exploit the Yule-Walker equations:
\[\begin{align*} \gamma(1) - \phi_{1} \gamma(0) - \phi_{2} \gamma(1) &= 0\\ \rho(1) &= \phi_{1} + \phi_{2} \rho(1) \\ \longrightarrow \phi_{11} = \rho(1) &= \frac{ \phi_{1} }{ 1 - \phi_{2} } \end{align*}\]


Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
Ajax applications sometimes fail to meet user's expectations because they do not interact with the browser in the same way as static web pages. This is often apparent — and frustrating for users — when an Ajax application does not integrate with browser history. For example, users expect browsers to be able to navigate back to previous pages visited using back and forward actions. Because an Ajax application is a usually single page running JavaScript logic and not a series of pages, the browser history needs help from the application to support this use case. Thankfully, GWT's history mechanism makes history support fairly straightforward.
GWT's History mechanism has a lot in common with other Ajax history implementations, such as RSH (Really Simple History). The basic premise is to keep track of the application's "internal state" in the url fragment identifier. This works because updating the fragment doesn't typically cause the page to be reloaded.
This approach has several benefits:
GWT includes a mechanism to help Ajax developers activate browser history. For each page that is to be navigable in the history, the application should generate a unique history token. A token is simply a string that the application can parse to return to a particular state. This token will be saved in browser history as a URL fragment (in the location bar, after the "#"), and this fragment is passed back to the application when the user goes back or forward in history, or follows a link.
For example, a history token named "page1" would be added to a URL as follows:
http://www.example.com/com.example.gwt.HistoryExample/HistoryExample.html#page1
When the application wants to push a placeholder onto the browser's history stack, it simply invokes History.newItem(token). When the user uses the back button, a call will be made to any object that was added as a handler with History.addValueChangeHandler(). It is up to the application to restore the state according to the value of the new token.
To use GWT History support, you must first embed an iframe into your host HTML page.

Then, in your GWT application, perform the following steps:
The following short example shows how to add a history event each time the user selects a new tab in a TabPanel.
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.event.logical.shared.SelectionEvent; import com.google.gwt.event.logical.shared.SelectionHandler; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.History; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.TabPanel; /** * Entry point classes define onModuleLoad(). */ public class BrowserHistoryExample implements EntryPoint { TabPanel tabPanel; /** * This is the entry point method. */ public void onModuleLoad() { tabPanel = new TabPanel(); tabPanel.add(new HTML("
Page 0 Content: Llamas
"), " Page 0 "); tabPanel.add(new HTML("
Page 1 Content: Alpacas
"), " Page 1 "); tabPanel.add(new HTML("
Page 2 Content: Camels
"), " Page 2 "); tabPanel.addSelectionHandler(new SelectionHandler<Integer>(){ public void onSelection(SelectionEvent<Integer> event) { // TODO Auto-generated method stub History.newItem("page" + event.getSelectedItem()); }}); History.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> event) { String historyToken = event.getValue(); // Parse the history token try { if (historyToken.substring(0, 4).equals("page")) { String tabIndexToken = historyToken.substring(4, 5); int tabIndex = Integer.parseInt(tabIndexToken); // Select the specified tab panel tabPanel.selectTab(tabIndex); } else { tabPanel.selectTab(0); } } catch (IndexOutOfBoundsException e) { tabPanel.selectTab(0); } } }); tabPanel.selectTab(0); RootPanel.get().add(tabPanel); } }
Hyperlinks are convenient to use to incorporate history support into an application. Hyperlink widgets are GWT widgets that look like regular HTML anchors. You can associate a history token with the Hyperlink, and when it is clicked, the history token is automatically added to the browser's history stack. The History.newItem(token) step is done automatically.
Special care must be taken in handling history for applications that store state. Enough information must be coded into the history token to restore the application state back to the point at which the history token was set. The application must also be careful to clear away any state not relevant to navigating back to a previously visited page.
As an example, an application that presents a multi-page questionnaire could encode the page number as a token as well as some other states. When a new page in the questionnaire is presented, a history token is added to the history stack. Note that with stateful applications, such as a questionnaire, some careful thought needs to be given to implementing the history callback. When returning to a page using a token, some logic needs to restore the previous state.
| Token | Action |
| "info" | Navigate to page where user enters biographic info. Restore previously entered data |
| "page1" | Navigate to page 1 in the questionnaire. Restore previous answers. |
| "page2" | Navigate to page 2 in the questionnaire. Restore previous answers. |
"page"
<n>
|
Navigate to page
<n>
... |
| "end" | Navigate to the end of the questionnaire. Validate that all questions were answered. Make sure not to re-submit the questionnaire. |
In the above case, navigating back to a page would be possible, but there isn't enough information in the history token to restore the user's previous answers. A better encoding for the token would be a syntax such as:
page=<pagename>;session=<sessionname>
Where <pagename> tells the application which page to go to and <sessionname> is a key to finding the user's previously entered data in a database.
The first step of handling the onValueChange() callback method in a ValueChangeHandler is to get the new history token with ValueChangeEvent.getValue(); you'll then want to parse the token. Keep in mind that your parsing needs to be robust! A user may type a URL by hand or have a URL stored from an old version of your application. Once the token is parsed, you can reset the state of the application.
When the onValueChange() method is invoked, your application must handle two cases:
In the first case, the application must properly initialize itself before handing the state token. In the second case, some parts of the application may need to be re-initialized.


Suspected Islamic State member returned to Germany along with three children
The woman is the first adult female to have officially been repatriated to Germany.
by AFPA WOMAN BELIEVED to have been a member of Islamic State (IS) and her three children have arrived back in her home country Germany.
The woman is the first adult female member of the group to have been returned through official channels to Germany from Syria.
Named only as Laura H, the 30-year-old from the state of Hesse arrived at Frankfurt airport late Saturday on a flight from Erbil in Iraq.
While she was not immediately arrested on arrival, Laura H remains the subject of an investigation on suspicion of membership of a terrorist organisation as well as failure to properly care for her children, Der Spiegel reported, citing security sources.
Her passport has also been confiscated and she has been banned from leaving the country, while her children are being entrusted to a close relative.
According to the magazine, the woman travelled from Giessen in central Germany to Syria in 2016 with her two children and her husband, a Somalia-born US citizen, before she joined IS.
She had already been linked to Salafist [Islamic fundamentalist] circles in Germany and allegedly posted an online call for aid donations for Syria that went to a fundamentalist group.
Following her husband’s reported killing and her own capture by Kurdish security forces, Laura H claims to have turned away from IS ideology.
A US aid organisation helped bring her to Erbil from the Al-Hol prison camp in northeastern Syria, according to Der Spiegel.
Kurdish authorities have repeatedly urged Western countries to repatriate their nationals linked to IS, but they have been largely reluctant to do so.
A Turkish invasion of northern Syria last month sparked concern of a mass breakout from Kurdish-held jails and camps.
Germany had already brought home a handful of orphans, but no adults until yesterday.
Irish woman Lisa Smith, who was married to an Islamic State fighter and lived in Syria until Turkey’s recent incursion into the country, is expected to be repatriated to Ireland.
A former member of the Irish Defence Forces, she was captured by Kurdish forces in northeast Syria after Islamic State fighters lost control of their final stronghold.
The 38-year-old was being held with her two-year old daughter in the Al-Hawl displacement camp for the wives and children of Islamic State fighters.
Members of the Irish Defence Forces had been dispatched to the border area between Syria and Turkey to bring Smith and her child home, and it looks likely she will return to Ireland in coming weeks.
Austria, Belgium, Britain and France have also repatriated some orphaned children, while the United States has repatriated several women and their children.
- © AFP 2019 with additional reporting from Michelle Hennessy.


As a UX Designer for Resonate.ai, I helped define an experience of how machine learning and A.I. can aid users sound more trustworthy and confident
problem synthesis
As a team, we interviewed the client and summarized a starting M.V.P for the product as:
Excerpts from interview with Dhaval Bhatt, CEO of Resonate.ai:
problem synthesis
Usability testing on existing product led us to remove non measurable tones like "joy", "anticipation", and "popularity" from the existing product classifiers. We summarized the outcomes:
Screenshot of existing product:
problem synthesis
We presented a product vision and strategy based on what the layers are of telling an effective story
Product vision strategy:
solution discovery
As part of the final delivery, we made a video of the mockup of the product vision for resonate.ai for financial marketers
Video of product mockup:
solution discovery
We started with interactive paper prototypes to mimic product features which was used to identify and prioritize necessary features. It also led to further research on identifying classifiers.
Photograph of paper prototype:
solution discovery
We reiterated designs through low-fidelity clickable slides-based rapid prototypes for different personas to gather feedback and effectively communicate functional design details to the client.
Screenshots of slides from rapid prototyping presentation:
solution discovery
We make mockups
Mockup of web application with score detail:
solution discovery
We made more mockups
Mockup of inline email-based tone editor:
process
We studied inline suggesters and document composers:
Learning from existing products:
process
We identified personas in Financial Startup Markets, and used these personas in prototypes to deliberate on features:
Personas representing Financial Startups:
process
I generated a 'feature and user flow' map for developers to easily understand the complete product flows and scope the development efforts requried in engineering the product.
Detailed User and Structural Flow Map:
process
We Synthesized the complete research and ideas into a phase-wise product roadmap. This included creation of an clear vision and feature plan for an Enterprise version for the startup product:
Product Roadmap:


Play around with LinguaRecorder's features.
| Event name | Count |
|---|---|
| ready | 0 |
| readyFail | 0 |
| started | 0 |
| recording | 0 |
| listening | 0 |
| saturated | 0 |
| paused | 0 |
| stoped | 0 |
| canceled | 0 |


Corsica
Corsica, is an island in the Mediterranean Sea and one of the 18 regions of France. It is located southeast of the French mainland and west of the Italian Peninsula, with the nearest land mass being the Italian island of Sardinia to the immediate south. A single chain of mountains makes up two-thirds of the island.
While being part of Metropolitan France, Corsica is also designated as a territorial collectivity (collectivité territoriale) by law. As a territorial collectivity, Corsica enjoys a greater degree of autonomy than other French regions; for example, the Corsican Assembly is able to exercise limited executive powers.
The island formed a single department until it was split in 1975 into two historical departments: Haute-Corse (Upper Corsica) and Corse-du-Sud (Southern Corsica), with its regional capital in Ajaccio, the prefecture city of Corse-du-Sud. Bastia, the prefecture city of Haute-Corse, is the second largest settlement in Corsica.
After being ruled by the Republic of Genoa since 1284, Corsica was briefly an independent Corsican Republic from 1755 until it was officially ceded by the Republic of Genoa to Louis XV as part of a pledge for debts in 1768. Due to Corsica's historical ties with the Italian peninsula, the island retains to this day many Italian cultural elements: the native tongue is recognised as a regional language by the French government. Corsica was ruled by various powers over the course of its history, but had several brief periods of self-government.
Napoleon was born in 1769 in the Corsican capital of Ajaccio. His ancestral home, Maison Bonaparte, is today used as a museum.
In Wikipedia. Retrieved January 24, 2018, from https://en.wikipedia.org/wiki/Corsica


continue
statements with labels.
Labeled continue
statements complicate refactoring and can be confusing.
Example:
void handle(List<String> strs) {
outer:
for (String s: strs) {
for (char ch : s.toCharArray()) {
if ('s' == ch) continue outer;
handleChar(ch);
}
}
}


Chapter 1 Introducing deep learning and the PyTroch library
Chapter 2 It starts with a tensor
Chapter 3 Real-world data representation with tensors
Chapter 4 The mechanics of learning
Chapter 5 Using a nueral network to fit your data
Chapter 2 It starts with a tensor
- 텐서, 파이토치의 기본 자료 구조
- Indexing and operating on PyTorch tensors to explore and manpulate data
- Interoperating with NumPy multidimensional arrays
- 속도를 위해 연산을 GPU로 이동
<소개글>
### *2.1 Tensors fundamentals*
A tensor is an array—that is, a data structure storing collection of numbers that are accessible individually by means of an index and that can be indexed with multiple indices.
파이썬 list indexing
- Numbers in Python are full-fledged objects?
- Lists in Python are meant for sequential collections of objects?
- The Python interpreter is slow compared with optimzed, compiled code?
- For these reasons, data science libraries rely on NumPy or introduce dedicated data structures such as PyTorch tensors
```python
# In[1]:
a = [1.0, 2.0, 1.0]
# In[2]:
a[0]
# Out[2]:
1.0
# In[3]:
a[2] = 3.0
a
# Out[3]:
[1.0, 2.0, 3.0]
```
파이토치 tensor indexing
```python
# In[4]:
import torch
a = torch.ones(3)
a
# Out[4]:
tensor([1., 1., 1.])
# In[5]:
a[1]
# Out[5]:
tensor(1.)
# In[6]:
float(a[1])
# Out[6]:
1.0
# In[7]:
a[2] = 2.0
a
# Out[7]:
tensor([1., 1., 2.])
```
겉으로는 파이썬 리스트와 파이토치 텐서와 다르지 않아보이지만, 실제로 뜯어보면 완전히 다름.
- 파이썬 리스트나 숫자들의 튜플 형태는 메모리에 개별적으로 할당된 파이썬 객체들의 집합 (boxed)
- 파이토치 텐서나 넘파이 어레이 형태는 contiguous memory blocks containing unboxed C numeric types, not Python objects임. In this case, 32 bits (4 bytes) float, as you see on the right side of figure 2.3. So a 1D tensor of 1 million float numbers requires 4 million contiguous bytes to be stored, plus a small overhead for the metadata (dimensions, numeric type, and so on).
coordinate - 1d tensor
```python
points = torch.zeros(6)
points[0] = 1.0
points[0] = 1.0
points[0] = 1.0
points[0] = 1.0
points[0] = 1.0
points[0] = 1.0
```
```python
points = torch.tensor([1.0, 4.0, 2.0, 1.0, 3.0, 5.0])
```
````
float(points[0]), float(points[1])
(1.0, 4.0)
````
upgrade ver. using 2d tensor
- by passing a list of lists to the constructor
```python
points = torch.tensor([[1.0, 4.0], [2.0, 1.0], [3.0, 5.0]])
points
tensor([[1., 4.],
[2., 1.],
[3., 5.]])
---
points.shape
torch.Size([3, 2])
---
points = torch.zeros(3, 2)
points
tensor([0., 0.],
[0., 0.],
[0., 0.])
---
points = torch.FloatTensor([[1.0, 4.0], [2.0, 1.0], [3.0, 5.0]])
points
tensor([[1., 4.],
[2., 1.],
[3., 5.]])
points[0, 1] # returns the y coordinate of the 0th point in your data set
# 0-based index, 처음자리는 데이터 갯수, 두번째는 x/y값인지 구분
tensor(4.)
---
points[0]
tensor([1., 4.])
```
Note that what you get as the output is *another tensor*, but a 1D tensor of size 2 contain- ing the values in the first row of the points tensor. Does this output mean that a new chunk of memory was allocated, values were copied into it, and the new memory was returned wrapped in a new tensor object? No, because that process would be ineffi- cient, especially if you had millions of points. What you got back instead was a differ- ent *view* of the same underlying data, limited to the first row.
### *2.2 Tensors and storages*
storages라는 객체가 있는데 tensor는 이러한 형태로 저장됨
### 2.3 *Size, storage offset, and strides*
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
```javascript
const Razorpay = require('razorpay');
let rzp = Razorpay({
key_id: 'KEY_ID',
secret: 'name'
});
// capture request
rzp.capture(payment_id, cost)
.then(function (data) {
return 2;
})
```
Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].
[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/
소개글>


Select with default bordering
This example shows select default implementaion
Select with noborder
This example shows select with no border type
Select with split border
This example shows select with a split border Type
Select with Icon
This example shows select with Icon


Naive Bayes Classifier in JavaScript
The Naive Bayes classifier is a pretty popular text classification algorithm because of it's simplicity. You'll often see this classifier used for spam detection, authorship attribution, gender authentication, determing whether a review is positive or negative, and even sentiment analysis. The Naive Bayes classifier takes in a corpus (body of text) known as a document, which then a stemmer runs through the document and returns a "bag or words" so to speak. Stemming is the process of reducing an inflected word to it's word stem (root). For example, the stem of the words "dreaming", "dreamer", and "dreamed", is just "dream".
In the code example below, I am using the Porter Stemming algorithm and the Bayes classifier algorithm implementations from the excellent general natural language facility library for node, natural by Chris Umbel.
The way Naive Bayes classifier works is it counts the frequencies of the stemmed words. These are called features. A class can contain many features. A document can contain many features of a class. Initial we must train the classifier to learn what class features belong to. Once the classifier has enough knowledge of classed features, we can asked it to classify a new document based on prior classifications. The algorithm is considered naive because it does not take account of where in the document the words are positioned. But it turns out that that algorithm does a pretty good job of classification even though it is not aware of context.
Algorithm
What is the probability of the class given the document?
P(c|d) = P(c)P(d|c)
Probability of the class given the document is equal to the probability of the class times the probability of the document given the class
The denominator can be dropped because it is a constant. For example, if we have one document and 10 classes and only one class can classify document, the probability of the document is the same.
/**
* Terminology
*
* label: refers to class as in classification, since `class` is a reserved word.
* doc: refers to document, since `document` is a reserved word.
* feature: a token (word) in the bag of words (document).
*/
/**
* Include Porter Stemmer algorithm
* https://github.com/miguelmota/bayes-classifier/blob/master/lib/stemmers/porter.js
*/
var stemmer = require('./porter-stemmer');
/**
* BayesClassifier
* @desc Bayes classifier constructor
* @constructor
* @return Bayes classifier instance
*/
function BayesClassifier() {
/*
* Create a new instance when not using the `new` keyword.
*/
if (!(this instanceof BayesClassifier)) {
return new BayesClassifier();
}
/*
* The stemmer provides tokenization methods.
* It breaks the doc into words (tokens) and takes the
* stem of each word. A stem is a form to which affixes
* can be attached, aka root word.
*/
this.stemmer = stemmer;
/*
* A collection of added documents
* Each document is an object containing the class, and array of stemmed words.
*/
this.docs = [];
/*
* Index of last added document.
*/
this.lastAdded = 0;
/*
* A map of all class features.
*/
this.features = {};
/*
* A map containing each class and associated features.
* Each class has a map containing a feature index and the count of feature appearances for that class.
*/
this.classFeatures = {};
/*
* Keep track of how many features in each class.
*/
this.classTotals = {};
/*
* Number of examples trained
*/
this.totalExamples = 1;
/* Additive smoothing to eliminate zeros when summing features,
* in cases where no features are found in the document.
* Used as a fail-safe to always return a class.
* http://en.wikipedia.org/wiki/Additive_smoothing
*/
this.smoothing = 1;
}
/**
* AddDocument
* @param {array|string} doc - document
* @param {string} label - class
* @return {object} - Bayes classifier instance
*/
BayesClassifier.prototype.addDocument = function(doc, label) {
if (!this._size(doc)) {
return;
}
if (this._isString(doc)) {
// Return array of stemmed words
doc = this.stemmer.tokenizeAndStem(doc);
}
var docObj = {
label: label,
value: doc
};
this.docs.push(docObj);
// Add token (feature) to features map
for (var i = 0; i < doc.length; i++) {
this.features[doc[i]] = 1;
}
};
/**
* AddDocuments
* @param {array} docs - documents
* @param {string} label - class
* @return {object} - Bayes classifier instance
*/
BayesClassifier.prototype.addDocuments = function(docs, label) {
for (var i = 0; i < docs.length; i++) {
this.addDocument(docs[i], label);
}
};
/**
* docToFeatures
*
* @desc
* Returns an array with 1's or 0 for each feature in document
* A 1 if feature is in document
* A 0 if feature is not in document
*
* @param {string|array} doc - document
* @return {array} features
*/
BayesClassifier.prototype.docToFeatures = function(doc) {
var features = [];
if (this._isString(doc)) {
doc = this.stemmer.tokenizeAndStem(doc);
}
for (var feature in this.features) {
features.push(Number(!!~doc.indexOf(feature)));
}
return features;
};
/**
* classify
* @desc Returns class with highest probability for document.
* @param {string} doc - document
* @return {string} class
*/
BayesClassifier.prototype.classify = function(doc) {
var classifications = this.getClassifications(doc);
if (!this._size(classifications)) {
throw 'Not trained';
}
return classifications[0].label;
};
/**
* train
* @desc train the classifier on the added documents.
* @return {object} - Bayes classifier instance
*/
BayesClassifier.prototype.train = function() {
var totalDocs = this.docs.length;
for (var i = this.lastAdded; i < totalDocs; i++) {
var features = this.docToFeatures(this.docs[i].value);
this.addExample(features, this.docs[i].label);
this.lastAdded++;
}
};
/**
* addExample
* @desc Increment the counter of each feature for each class.
* @param {array} docFeatures
* @param {string} label - class
* @return {object} - Bayes classifier instance
*/
BayesClassifier.prototype.addExample = function(docFeatures, label) {
if (!this.classFeatures[label]) {
this.classFeatures[label] = {};
this.classTotals[label] = 1;
}
this.totalExamples++;
if (this._isArray(docFeatures)) {
var i = docFeatures.length;
this.classTotals[label]++;
while(i--) {
if (docFeatures[i]) {
if (this.classFeatures[label][i]) {
this.classFeatures[label][i]++;
} else {
this.classFeatures[label][i] = 1 + this.smoothing;
}
}
}
} else {
for (var key in docFeatures) {
value = docFeatures[key];
if (this.classFeatures[label][value]) {
this.classFeatures[label][value]++;
} else {
this.classFeatures[label][value] = 1 + this.smoothing;
}
}
}
};
/**
* probabilityOfClass
* @param {array|string} docFeatures - document features
* @param {string} label - class
* @return probability;
* @desc
* calculate the probability of class for the document.
*
* Algorithm source
* http://en.wikipedia.org/wiki/Naive_Bayes_classifier
*
* P(c|d) = P(c)P(d|c)
* ---------
* P(d)
*
* P = probability
* c = class
* d = document
*
* P(c|d) = Likelyhood(class given the document)
* P(d|c) = Likelyhood(document given the classes).
* same as P(x1,x2,...,xn|c) - document `d` represented as features `x1,x2,...xn`
* P(c) = Likelyhood(class)
* P(d) = Likelyhood(document)
*
* rewritten in plain english:
*
* posterior = prior x likelyhood
* ------------------
* evidence
*
* The denominator can be dropped because it is a constant. For example,
* if we have one document and 10 classes and only one class can classify
* document, the probability of the document is the same.
*
* The final equation looks like this:
* P(c|d) = P(c)P(d|c)
*/
BayesClassifier.prototype.probabilityOfClass = function(docFeatures, label) {
var count = 0;
var prob = 0;
if (this._isArray(docFeatures)) {
var i = docFeatures.length;
// Iterate though each feature in document.
while(i--) {
// Proceed if feature collection.
if (docFeatures[i]) {
/*
* The number of occurances of the document feature in class.
*/
count = this.classFeatures[label][i] || this.smoothing;
/* This is the `P(d|c)` part of the model.
* How often the class occurs. We simply count the relative
* feature frequencies in the corpus (document body).
*
* We divide the count by the total number of features for the class,
* and add it to the probability total.
* We're using Natural Logarithm here to prevent Arithmetic Underflow
* http://en.wikipedia.org/wiki/Arithmetic_underflow
*/
prob += Math.log(count / this.classTotals[label]);
}
}
} else {
for (var key in docFeatures) {
count = this.classFeatures[label][docFeatures[key]] || this.smoothing;
prob += Math.log(count / this.classTotals[label]);
}
}
/*
* This is the `P(c)` part of the model.
*
* Divide the the total number of features in class by total number of all features.
*/
var featureRatio = (this.classTotals[label] / this.totalExamples);
/**
* probability of class given document = P(d|c)P(c)
*/
prob = featureRatio * Math.exp(prob);
return prob;
};
/**
* getClassifications
* @desc Return array of document classes their probability values.
* @param {string} doc - document
* @return classification ordered by highest probability.
*/
BayesClassifier.prototype.getClassifications = function(doc) {
var classifier = this;
var labels = [];
for (var className in this.classFeatures) {
labels.push({
label: className,
value: classifier.probabilityOfClass(this.docToFeatures(doc), className)
});
}
return labels.sort(function(x, y) {
return y.value - x.value;
});
};
/*
* Helper utils
*/
BayesClassifier.prototype._isString = function(s) {
return typeof(s) === 'string' || s instanceof String;
};
BayesClassifier.prototype._isArray = function(s) {
return Array.isArray(s);
};
BayesClassifier.prototype._isObject = function(s) {
return typeof(s) === 'object' || s instanceof Object;
};
BayesClassifier.prototype._size = function(s) {
if (this._isArray(s) || this._isString(s) || this._isObject(s)) {
return s.length;
}
return 0;
};
/*
* Export constructor
*/
module.exports = BayesClassifier;
Usage
Now we get to use the Bayes classifier. Here's an example to classify a statement as either positive or negative. The algorithm must first learn from a training set of data.
var BayesClassifier = require('../bayes-classifier');
var classifier = new BayesClassifier();
var positiveDocuments = [
'I love tacos.',
'Dude, that burrito was epic!',
'Holy cow, these nachos are so good and tasty.',
'I am drooling over the awesome bean and cheese quesadillas.'
];
var negativeDocuments = [
'Gross, worst taco ever.',
'The buritos gave me horrible diarrhea.',
'I\'m going to puke if I eat another bad nacho.',
'I\'d rather die than eat those nasty enchiladas.'
];
classifier.addDocuments(positiveDocuments, 'positive');
classifier.addDocuments(negativeDocuments, 'negative');
classifier.train();
console.log(classifier.classify('I heard the mexican restaurant is great!')); // "positive"
console.log(classifier.classify('I don\'t want to eat there again.')); // "negative"
console.log(classifier.classify('The torta is epicly bad.')); // "negative"
console.log(classifier.classify('The torta is horribly awesome.')); // "positive"
Conclusion
Hopefully the code was easy to follow. The full code is available on github as a node module. Definitely checkout the natural library for more text classification algorithms. The library contains many general natural language facilities, such as tokenization, stemming, classification, phonetics, tf-idf, WordNet, and string similarity.


Two global-value-chain decompositions are implemented. Firstly, the Wang-Wei-Zhu (Wang, Wei, and Zhu, 2013) algorithm splits bilateral gross exports into 16 value-added components. Secondly, the Leontief decomposition (default) derives the value added origin of exports by country and industry, which is also based on Wang, Wei, and Zhu (Wang, Z., S.-J. Wei, and K. Zhu. 2013. "Quantifying International Production Sharing at the Bilateral and Sector Levels.").
| Version: | 4.5.0 |
| Depends: | R (≥ 2.10) |
| Suggests: | gvc, testthat, knitr |
| Published: | 2016-08-17 |
| Author: | Bastiaan Quast [aut, cre], Fei Wang [aut], Victor Kummritz [aut], Oliver Reiter [ctb] |
| Maintainer: | Bastiaan Quast <bquast at gmail.com> |
| BugReports: | https://github.com/bquast/decompr/issues |
| License: | GPL-3 |
| URL: | http://qua.st/decompr, https://github.com/bquast/decompr |
| NeedsCompilation: | no |
| Citation: | decompr citation info |
| Materials: | README NEWS |
| In views: | Econometrics |
| CRAN checks: | decompr results |
| Reference manual: | decompr.pdf |
| Vignettes: |
decompr |
| Package source: | decompr_4.5.0.tar.gz |
| Windows binaries: | r-devel: decompr_4.5.0.zip, r-release: decompr_4.5.0.zip, r-oldrel: decompr_4.5.0.zip |
| OS X binaries: | r-release: decompr_4.5.0.tgz, r-oldrel: decompr_4.5.0.tgz |
| Old sources: | decompr archive |
| Reverse imports: | gvc, wiod |
Please use the canonical form https://CRAN.R-project.org/package=decompr to link to this page.


Click here to download this week's dataset as a CSV
Click here to download this week's dataset as a Hyper Extract
Data Storytelling and Data Viz Approach
I really enjoyed this dataset, and probably went a bit overboard. I've always found the hurricane track maps, and especially the forecast models to be very interesting. The cone of probability and multiple spaghetti models with their underlying algorithms and forecasts make for an engaging, albeit busy, visualization. Here, we're only looking at the historical tracks and details of past storms, but the visuals can still be quite stunning.
It shouldn't be a surprise that I've incorporated maps into this visualization. I wanted to include the typical storm tracks map, but also wanted to answer some questions I had when looking through the dataset - where do most storms originate, and where do most storms make landfall? We'll talk about the storm origin first - or maybe it's better to call it the first observation locations. This was relatively easy to accomplish. I used the latitude and longitude columns, and plotted only the details for the first observation.
Courtesy of satellites and other technology, in recent years, the first observation is most likely the origin of the storm. However in the older data, the first observation truly is the first time that the developing storm system was chanced upon by humans. By choosing different years across the decades (and maybe zooming out a bit), you can see that more recently, we detect storms as they develop off the coast of Africa. In the late 1800's, most of the first observations are much closer to North and Central America.
I also thought it would be interesting to see where storms made landfall. Once again, this was pretty easy to accomplish by plotting points on the map and filtering for an Event Type of 'L' for landfall. On both of these maps, I filtered the values down to the decade, using color and size to highlight the data tied to the selected year, but still showing the relationship between the storms in the selected year and the others in the decade. I used a parameter as a sheet selector (in conjunction with some filters) to allow the user to choose which map type they want to view.
To drive some additional interactivity with the maps, I added a very small viz with a listing of all of the storms for the selected year. When the user clicks on a storm name, it highlights the pertinent data on the chosen map. Framing the maps, I used a set of BANS to show the number of storms for the chosen year by the maximum storm type. To do this, I created a set of calculated fields to work through a hierarchy of the storm types to count the storm at its strongest - the maximum type for that storm. Completing the frame, I used simple bar graph to show the relation between the total number of storms by year for the selected year and the rest of the decade.
I created several calculated fields, mostly to deal with converting the data that was in the original dataset into more meaningful data elements - extracting dates, accounting for '999' where observations didn't exist, determining the hurricane categories, etc. Overall, this viz was a lot of fun to create!
This definitely is not the first time that hurricane data has been visualized in Tableau, but we're curious what new insights or visualizations you can find and create with this dataset. Take some time to post your work to Tableau Public and Twitter with the hashtag #ThrowbackThursday, tagging @TThrowbackThurs. We'd really love to see what you can come up with!
Data Source
This week's dataset comes from the National Hurricane Center. Check out the Data Dictionary for column definitions! Please be sure to cite the source on your viz.


{% extends "layout.html" %} {% block body %} Hello {{ full_name }}, Thanks for contacting us! We will get back to you very soon! {% endblock %}


swingUtilities Supporting tagline
Java GUI编程SwingUtilities.invokeLater作用.
EventDispatchThread
Event-dispatching thread
All events are processed by the listeners that receive them within the event-dispatching thread (an instance of java.awt.EventDispatchThread).
All painting and component layout is expected to occur within this thread as well.
The event-dispatching thread is of primary importance to Swing and AWT, and plays a key role in keeping updates to component state and display in an app under control.
Associated with this thread is a FIFO queue of events – the system event queue (an instance of java.awt.EventQueue).
This gets filled up, as any FIFO queue, in a serial fashion.
Each request takes its turn executing event handling code, whether this be updating component properties, layout, or repainting.
All events are processed serially to avoid such situations as a component’s state being modified in the middle of a repaint.
Knowing this, we must be careful not to dispatch events outside of the event-dispatching thread.
For instance, calling a fireXX() method directly from a separate thread of execution is unsafe.
We must also be sure that event handling code, and painting code can be executed quickly.
Otherwise the whole system event queue will be blocked waiting for one event process, repaint, or layout to occur, and our application will appear frozen or locked up.


#include <re.h>
Data Fields | |
| struct re_registers | regs |
| int | char_offset_updated |
| int | char_offset_num_allocated |
| struct rmatch_offset * | char_offset |
Definition at line 38 of file re.h.
struct rmatch_offset* rmatch::char_offset [read] |
Definition at line 43 of file re.h.
Referenced by match_init_copy(), obj_free(), and update_char_offset().
Definition at line 42 of file re.h.
Referenced by match_init_copy(), memsize_of(), and update_char_offset().
Definition at line 41 of file re.h.
Referenced by match_init_copy(), and update_char_offset().
struct re_registers rmatch::regs [read] |
Definition at line 39 of file re.h.
Referenced by match_init_copy(), obj_free(), and update_char_offset().


-
For standalone variables, a valid placeholder is both
\${var:varname}
and\${varname}
-
Within complex expressions, the
var:
prefix is mandatory:\${str:join(',', var:first, var:second, var:third}
-
To escape a text expression, prefix it with a backslash:
\\${var:varname}
The text variable delegate is invoked with an instance of SageContext
, containing all the necessary context information about the current project, request etc; and variableName
, the name of the variable that was matched - this enables reusing the same function for multiple variables. The string that this function returns is the value that will be used to replace the variable placeholder with.
To enable Sage to discover the designated text variable delegate, it needs to be decorated by the TextVariable
attribute. The TextVariableAttribute
constructor takes a variable number of string arguments, each specifying the name of one variable for which this method is being registered. In the following example, the GetContextVariable
method is registered to handle assetpath
, sharedassetpath
and modulepath
variables.
NOTE: The designated method must be static in order to be used.
The following table lists all text variables provided by Sage out of the box. Hover above variable names to reveal their values in the current application.
\${assetpath} |
Inserts the fully resolved, web-relative value of the asset path configuration property. |
|---|---|
\${sharedassetpath} |
Inserts the fully resolved, web-relative value of the shared asset path configuration property. |
\${modulepath} |
Inserts the fully resolved, web-relative value of the module path configuration property. |
\${basehref} |
Inserts the fully qualified URL of the current web application. For example: http//sage.cycle99.com
|
\${locale} |
Inserts the name of the current locale. |
\${category} |
Inserts the name of the current category. |


the and with for The protease from are protein SARS–CoV- structure {background spike viral docking margin {border-style antiviral px;} that #ffffff;} drugs (DB), against molecular residues virus binding different was []. coronavirus its (Figure SARS–CoV proteins this HIV shown which inhibitors very were Figure RNA results two HCV SARS Structural between domain envelope main model other representation shows site structures three C-like Coronavirus Enfuvirtide RdRp also available more new novel px; structural used {font-family (PDB (a) (b) ... ID: active colored complex drug font-size hydrophobic obtained protein. several than therapy COVID- Protein SARS-CoV- Simeprevir best crystallographic double; inhibitor nucleocapsid our panel respiratory similarity some trimeric (ID: Med. Pleconaril SARS–CoV-. Table These Umifenovir Vina border-color border-width can catalytic computational data first formed have homology into may membrane monomer patients performed potential region reported screening sequence share solid; their these {font-style {font-weight Molecular PDB RNA, RNA-dependent RNA-polymerase This [,]. about alignment already among analysis approach area around binding, bold chain combination comparison could courier; differences diffusion electrostatic em; energy high homolog host important involved like loop one online pocket pose pre-fusion present primary pt;} same scoring structure, surface target terms treatment viruses


Compare scRNA-seq data to bulk RNA-seq data.
clustify(input, ...) # S3 method for default clustify(input, ref_mat, metadata = NULL, cluster_col = NULL, query_genes = NULL, per_cell = FALSE, n_perm = 0, compute_method = "spearman", verbose = FALSE, lookuptable = NULL, rm0 = FALSE, obj_out = FALSE, rename_prefix = NULL, threshold = 0, ...) # S3 method for seurat clustify(input, ref_mat, cluster_col = NULL, query_genes = NULL, per_cell = FALSE, n_perm = 0, compute_method = "spearman", use_var_genes = TRUE, dr = "umap", seurat_out = TRUE, threshold = 0, verbose = FALSE, rm0 = FALSE, rename_prefix = NULL, ...) # S3 method for Seurat clustify(input, ref_mat, cluster_col = NULL, query_genes = NULL, per_cell = FALSE, n_perm = 0, compute_method = "spearman", use_var_genes = TRUE, dr = "umap", seurat_out = TRUE, threshold = 0, verbose = FALSE, rm0 = FALSE, rename_prefix = NULL, ...)
| input | single-cell expression matrix or Seurat object |
|---|---|
| ... | additional arguments to pass to compute_method function |
| ref_mat | reference expression matrix |
| metadata | cell cluster assignments, supplied as a vector or data.frame.
If data.frame is supplied then |
| cluster_col | column in metadata that contains cluster ids per cell. Will default to first column of metadata if not supplied. Not required if running correlation per cell. |
| query_genes | A vector of genes of interest to compare. If NULL, then common genes between the expr_mat and ref_mat will be used for comparision. |
| per_cell | if true run per cell, otherwise per cluster. |
| n_perm | number of permutations, set to 0 by default |
| compute_method | method(s) for computing similarity scores |
| verbose | whether to report certain variables chosen |
| lookuptable | if not supplied, will look in built-in table for object parsing |
| rm0 | consider 0 as missing data, recommended for per_cell |
| obj_out | whether to output object instead of cor matrix |
| rename_prefix | prefix to add to type and r column names |
| threshold | identity calling minimum correlation score threshold, only used when obj_out = T |
| use_var_genes | if providing a seurat object, use the variable genes (stored in<EMAIL_ADDRESS>as the query_genes. |
| dr | stored dimension reduction |
| seurat_out | output cor matrix or called seurat object |
| ref_mat | reference expression matrix |
| cluster_col | column in metadata that contains cluster ids per cell. Will default to first column of metadata if not supplied. Not required if running correlation per cell. |
| query_genes | A vector of genes of interest to compare. If NULL, then common genes between the expr_mat and ref_mat will be used for comparision. |
| per_cell | if true run per cell, otherwise per cluster. |
| n_perm | number of permutations, set to 0 by default |
| compute_method | method(s) for computing similarity scores |
| use_var_genes | if providing a seurat object, use the variable genes (stored in<EMAIL_ADDRESS>as the query_genes. |
| dr | stored dimension reduction |
| seurat_out | output cor matrix or called seurat object |
| threshold | identity calling minimum correlation score threshold |
| verbose | whether to report certain variables chosen |
| rm0 | consider 0 as missing data, recommended for per_cell |
| rename_prefix | prefix to add to type and r column names |
| ... | additional arguments to pass to compute_method function |
| ref_mat | reference expression matrix |
| cluster_col | column in metadata that contains cluster ids per cell. Will default to first column of metadata if not supplied. Not required if running correlation per cell. |
| query_genes | A vector of genes of interest to compare. If NULL, then common genes between the expr_mat and ref_mat will be used for comparision. |
| per_cell | if true run per cell, otherwise per cluster. |
| n_perm | number of permutations, set to 0 by default |
| compute_method | method(s) for computing similarity scores |
| use_var_genes | if providing a seurat object, use the variable genes (stored in<EMAIL_ADDRESS>as the query_genes. |
| dr | stored dimension reduction |
| seurat_out | output cor matrix or called seurat object |
| threshold | identity calling minimum correlation score threshold |
| verbose | whether to report certain variables chosen |
| rm0 | consider 0 as missing data, recommended for per_cell |
| rename_prefix | prefix to add to type and r column names |
| ... | additional arguments to pass to compute_method function |
matrix of correlation values, clusters from input as row names, cell types from ref_mat as column names
seurat2 object with type assigned in metadata, or matrix of correlation values, clusters from input as row names, cell types from ref_mat as column names
seurat3 object with type assigned in metadata, or matrix of correlation values, clusters from input as row names, cell types from ref_mat as column names
# Annotate a matrix and metadata clustify( input = pbmc_matrix_small, metadata = pbmc_meta, ref_mat = pbmc_bulk_matrix, query_genes = pbmc_vargenes, cluster_col = "classified", verbose = TRUE )#>#> primary human B cells rep 1 primary human myeloid DC rep 1 #> B 0.62161187 0.5134249 #> CD14+ Mono 0.38176061 0.6585926 #> CD8 T 0.43926595 0.4648890 #> DC 0.37326478 0.5726146 #> FCGR3A+ Mono 0.39707564 0.6828512 #> Memory CD4 T 0.47496679 0.4835943 #> Naive CD4 T 0.47847311 0.4753289 #> NK 0.41142231 0.4600473 #> Platelet 0.09448371 0.2607297 #> primary human monocytes rep 1 primary human neutrophils rep 1 #> B 0.4858326 0.4004996 #> CD14+ Mono 0.6932047 0.5548357 #> CD8 T 0.4396090 0.3759313 #> DC 0.5619668 0.3990601 #> FCGR3A+ Mono 0.6464808 0.5302247 #> Memory CD4 T 0.4637761 0.3883083 #> Naive CD4 T 0.4615861 0.3824808 #> NK 0.4339593 0.3824971 #> Platelet 0.2607125 0.2120760 #> primary human NK cells rep 1 primary human PBMC rep 1 #> B 0.4682206 0.4930223 #> CD14+ Mono 0.4380704 0.5716609 #> CD8 T 0.5988312 0.5230516 #> DC 0.4031306 0.4926074 #> FCGR3A+ Mono 0.4434886 0.5511974 #> Memory CD4 T 0.5500075 0.5277524 #> Naive CD4 T 0.5418622 0.5293089 #> NK 0.6443927 0.5141864 #> Platelet 0.1429789 0.2285756 #> primary human T cells rep 1 primary human B cells rep 2 #> B 0.4688555 0.6409642 #> CD14+ Mono 0.3525068 0.4081323 #> CD8 T 0.5533326 0.4529453 #> DC 0.3248138 0.4027535 #> FCGR3A+ Mono 0.3585348 0.4240105 #> Memory CD4 T 0.6017151 0.4884443 #> Naive CD4 T 0.6091448 0.4899223 #> NK 0.5180162 0.4274134 #> Platelet 0.0734803 0.1147430 #> primary human myeloid DC rep 2 primary human monocytes rep 2 #> B 0.5142264 0.4817698 #> CD14+ Mono 0.6585599 0.7061875 #> CD8 T 0.4657318 0.4380312 #> DC 0.5714870 0.5624386 #> FCGR3A+ Mono 0.6868239 0.6588797 #> Memory CD4 T 0.4841326 0.4637714 #> Naive CD4 T 0.4743983 0.4603821 #> NK 0.4652355 0.4398213 #> Platelet 0.2626675 0.2685089 #> primary human neutrophils rep 2 primary human NK cells rep 2 #> B 0.3882407 0.4719677 #> CD14+ Mono 0.5573050 0.4408221 #> CD8 T 0.3636086 0.6007341 #> DC 0.3955419 0.4074878 #> FCGR3A+ Mono 0.5322509 0.4450197 #> Memory CD4 T 0.3760267 0.5502540 #> Naive CD4 T 0.3692816 0.5415756 #> NK 0.3715250 0.6474230 #> Platelet 0.2165613 0.1468565 #> primary human PBMC rep 2 primary human T cells rep 2 #> B 0.5179320 0.48219201 #> CD14+ Mono 0.6026460 0.36879949 #> CD8 T 0.5235911 0.57153550 #> DC 0.5077886 0.33963841 #> FCGR3A+ Mono 0.5802021 0.37464917 #> Memory CD4 T 0.5471137 0.61932481 #> Naive CD4 T 0.5498952 0.62715073 #> NK 0.5070531 0.53661318 #> Platelet 0.2523581 0.08479795# Annotate using a different method res <- clustify( input = pbmc_matrix_small, metadata = pbmc_meta, ref_mat = pbmc_bulk_matrix, query_genes = pbmc_vargenes, cluster_col = "classified", compute_method = "cosine" ) # Annotate a Seurat object clustify( s_small, pbmc_bulk_matrix, cluster_col = "res.1", seurat_out = TRUE, per_cell = FALSE, dr = "tsne" )#>#> primary human B cells rep 1 primary human myeloid DC rep 1 #> 0 0.56495413 0.2905662 #> 1 0.38339099 0.6645159 #> 2 0.01569994 0.3132044 #> 3 -0.42255352 -0.1581610 #> primary human monocytes rep 1 primary human neutrophils rep 1 #> 0 0.2860993 0.31382849 #> 1 0.5913028 0.54143473 #> 2 0.2506601 0.26686921 #> 3 -0.1596368 -0.04526416 #> primary human NK cells rep 1 primary human PBMC rep 1 #> 0 0.2521516 0.4810757 #> 1 0.3960676 0.4553994 #> 2 0.5476851 0.3873399 #> 3 -0.2740145 -0.2484332 #> primary human T cells rep 1 primary human B cells rep 2 #> 0 0.5081027 0.5427781 #> 1 0.4296189 0.3996944 #> 2 0.3657692 0.0329662 #> 3 -0.3359033 -0.3573163 #> primary human myeloid DC rep 2 primary human monocytes rep 2 #> 0 0.2512582 0.21316182 #> 1 0.6595903 0.57611050 #> 2 0.2938857 0.22226395 #> 3 -0.1374992 -0.09252722 #> primary human neutrophils rep 2 primary human NK cells rep 2 #> 0 0.29267862 0.3189304 #> 1 0.55990915 0.4737587 #> 2 0.21612700 0.5310227 #> 3 -0.03016533 -0.1999765 #> primary human PBMC rep 2 primary human T cells rep 2 #> 0 0.4634318 0.5432248 #> 1 0.4997303 0.4406714 #> 2 0.2883316 0.3448771 #> 3 -0.1891536 -0.2745370# Annotate (and return) a Seurat object per-cell res <- clustify( input = s_small, ref_mat = pbmc_bulk_matrix, cluster_col = "res.1", seurat_out = TRUE, per_cell = TRUE, dr = "tsne" )#> Warning: the standard deviation is zero#>


New to Mac? Learn the basics of your menu bar
by Sandy WrittenhouseOne of the key tools you have on your Mac is the menu bar. This handy dandy toolbar sits across the top of your screen and gives you access to everything you need on your Mac.
For those new to macOS, the menu bar can be a little tough to understand in some situations. Plus, you have ways to customize it exactly as you’d like it, as long as you know how.
If you’re a new Mac user, we want to help make your macOS experience as productive and efficient as it can be. So, here are the basics of the menu bar that you need to know along with some tips to help you use it more effectively.
Mac menu bar basics
You can browse the article to learn about the menu bar from top to bottom or skip to one of the following sections.
Menu bar layout
Your Mac menu bar is set up for quick access to your system settings, app menus, and status indicators; from left to right.
Apple menu
The Apple icon sits furthest to the left on your menu bar and remains there regardless of the apps you have open. Whenever you want to get information about your Mac, open the System Preferences, log out, or shut down your Mac, just click that Apple icon.
App menu
To the right of the Apple menu, you have your app menu. When you have an app open and currently active, you will see its menu options here. It begins with the app’s name in bold on the left and all options for that app to the right.
Status indicators
Over to the right side of the menu bar, you’ll see your status indicators. This can include volume control, Wi-Fi, Bluetooth, battery level, and the date and time. These types of items can be added, removed, and rearranged to suit your preference.
Search, Siri, and Notification Center
After the status indicators, you’ll see buttons for Spotlight Search, Siri, and the Notification Center. These are convenient tools for daily use and the buttons in your menu bar make it easy to access each of three with a click.
Adding icons and buttons
Controls built into your Mac such as the time, date, volume, and Wi-Fi can be added to the menu bar from their settings in Apple icon > System Preferences.
Here are few examples of system controls to get you started:
- Date and time: System Preferences > Date and Time > enable Show date and time in menu bar.
- Battery: System Preferences > Energy Saver > enable Show battery status in menu bar.
- Volume: System Preferences > Sound > enable Show volume in menu bar.
- Wi-Fi: System Preferences > Network > enable Show Wi-Fi status in menu bar.
- Bluetooth: System Preferences > Bluetooth > enable Show Bluetooth in menu bar.
Many apps that you download from the App Store will offer this as well. Depending on the app, access the settings and look for the menu bar option.
Removing and rearranging icons
You can remove icons from the right side of the menu bar if you like. For instance, you might never use the Siri button and want to free up that space for something different.
You can use the steps above to disable the “Show in menu bar” option for the particular control.
For an alternative way to quickly remove an icon from the menu bar, hold down your Command key, click the icon, drag it out of the menu bar, and release.
In addition to adding and removing icons, you can rearrange them how you want them. As an example, you may prefer to have your clock on the other side of your volume control.
To rearrange an icon, hold your Command key, click the icon, drag it to its new spot, and release.
More customization options
You can head to the Menu Bar section of iDB for additional ways to customize your menu bar. Here are just some of the things you can do:
- How to remove your account name from your Mac Menu Bar
- How to display clocks for other time zones in your Mac menu bar
- How to hide the Spotlight Search icon from the menu bar
- How to add the weather forecast to your Mac menu bar
- How to put a calendar and time zones in the Mac Menu Bar
Wrapping it up
For those new to Mac, learning these basics of using the menu bar is another key element to making the most out of your Mac.
Are there other things that you’d like help with as a new macOS user? If so, leave a comment below or message us on Twitter!


Text Books
Table of Contents
1. Programming
1.1. The Art of Computer Programming: Fundamental Algorithms
1.2. Structure and Interpretation of Computer Programs
1.3. C Programming: A Modern Approach
2. Math
2.1. Measurement
3. Physics
3.1. The Feynman Lectures on Physics: Mainly Mechanics, Radiation and Heat
Index
1
Programming
1.1
The Art of Computer Programming: Fundamental Algorithms
1.2
Structure and Interpretation of Computer Programs
1.3
C Programming: A Modern Approach
2
Math
2.1
Measurement
3
Physics
3.1
The Feynman Lectures on Physics: Mainly Mechanics, Radiation and Heat
Author: Tatsu
Created: 2020-07-04 Sat 12:49
Validate


A passionate and detail-oriented experience designer seeking for balance between usability and aesthetics.


Personal data
Surname
First Name
Middle name
You are
male
female
Age
Country of Residence
Russia
China
USA
City
Ryazan
Moscow
Photography
Title
Web Master
Database Administrator
Computer-aided design
Economic Planning
Management accounting
Budgeting and planning
Salary
Contact Information
Site
Email
Phone
Password
Отправить
Сбросить


Learning Web Development
- Backround Skills
- Unix Commands
- Vim Text Editor
- HTML
- Minimal Page
- Headings
- Tags
- Lists
- Unordered
- Ordered
- Definition
- Nested
- Links
- Absolute
- Relative
- Images
- CSS
- Anatomy
- Basic Selectors
- Element
- Class
- ID
- Group
- The DOM
- Advanced Selectors
- Box Model
- Programming
- Python
- JavaScript
- Database
- Flat File
- Relational


Cuthbert Spraingue! Cuthbert Spraingue!
He's the boss of the Mayonnaise Gang!
His head's the same colour as his shoes.
He darts between elms & bays & yews.
He came unglued on St Bibblybibdib's Day.
A cart pulled up to take him away.
He fought them off with pins and straw,
Just pins and straw and nothing more.
They say he's related to Nobby Stiles,
According to the police station files,
But he denies any links by blood
To Nobby. memorably smeared with mud
At the end of that match in ’66.
Cuthbert Spraingue loathes Weetabix
And Coco-pops and Special K.
He eschews breakfast every day,
But his days still go with a bang!
For he's the boss of the Mayonnaise Gang!
Cuthbert Spraingue! Cuthbert Spraingue!


WITNESS LIST Defense Affairs & State-Federal Relations Committee March 3, 2005-8:00A HB 548 For: Schwab, Carlton (Texas Economic Development Council) On: Bearden, Bob (State Comptroller) Thomas, Zindia (Attorney General's Office) HB 1010 On: Moller, Lesa (Texas Higher Education Coordinating Board) HB 1076 On: Dille, Brenda (Texas Parks and Wildlife Department)