--- layout: ocpj8-notes title: Java SE 8 Programmer II - Java Class Design permalink: /:path/:basename ---
Encapsulation means keeping the internal workings of your code safe from other programs that use it, allowing only what you choose to be accessed. This makes the code that uses the encapsulated code much simpler and easier to maintain since much of the complexity of the latter is hidden.
The main benefit of encapsulation is that it protects a class from being used in a way that it wasn't meant to be. By controlling the way the code is used, it can only ever do what you want it to do.
For example, if we set a variable like this:
car.model = 2015;
We can't prevent an invalid assignment like this:
car.model = 2343242;
To implement encapsulation, we set up the class so only its methods can refer to its instance variables. External code will access these private instance variables only through public get/set methods. This is a convention used in reusable components called JavaBeans. The rules are:
So if we have a class like the following:
public class Car {
int model;
String name;
String color;
}
The encapsulated version would look like this:
public class Car {
private int model;
private String name;
private String color;
public int getModel() {
return model;
}
public String getName() {
return name;
}
public String getColor() {
return color;
}
public void setModel(int model) {
this.model = model;
}
public void setName(int name) {
this.name = name;
}
public void setColor(int color) {
this.color = color;
}
}
Notice the use of this
in the setter methods. The parameter name can be anything, but if it's the same as the instance variable's name, this
(that references the instance) must be used to differentiate between them.
Of course, just like that, in the surface this code does the same as the non-encapsulated version, but by using a method instead of getting/setting the instance variable directly, we can add something like a validation without breaking the external code:
public void setModel(int model) {
if(model >= 2000 && model <= 2015) {
this.model = model;
} else {
this.model = 2000;
}
}
Now, if we set an invalid value:
car.setModel(2343242);
We'll get a default and valid value that will protect the class from being used in a way it wasn't meant to be.
Encapsulation can also be used with constructors and methods of a class. The key thing is to restrict the access to any member of the class that can break things when something changes or that doesn't want to be exposed.
With inheritance, you created classes based on the other classes so they can get the attributes and methods from the base class to reuse them and even redefine them.
The keyword extends
is used to make a new class that derives from an existing class. The base class is called the superclass and the new class is called the subclass.
Let's begin for example with this class:
public class Animal {
public void eat() { /* Do something */ }
}
A subclass can be:
public class Dog extends Animal {
}
By inheriting from Animal, the Dog class automatically gets the method eat()
. We can add a method to the class:
public class Dog extends Animal {
public void bark() { /* Do something */ }
}
So now Dog has two methods, eat()
that is inherited from Animal and bark()
that is specific to the Dog class. Animal still has one method, inheritance only works from the superclasses to the subclasses.
Not everything can be inherited, and this depends directly from the used visibility modifiers.
When a subclass extends a superclass in Java, all protected and public attributes and methods of the superclass are inherited by the subclass. Attributes and methods with default (package) access modifiers can be accessed by subclasses only if the subclass is located in the same package as the superclass. Private attributes and methods of the superclass are not inherited.
| Modifier | Inherited |
|---|---|
| public | Yes |
| protected | Yes |
| default | Only for subclasses in the same package |
| private | No |
When you create a subclass, the methods in the subclass cannot have less accessible access modifiers assigned to them than they had in the superclass. For instance, if a method in the superclass is public then it must be public in the subclass too.
In Java, a class is only allowed to inherit from a single superclass (singular inheritance). In some programming languages, like C++, it is possible for a subclass to inherit from multiple superclasses (multiple inheritance).
You do composition by having an instance of another class as a field of your class instead of extending.
When to use which?
For example:
class Toy {}
class Animal{}
// Cat is an Animal, so Cat class extends Animal class.
class Cat extends Animal {
// Cat has a Toy, so Cat has an instance of Toy as its member.
private Toy toy;
}
Favoring composition over inheritance is a popular object-oriented design principle that helps to create flexible and maintainable code. For example, composition facilitates testing. If one class is composed of another class, you can easily create a mock object representing the composed class.
With inheritance, you can take advantage of polymorphism. Polymorphism is based on the fact that you can use a variable of a superclass type to hold a reference to an object whose class is any of its subclasses, for example:
Animal animal = new Dog();
This way, polymorphism allows the program to act differently based on the object performing the action. For example:
class Animal {
public void eat() {
System.out.println("Animal Food");
}
}
class Dog extends Animal {
public void eat() {
System.out.println("Dog Food");
}
}
class Cat extends Animal {
public void eat() {
System.out.println("Cat Food");
}
}
public class Test {
public static void main(String args[]) {
Animal a = new Dog();
System.out.println(a.eat());
a = new Cat();
System.out.println(a.eat());
}
}
The first System.out.println(a.eat());
will print Dog Food since in that moment, the a reference is holding a Dog object. In the second call, it will print Cat Food, since now the reference holds a Cat object.
So polymorphism can help make code easier to change. If you have a fragment of code that uses a variable of a superclass type, such as Animal, you could later create a brand new subclass with another behavior, such as Spider, polymorphism will ensure that Spider's implementation of Animal's method gets executed and the fragment will work without change.
From javadoc:
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
It is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the general contract for the hashCode
method, which states that equal objects must have equal hash codes.
From javadoc:
public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap
.
The general contract of hashCode is:
hashCode
method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.hashCode
method on each of the two objects must produce the same integer result.hashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.Object
does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by Java.)The relation between the two methods is:
Whenever a.equals(b
), then a.hashCode()
must be same as b.hashCode()
.
From javadoc:
public String toString()
Returns a string representation of the object. In general, the toString
method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the object is an instance, the at-sign character '@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
The following is an example of an implementation of these methods:
public class Person {
private final String lastName;
private final String firstName;
private final boolean female;
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final Person other = (Person) obj;
if ((this.lastName == null) ? (other.lastName != null) : !this.lastName.equals(other.lastName))
{
return false;
}
if ((this.firstName == null) ? (other.firstName != null) : !this.firstName.equals(other.firstName))
{
return false;
}
if (this.female != other.female)
{
return false;
}
return true;
}
@Override
public int hashCode()
{
int hash = 3;
hash = 19 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
hash = 19 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
hash = 19 * hash + (this.female ? 1 : 0);
return hash;
}
@Override
public String toString()
{
return "Person{" + "lastName=" + lastName + ", firstName=" + firstName
+ ", female=" + female + '}';
}
}
Singleton is a design pattern that provides a way for a class to create only one object from that class.
The key for a Singleton class is to make the constructor private, have a static instance of itself and a method to access it:
public class Singleton {
//Create an object
private static final Singleton instance = new Singleton();
//Make the constructor private so that this class cannot be instantiated
private Singleton(){}
//Get the only object available
public static Singleton getInstance(){
return instance;
}
}
The line private static final Singleton instance = new Singleton();
is only executed when the class Singleton is actually used. This guaranteed the instantiation to be thread safe. To use the singleton class:
Singleton s = Singleton.getInstance();
The other ways to build a Singleton class are:
Using an Enum
public enum Singleton{
INSTANCE;
}
Locking /Lazy loading with Double checked Locking
public class Singleton{
private static volatile Singleton instance;
private Singleton(){}
public static Singleton getInstance(){
if(instance == null){
synchronized(Singleton.class){
//double checking Singleton instance
if(instance == null){
instance = new Singleton();
}
}
}
return instance;
}
}
Immutable objects are simply objects whose state (data) cannot change after construction, for examples the String class. They are useful in concurrent applications, since they cannot change state, they cannot be corrupted by threads.
There are several ways for creating immutable objects:
A static member belongs to the class rather than to an instance of the class.
A static block is used to initialize a static variable or execute some initialize code since the block is executed at the time of the class loading, before any constructors or methods.
class Block {
static {
System.out.println("static block executed");
}
Block() {
System.out.println("constructor executed");
}
public static void main(String args[]) {
new Block();
System.out.println("main method executed");
}
}
The output is:
static block executed
constructor executed
main method executed
Static blocks are executed in the order they are defined.
A static variable is used to refer a common property of all objects or instances (something that is not unique for each object) of a class. It's initialized at the time of class loading.
public class Man {
String name;
static String gender = "M";
Man(String name) {
this.name = name;
}
void display() {
System.out.println(name+" "+name+" "+gender+" "+gender);
}
public static void main(String args[]) {
Man m1 = new Man("Bob");
Man m2 = new Man("Richard");
m1.display();
m2.display();
}
}
The output is:
Bob M
Richard M
A static method also belongs to the class rather than object of a class and can be invoked without the need for creating an instance of a class. The only restrictions are:
this
and super
cannot be used in a static method.
public class Square {
static int calculate(int x){
return x*x;
}
public static void main(String args[]){
int result = Square.calculate(9);
System.out.println(result);
}
}
We can define a class within another class. Such a class is called a nested class. We can't make a top level class static. Only nested classes can be static.
class OuterClass {
// Static nested class
public static class NestedStaticClass{
public void print() {
System.out.println("Message from nested static class");
}
}
}
public class Test {
public static void main(String args[]) {
// create instance of nested Static class
OuterClass.NestedStaticClass sc = new OuterClass.NestedStaticClass();
// call non static method of nested static class
sc.print();
}
}
The characteristics of a static nested class are:


MOTUS Web App
index
Earthquake magnitude
10
9
8
7
6
5
4
3
Fault type
Normal faults
Reverse faults
Left strike-slip faults
Right strike-slip faults
Plate Boundries
View
Hide
UAV Data
View
Hide
last update: 2/28/2019 Author: Henrichsen Copyright: public


You can either sponsor jsDelivr with your services or with monthly donations. For example, to become a Bronze sponsor you need to either sponsor a service worth $150-499 per month or simply donate the same amount of money towards the further development of the project. If you are a company then you can also donate development hours of your coders towards improving jsDelivr. Just send us an email if you have questions.
For companies that want to offer a smaller or bigger amount than the one listed above and/or has custom requirements from jsDelivr.


Default behaviour of Object Status with very long text. The text goes on multiple lines.
Object Status with text truncation with ellipsis
Inverted Negative with very, very long text which truncates
Positive with very, very long text which truncates
Indication8 with very, very long text which truncates


| vec_ptype2.hms {hms} | R Documentation |
Double dispatch methods to support vctrs::vec_ptype2()
.
## S3 method for class 'hms' vec_ptype2(x, y, ..., x_arg = "", y_arg = "")
x |
Vector types. |
y |
Vector types. |
... |
These dots are for future extensions and must be empty. |
x_arg |
Argument names for |
y_arg |
Argument names for |


Our team
We are the perfect renovation for you.
Eduardo Vazquez
Representative / Owner / Director / Founder
Eduardo Vazquez better known as:
equis01, or Vazem
Eduardo, is the main person in charge
of the actions that improve each server.
Is the
main founder of Reward Helper.
He's the official bot programmer for the team.
He is dedicated to configuring each bot outside of
them.
Is dedicated to moderating and helping with the configuration of your server.
With a certificate in computing and experience in
what he does.
Anyelyna
Owner / Director / Founder
Anyelyna, being the second founder, is mainly in charge of configuring bots outside of us.
She is the one who takes the order, to decide mainly who will belong to the team, or who will leave.
She is in charge of giving attention to those who have doubts.
And help for the decoration of each server..
D. Andara
Owner / Director /
Founder
D. Andara, better known as BSK_BE4T5, is a music producer, student of a technical career in systems.
It has a medium-advanced learning of language in programming.
He is the third founder of this.
It is responsible for helping, moderating and advise.
With experience in what he does.


{REFERRER} has invited you to try Plotagon Studio, the easiest way to turn ordinary text into amazing videos.
When you are ready, use the coupon code {COUPON} to save 10% on your monthly or annual subscription for up to 12 months.
{{ content }}--- header_icon: assets/icons/company-logo.png --- {% include head.html %}
When you are ready, use the coupon code {COUPON} to save 10% on your monthly or annual subscription for up to 12 months.
{{ content }}


Expression
Expression is used to build filtering expressions, like those used in WHERE clauses. It can be used for fluent and safe building of queries using untrusted input.
Example:
e => e
.field('host').equals.value('ares.peet.io')
.or
.field('host').matches(/example\.com$/)
.or
.expr(e => e
.field('country').equals.value('US')
.and
.field('state').equals.value('WA'));
// Generates:
// "host" = 'ares.peet.io' OR "host" ~= /example\.com$/ OR \
// ("county" = 'US' AND "state" = 'WA')
Member Summary
| Public Members | ||
| public get |
and: * Chains on an AND clause to the expression. |
|
| public get |
div: * Chains on a |
|
| public get |
doesntMatch: * Chains on a |
|
| public get |
equals: * Chains on a |
|
| public get |
gt: * Chains on a |
|
| public get |
gte: * Chains on a |
|
| public get |
lt: * Chains on a |
|
| public get |
lte: * Chains on a |
|
| public get |
matches: * Chains on a |
|
| public get |
minus: * Chains on a |
|
| public get |
notEqual: * Chains on a |
|
| public get |
or: * Chains on an OR clause to the expression. |
|
| public get |
plus: * Chains on a |
|
| public get |
times: * Chains on a |
Method Summary
| Public Methods | ||
| public |
exp(fn: *): * Inserts a subexpression; invokes the function with a new expression that can be chained on. |
|
| public |
field(name: *): * Inserts a field reference into the expression; the name will be automatically escaped. |
|
| public |
tag(name: *): * Inserts a tag reference into the expression; the name will be automatically escaped. |
|
| public |
toString(): * Converts the expression into its InfluxQL representation. |
|
| public |
value(value: *): * Value chains on a value to the expression. |
Public Members
Public Methods
public exp(fn: *): * source
Inserts a subexpression; invokes the function with a new expression that can be chained on.
Params:
| Name | Type | Attribute | Description |
| fn | * |
Return:
| * |
Example:
e.field('a').equals.value('b')
.or.expr(e =>
e.field('b').equals.value('b')
.and.field('a').equals.value('c'))
.toString()
// "a" = 'b' OR ("b" = 'b' AND "a" = 'c')
public field(name: *): * source
Inserts a field reference into the expression; the name will be automatically escaped.
Params:
| Name | Type | Attribute | Description |
| name | * |
Return:
| * |
public tag(name: *): * source
Inserts a tag reference into the expression; the name will be automatically escaped.
Params:
| Name | Type | Attribute | Description |
| name | * |
Return:
| * |
public value(value: *): * source
Value chains on a value to the expression.
- Numbers will be inserted verbatim
- Strings will be escaped and inserted
- Booleans will be inserted correctly
- Dates will be formatted and inserted correctly, including INanoDates.
- Regular expressions will be inserted correctly, however an error will be thrown if they contain flags, as regex flags do not work in Influx
- Otherwise we'll try to call
.toString()
on the value, throwing if we cannot do so.
Params:
| Name | Type | Attribute | Description |
| value | * |
Return:
| * |


Tutlage Playground is an online in browser code editor quite similar to JsFiddle and JsBin. My idea is not to compete them as they already great in themselves, tutlage playground an open source approach where you download the source files and create your own snippets community using Tutlage Playground.
Version 1.0 is an standalone version which means you have all the flexibility to integrate it with your existing website or blog. It makes use of Php ( 70% or greater ) and Jquery ( 30% of lesser ) to setup a working in browser code editor.
Currently it supports web standard languages which includes Html,Css and Javascript libraries
Above are the default libraries which are supported by tutlage playground, you can add more libraries just my adding couple of more lines inside config file.
In order to add more js libraries on config.php file and follow the below instructions.
Add new library display name inside the following array
$js_array = array( 'Plain Javascript', 'Jquery', 'MooTools', 'Prototype', 'YUI3.6', 'Dojo', 'ExtJs', 'Your New Library Display Name' );
Adding new library source file is as easy as adding the display name, just edit the below array as instructed
$js_libs = array( 'Plain Javascript' => '', 'Jquery' => '', 'MooTools' => '', 'Prototype' => '', 'YUI3.6' => '', 'Dojo' => '', 'ExtJs' => '', 'Your New Library Display Name' => 'New Library Src Url' );
Almost all jquery libraries have their onload or ondomready functions, which needs to defined under the following array
$js_onReadyFunctions = array( 'Plain Javascript' => '** CODE **', 'Jquery' => "$(function(){** CODE **})", 'MooTools' => "window.addEvent('domready', function() {** CODE **})", 'Prototype' => "document.observe('dom:loaded', function() {** CODE **})", 'YUI3.6' => 'YUI().use("node", function(Y){ Y.on("domready", function(){** CODE **});})', 'Dojo' => "dojo.addOnLoad(function(){** CODE **})", 'ExtJs' => "Ext.onReady(function(){** CODE **})", 'Your New Library Display Name' => 'New Library Dom Ready Function{** CODE **}' );
That all is required in order to add new library to tutlage playground, apart from all this it do support external file includes for css and js only files with handy keyword shortcuts to save mouse moving time.
CTRL + S
ALT + D
ALT + R
ALT + A
Fullscreen support will toggle the output area to cover the entire width and height of the screen and user can also leave comments which will be appended to the top of the actual file which they will download later.
With all that done to functionality , the key part is the accessibility of the values. Lot of you would be incorporating it to your existing site or blog. That is why i decided to store all the configration values and code values inside sessions. Which will let you access them anywhere on your server without including any dependency files.
$_SESSION['mashed_code']; // Complete marked up code $_SESSION['js_library']; // Js Library Source File Url $_SESSION['external_libraries']; // List of all included external files ( Will be rendered with the file code ) $_SESSION['playground_js']; // Js code written by the end user $_SESSION['playground_css']; // Css code written by the end user $_SESSION['playground_html']; // Html code written by the end user $_SESSION['playground_comments']; // Comments left by the end user $_SESSION['selected_js_lib']; // Select Js library display name $_SESSION['existing_external_libs']; // List of all included external files ( Will be shown to the user under add files dialog box ) $_SESSION['external_libs_count']; // Number of external files included $_SESSION['active_tab']; // Active tab the user was working with $_SESSION['js_default_position']; // Default position to load the js code ( Can be inside head OR before body closing tags )
Setting values is as easier as getting values, all you need to take care of is that they are in the right format which you test by doing an echo on above sessions.
// It will set the html of the playground to an heading tag with hello world phrase $_SESSION['playground_html'] = '<h2> hello world </h2>';
As shown above you can set the value of any session on the page load time and it will be reflected automatically.
As tutlage playground is tested by couple of team members it will be hard for us to find real time challanges. Any bugs,advice and suggestions will be appreciated, you can contact the support team here


On 11 November 2016, the National Health and Family Planning Commission (NHFPC) of China notified WHO of two additional cases of laboratory-confirmed human infection with avian influenza A(H7N9) virus.
A total of 800 laboratory-confirmed human cases with avian influenza A (H7N9) virus infection have been reported through IHR notification since early 2013.
The Chinese Government has taken the following surveillance and control measures:
Most human cases had history of exposure to the A(H7N9) virus through contact with infected poultry or contaminated environments, including live poultry markets. As long as the virus continues to be detected in animals and environments, further human cases can be expected. Although small clusters of human cases with influenza A(H7N9) viruses have been reported including those involving healthcare workers, current epidemiological and virological evidence suggests that this virus has not acquired the ability of sustained transmission among humans. Therefore further community level spread is considered unlikely.
Human infections with the A(H7N9) virus are unusual and should be monitored closely in order to identify changes in the virus and/or its transmissibility in humans which may have a serious public health impact.
WHO advises that travellers to countries with known outbreaks of avian influenza should avoid, if possible, poultry farms, contact with animals in live bird markets, entering areas where poultry may be slaughtered, or contact with any surfaces that appear to be contaminated with faeces from poultry or other animals. Travellers should also wash their hands often with soap and water, and follow good food safety and good food hygiene practices.
WHO does not advise special screening at points of entry with regard to this event, nor does it currently recommend any travel or trade restrictions. As always, a diagnosis of infection with an avian influenza virus should be considered in individuals who develop severe acute respiratory symptoms while travelling in or soon after returning from an area where avian influenza is a concern.
WHO encourages countries to continue strengthening influenza surveillance, including surveillance for severe acute respiratory infections (SARI) and influenza-like illness (ILI) and to carefully review any unusual patterns, ensure reporting of human infections under the IHR (2005), and continue national health preparedness actions.


[gecode-users] How to put constratins on sort order variables !
Narasinga Rao
miniskar at imec.be
Sun Nov 23 10:52:52 CET 2008
Dear all, I would like to know how to post the constraints on sort order
variables.
The basic idea is
1. First we need to order the tasks based on the start times (basically a
sorting based on start times)
2. Post some constraints on the derived ordered start times
Here is the example code...
IntVarArray start;
IntVarArray end;
IntVarArray startOrder;
IntVarArray order;
.....................
.....................
.....................
// start and end constraints are well defined
.....................
.....................
for( int i=0; i<nTasks; i++) {
post( this, start, order[i], startOrder );
post( this, end, order[i], endTimeStamps );
if( i < nTasks-1 )
post( this, startOrder[i] < startOrder[i+1] );
}
// Adding some post constraints on the ordered tasks
for( int i=0; i<nTasks-1; i++ ) {
post( this, endTimeStamps[i] + switchingCost[i+1] < startOrder[i+1] );
}
If we add the above constraint, it is not providing any solution. Instead if
we give the same constraints with predefined input order values like given
below, it is providing solution.
int order[] = { 0, 1, 2, 3, 4, 5 };
......................
for( int i=0; i<nTasks-1; i++ ) {
post( this, endTimeStamps[i] + switchingCost[i+1] < start[order[i+1]]
);
}
Can any body help me in providing the solution.
Thanks in advance...
--
---------------------
With Regards,
Narasinga Rao, Miniskar,
IMEC, Belgium.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20081123/a26b7142/attachment.htm>
More information about the gecode-users
mailing list


Documentation / Monitoring
Monitoring
Ebean collects metrics for transactions, queries and cache hits. These metrics are then available to collect and report.
Dumping metrics
The fast way to see what metrics are collected is to have them dumped
when the server is shutdown via dumpMetricsOnShutdown
(typically after running all the tests).
Example application-test.yaml
ebean:
dumpMetricsOnShutdown: true
dumpMetricsOptions: loc,sql,hash
test:
platform: h2 # h2, postgres, mysql, oracle, sqlserver, sqlite
ddlMode: dropCreate # none | dropCreate | migrations | create
dbName: my_app
Example output
Below is small example output with options of loc,sql,hash
.
- loc - include profile location
- hash - include the hash of the sql query
- sql - include the sql for queries
-- Dumping metrics for db --
txn.main count:10 total:117459 mean:11745 max:32894
-- ORM queries --
query:CustomerFinder.findByName count:1 total:4089 mean:4089 max:4089
hash:8c314fa1f6dbecfcdd449ccd021c8980
loc:CustomerFinder.findByName(CustomerFinder.kt:17)
sql:select t0.id, t0.name from customer t0 where lower(t0.name) like ? escape'|'
query:ProductFinder.findMapBySku count:1 total:2364 mean:2364 max:2364
hash:aeda919cc69bea1026543d5307276eeb
loc:ProductFinder.findMapBySku(ProductFinder.kt:12)
sql:select t0.id, t0.sku, t0.name, t0.version, t0.when_created, t0.when_modified from product t0
...
Metrics
We can obtain the metrics via MetaInfoManager. When we call collectMetrics() the non-empty metrics are returned and the metric counters are reset.
// Collect the metrics
ServerMetrics serverMetrics = database.getMetaInfoManager().collectMetrics();
// Transactions, L2 cache, SQL updates and queries
List<MetaTimedMetric> timedMetrics : serverMetrics.getTimedMetrics()
// ORM queries
List<MetaOrmQueryMetric> ormQueryMetrics = serverMetrics.getOrmQueryMetrics();
// DTO queries
List<MetaQueryMetric> dtoQueryMetrics = serverMetrics.getDtoQueryMetrics();


assign_visit_to_cluster.Rd
Assign a given visit to the closest cluster from a given clustering. The function generates the embedding of the visit (by the function embed_visit) and computed the squared Euclidean distance from the clusters' centers.
assign_visit_to_cluster(visit_description, clusters, inter_term_vectors, exam_term_vectors)
| visit_description | A named two element vector (with names: |
|---|---|
| clusters | An output of the function cluster_visits |
| inter_term_vectors | A matrix of embeddings of the interview terms |
| exam_term_vectors | A matrix of embeddings of the examination terms |
A list of:
cl
The number of the closest cluster
distances
The vector of distances to each cluster
#> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 1, expected cost 0.1702 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 2, expected cost 0.0983 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 3, expected cost 0.0628 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 4, expected cost 0.0421 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 5, expected cost 0.0293 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 6, expected cost 0.0209 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 7, expected cost 0.0154 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 8, expected cost 0.0116 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 9, expected cost 0.0088 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 10, expected cost 0.0069 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 11, expected cost 0.0054 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 12, expected cost 0.0042 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 13, expected cost 0.0033 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 14, expected cost 0.0027 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 15, expected cost 0.0021#> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 1, expected cost 0.0729 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 2, expected cost 0.0370 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 3, expected cost 0.0243 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 4, expected cost 0.0180 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 5, expected cost 0.0142 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 6, expected cost 0.0118 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 7, expected cost 0.0100 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 8, expected cost 0.0087 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 9, expected cost 0.0076 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 10, expected cost 0.0068 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 11, expected cost 0.0061 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 12, expected cost 0.0054 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 13, expected cost 0.0049 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 14, expected cost 0.0044 #> INFO [2020-06-05 12:42:02] 2020-06-05 12:42:02 - epoch 15, expected cost 0.0040visits_vectors <- embed_list_visits(interviews, examinations, inter_term_vectors, exam_term_vectors) clusters <- cluster_visits(visits_vectors, visits, spec = "internist", cluster_number = 2L) assign_visit_to_cluster(c(inter = "cough, fever, rhinitis", exam = ""), clusters, inter_term_vectors, exam_term_vectors)#> $cl #> 2 #> 2 #> #> $distances #> 1 2 #> 0.06375225 0.03257228 #>assign_visit_to_cluster(c(inter = "thyroid", exam = ""), clusters, inter_term_vectors, exam_term_vectors)#> $cl #> 2 #> 2 #> #> $distances #> 1 2 #> 0.10117841 0.06527791 #>assign_visit_to_cluster(c(inter = "cough, fever, rhinitis", exam = "patient, heart"), clusters, inter_term_vectors, exam_term_vectors)#> $cl #> 2 #> 2 #> #> $distances #> 1 2 #> 0.09267911 0.03307892 #>


England win super over thriller to take NZ T20 series
Auckland - England snatched the Twenty20 series against New Zealand in dramatic fashion in Auckland on Sunday, with a super over required to break the deadlock in scenes reminiscent of the World Cup final four months ago.
A Chris Jordan boundary on the last ball of the England innings brought the tourists level with New Zealand's 146 pushing the rain-shortened match into a tiebreaking super over.
Jonny Bairstow, whose thumping man-of-the-match 47 enabled England to catch New Zealand after they lost three early wickets, partnered Eoin Morgan in a 17-run stand in the match- and series-deciding over.
But unlike the World Cup final, when even the super over was tied, this time New Zealand finished nine runs short to give England the win and take the series 3-2.
Somewhat surprisingly, Tim Seifert opened their super over and was out of six after four balls while the hard-hitting Martin Guptill stood unemployed at the non-striker's end.
In a match reduced to 11 overs per side because of rain, Guptill and Colin Munro gave New Zealand a flying start after they lost the toss and were sent into bat.
Guptill peppered the short Eden Park boundaries with five sixes and three fours and needed only 19 deliveries to reach his 50 before being removed by Adil Rashid one ball later.
Munro had four sixes and two fours in his 46 off 21 balls.
England were rocked early in reply with Trent Boult removing Tom Banton (seven) and Eoin Morgan (17), while Tim Southee accounted for James Vince (1) to have the tourists at 39 for three after three overs.
Sam Curran pulled England back into the game with 20 runs off Scott Kuggeleijn's sole over and Bairstow belted three sixes off Ish Sodhi in the next over.

In the final over of regular play, England needed 13 from the last three balls by Neesham when Jordan went to the middle and belted six, two, and four to set up the tiebreaker.
The first of two Tests between New Zealand and England starts in Tauranga on November 21.


-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutgoingDelivery
abort()
Aborts the outgoing delivery if not already settled.ProtonOutgoingDelivery
deliveryStateUpdatedHandler(EventHandler<OutgoingDelivery> handler)
Handler for updates to the remote state of outgoing deliveries that have begun transferring frames.OutgoingDelivery
disposition(DeliveryState state)
updates the state of the deliveryOutgoingDelivery
disposition(DeliveryState state, boolean settle)
Update the delivery with the given disposition if not locally settled and optionally settles the delivery if not already settled.ProtonAttachments
getAttachments()
ProtonSender
getLink()
<T> T
getLinkedResource()
<T> T
getLinkedResource(java.lang.Class<T> typeClass)
Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.int
getMessageFormat()
Gets the message-format for this Delivery, representing the 32bit value using an int.DeliveryState
getRemoteState()
DeliveryState
getState()
DeliveryTag
getTag()
int
getTransferCount()
Returns the total number of transfer frames that have occurred for the givenOutgoingDelivery
.boolean
isAborted()
boolean
isPartial()
Check for whether the delivery is still partial.boolean
isRemotelySettled()
boolean
isSettled()
ProtonOutgoingDelivery
setLinkedResource(java.lang.Object resource)
Links a given resource to thisEndpoint
.OutgoingDelivery
setMessageFormat(int messageFormat)
Sets the message-format for this Delivery, representing the 32bit value using an integer value.OutgoingDelivery
setTag(byte[] deliveryTag)
Sets the delivery tag to assign to this outgoing delivery from the given byte array.OutgoingDelivery
setTag(DeliveryTag deliveryTag)
Sets theDeliveryTag
to assign to this outgoing delivery.OutgoingDelivery
settle()
Settles this delivery if not already settled.OutgoingDelivery
streamBytes(ProtonBuffer buffer)
Write the given bytes as a portion of the payload of this delivery, additional bytes can be streamed until the stream complete flag is set to true on a call toOutgoingDelivery.streamBytes(ProtonBuffer, boolean)
or a call toOutgoingDelivery.writeBytes(ProtonBuffer)
is made.OutgoingDelivery
streamBytes(ProtonBuffer buffer, boolean complete)
Write the given bytes as a portion of the payload of this delivery, additional bytes can be streamed until the stream complete flag is set to true on a call toOutgoingDelivery.streamBytes(ProtonBuffer, boolean)
and the buffer contents on that send are fully written.OutgoingDelivery
writeBytes(ProtonBuffer buffer)
Write the given bytes as the payload of this delivery, no additional writes can occur on this delivery if the write succeeds in sending all of the given bytes.
-
-
-
Constructor Detail
-
ProtonOutgoingDelivery
public ProtonOutgoingDelivery(ProtonSender link)
Creates an empty outgoing delivery instance that is owned by the givenProtonSender
instance.- Parameters:
link
- theSender
link that owns this outgoing delivery.
-
-
Method Detail
-
getLink
public ProtonSender getLink()
- Specified by:
getLink
in interfaceOutgoingDelivery
- Returns:
- the link that this
OutgoingDelivery
is bound to.
-
getAttachments
public ProtonAttachments getAttachments()
- Specified by:
getAttachments
in interfaceOutgoingDelivery
- Returns:
- the
Attachments
instance that is associated with thisOutgoingDelivery
-
setLinkedResource
public ProtonOutgoingDelivery setLinkedResource(java.lang.Object resource)
Description copied from interface:OutgoingDelivery
Links a given resource to thisEndpoint
.- Specified by:
setLinkedResource
in interfaceOutgoingDelivery
- Parameters:
resource
- The resource to link to thisEndpoint
.- Returns:
- this
OutgoingDelivery
instance.
-
getLinkedResource
public <T> T getLinkedResource()
- Specified by:
getLinkedResource
in interfaceOutgoingDelivery
- Type Parameters:
T
- The type that the linked resource should be cast to on return.- Returns:
- the user set linked resource for this
Endpoint
instance.
-
getLinkedResource
public <T> T getLinkedResource(java.lang.Class<T> typeClass)
Description copied from interface:OutgoingDelivery
Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.- Specified by:
getLinkedResource
in interfaceOutgoingDelivery
- Type Parameters:
T
- The type to cast the linked resource to if one is set.- Parameters:
typeClass
- the type's Class which is used for casting the returned value.- Returns:
- the user set linked resource for this Context instance.
-
getTag
public DeliveryTag getTag()
- Specified by:
getTag
in interfaceOutgoingDelivery
- Returns:
- the
DeliveryTag
assigned to this Delivery.
-
setTag
public OutgoingDelivery setTag(byte[] deliveryTag)
Description copied from interface:OutgoingDelivery
Sets the delivery tag to assign to this outgoing delivery from the given byte array.- Specified by:
setTag
in interfaceOutgoingDelivery
- Parameters:
deliveryTag
- a byte array containing the delivery tag to assign to thisOutgoingDelivery
- Returns:
- this
OutgoingDelivery
instance.
-
setTag
public OutgoingDelivery setTag(DeliveryTag deliveryTag)
Description copied from interface:OutgoingDelivery
Sets theDeliveryTag
to assign to this outgoing delivery.- Specified by:
setTag
in interfaceOutgoingDelivery
- Parameters:
deliveryTag
- a byte array containing the delivery tag to assign to thisOutgoingDelivery
- Returns:
- this
OutgoingDelivery
instance.
-
getState
public DeliveryState getState()
- Specified by:
getState
in interfaceOutgoingDelivery
- Returns:
- the
DeliveryState
at the local side of this Delivery.
-
getRemoteState
public DeliveryState getRemoteState()
- Specified by:
getRemoteState
in interfaceOutgoingDelivery
- Returns:
- the
DeliveryState
at the remote side of this Delivery.
-
getMessageFormat
public int getMessageFormat()
Description copied from interface:OutgoingDelivery
Gets the message-format for this Delivery, representing the 32bit value using an int.The default value is 0 as per the message format defined in the core AMQP 1.0 specification.
See the following for more details:
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-transfer
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-message-format
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#definition-MESSAGE-FORMAT- Specified by:
getMessageFormat
in interfaceOutgoingDelivery
- Returns:
- the message-format for this Delivery.
-
setMessageFormat
public OutgoingDelivery setMessageFormat(int messageFormat)
Description copied from interface:OutgoingDelivery
Sets the message-format for this Delivery, representing the 32bit value using an integer value. The message format can only be set@Override prior to the firstTransfer
of delivery payload having been written. If one of the delivery write methods is called prior to the message format being set then it defaults to the AMQP default format of zero.The default value is 0 as per the message format defined in the core AMQP 1.0 specification.
See the following for more details:
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-transfer
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-message-format
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format
http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#definition-MESSAGE-FORMAT- Specified by:
setMessageFormat
in interfaceOutgoingDelivery
- Parameters:
messageFormat
- the message format- Returns:
- this
OutgoingDelivery
instance.
-
isPartial
public boolean isPartial()
Description copied from interface:OutgoingDelivery
Check for whether the delivery is still partial.For a receiving Delivery, this means the delivery does not hold a complete message payload as all the content hasn't been received yet. Note that an
aborted
delivery will also be considered partial and the full payload won't be received.For a sending Delivery, this means that the application has not marked the delivery as complete yet.
- Specified by:
isPartial
in interfaceOutgoingDelivery
- Returns:
- true if the delivery is partial
- See Also:
OutgoingDelivery.isAborted()
-
isAborted
public boolean isAborted()
- Specified by:
isAborted
in interfaceOutgoingDelivery
- Returns:
- true if the delivery has been aborted.
-
isSettled
public boolean isSettled()
- Specified by:
isSettled
in interfaceOutgoingDelivery
- Returns:
- true if the delivery has been settled locally.
-
isRemotelySettled
public boolean isRemotelySettled()
- Specified by:
isRemotelySettled
in interfaceOutgoingDelivery
- Returns:
- true if the delivery has been settled by the remote.
-
disposition
public OutgoingDelivery disposition(DeliveryState state)
Description copied from interface:OutgoingDelivery
updates the state of the delivery- Specified by:
disposition
in interfaceOutgoingDelivery
- Parameters:
state
- the new delivery state- Returns:
- this
OutgoingDelivery
instance.
-
disposition
public OutgoingDelivery disposition(DeliveryState state, boolean settle)
Description copied from interface:OutgoingDelivery
Update the delivery with the given disposition if not locally settled and optionally settles the delivery if not already settled.The action taken by this method depends on the state of the
OutgoingDelivery
at the time it is called.If there has yet to be any writes from this delivery the delivery state and settlement value is cached and applied to the first (or only) write of payload from this delivery. If however a write has already been performed than this method result in a
Disposition
frame being sent to the remote with the given delivery state and settlement value. Once the delivery is marked as settled any future call to this method will do nothing if the requested disposition and settlement is the same however if a new state is applied which cannot be conveyed due to having already locally settling theOutgoingDelivery
than anIllegalStateException
is thrown to indicate that request is not valid.- Specified by:
disposition
in interfaceOutgoingDelivery
- Parameters:
state
- the new delivery statesettle
- if true the delivery is settled.- Returns:
- this
OutgoingDelivery
instance.
-
settle
public OutgoingDelivery settle()
Description copied from interface:OutgoingDelivery
Settles this delivery if not already settled. Once settled locally no further updates to the delivery state can be applied. If called prior to the first write of payload bytes the settlement state is cached and transmitted within the firstTransfer
frame of thisOutgoingDelivery
.- Specified by:
settle
in interfaceOutgoingDelivery
- Returns:
- this
OutgoingDelivery
instance.
-
writeBytes
public OutgoingDelivery writeBytes(ProtonBuffer buffer)
Description copied from interface:OutgoingDelivery
Write the given bytes as the payload of this delivery, no additional writes can occur on this delivery if the write succeeds in sending all of the given bytes.When called the provided buffer is treated as containing the entirety of the transfer payload and the Transfer(s) that result from this call will result in a final Transfer frame whose more flag is set to false which tells the remote that no additional data will be sent for this
Transfer
. TheSender
will output as much of the buffer as possible within the constraints of both the link credit and the current capacity of the parentSession
.The caller must check that all bytes were written and if not they should await updates from the
Link.creditStateUpdateHandler(EventHandler)
that indicate that theSender.isSendable()
has become true again or the caller should checkSender.isSendable()
periodically until it becomes true once again.- Specified by:
writeBytes
in interfaceOutgoingDelivery
- Parameters:
buffer
- The buffer whose contents should be sent.- Returns:
- this
OutgoingDelivery
instance.
-
streamBytes
public OutgoingDelivery streamBytes(ProtonBuffer buffer)
Description copied from interface:OutgoingDelivery
Write the given bytes as a portion of the payload of this delivery, additional bytes can be streamed until the stream complete flag is set to true on a call toOutgoingDelivery.streamBytes(ProtonBuffer, boolean)
or a call toOutgoingDelivery.writeBytes(ProtonBuffer)
is made.The
Sender
will output as much of the buffer as possible within the constraints of both the link credit and the current capacity of the parentSession
. The caller must check that all bytes were0 written and if not they should await updates from theLink.creditStateUpdateHandler(EventHandler)
that indicate that theSender.isSendable()
has become true again or the caller should checkSender.isSendable()
periodically until it becomes true once again.This method is the same as calling
OutgoingDelivery.streamBytes(ProtonBuffer, boolean)
with the complete value set to false.- Specified by:
streamBytes
in interfaceOutgoingDelivery
- Parameters:
buffer
- The buffer whose contents should be sent.- Returns:
- this
OutgoingDelivery
instance.
-
streamBytes
public OutgoingDelivery streamBytes(ProtonBuffer buffer, boolean complete)
Description copied from interface:OutgoingDelivery
Write the given bytes as a portion of the payload of this delivery, additional bytes can be streamed until the stream complete flag is set to true on a call toOutgoingDelivery.streamBytes(ProtonBuffer, boolean)
and the buffer contents on that send are fully written.The
Sender
will output as much of the buffer as possible within the constraints of both the link credit and the current capacity of the parentSession
. The caller must check that all bytes were0 written and if not they should await updates from theLink.creditStateUpdateHandler(EventHandler)
that indicate that theSender.isSendable()
has become true again or the caller should checkSender.isSendable()
periodically until it becomes true once again.- Specified by:
streamBytes
in interfaceOutgoingDelivery
- Parameters:
buffer
- The buffer whose contents should be sent.complete
- When true the delivery is marked complete and no further bytes can be written.- Returns:
- this
OutgoingDelivery
instance.
-
abort
public OutgoingDelivery abort()
Description copied from interface:OutgoingDelivery
Aborts the outgoing delivery if not already settled.- Specified by:
abort
in interfaceOutgoingDelivery
- Returns:
- this delivery.
-
deliveryStateUpdatedHandler
public ProtonOutgoingDelivery deliveryStateUpdatedHandler(EventHandler<OutgoingDelivery> handler)
Description copied from interface:OutgoingDelivery
Handler for updates to the remote state of outgoing deliveries that have begun transferring frames.Remote state updates for an
OutgoingDelivery
can happen when the remote settles a completeOutgoingDelivery
or otherwise modifies the delivery outcome and the user needs to act on those changes such as a spontaneous update to theDeliveryState
. If the initialTransfer
of an outgoing delivery already indicates settlement then this handler will never be called.- Specified by:
deliveryStateUpdatedHandler
in interfaceOutgoingDelivery
- Parameters:
handler
- The handler that will be invoked when a new remote state update for anOutgoingDelivery
arrives on this link.- Returns:
- this
OutgoingDelivery
instance.
-
getTransferCount
public int getTransferCount()
Description copied from interface:OutgoingDelivery
Returns the total number of transfer frames that have occurred for the givenOutgoingDelivery
. If theOutgoingDelivery
has yet to have any of its write methods called this value will read zero. Aborting a transfer after anyTransfer
frames have been written will not result in an addition recordedTransfer
write.- Specified by:
getTransferCount
in interfaceOutgoingDelivery
- Returns:
- the number of
Transfer
frames that thisOutgoingDelivery
has initiated.
-
-


PDX bids farewell to 'stuffy, old' concourse
Portland's airport undergoes major renovation
by Amber Wilmarth, FOX 12 StaffPORTLAND, Ore. - The time has come to finally say goodbye to a Concourse A at the Portland International Airport.
Airport officials say they plan to demolish Concourse A to make room for an expansion of Concourse B, which will feature new art and restaurants.
"That would be a nice feature because people sit around for quite a long time. That would be a nice thing to add to the airport" said traveler Teresa Larson. "Actually, I think Portland is one of the prettier airports."
The plan to close and demolish Concourse A was mostly met with excitement, as Portland travelers realized it wasn't the prettiest part of the airport.
"It seems about time. It's run its course," said Clay Roscoe.
Roscoe knows Concourse A very well.
"I've probably traveled it now for 20 to 25 years," Roscoe said.
Concourse A is known for its dim lights, low ceilings, and crowded seating area. It was built in 1988 and was meant to be temporary.
Airport officials say it's bittersweet because there are a lot of memories in the "stuffy, old" concourse - from a surprise wedding proposal to a strip of the famous PDX carpet.
Airport officials are encouraging people to share their Concourse A memories on social media using #GoodbyeA.


Chat at #lugatgt on irc.freenode.net
DuckDuckGo has everything you expect a search engine to have, including images, news and places, all while respecting your privacy. Great results without tracking you. That's DuckDuckGo in a nutshell.
DuckDuckGo makes it very easy to contribute instant answers through DuckDuckHack
#!/usr/bin/perl
use strict;
use warnings;
print "Hello World!\n";
my $x = 10; #scalar variables begin with a $
my @a = (10,12,43); #arrays begin with a @
my %h = ( name => 'Collin', age => 19); #hashes begin with a %
$_ = 10; #perl has a special variable called the default variable
sub foo {
my ($p1, $p2) = @_; #destructuring arguments
return 'bar';
}
foo(); #calling the subroutine
Types in perl are kind of weird. Basically the type information can be encoded in the operators.*
my $day = 21;
print "Today is January " . $day . " !";
$_ = 'foobar';
if (/.*bar.*/) { # $var =~ /.*bar.*/
print "$_ contains bar";
} else {
print "$_ does not match";
}


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.Utilities
public class Utilities
A collection of methods to deal with various text related activities.
| Constructor Summary | |
|---|---|
Utilities()
|
| Method Summary | |
|---|---|
static int |
drawTabbedText(Segment s,
int x,
int y,
Graphics g,
TabExpander e,
int startOffset)
Draws the given text, expanding any tabs that are contained using the given tab expansion technique. |
static int |
getBreakLocation(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
Determine where to break the given text to fit within the given span. |
static int |
getNextWord(JTextComponent c,
int offs)
Determines the start of the next word for the given location. |
static Element |
getParagraphElement(JTextComponent c,
int offs)
Determines the element to use for a paragraph/line. |
static int |
getPositionAbove(JTextComponent c,
int offs,
int x)
Determines the position in the model that is closest to the given view location in the row above. |
static int |
getPositionBelow(JTextComponent c,
int offs,
int x)
Determines the position in the model that is closest to the given view location in the row below. |
static int |
getPreviousWord(JTextComponent c,
int offs)
Determine the start of the prev word for the given location. |
static int |
getRowEnd(JTextComponent c,
int offs)
Determines the ending row model position of the row that contains the specified model position. |
static int |
getRowStart(JTextComponent c,
int offs)
Determines the starting row model position of the row that contains the specified model position. |
static int |
getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset)
Determines the relative offset into the given text that best represents the given span in the view coordinate system. |
static int |
getTabbedTextOffset(Segment s,
FontMetrics metrics,
int x0,
int x,
TabExpander e,
int startOffset,
boolean round)
|
static int |
getTabbedTextWidth(Segment s,
FontMetrics metrics,
int x,
TabExpander e,
int startOffset)
Determines the width of the given segment of text taking tabs into consideration. |
static int |
getWordEnd(JTextComponent c,
int offs)
Determines the end of a word for the given location. |
static int |
getWordStart(JTextComponent c,
int offs)
Determines the start of a word for the given model location. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utilities()
| Method Detail |
|---|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset)
s
- the source of the textx
- the X origin >= 0y
- the Y origin >= 0g
- the graphics contexte
- how to expand the tabs. If this value is null,
tabs will be expanded as a space character.startOffset
- starting offset of the text in the document >= 0
public static final int getTabbedTextWidth(Segment s, FontMetrics metrics, int x, TabExpander e, int startOffset)
s
- the source of the textmetrics
- the font metrics to use for the calculationx
- the X origin >= 0e
- how to expand the tabs. If this value is null,
tabs will be expanded as a space character.startOffset
- starting offset of the text in the document >= 0
public static final int getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
s
- the source of the textmetrics
- the font metrics to use for the calculationx0
- the starting view location representing the start
of the given text >= 0.x
- the target view location to translate to an
offset into the text >= 0.e
- how to expand the tabs. If this value is null,
tabs will be expanded as a space character.startOffset
- starting offset of the text in the document >= 0
public static final int getTabbedTextOffset(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset, boolean round)
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset)
s
- the source of the textmetrics
- the font metrics to use for the calculationx0
- the starting view location representing the start
of the given text.x
- the target view location to translate to an
offset into the text.e
- how to expand the tabs. If this value is null,
tabs will be expanded as a space character.startOffset
- starting offset in the document of the text
public static final int getRowStart(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final int getRowEnd(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final int getPositionAbove(JTextComponent c, int offs, int x) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0x
- the X coordinate >= 0
BadLocationException
- if the offset is out of rangepublic static final int getPositionBelow(JTextComponent c, int offs, int x) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0x
- the X coordinate >= 0
BadLocationException
- if the offset is out of rangepublic static final int getWordStart(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final int getWordEnd(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final int getNextWord(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final int getPreviousWord(JTextComponent c, int offs) throws BadLocationException
c
- the editoroffs
- the offset in the document >= 0
BadLocationException
- if the offset is out of rangepublic static final Element getParagraphElement(JTextComponent c, int offs)
c
- the editoroffs
- the starting offset in the document >= 0
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


「
Star
Platinum
」
If enabled, a special name is added to the end (Ex: : The World, ACT1, ACT2, etc.)
Inspired by Alex Onsager's Pokemon Fusion
Stand images and info from JoJo's Bizarre Encyclopedia This is a fan project not associated with the wikia.


Master Toma:
A donation? Let me see... Is it already time for another donation? Strange indeed! It seems like just yesterday I gave one. This wouldn't be a trick from that rascal Arin?
Oh, well, I can't say no to your request... Here is the donation...


Lets say we have a business service class which provides a business operation with the following responsibilities: a) it finds certain persistent entities needed by the operation; b) it persists the state for a new entity; and c) it sends a notification e-mail to an interested party. The first two responsibilities require access to the application database, which is done through a simplified API to the persistence subsystem. The third one can be achieved with a third-party API for sending e-mail, which in this example is the Commons Email library.
Therefore, the service class has two separate dependencies, one for persistence and another for e-mail.
In order to unit test the business operation while verifying proper interaction with these collaborators, we will use
the available mocking APIs.
Complete source code for a working solution - with all tests - is available
online and under
samples/tutorial
in the full distribution zip file.
package domain;
import static infrastructure.Database.*;
import org.apache.commons.mail.*;
public final class MyBusinessService
{
public void doBusinessOperationXyz(EntityX data) throws EmailException
{
List<EntityX> items =
(1) find("select item from EntityX item where item.someProperty = ?1", data.getSomeProperty());
// Compute or obtain from another service a total value for the new persistent entity:
BigDecimal total = ...
data.setTotal(total);
(2) persist(data);
sendNotificationEmail(data, items);
}
private void sendNotificationEmail(EntityX data, List<EntityX> items) throws EmailException
{
Email email = new SimpleEmail();
email.setSubject("Notification about processing of ...");
(3) email.addTo(data.getCustomerEmail());
// Other e-mail parameters, such as the host name of the mail server, have defaults defined
// through external configuration.
String message = buildNotificationMessage(items);
email.setMsg(message);
(4) email.send();
}
private String buildNotificationMessage(List<EntityX> items)
{
// Builds the message with data from the list of items...
}
}
The Database
class contains only static methods and a private constructor; the find
and
persist
methods should be obvious, so we won't list them here (assume they are implemented on top of an
ORM API, such as Hibernate or JPA).
So, how can we unit test the "doBusinessOperationXyz" method without making any changes to the
existing application code?
JMockit actually provides three different APIs that can be used, each capable enough for our needs.
(In practice, the first two APIs are just subsets of a larger behavior-oriented mocking API; the other one,
which can be described as an state-oriented mocking API, is truly different and unique.)
We will see how to use each one of them in the following sections.
In every situation, a JUnit test case will verify the invocations of interest made from the unit
under test to its external dependencies. These invocations are the ones at points (1)
-(4)
,
indicated above.
First, lets use the JMockit Expectations API.
package domain;
import java.util.*;
import org.apache.commons.mail.*;
import infrastructure.*;
import org.junit.*;
import mockit.*;
public final class MyBusinessService_ExpectationsAPI_Test
{
@Mocked final Database unused = null;
@NonStrict SimpleEmail email; // calls to setters are unimportant, so we make it non-strict
@Test
public void doBusinessOperationXyz() throws Exception
{
final EntityX data = new EntityX(5, "abc", "5453-1");
final List<EntityX> items = new ArrayList<EntityX>();
items.add(new EntityX(1, "AX5", "someone@somewhere.com"));
new Expectations()
{
{
// "Database" is mocked strictly, therefore the order of these invocations does matter:
(1) Database.find(withSubstring("select"), (Object[]) any); result = items;
(2) Database.persist(data);
// Since "email" is a non-strict mock, this invocation can be replayed in any order:
(4) email.send(); times = 1; // a non-strict invocation requires a constraint if expected
}
};
new MyBusinessService().doBusinessOperationXyz(data);
}
@Test(expected = EmailException.class)
public void doBusinessOperationXyzWithInvalidEmailAddress() throws Exception
{
new NonStrictExpectations()
{
{
(3) email.addTo((String) withNotNull()); result = new EmailException();
// If the e-mail address is invalid, sending the message should not be attempted:
email.send(); times = 0;
}
};
EntityX data = new EntityX(5, "abc", "5453-1");
new MyBusinessService().doBusinessOperationXyz(data);
}
}
First of all, note that what gets mocked is specified through mock fields, which in this case are
instance fields of the test class annotated as @Mocked
and/or as
@NonStrict
.
A mock field can be of any reference type: an interface, an abstract class, a final/non-final class, an enum type, an
annotation type, or even a generic type parameter.
We say that such a mock field has a mocked type. In truth, it is the type specified to be mocked that truly
matters; the field itself is not essential, although very useful when the test needs a mocked object to
record expectations on. Such a mocked instance will be automatically created and assigned to the field, so it
will never be left with a null
reference.
It is possible to "take over" the value assigned to the mock field, though, by simply declaring it as
final
.
By default, all methods of a class declared as a mocked type will be mocked, that is, they will be modified
so that the actual method implementation in production code is never executed as long as the type stays mocked.
The same holds true for the constructors of a mocked class.
Notice that JMockit Expectations does not create any mock subclasses for concrete mocked classes;
instead, it directly modifies the actual implementation of the mocked class.
On the other hand, methods of an interface and abstract
methods do not contain any implementation to be
modified.
In such cases, an empty implementation body is provided in a concrete implementation class.
This is all done automatically by JMockit in a transparent way, with no additional effort on the part of the
developer.
Finally, note that this makes every instance of a mocked class a mocked instance, for as long as
the class remains mocked - there is no separate "mock object" per se.
In certain cases, it may be necessary to partially mock a type.
Specific methods and constructors can be selected to be mocked or not through filter expressions
provided as an attribute of the @Mocked
annotation.
This annotation has a few other attributes and capabilities which we won't discuss at this point.
Check the API documentation for the complete specification.
As the example tests show, expected or allowed invocations are specified through regular method and
constructor invocations on mocked classes or mock fields, while inside an Expectations
or
NonStrictExpectations
block (which is an anonymous inner class containing an
instance initialization block). Each such invocation partly defines an expectation for the test.
We say that such invocations or expectations are recorded during a record phase, so that they can be replayed (and automatically verified) later, during a replay phase. Typically, this second phase of the test starts with the call that exercises the code under test, and lasts until the test execution completes. This is known as the record-replay model of test execution. Note that the record/replay dichotomy applies to each individual expectation, not to the test as whole. That is, a test method can switch between the record and replay phases any number of times with different expectations; doing so, however, would lead to confusing tests and is therefore highly discouraged, even if valid.
Additional behavior can and often is specified for an expectation.
This is done by assigning values to certain fields and/or calling certain methods of the Expectations API,
after the recorded method/constructor invocation of interest, and before the next expectation to
appear in the block.
A recorded return value of any type can be assigned to the special result
field.
Similarly, a recorded exception (or error) can be specified by assigning the desired
Throwable
instance to this same result
field.
The method calls "withXyz(...)
", as well as the field accesses
"anyAbc
", allow flexible matching of argument values for the recorded invocations.
Otherwise, an exact match is expected between recorded argument values and the corresponding values received in the
replay phase.
All expectations recorded inside Expectations
blocks are strictly verified
before the end of the test, unless the mocked type was declared as @NonStrict
.
Non-strict invocations (those made to non-strict mocked types or appearing inside a
NonStrictExpectations
block) are only verified if an explicit invocation count
constraint is specified in the test, through an assignment to the times
field (or
alternatively to the minTimes
and/or maxTimes
fields).
A java.lang.AssertionError
will be thrown for any expected invocation which did not happen
during the replay phase.
An error will also be thrown for any invocation to a mocked type that does occur during the replay phase, but which
was expected to not occur; all the unrecorded invocations to strictly mocked types will cause such an error,
and also the ones recorded (strictly or not) with a minimum invocation count which gets violated at replay time.
Even more, the test will fail (again, with an AssertionError
) if expected invocations to
one or more strict mocked types are replayed in a different order than they were recorded.
There is more to the Expectations API, about which you can find in the chapter on behavior-based testing, in the API documentation, and also in the many additional sample tests inside the full distribution.
Up to this point we focused on expectations that are recorded/specified before exercising the code under test. Such expectations are verified implicitly (when strict or with an specified invocation count constraint) or not at all (when non-strict and without any associated invocation count constraint). Lets now consider the use of the JMockit Verifications API, which lets us deal with expectations after having exercised the code under test.
package domain;
import java.util.*;
import static java.util.Arrays.*;
import org.apache.commons.mail.*;
import infrastructure.*;
import org.junit.*;
import mockit.*;
public final class MyBusinessService_VerificationsAPI_Test
{
@Tested MyBusinessService service; // instantiated automatically
@Mocked Database onlyStatics;
@Capturing Email email; // concrete subclass mocked on demand, when loaded
final EntityX data = new EntityX(5, "abc", "someone@somewhere.com");
@Test
public void doBusinessOperationXyzPersistsData() throws Exception
{
// No expectations recorded in this case.
service.doBusinessOperationXyz(data);
new Verifications()
{
{
(2) Database.persist(data);
}
};
}
@Test
public void doBusinessOperationXyzFindsItemsAndSendsNotificationEmail() throws Exception
{
// Invocations that produce a result are recorded, but only those we care about.
new NonStrictExpectations()
{
{
(1) Database.find(withSubstring("select"), (Object[]) null);
result = asList(new EntityX(1, "AX5", "someone@somewhere.com"));
}
};
service.doBusinessOperationXyz(data);
new VerificationsInOrder()
{
{
(3) email.addTo(data.getCustomerEmail());
(4) email.send();
}
};
}
}
To recapitulate, non-strict expectations differ from strict ones in that they can be executed or not by code under test, even if they were not previously recorded. And if they are executed the relative order between invocations doesn't matter, unless specified otherwise.
The example tests above show two ways to have non-strict expectations: first, by simply having no expectation block
at all; second, by specifying expectations inside a NonStrictExpectations
block.
In the first case, all invocations to mocked types made in production code will be allowed without restrictions, but
non-void mocked methods will always return a fixed default value according to the method return type.
It is also possible to mix strict and non-strict expectations, by using the
@NonStrict
annotation on mocked types, and/or by calling the
notStrict()
method right after a recorded invocation while inside an
Expectations
block.
When we use non-strict expectations, invocations to mocked methods and constructors during the replay phase are not immediately verified (unless explicitly specified otherwise through an invocation count constraint). Those non-strict invocations which were recorded with an specific return value or with an exception/error to be thrown will produce the expected result if and when replayed by production code.
The fact that an explicitly recorded non-strict expectation allows the test to pass is usually
enough evidence to demonstrate that the tested unit did the right thing.
In the second test above for example, suppose the line recording a result for the
Database.find(...)
invocation is commented out.
The test will likely fail when another part of the code under test which depends on that returned value is executed,
or when an expected invocation is verified in the test itself (in this example test, an extra
email.setMsg(withNotEqual(""));
verification would be needed between the other two verified
invocations).
However, in some cases you may want to be sure that the invocation will occur at least once.
To achieve that, simply specify it with a minTimes = 1
constraint after the recorded invocation
in the non-strict expectation block.
Another advantage of non-strict expectations is that they can be explicitly verified in test code.
Such verifications are just like the recording of invocations: simply invoke the method or
constructor to be verified, but inside a Verifications
block (or a subclass such as
VerificationsInOrder
, which also verifies the relative order of execution).
Such blocks must always be executed after the code under test was exercised, that is, after the end of the
replay phase.
Note that verification blocks will typically contain invocations to constructors and methods of void
return type.
Non-void methods can be explicitly verified as well (even if recorded previously in the test), although as we saw
before they will also be implicitly verified if an invocation count constraint was specified in the record phase.
Syntactically, a verification block is just like an expectation block.
Invocations to mocked types are immediately verified to match corresponding invocations made
during the replay phase. Argument matching constraints can be used so that a single invocation in
a verification block verifies several invocations executed by the code under test.
The invocation count for a particular method or constructor can be verified by specifying
constraints through one of the times
, minTimes
, and
maxTimes
fields, just like it can be done for expectations in the recording phase.
In particular, it can be verified that an specific invocation never happened by specifying a
times = 0
invocation count constraint (or maxTimes = 0
if preferred).
Next, lets see how the JMockit Annotations API solves the problem.
package domain;
import java.util.*;
import org.apache.commons.mail.*;
import org.junit.*;
import static org.junit.Assert.*;
import mockit.*;
import domain.MyBusinessService_AnnotationsAPI_Test.*;
import infrastructure.*;
@UsingMocksAndStubs({MockDatabase.class, Email.class})
public final class MyBusinessService_AnnotationsAPI_Test
{
@MockClass(realClass = Database.class, stubs = "<clinit>")
public static class MockDatabase
{
@Mock(invocations = 1)
(1) public static List<EntityX> find(String ql, Object... args)
{
assertNotNull(ql);
assertTrue(args.length > 0);
return Arrays.asList(new EntityX(1, "AX5", "someone@somewhere.com"));
}
@Mock(maxInvocations = 1)
(2) public static void persist(Object o) { assertNotNull(o); }
}
final EntityX data = new EntityX(5, "abc", "5453-1");
@Test
public void doBusinessOperationXyz() throws Exception
{
new MockUp<Email>()
{
@Mock(invocations = 1)
(4) String send() { return ""; }
});
new MyBusinessService().doBusinessOperationXyz(data);
}
@Test(expected = EmailException.class)
public void doBusinessOperationXyzWithInvalidEmailAddress() throws Exception
{
new MockUp<Email>()
{
@Mock
(3) Email addTo(String emailAddress) throws EmailException
{
assertNotNull(emailAddress);
throw new EmailException();
}
@Mock(invocations = 0)
String send() { return null; }
};
new MyBusinessService().doBusinessOperationXyz(data);
}
}
Here, instead of recording or verifying expectations through invocations to mocked types, we directly specify
mock implementations for the methods and constructors of interest.
Such mock methods must have the same signature as the "real" methods and constructors, and be annotated with
@Mock
.
They are defined in a mock class, which can either be a separate class (nested or not) annotated with
@MockClass
or an anonymous inner class defined inside a test method.
The two tests above share a reusable mock class, MockDatabase
, which is applied to
the test class as a whole through the @UsingMocksAndStubs
annotation.
As the name suggests, this annotation can also be applied to make all tests in a given test class
use stub (empty) implementations for one or more classes.
In this case, we stub out the Email
class, which has methods that are called from
the tested class (MyBusinessService
) but aren't actually relevant in our tests (for
example, the setSubject(String)
method).
When a class is stubbed out, all of its methods, constructors, and static initializers (if any) are
temporarily replaced with empty implementations. However, an individual test method can still specify a particular
mock implementation for any of the stubbed out methods and constructors.
Notice that we also stub out static initializers in the Database
class, by
specifying the special method name "<clinit>
" in another attribute of the
@MockClass
annotation. This is necessary in this case because the
Database
class actually creates a JPA EntityManagerFactory
instance during its static
initialization.
Each test sets up specific mocks for the Email
class by creating an inline
mock-up class, which is a special kind of mock class where the mocked type is specified through a generic
type parameter instead of through the @MockClass(realClass = Xyz.class)
annotation.
Constructors can be mocked with mock methods named "$init
" and having the same
parameters as the constructor to be mocked.
A mock method named "$clinit
" will provide a mock implementation for the static
initialization block of the real class, if any.
The @Mock
annotation can optionally specify exact/min/max constraints on the
expected/allowed number of invocations to the corresponding real method/constructor.
Another attribute of this annotation is reentrant
(boolean with default of false), which allows a mock
method to call back to the real method, causing its real implementation to be executed.
For that, an instance field named it
must be defined in the mock class, and have the same type as the
real class. (This is a powerful AOP-like feature which should be used sparingly, though.)
Typically, the vast majority of tests can be written with the Expectations & Verifications API. There are situations, however, where the Annotations API can be an useful complement to that.


THE BELLY OF AN ARCHITECT A film review by Jeff Meyer Copyright 1988 Jeff Meyer
See at the Seattle Film Festival: THE BELLY OF AN ARCHITECT (Great Britain, 1987) Director/Screenwriter: Peter Greenaway Cast: Brian Dennehy, Chloe Webb, Lambert Wilson, Vanni Corbellini
I made a special point of going to see THE BELLY OF AN ARCHITECT since I had heard that, due to legal hassles, it may never see the light of day. I wish I could tell you that its absence from distribution would be a shame; unfortunately, I was totally at sea during the entire picture. The plot itself is interesting: a noted Chicago architect, Stourley Kracklite (Dennehy) and his much younger wife (Webb) travel to Rome so that Kracklite can fulfill a dream: design a tribute to the 18th century architect Etienne Louis Boullee. Kracklite is obsessed with Boullee, and his health begins to fail under the strain of getting the tribute prepared in time for the opening. Several of his sponsors are trying to turn it into a more commercial affair than Kracklite would like, and one (Wilson) begins to seduce Kracklite's wife. This drives Kracklite further into his obsession; he begins to write letters to Boullee, describing his problems; his gastric problems, which mimic Boullee's, become serious, and he wonders if his wife is poisoning him (like Alexander's wife did -- a famous statue of Alexander was done by Boullee).
I won't get into the conclusion, but you basically have the plot right there, and there are few surprises. No one is really very sympathetic in the film; Kracklite's wife and Kracklite basically work at destroying the other, and while you feel sorry for Kracklite as he breaks down, it's not the type of artistic obsession you can empathize with.  The photography is fairly staid, and things move at a snail's pace. About the only good thing I can say about it is that the shots of the Roman architecture are spectacular; but I am sure there are several PBS documentaries on Italian Architecture which could provide just as much scenic pleasure while sparing us the angst.
Not recommended.
Moriarty, aka Jeff Meyer INTERNET<EMAIL_ADDRESS>Manual UUCP: {uw-beaver, sun, microsoft}!fluke!moriarty
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
BiriBiriBeat
An Arduboy Otoge/Rhythm Game
|
#include "Squawk.h"
Go to the source code of this file.
Classes | |
| class | StreamROM |
| struct | pto_t |
| struct | cel_t |
| struct | fxm_t |
Macros | |
| #define | EFFECT_10 |
| #define | EFFECT_20 |
| #define | EFFECT_A0 |
| #define | EFFECT_EC |
| #define | PERIOD_MIN 28 |
| #define | PERIOD_MAX 3424 |
| #define | LO4(V) ((V) & 0x0F) |
| #define | HI4(V) (((V) & 0xF0) >> 4) |
| #define | MIN(A, B) ((A) < (B) ? (A) : (B)) |
| #define | MAX(A, B) ((A) > (B) ? (A) : (B)) |
| #define | FREQ(PERIOD) (p_fxm->tune + tuning_long / (PERIOD)) |
Functions | |
| uint8_t | __attribute__ ((used)) pcm |
| static int8_t | do_osc (pto_t *p_osc) |
| static uint16_t | arpeggio (uint8_t ch, uint8_t halftones) |
| static uint16_t | glissando (uint8_t ch) |
| static void | decrunch_row () |
| static void | playroutine_reset () |
Variables | |
| static uint8_t | order_count |
| static uint8_t | order [64] |
| static uint8_t | speed |
| static uint8_t | tick |
| static uint8_t | ix_row |
| static uint8_t | ix_order |
| static uint8_t | ix_nextrow |
| static uint8_t | ix_nextorder |
| static uint8_t | row_delay |
| static fxm_t | fxm [4] |
| static cel_t | cel [4] |
| static uint32_t | tuning_long = (long)(((double)3669213184.0 / (double) 32000UL ) * (double) 1UL ) |
| static uint16_t | tick_rate = 50UL |
| static uint16_t | tick_counter = 0 |
| static uint8_t | loop_counter = 0 |
| static SquawkStream * | stream |
| static uint16_t | stream_base |
| static StreamROM | rom |
| intptr_t | squawk_register |
| uint16_t | cia |
| uint16_t | cia_count |
| osc_t | __attribute__ ((used)) osc[4] |
| void(* | first_tick_func )(void) = NULL |
| const uint16_t | period_tbl [84] |
| const int8_t | sine_tbl [32] |
| SquawkSynth | Squawk |
| static uint8_t | count_in = 0 |
| #define EFFECT_10 |
Definition at line 13 of file Squawk.cpp.
| #define EFFECT_20 |
Definition at line 14 of file Squawk.cpp.
| #define EFFECT_A0 |
Definition at line 20 of file Squawk.cpp.
| #define EFFECT_EC |
Definition at line 32 of file Squawk.cpp.
| #define FREQ | ( | PERIOD | ) | (p_fxm->tune + tuning_long / (PERIOD)) |
Definition at line 45 of file Squawk.cpp.
| #define HI4 | ( | V | ) | (((V) & 0xF0) >> 4) |
Definition at line 42 of file Squawk.cpp.
| #define LO4 | ( | V | ) | ((V) & 0x0F) |
Definition at line 41 of file Squawk.cpp.
| #define MAX | ( | A, | |
| B | |||
| ) | ((A) > (B) ? (A) : (B)) |
Definition at line 44 of file Squawk.cpp.
| #define MIN | ( | A, | |
| B | |||
| ) | ((A) < (B) ? (A) : (B)) |
Definition at line 43 of file Squawk.cpp.
| #define PERIOD_MAX 3424 |
Definition at line 38 of file Squawk.cpp.
| #define PERIOD_MIN 28 |
Definition at line 37 of file Squawk.cpp.
| uint8_t __attribute__ | ( | (used) | ) |
|
inlinestatic |
|
static |
Definition at line 312 of file Squawk.cpp.
|
static |
|
inlinestatic |
|
static |
Definition at line 370 of file Squawk.cpp.
| void __attribute__ |
Definition at line 504 of file Squawk.cpp.
|
static |
Definition at line 94 of file Squawk.cpp.
| uint16_t cia |
| uint16_t cia_count |
|
static |
Definition at line 487 of file Squawk.cpp.
| void(* first_tick_func) (void) = NULL |
Definition at line 117 of file Squawk.cpp.
|
static |
Definition at line 93 of file Squawk.cpp.
|
static |
Definition at line 91 of file Squawk.cpp.
|
static |
Definition at line 90 of file Squawk.cpp.
|
static |
Definition at line 89 of file Squawk.cpp.
|
static |
Definition at line 88 of file Squawk.cpp.
|
static |
Definition at line 102 of file Squawk.cpp.
|
static |
Definition at line 85 of file Squawk.cpp.
|
static |
Definition at line 84 of file Squawk.cpp.
| const uint16_t period_tbl[84] |
Definition at line 120 of file Squawk.cpp.
|
static |
Definition at line 106 of file Squawk.cpp.
|
static |
Definition at line 92 of file Squawk.cpp.
| const int8_t sine_tbl[32] |
Definition at line 131 of file Squawk.cpp.
|
static |
Definition at line 86 of file Squawk.cpp.
| SquawkSynth Squawk |
Definition at line 137 of file Squawk.cpp.
| intptr_t squawk_register |
|
static |
Definition at line 104 of file Squawk.cpp.
|
static |
Definition at line 105 of file Squawk.cpp.
|
static |
Definition at line 87 of file Squawk.cpp.
|
static |
Definition at line 101 of file Squawk.cpp.
|
static |
Definition at line 100 of file Squawk.cpp.
|
static |
Definition at line 95 of file Squawk.cpp.


{% load i18n %}
{% blocktrans %} {{PRODUCT_NAME}} supports closing review requests that are referenced in commit messages for any changes pushed to this repository. These references are in the form of: {% endblocktrans %}
Reviewed at {{example_url}}
{% trans "Or:" %}
Review Request #{{example_id}}
{% blocktrans %} To configure this, add a new webhook for your GitHub repository and set: {% endblocktrans %}
| Payload URL: | {{webhook_endpoint_url}} |
|---|---|
| Content type: | application/json |
| Secret: | {{hook_uuid}} |
{% blocktrans %} Then click Add webhook. You're done! {% endblocktrans %}


Public Member Functions | |
| __construct ($default_cell_emptychars= '', $alternate=true, $altclass= 'odd_row') | |
| __destruct () | |
| loop_attributes ($attrs="") | |
| tbl_open ($attrs=null, $caption=null, $cap_attrs=null) | |
| colgroup ($data= '', $attrs=null) | |
| col ($attrs=null) | |
| tbl_head ($data, $attrs=null) | |
| assemble_headers ($headrowdata) | |
| tbl_row ($data, $attrs=null) | |
| tbl_cell ($data, $type="TD", $attrs=null) | |
| tbl_body ($data, $attrs=null) | |
| tbl_foot ($data, $attrs=null) | |
| assemble_rows ($data) | |
| tbl_close () | |
| display ($table_data) | |
Class for the creation of simple data tables
| __construct | ( | $default_cell_emptychars = '' , |
|
$alternate = true , |
|||
$altclass = 'odd_row' |
|||
| ) |
| string | $default_cell_emptychars | |
| bool | $alternate | |
| string | $altclass |
| __destruct | ( | ) |
Destructor. Unsets all object variables
| assemble_headers | ( | $headrowdata | ) |
| assemble_rows | ( | $data | ) |
loops throu an array of data assembling each row
| $data |
| col | ( | $attrs = null | ) |
generates an HTML <col> element and its attributes
| array | $attrs | array of attributes for <col> |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <col> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) span NUMBER 1 – COL attributes affect N columns – width MultiLength; – column width specification – halign – horizontal alignment in cells – valign – vertical alignment in cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| colgroup | ( | $data = '' , |
|
$attrs = null |
|||
| ) |
generates an HTML <colgroup> element and its contents
| string | $data | the data to be entered between the opening and closing <colgroup> elements |
| array | $attrs | array of attributes for <colgroup> |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <colgroup> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) span NUMBER 1 – default number of columns in group – width MultiLength; – default width for enclosed COLs – halign – horizontal alignment in cells – valign – vertical alignment in cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| display | ( | $table_data | ) |
| string | $table_data |
| loop_attributes | ( | $attrs = "" | ) |
CORE ATTRIBUTES - this section is just reference info for use with the class ATTRIBUTE VALUE TYPE DESCRIPTION id ID – document-wide unique id – class CDATA – space-separated list of classes – style StyleSheet; – associated style info – title Text; – advisory title –
I18N (Internationalization) ATTRIBUTE VALUE TYPE DESCRIPTION lang LanguageCode; – ISO language code – dir (ltr|rtl) – direction for weak/neutral text –"
EVENT HANDLERS ATTRIBUTE VALUE TYPE DESCRIPTION onclick Script; – a pointer button was clicked – ondblclick Script; – a pointer button was double clicked– onmousedown Script; – a pointer button was pressed down – onmouseup Script; – a pointer button was released – onmouseover Script; – a pointer was moved onto – onmousemove Script; – a pointer was moved within – onmouseout Script; – a pointer was moved away – onkeypress Script; – a key was pressed and released – onkeydown Script; – a key was pressed down – onkeyup Script; – a key was released –"
returns a string of attributes
| mixed | $attrs | attributes, most often an array, can also be a string |
| tbl_body | ( | $data, | |
$attrs = null |
|||
| ) |
generates an HTML <tbody> element and its data
| mixed | $data | the data to be inserted into the <tbody> |
| array | $attrs | array of attributes for |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <tbody> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) halign – horizontal alignment in cells – valign – vertical alignment in cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| tbl_cell | ( | $data, | |
$type = "TD" , |
|||
$attrs = null |
|||
| ) |
generates an HTML
or
element and its contents
| mixed | $data | the data to be inserted into the cell |
| string | $type | whether this is a |
or
cell
| array | $attrs | array of attributes for |
$attrs is an array of any of the possible attributes valid in the HTML spec for the
or
element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) abbr Text; – abbreviation for header cell – axis CDATA – comma-separated list of related headers– headers IDREFS – list of id's for header cells – scope Scope; – scope covered by header cells – rowspan NUMBER 1 – number of rows spanned by cell – colspan NUMBER 1 – number of cols spanned by cell – halign – horizontal alignment in cells – valign – vertical alignment in cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| tbl_close | ( | ) |
| tbl_foot | ( | $data, | |
$attrs = null |
|||
| ) |
generates an HTML <tfoot> element and its contents
| mixed | $data | the data to be inserted into the <tfoot> |
| array | $attrs | array of attributes for |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <tbody> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) halign – horizontal alignment in cells – valign – vertical alignment in cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| tbl_head | ( | $data, | |
$attrs = null |
|||
| ) |
generates an HTML <thead> element and its contents
| mixed | $data | the data to be inserted into the <thead> |
| array | $attrs | array of attributes for <thead> |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <thead> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document)
These attributes must be arranged like: $attrs['attribute'] = "value";
| tbl_open | ( | $attrs = null , |
|
$caption = null , |
|||
$cap_attrs = null |
|||
| ) |
begins an HTML table
| array | $attrs | array of attributes for |
| array | $cap_attrs | array of attributes for |
$attrs is an array of any of the possible attributes valid in the HTML spec for the
. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) summary Text; – purpose/structure for speech output– width Length; – table width – border Pixels; – controls frame width around table – frame TFrame; – which parts of frame to render – rules TRules; – rulings between rows and cols – cellspacing Length; – spacing between cells – cellpadding Length; – spacing within cells – These attributes must be arranged like: $attrs['attribute'] = "value";
| tbl_row | ( | $data, | |
$attrs = null |
|||
| ) |
generates an HTML
element and its contents
| mixed | $data | the data to be inserted into the |
| array | $attrs | array of attributes for |
$attrs is an array of any of the possible attributes valid in the HTML spec for the <thead> element. I name them here just for reference: (In addition to the attributes listed below, this element can use any of the attributes listed at the head of this document) These attributes must be arranged like: $attrs['attribute'] = "value";


Using new with String Objects
Often, the new operator is not used when allocating a String object. For example, when initializing a String, we may write:
String s = "ABC"
instead of writing:
String s = new String("ABC");
The reason that not using the new operator works is because the String object is a special object, unique in Java. When the language was implemented, the designers decided to allow programmers to specify String objects, and String objects only, as a literal string of characters. Behind the scenes, Java is actually creating an object for you using the new operator. To emphasize the fact that an object is always created, however, this module will always use a new operator when creating a String object.


Mario Details
About Us
Dashboard
Edit Profile
Post Jobs
My Jobs
Notifications
Log Out
Name
Service
Driver / pillon rider
Run errands
Handyman
Payment method
Credit / Debit card
Paypal ID
Profile picture
SAVE