GeoMesa Kafka Quick Start¶
This tutorial will show you how to:
- Write custom Java code to produce and consume messages in Apache Kafka using GeoMesa.
- Query the data and replay the messages in a Kafka topic to achieve an earlier state.
- Visualize the changes being made in Kafka with GeoServer.
Background¶
Apache Kafka is “publish-subscribe messaging rethought as a distributed commit log.”
In the context of GeoMesa, Kafka is a useful tool for working with streams of geospatial data. Interaction with Kafka in GeoMesa occurs with the KafkaDataStore which implements the GeoTools DataStore interface.
Prerequisites¶
- basic knowledge of GeoTools, GeoServer, and Kafka,
- an instance of Kafka 0.8.2.x with (an) appropriate Zookeeper instance(s),
- an instance of GeoServer version 2.8.1 with the GeoMesa Kafka plugin installed,
- Java JDK 8,
- Apache Maven 3.2.2 or better, and
- a git client.
In order to install the GeoMesa Kafka GeoServer plugin, follow the instructions here.
Ensure your Kafka and Zookeeper instances are running. You can use Kafka’s quickstart to get Kafka/Zookeeper instances up and running quickly.
Download and Build the Tutorial¶
Pick a reasonable directory on your machine, and run:
$ git clone https://github.com/geomesa/geomesa-tutorials.git
$ cd geomesa-tutorials
To build, run
$ mvn clean install -pl geomesa-quickstart-kafka
Note
Ensure that the version of Kafka and Zookeeper in
the root pom.xml
match your environment.
Note
Depending on the version, you may also need to build GeoMesa locally. Instructions can be found in Installation and Configuration.
Run the Code¶
On the command-line, run:
$ java -cp geomesa-quickstart-kafka/target/geomesa-quickstart-kafka-$VERSION.jar com.example.geomesa.kafka.KafkaQuickStart -brokers <brokers> -zookeepers <zookeepers>
where you provide the values for the following arguments:
<brokers>
your Kafka broker instances, comma separated. For a local install, this would belocalhost:9092
.<zookeepers>
your Zookeeper nodes, comma separated. For a local install, this would belocalhost:2181
.
The program will create some metadata in Zookeeper and an associated
topic in your Kafka instance, and pause execution to let you add the
newly created KafkaDataStore
to GeoServer. Once GeoServer has been
configured, we’ll pick back up with the paused program.
Optional command-line arguments for KafkaQuickStart
are:
-zkPath <zkpath>
: used for specifiying the Zookeeper path for storing GeoMesa metadata. Defaults to “/geomesa/ds/kafka” and ordinarily does not need to be changed-automated
: omits the pause in execution for configuring GeoServer.
The class may also be run using Maven via the live-test
profile.
$ mvn -Plive-test exec:exec -Dbrokers=<brokers> -Dzookeepers=<zookeepers>
Register the Store in GeoServer¶
Log into GeoServer using your credentials. Click “Stores” in the left-hand gutter and “Add new Store”. If you do not see the Kafka Data Store listed under Vector Data Sources, ensure the plugin and dependencies are in the right directory and restart GeoServer.
Select the Kafka Data Store
vector data source and enter the
following parameters:
- Basic Store Info
workspace
this is dependent upon your GeoServer installationdata source name
pick a sensible name, such as,geomesa_kafka_quickstart
description
pick a sensible description, such asGeoMesa Kafka quick start
- Connection Parameters
brokers
your Kafka broker instances, comma separated. Use the same ones you used on the command line.zookeepers
your Zookeeper nodes, comma separated. Use the same ones you used on the command line.
Leave all other fields empty or with the default value.
Click “Save” and GeoServer will search your Kafka instance for any GeoMesa-managed feature types.
Publish the Layer¶
GeoServer should find the KafkaQuickStart
feature type in the data
store and redirect you to the “New Layer” page, presenting the feature
type as a layer that can be published. Click on the “Publish” link. You
will be taken to the “Edit Layer” page.
Warning
If you have not yet run the quick start code as described
in Run the Code above, the feature type will not have been
registered and you will not get a “New Layer” page after saving the
store. In this case, run the code as described above, click on
“Layers” in the left-hand gutter, click on “Add a new resource”, and
select your data store in the pulldown next to “Add layer from”. The
link to publish the KafkaQuickStart
feature should appear.
You can leave most fields as default. In the Data pane, you’ll need to enter values for the bounding boxes. In this case, you can click on the links to compute these values from the data. Click “Save”.
View the layer¶
Click on the “Layer Preview” link in the left-hand gutter. If you don’t see the quick-start layer on the first page of results, enter the name of the layer you just created into the search box, and press <Enter>.
Once you see your layer, click on the “OpenLayers” link, which will open a new tab. At this point, there are no messages in Kafka so nothing will be shown.
Produce Some Data¶
Resume the program’s execution by inputting <Enter> in your terminal now
that the KafkaDataStore
is registered in GeoServer. The program will
create two SimpleFeature
s and then write a stream of updates to
the two SimpleFeature
s over the course of about a minute.
You can refresh the GeoServer layer preview repeatedly to visualize the updates being written to Kafka.
What’s Happening in GeoServer¶
The layer preview of GeoServer uses the
LiveKafkaConsumerFeatureSource
to show a real time view of the
current state of the data stream. Two SimpleFeature
s are being
updated over time in Kafka which is reflected in the GeoServer display.
As you refresh the page, you should see two SimpleFeature
s that
start on the left side gradually move to the right side while crossing
each other in the middle. As the two SimpleFeature
s get updated,
the older SimpleFeature
s disappear from the display.
Consumers Explained¶
GeoMesa wraps Kafka consumers in two different ways; as a
LiveKafkaConsumerFeatureSource
or a
ReplayKafkaConsumerFeatureSource
. Both of these classes implement
GeoTools’
FeatureSource
API.
The LiveKafkaConsumerFeatureSource
will consume messages as they are
being produced and maintain the real time state of SimpleFeatures
pertaining to a Kafka topic.
The ReplayKafkaConsumerFeatureSource
allows users to specify any
range of time in order to obtain the state of SimpleFeatures from any
previous moment.
View the Consumer Output¶
The program will construct the live and replay consumers and log SimpleFeatures to the console after all the messages are sent to Kafka and therefore after all the updates are made.
The live consumer will log the state of the two SimpleFeatures after all
updates are finished. The replay consumer will log the state of the two
SimpleFeatures five seconds earlier than the last update. The replay
consumer will create a new SimpleFeatureType
with an additional
attribute KafkaLogTime
. By preserving the KafkaLogTime
as an
attribute, we can create the state of SimpleFeatures at time x by
querying for when KafkaLogTime
equals x.
Consuming with the live consumer...
2 features were written to Kafka
Here are the two SimpleFeatures that were obtained with the live consumer:
fid:1 | name:James | age:20 | dtg:Mon Dec 14 19:08:23 EST 2015 | geom:POINT (180 90)
fid:2 | name:John | age:62 | dtg:Fri Oct 02 09:56:49 EDT 2015 | geom:POINT (180 -90)
Consuming with the replay consumer...
2 features were written to Kafka
Here are the two SimpleFeatures that were obtained with the replay consumer:
fid:2 | name:John | age:52 | dtg:Thu May 21 21:27:19 EDT 2015 | geom:POINT (132 -66) | KafkaLogTime:Tue Jun 09 13:33:47 EDT 2015
fid:1 | name:James | age:59 | dtg:Sat Jan 24 06:26:44 EST 2015 | geom:POINT (132 66) | KafkaLogTime:Tue Jun 09 13:33:47 EDT 2015
For a deeper understanding of what’s going on, we recommend exploring the source code.
(Optional) Listening for FeatureEvents¶
The GeoTools API also includes a mechanism to fire off a
`FeatureEvent
<http://docs.geotools.org/stable/javadocs/index.html?org/geotools/data/FeatureEvent.Type.html>`__
each time there is an event (typically when the data are changed) in a
DataStore
. A client may implement a
`FeatureListener
<http://docs.geotools.org/stable/javadocs/index.html?org/geotools/data/FeatureEvent.Type.html>`__,
which has a single method called changed()
that is invoked as each
FeatureEvent
is fired.
The code in com.example.geomesa.kafa.KafkaListener
implements a
simple FeatureListener
that simply prints the messages received.
Open up a second terminal window and run:
$ java -cp geomesa-quickstart-kafka/target/geomesa-quickstart-kafka-${geomesa.version}.jar com.example.geomesa.kafka.KafkaListener -brokers <brokers> -zookeepers <zookeepers>
and use the same settings for <brokers>
and <zookeepers>
. Then
in the first terminal window, re-run the KafkaQuickStart
code as
before. The KafkaListener
terminal should produce messages like the
following:
Received FeatureEvent of Type: CHANGED
fid:1 | name:Hannah | age:53 | dtg:Sun Dec 13 11:04:40 EST 2015 | geom:POINT (-66 -33)
Received FeatureEvent of Type: CHANGED
fid:2 | name:Claire | age:77 | dtg:Thu Feb 26 02:06:41 EST 2015 | geom:POINT (-66 33)
The KafkaListener
code will run until interrupted.
The portion of KafkaListener
that creates and implements the
FeatureListener
is:
// the live consumer must be created before the producer writes features
// in order to read streaming data.
// i.e. the live consumer will only read data written after its instantiation
SimpleFeatureSource consumerFS = consumerDS.getFeatureSource(sftName);
consumerFS.addFeatureListener(new FeatureListener() {
@Override
public void changed(FeatureEvent featureEvent) {
System.out.println("Received FeatureEvent of Type: " + featureEvent.getType());
if (featureEvent.getType() == FeatureEvent.Type.CHANGED &&
featureEvent instanceof KafkaFeatureEvent) {
printFeature(((KafkaFeatureEvent) featureEvent).feature());
}
if (featureEvent.getType() == FeatureEvent.Type.REMOVED) {
System.out.println("Received Delete for filter: " + featureEvent.getFilter());
}
}
});
Additionally, the KafkaQuickStart
class run above can generate a
‘clear’ control message at the end of the run if you specify
“-Dclear=true” on the commandline. This will generate a Feature removed
FeatureEvent
with a Filter.INCLUDE
.
$ java -Dclear=true -cp geomesa-quickstart-kafka/target/geomesa-quickstart-kafka-${geomesa.version}.jar com.example.geomesa.kafka.KafkaQuickStart -brokers <brokers> -zookeepers <zookeepers>
KafkaDataStore Load Test¶
For those interested in load testing the KafkaDataStore, there is a simple utility with constructs any number of SimpleFeatures, rolls a random latitude, and then have them step left or right.
$ java -cp target/geomesa-quickstart-kafka-${geomesa.version}.jar com.example.geomesa.kafka.KafkaLoadTester -brokers <brokers> -zookeepers <zookeepers> -count <count>
The ‘count’ parameter is optional. Without it, the tool defaults to 1000 SimpleFeatures.
Conclusion¶
Given a stream of geospatial data, GeoMesa’s integration with Kafka enables users to maintain a real time state of SimpleFeatures or retrieve any arbitrary state preserved in history. One can additionally process and analyze streams of data by integrating a data processing system like Storm or Samza. See the GeoMesa Storm Quick Start tutorial for more information on using Storm with GeoMesa.
For additional information about the KafkaDataStore
, see the
readme
on github.


{% for b in bathrooms %}
{{b[2]}} bathroom on floor {{b[1]}} of {{b[3]}} with rating {% if b[4] %}{{"%.2f" % b[4]}}{% else %} - {% endif %}
{% endfor %}
Add a building
Add a bathroom
Add a major
Modify your user
Associate a building and a major
Bathrooms open to you
Bathrooms open to everyone right now


First of all congratulations for that great hardware and software tool.
I am trying to design a dashboard in my own language (Spanish) using accents ( with the Á sintax) and it worked fine but when i save and reload de dashboard that html code disappears.
Maybe the js parser clean that code. Is there a solution or are you working in the fix?... if you want i could make a fix code ;-)
Best regards
ilde
Re: Problems using accents
Hello Ilde, a fix would be most welcome! thanks
Re: Problems using accents
Hello
i have detected a problem with that the line: $("#page").html($("#editarea").val()); in dashboard_view.php
From http://api.jquery.com/html/ documentation: Some browsers may not return HTML that exactly replicates the HTML source in an original document
so, if i write/edit some html code it could change significantly for example when using accents symbols. Trying to fix it i have been thinking in use another editor like open source ckeditor as a talk about in (i think is the same that the forum is using) http://openenergymonitor.org/emon/node/583
Waiting for hear your comments. Best regards.
Ilde


Navy squeezes past East Carolina 62-57 in Veterans Classic
by DAVID GINSBURGANNAPOLIS, Md. (AP) - John Carter Jr. had 13 points and 10 rebounds, and Navy used a second-half surge to beat East Carolina 62-57 Friday night in the Veterans Classic.
The Midshipmen (1-1) trailed 38-31 with 14 minutes left and 47-43 with 6 ½ minutes to go before finishing with a 19-10 run.
Cam Davis scored 14 and Greg Summers added 13 for Navy, which evened its record after falling to George Mason in overtime three days earlier.
Jayden Gardner led the Pirates (1-1) with 15 points and Seth LeDay had 11.
After going 10-21 in his first season at East Carolina, coach Joe Dooley signed seven junior college transfers and four freshmen. The Pirates’ 11 newcomers are most in the country, and it’s apparent that they’re still learning how to play together.
The Pirates had 19 turnovers, shot 41 percent and were outscored 39-28 in the second half.
After falling behind 29-23 at halftime, Navy made little headway until Carter made two free throws and a 3-pointer to spark a 12-2 run that gave the Midshipmen their first lead since the game’s opening minutes.
LeDay then sandwiched a pair of dunks around a 3-point bank shot by J.J. Miles for a four-point advantage, but Navy answered with a 9-2 spurt that began with a three-point play by Davis and four straight free throws by Summers.
The Midshipmen stayed in front by sinking six free throws over the final 42 seconds.
In the first game of the annual Veterans Classic, No. 24 Auburn defeated Davidson 76-66.
GRACIOUS HOSTS
Navy has now won twice in the six-year history of this tournament, also defeating Pittsburgh in 2017. The Midshipmen have lost to Maryland, Ohio State, Florida and Michigan State.
BIG PICTURE
East Carolina: The rebuilding Pirates lack experience, and their uncertainty down the stretch shows they’ve got some growing to do before opening play in the American Athletic Conference.
Navy: The Midshipmen always hustle, play with grit and won’t hesitate to dive after a loose ball. Sometimes, that’s good enough - even with 22 turnovers.
UP NEXT
East Carolina seeks to rebound with a trip to Appalachian State on Tuesday night.
Navy hosts Washington College (Md.) on Sunday. The Midshipmen beat the Division III school 110-45 on Nov. 22, 2017.
For more AP college basketball coverage: https://apnews.com/Collegebasketball and http://twitter.com/AP_Top25
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Albedo
“Albedo is a non-dimensional, unit-less quantity that indicates how well a surface reflects solar energy. Albedo (Î±) varies between 0 and 1. Albedo commonly refers to the “whiteness” of a surface, with 0 meaning black and 1 meaning white. A value of 0 means the surface is a “perfect absorber” that absorbs all incoming energy. Absorbed solar energy can be used to head the surface or, when sea ice is present, melt the surface. A value of 1 means the surface is a “perfect reflector” that reflects all incoming energy.
Albedo generally applies to visible light, although it may involve some of the infrared region of the electromagnetic spectrum. You understand the concept of low albedo intuitively when you avoid walking barefoot on blacktop on a hot summer day. Blacktop has a much lower albedo than concrete because the black surface absorbs more energy and reflects very little energy.
Sea ice has a much higher albedo compared to other Earth surfaces, such as the surrounding ocean. A typical ocean albedo is approximately 0.06, while bare sea ice varies from approximately 0.5 to 0.7. This means that the ocean reflects only 6% of the incoming solar radiation and absorbs the rest, while sea ice reflects 50% to 70% of the incoming energy. The sea ice absorbs less solar energy and keeps the surface cooler.
Snow has an even higher albedo than sea ice, and so thick sea ice covered with snow reflects as much as 90% of the incoming solar radiation. This serves to insulate the sea ice, maintaining cold temperatures and delaying ice melt in the summer. After the snow does begin to melt, and because shallow melt ponds have and albedo of approximately 0.2 to 0.4, the surface albedo drops to about 0.75. As melt ponds grow and deepen, the surface albedo can drop to 0.15. As a result, melt ponds are associated with higher energy absorption and a more rapid ice melt.”


Projects
These are some of the projects I have worked on.
Capstone ePortfolio
View Project
Read Details
Javascript Calculator
View Project
Read Details
Picture Scramble
View Project
Read Details
Quote Generator
View Project
Read Details
Local Weather App
View Project
Read Details
Wikipedia Search
View Project
Read Details
×
Capstone ePortfolio
My ePortfolio site was created as the capstone
achievement for my Masters of Information Science. It was selected to win
the Outstanding ePortfolio award for 2016.
It contains much of my academic work, as well as further examples
of my projects that relate to Information Architecture,
Content Management Systems, and database design.
×
JavaScript Calculator
This is a simple calculator that I made while learning JavaScript.
The user interface of the calculator was created using HTML and styled with css,
the functionality was coded using only JavaScript.
Through this project, I learned a great deal about using events and event listeners,
as well as the importance of logic planning.
×
Picture Scramble
This is the second version of Picture Scramble.
The first version made use of the HTML5 data transfer API to switch the tiles, which
relied on a dragStart event to begin the transfer. While this approach worked great on a PC,
it proved to be problematic for mobile or touch devices since the dragStart was depedant on a
mouse click event. To solve this issue, I used the JQuery UI library and Touch Punch which did
an excellent job of providing touch functionality. Both versions make use of JavaScript and
JQuery to generate the puzzle in an empty HTML div element called “board” when the page loads.
The source code for each version is available through my GitHub repository.
×
Quote Generator
I created this quote generator as one of the zipline challenges from
FreeCodeCamp. It was my first hands on experience creating an interface that communicated with
a third party API. The app makes a request to Quotes on Design for a random quote and receives
the quote in the form of a JSON object. The data is then formatted and displayed in the textbox
on the user interface where it can then be tweeted by clicking the tweet button.
×
Local Weather
This app makes use of geolocation to determine the users coordinates and then makes
a call to the OpenWeather API to retrieve the local weather information in the form of a JSON object. It then
displays the information along with a background image and icon appropriate to the weather conditions.
Images are courtesy of Pixabay and the icons are from the
Weather Icons open-source icon font project.
×
Wikipedia Search
This app uses the Wikipedia API to retrieve the first ten results related to the users search
criteria. Through creating this app, I learned a great deal about how API’s work as well as query formulation to
retrieve only the desired information. The MediaWiki and Wikipedia API’s offer an impressive amount of flexibility
and search customization options.


Hydrohomies
See All Reviews
Add New Beverages
Logout
Tell us what you think!!
Enter the information for the beverage you want to review:
Choose a Brand:
Choose a Flavor:
Bubbles?
Rating
Review Title:
Review:
Submit your Review
Loading....


Basic Usage
Demonstrates basic usage of the plugin.
Side by side
Using multiple comparisons at once.


Welcome to Quantum Algorithms
Started at https://github.com/TheAlgorithms/Python/issues/1831
-
D-Wave: https://www.dwavesys.com and https://github.com/dwavesystems
- Google: https://research.google/teams/applied-science/quantum
- IBM: https://qiskit.org and https://github.com/Qiskit
- Rigetti: https://rigetti.com and https://github.com/rigetti
IBM Qiskit
-
Start using by installing
pip install qiskit
, refer the
docs for
more info.
-
Tutorials & References
- https://github.com/Qiskit/qiskit-tutorials
- https://quantum-computing.ibm.com/docs/iql/first-circuit
-
https://medium.com/qiskit/how-to-program-a-quantum-computer-982a9329ed02


The Launch Dock can be used to find and load or edit the launch files. The root contains the paths defined by ROS_PACKAGE_PATH environment variable. Only configuration relevant files are shown in launch dock.The extentions of display files can be changed in the settings dock (Parameter: 'Show files extentions').
The launch dock uses gRPC to communicate with node manager daemon and to manage configuration files. This allows to load and edit configuration files on remote host. The connection to remote host is displayed in the launch dock if a host is selected in network dock
On load, the launch file itself and all included files are added to a watcher list. Each time the node manager is focused it checks however a file was changed. If one of this files was changed, you will prompt to reload the launch file. If changes for a node are detected you will be asked to restart the changed node. In the root also will be shown a history of last five loaded launch files. When needed, the selected history files can be removed by pressing the Delete button.
You can also search for a package where the launch-file is located.Launch control buttons:
| Refresh the current path. | |
| Opens the launch file in a Launch Editor. | |
| Creates a new launch file. | |
| Copies the selected file to a remote hosts. Optionally, the included files are copied, too. | |
| Loads the launch file and show the content on the selected host. |


The Firebird Base library for Python¶
The firebird-base
package provides common Python 3 modules used by Firebird Project
in various development projects. However, these modules have general applicability outside
the scope of development for Firebird RDBMS.
Topic covered by firebird-base
package:
General data types like
singletons
,sentinels
and objects with identity.Unified system for data conversion from/to string.
DataList
andRegistry
collection types with advanced data-processing cappabilities.Work with structured binary buffers.
Global registry of Google
protobuf
messages and enumerations.Extended configuration system based on
ConfigParser
.Context-based logging.
Trace/audit for class instances.
General “hook” mechanism.
Callback system based on Signals and Slots, and “Delphi events”.
Note
Requires Python 3.8+
Tip
You can download docset for Dash (MacOS) or Zeal (Windows / Linux) documentation readers from releases at github.


| Package | Description |
|---|---|
| edu.cmu.sphinx.decoder.search |
Provides classes and interfaces that are used to manage the search
through the search graph.
|
| edu.cmu.sphinx.linguist |
Provides a set of interfaces and classes that are used to define the
search graph used by the decoder.
|
| edu.cmu.sphinx.linguist.dictionary |
Provides a generic interface to a dictionary as well as several
implementations.
|
| edu.cmu.sphinx.linguist.flat |
Provides an implementation of the
Linguist that
statically represents the search space as a flat graph, where each
word in the vocabulary has its own branch. |
| edu.cmu.sphinx.linguist.language.classes | |
| edu.cmu.sphinx.linguist.language.grammar |
Provides classes and interfaces that can be used to represent a graph of words and word transitions.
|
| edu.cmu.sphinx.linguist.language.ngram.large |
Provides an implementation of the LanguageModel interface.
|
| edu.cmu.sphinx.result |
Provides a set of classes that represent the result of a recognition.
|
| Modifier and Type | Method and Description |
|---|---|
Word |
Token.getWord()
Returns the word of this Token, the search state is a WordSearchState.
|
| Modifier and Type | Method and Description |
|---|---|
Word |
WordSequence.getWord(int n)
Returns the n-th word in this sequence
|
Word[] |
WordSequence.getWords() |
| Modifier and Type | Method and Description |
|---|---|
WordSequence |
WordSequence.addWord(Word word,
int maxSize)
Returns a new word sequence with the given word added to the sequence
|
| Constructor and Description |
|---|
WordSequence(Word... words)
Constructs a word sequence with the given word IDs
|
| Constructor and Description |
|---|
WordSequence(List<Word> list)
Constructs a word sequence from the list of words
|
| Modifier and Type | Field and Description |
|---|---|
static Word |
Word.UNKNOWN
The Word representing the unknown word.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Word> |
TextDictionary.wordDictionary |
| Modifier and Type | Method and Description |
|---|---|
Word[] |
TextDictionary.getFillerWords()
Gets the set of all filler words in the dictionary
|
Word[] |
Dictionary.getFillerWords()
Gets the set of all filler words in the dictionary
|
Word |
TextDictionary.getSentenceEndWord()
Returns the sentence end word.
|
Word |
Dictionary.getSentenceEndWord()
Returns the sentence end word.
|
Word |
TextDictionary.getSentenceStartWord()
Returns the sentence start word.
|
Word |
Dictionary.getSentenceStartWord()
Returns the sentence start word.
|
Word |
TextDictionary.getSilenceWord()
Returns the silence word.
|
Word |
Dictionary.getSilenceWord()
Returns the silence word.
|
Word |
Pronunciation.getWord()
Retrieves the word that this Pronunciation object represents.
|
Word |
TextDictionary.getWord(String text)
Returns a Word object based on the spelling and its classification.
|
Word |
Dictionary.getWord(String text)
Returns a Word object based on the spelling and its classification.
|
| Modifier and Type | Method and Description |
|---|---|
int |
Word.compareTo(Word other) |
void |
Pronunciation.setWord(Word word)
Sets the word this pronunciation represents.
|
| Modifier and Type | Method and Description |
|---|---|
Word[] |
AlternativeState.getAlternative()
Gets the word associated with this state
|
Word |
SentenceHMMState.getAssociatedWord()
Returns the word associated with the particular unit
|
Word |
WordState.getWord()
Gets the word associated with this state
|
| Modifier and Type | Method and Description |
|---|---|
Word |
ClassMap.getClassAsWord(String text) |
Word[] |
ClassPresentingDictionary.getFillerWords() |
Word |
ClassPresentingDictionary.getSentenceEndWord() |
Word |
ClassPresentingDictionary.getSentenceStartWord() |
Word |
ClassPresentingDictionary.getSilenceWord() |
Word |
ClassPresentingDictionary.getWord(String text)
This method disguises all classes as words.
|
| Modifier and Type | Method and Description |
|---|---|
Word[][] |
GrammarNode.getAlternatives()
Retrieves the words associated with this grammar node
|
Word |
GrammarNode.getWord()
Retrieve the single word associated with this grammar
|
Word[] |
GrammarNode.getWords(int alternative)
Retrieves the words associated with a specific alternative
|
| Constructor and Description |
|---|
GrammarNode(int id,
Word[][] alternatives)
Creates a GrammarNode with the given ID, Words.
|
| Modifier and Type | Method and Description |
|---|---|
int |
LargeNGramModel.getWordID(Word word)
Returns the ID of the given word.
|
boolean |
LargeNGramModel.hasWord(Word w)
Returns true if the language model contains the given word
|
| Modifier and Type | Method and Description |
|---|---|
Word |
WordResult.getWord()
Gets the word object associated with the given result.
|
Word |
Node.getWord()
Get the word associated with this Node
|
| Modifier and Type | Method and Description |
|---|---|
protected Node |
Lattice.addNode(String id,
Word word,
long beginTime,
long endTime)
Add a Node with a given ID that represents the theory that a given word
was spoken over a given period of time.
|
| Constructor and Description |
|---|
Node(String id,
Word word,
long beginTime,
long endTime)
Create a new Node with given ID.
|
Node(Word word,
long beginTime,
long endTime)
Create a new Node
|
WordResult(Word w,
TimeFrame timeFrame,
double score,
double posterior)
Construct a word result with full information.
|
Copyright © 2017. All rights reserved.


Status of Indonesia Multi-sectoral Response Plan
Partners’ Response Overview
The Multi Sectoral Response Plan aims at complementing the efforts of the Government of Indonesia in addressing the direct and indirect impact of the COVID-19 crisis.
The Roadmap of the impact of COVID-19 on the resilience of food systems is being finalized and the Technical Cooperation Programme is prepared to support addressing the most immediate consequences of the pandemic on food systems in the country.
Three bulletins on COVID-19 Economic and Food Security implications for Indonesia have been issued:
Partners’ COVID-19 response
Vulnerabilities
Fragilities in supply chain and markets are reducing people’s access to adequate diverse sources of food, both in rural and urban areas, especially where the pandemic has been severe and food insecurity is in any case pronounced.
Partners’ COVID-19 response
Activities
WFP has finalized the third bulletin on food security with snapshot of the implications of the pandemic on employment, livelihoods, food security and impact on social protection programmes.
WFP has initiated discussions with the Food Security Agency (BKP) of the MOA and BPS on its feasibility study on utilization of a WFP’s mobile data collection and monitoring (mVAM) in Indonesia. The system allows collecting data on early warning and monitoring the situation in remote locations.
The Rome-based Agencies (FAO, IFAD, and WFP) roadmap of the impact of COVID-19 on resilience of food systems is finalized and the Technical Cooperation Programme (TCP) is prepared to technically support the Government of Indonesia in addressing the most immediate consequences of the on-going pandemic on the food systems in the country.
FAO, UNICEF and WFP are in the process of implementing a survey to assess the status and determinants of household food security and the nutritional status of under-five and their mothers in informal urban settlements of Jakarta. This study, in such settings, will bring robust evidence on critical issues related to food security and nutrition and provides recommendations to Government and stakeholders for adapted interventions specific to poor urban communities.
WFP initiated collaboration with BKP in strengthening its unified food security and nutrition early-warning monitoring, which builds on the existing Food and Nutrition Surveillance Systems (SKPG).
As of 12 July, Rumah Zakat has provided about 20,000 food packages and 6,000 ready-to-eat meals benefitting to 24,381 poor households.
Partners’ Response Overview
Gaps and Constraints
There is limited multi-stakeholder coordination platform to address the most immediate consequences of the COVID-19 pandemic on the food systems in Indonesia.


Multiple Notification Messages
If this checkbox is set, Moderate will default to creating separate notification messages for each file when you are adding multiple files to a file list. Otherwise the default will be to create a single notification message for all the files.


iAgent::Kernel - The main iAgent Kernel
This perl module provides a simple interface to register plug-in modules and to dispatch system-wide messages.
Register a module on the iAgent system.
This system instances the specified class, initializes it, wraps it in a POE session, and registers it on the broadcast system.
Syntax:
iAgent::Kernel::Register({ class => "My::Module", - The class name of the module to instance args => { .. args .. }, - The arguments passed to the C<new> function and C<_start> event })
All the special information regarding the module priority, the handled POE Events, the config etc. are provided by the module manifest. To define a module manifest, you should create a global MANIFEST variable in the class with the following syntax:
package mySystem::myModule; use strict; our $MANIFEST = { # # [1] Define the hooks for the PoE events # You have 3 options: # # a) Use automatic detection (default) # # In this mode, the Kernel will scan the class subroutines and will # convert the ones prefixed with the specified prefix into event # handlers of the omonymous event. For example: # # sub __random_event () { } # # Will be called when the 'random_event' is dispatched. # # You can change the default prefix ('__') with your own, using the # hooks_prefix field. # hooks => 'AUTO', hooks_prefix => '__', # # b) Use only specified event handlers that have the same name # with the event # hooks => [ 'start', 'stop', 'msg_arrived', 'msg_dispatched' ], # # c) Explicitly define what subs handle what event # hooks => { 'start' => 'start_handler', 'msg_arrived' => 'data_handler', 'data_arrived' => 'data_handler' } # # [2] Define the (optional) configuration file associated with this module # # This configuration file must be located on iAgent's etc folder. # config => 'my_config.conf', # # [3] Define the module priority # # Each module has a specific priority. When a event is dispatched it starts from # the module with the highest priority until it reaches the target. This helps # adding pre/post processing modules for the events. Some typical priorities follow: # # +----------+--------------------------------------------+ # | Priority | Typical use | # +----------+--------------------------------------------+ # | 0 ~ 1 | I/O Modules, such as the XMPP module | # | 2 ~ 4 | Filtering modules such as authentication, | # | | authorization etc, such as LDAP Module | # | 5 | Default module priority | # | 6 ~ 10 | Post-processing modules | # +----------+--------------------------------------------+ # priority => 6 };
A typical manifest will have the following structure:
our $MANIFEST = { config => 'your config here.conf', priority => 5 };
If nothing specified (not even the $MANIFEST variable), the defaults are:
our $MANIFEST = { hooks => 'AUTO', hooks_prefix => '__', priority => 5 };
The kernel creates a POE Session for each module. It uses an intuitive design in order to require less code while designing modules.
First of all, you never create the PoE Session yourself. You only define the class for your module, and provide the required hook handlers. The system will then analyze your class, instance it and register it on the PoE and Broadcast system.
The instance is performed that way:
$instance = new YOURCLASS ( \%CONFIG_FILE_HASH );
And then registered in a dedicated POE session that way:
POE::Session::Create( args => \%CONFIG_FILE_HASH, object_states => { $YOUR_OBJECT_INSTANCE => { # Automatically detected or manually # defined (from the MANIFEST) hooks ... } }, heap => { CLASS => 'Your::class::package::name', MANIFEST => \%YOUR_CLASS_MANIFEST } )
Asynchronously broadcast a message.
This function posts a message to all the registered sessions (using the Register function). This function exits immediately with return value '1', so no further processing can be done on the result.
iAgent::Kernel::Broadcast( 'message', .. args .. )
Synchronously broadcast a message.
This function calls the specified message handler on each registered session, waits for a reply and continues accordingly:
If the message handler returns 0 the message broadcasting stops. No upcoming plugin receives that message.
If the message handler returns 1 the message broadcast continues. (Thats usually what you should always return)
If the message handler returns any other value, the broadcast continues, and additionally the return value of the function is set to that value.
my $result = iAgent::Kernel::Dispatch( 'message', .. args .. )
The function retuns the following values:
If no plugin received the event
If no plugin responded
If the message dispatch was canceled
If the message was processed successfuly
If the message was processed successfuly, and the return value is the return value of the last handler's return value.
Query all the plugins
This function is simmilar to Dispatch
. However, this function just collects all the return
values and stacks them in an array.
The return value of this function is an array reference that conains the results of the called message handlers.
my $results = iAgent::Kernel::Query('message', ...); # The result is something like: $results = { $object => # Return Value # };
Reply to a currently active message.
It is recommended to use this function to reply to Dispatch
or Broadcast
, rather than using directly POE,
becuase this function also processes the message through the plugin stack.
This function detects the target and caller's position in the hierectary and then dispatches the event to all the plugins inbetween.
my $result = iAgent::Kernel::Reply( 'message', .. args .. )
Notify a plugin crash
This function is either called by an error trap or by the plugin itself when an unrecoverable error occured. This function will unregister the plugin from the message queue, do the appropriate cleanup and log/reporting and if possible, try to reload the plugin.
If there was a successful restart, the event 'recovered' will be sent to the plugin, passing as first argument the hash that was passed to this function as a second argument. This enables a custom recovery handling mechanism for the plugins.
This function should be called from within the plugin class and has the following syntax:
iAgent::Kernel::Crash( 'crash message', { .. details hash .. } # Optional )
Inform the iAgent kernel that the calling session will handle the specified event(s) even though it's not specified through the manifest.
In order to optimize iAgent internal message dispatching mechanism, it's keeping a table of all the registered messages and dispatches them only on targets that can handle it. If a session registeres a POE message during run-time, the kernel will not be aware of this fact and will not deliver the message there. In order to bypass this, you need to call this function to update the module's capabilities.
$_[SESSION]->_register_state('dynamic_event', \&_dyn_event ); iAgent::Kernel::RegisterHandler( 'dynamic_event' );
If your script is registering a handler on a different session, you can specify it as a first argument:
$other_session->_register_state('dynamic_event', \&_dyn_event ); iAgent::Kernel::RegisterHandler( $other_session, 'dynamic_event' );
Check if the specified module is loaded. Example:
if (!iAgent::Kernel::ModuleLoaded('iAgent::Module::XMPP')) { log_die("You need an XMPP module!");
Shuts down gracefully the kernel and all the sessions by sending the SIGQUIT signal to all of the active sessions.
Developed by Ioannis Charalampidis<EMAIL_ADDRESS>2011-2012 at PH/SFT, CERN


Badgers salvage tie with Minnesota, claim extra point in shootout
by FOX Sports WisconsinTarek Baker and K’Andre Miller scored in the third period, while Max Zimmer converted in the shootout, as the Wisconsin Badgers salvaged a 3-3 tie with Minnesota on Saturday and claimed an extra point in the Big Ten standings.
Baker scored just 13 seconds into the final frame to cut the Gophers’ lead to 3-2, before K’Andre Miller’s blast from the blue line tied things up at 5:34.
Badgers goaltender Jack Berry stood tall through two overtime periods and a shootout, turning aside Minnesota’s Brannon McManus, Ben Meyers and Sampo Ranta. Cole Caufield and Alex Turcotte missed for Wisconsin, before Zimmer beat Gophers goaltender Jack LaFontaine to end it.
Ty Emberson got the Badgers on the board at 18:31 of the first period, before Minnesota scored three unanswered goals to build a two-goal lead heading into the third.
It’s a welcome result for Wisconsin, which fell 4-1 in Friday’s series opener and has just one win in Big Ten play after splitting with Notre Dame last weekend.
Minnesota out-shot Wisconsin 38-36, and went 1-for-5 on the power play, while the Badgers went 0-for-4.
The Badgers (6-7-1, 1-4-1 Big Ten) host conference rival Michigan Nov. 22-23.


Shabana Azmi's mother Shaukat Kaifi passes away; Boney Kapoor, Tabu, Urmila Matondkar and other celebs arrive to pay their last respects
by TIMESOFINDIA.COMVeteran actor and Shabana Azmi's mother Shaukat Kaifi passed away in Mumbai on Friday evening due to age-related illness at the age of 93.
Kaifi's son-in-law, veteran writer-lyricist Javed Akhtar, confirmed the news of the demise of the theatre and film actor.

Check out the pictures here:
"She was 93 and she was having one problem after another. She was admitted to Kokikaben Dhirubhai Ambani hospital, for certain days she was in the ICU and then she was out of ICU. It was all age-related," Javed Akhtar said.
"Ultimately they brought her home. She wanted to come back to her own room she stayed for a day or two and then passed away. Shabana is in Mumbai," Akhtar, who is in the US, told PTI.
The last rites will be held Saturday noon.


Data Rows with customized rendering in Custom element DataTable.
0 products
Welcome to our online shop!


Hatch
Startup idea procreation using potent prompts
Nurture
Develop promising ideas with tools and resources to guide your thinking (coming soon)
Release
Tools to help develop your idea and release it to the wild (coming soon)


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.eeittadminfrontend.models.{Pagination} @import uk.gov.hmrc.eeittadminfrontend.views._ @this(main_template: main_template) @(pagination: Pagination, redirects: List[FormRedirect])(implicit messages: Messages) @navigationLink(page: Int, label: String) = { @label } @main_template(title = s"Legacy Forms", tab = "legacy-forms"){
| Legacy form id | Redirect form id |
|---|---|
| @{redirect._id} | @{redirect.redirect} |


1 write to OutputPipe
System.Management.Automation (1)
engine\lang\scriptblock.cs (1)
1431
OutputPipe
= outputPipe;
1 reference to OutputPipe
System.Management.Automation (1)
engine\lang\scriptblock.cs (1)
1065
eventArgs.
OutputPipe
,


VADYM TESLIA
Cell: +380(99)1704660
Email<EMAIL_ADDRESS>WWW: https://teslia.me
SUMMARY
15 years of experience architecting, deployment and maintenance systems on Linux, FreeBSD, and Windows platforms. Last 8 years I am focused on support virtualization, cloud, VPN and CDN solutions. Ability to work alone or in a team. Excellent problem solving skills.
I am open to new ideas and able quickly learn new technologies.
LANGUAGES
English – upper-intermediate, Russian – fluent, Ukrainian – native.
TECHNICAL SKILLS
-
Cloud solutions: AWS, GCP, Azure, OnApp.
-
Virtualization: Xen, KVM, OpenVZ, Docker.
-
Storage solutions: LVM, iSCSI, NFS, GlusterFS, DRBD, AoE.
-
Networking: Opensource and proprietary VPN solutions, CDN, GeoDNS, LoadBalancing, Firewalls, PXE-booting.
-
Databases: MySQL (NDB cluster), InfluxDB, MongoDB (cert), Redis.
-
BigData stack: Hadoop, Hive, Cassandra, Scylla.
-
Programing languages: I use bash for sysadmin’s tasks and am able to read and make small fixes in Ruby, Go and PHP.
EXPERIENCE
OpenVPN Inc: Technical B2B Customer Support for Networking Solutions (2018 – present):
report to Product manager
- Pre-sale consultation, assistance with building PoC;
- Support for licensing and technical issues;
- Investigation technical problems, reproducing bugs reported by customets;
- Deployment and maintenance test environments;
- Coordination with other team members as well as other teams to resolve or refer more complicated issues;
report to CTO
- Design, deployment and maintenance of new services.
- Optimisation of existing services and application for high load.
Onapp: System administrator, L3 support engineer, (2011 – 2017):
report to L3 support manager
- pre-deployment hardware recommendation for cloud solution;
- instalation, upgrade and mirgation for all cloud components (control panel, hypervisors, backups etc)
- high-level support and troubleshooting for deployed software and whole clouds;
- deployment CDN solutions for operators and end-users;
- monitoring of all components CDN and reaction within responsibility;
- implementation fail-over and High availability for different cloud components;
- DB administration, tunning and migration (MySQL, MariaDB, Percona).
- maintaining internal knowledgebase, organization of internal trainings and presentations;
- maintenance of internal environments (labs) for testing purposes;
- participation in development process as bug-reporter;
- development of scripts for automation trivial task (installation, upgrade etc).
Innocode: System administrator, (2012 – 2013):
report to CTO
- Support and maintenance development, staging and production environments for RoR and LAMP projects.
- Modernization office network.
VPSimple: System administrator, (2010 – 2011):
report to Director
- Support and maintenance shared, VPS and dedicated hosting.
- VPS templates development.
- Research of cloud solutions.
Zerogrey: System administrator, (2010 – 2011):
report to CTO
- Support and maintenance e-commerce services.
report to Head of IT department
- Installation and support Windows servers (AD, MSSQL, 1C, TS, Proxy) and workstations.
- Installations and maintenance LAN.
- Support internal services: (Web-hosting, Mail servers, VoIP, Webinars ).
- Coordinate of hardware and software installations and upgrades.
report to Director
- Installation and support Windows servers (AD, MSSQL, 1C, TS, Proxy) and workstations.
- Installations and maintenance LAN.
- Hardware and software installations and upgrades.
McLaut ISP: Support engineer, (2005-2006):
report to Head of support team
- User support.
- Installations and maintenance knowledge database, supporting
services (forum, IRC).
MEC “Orient”: System administrator, Lecturer, (June 2004 – December 2004):
report to Director
- Installations and maintenance LAN with access to Internet, AD, server of 1C.
- Teaching of computer sciences
OTHER PROJECTS
WpPage: Landing page generator, (2013):
used XEN, LAMP, Swift, Wordpress, BackupPC
- Server-side configuration, implementation backup scenario, performance tuning, support.
Grafikator: Online web-page elements generator, (2013):
used XEN, LAMP, PhantomJS
- Moving project into cloud, performance tuning, support.
DMPEN webinars: Webinar system for on-line learning, (2012-2015):
used BigBlueButton, RoR, Red5, FFmpeg, FreeSWITCH, Moodle
- Installation, performance tuning, integration with Joomla and Moodle, support.
EDUCATION
Cherkasy State Technological University: (2003 - 2008):
Degree: Bachelor of information technology
Field of Study: Computer system and networks


Class: ActionCable::Connection::TestRequest
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
self,
::ActionDispatch::TestRequest ,
::ActionDispatch::Request ,
::ActionDispatch::Flash::RequestMethods ,
Rack::Request::Env,
::ActionDispatch::PermissionsPolicy::Request ,
::ActionDispatch::ContentSecurityPolicy::Request ,
::ActionDispatch::Http::URL ,
::ActionDispatch::Http::FilterParameters ,
::ActionDispatch::Http::Parameters ,
::ActionDispatch::Http::MimeNegotiation ,
::ActionDispatch::Http::Cache::Request ,
Rack::Request::Helpers
|
|
| Inherits: |
ActionDispatch::TestRequest
|
| Defined in: | actioncable/lib/action_cable/connection/test_case.rb |
Constant Summary
::ActionDispatch::Http::Cache::Request
- Included
HTTP_IF_MODIFIED_SINCE, HTTP_IF_NONE_MATCH
::ActionDispatch::Http::MimeNegotiation
- Included
BROWSER_LIKE_ACCEPTS, RESCUABLE_MIME_FORMAT_ERRORS
::ActionDispatch::Http::Parameters
- Included
DEFAULT_PARSERS, PARAMETERS_KEY
::ActionDispatch::Http::FilterParameters
- Included
ENV_MATCH, KV_RE, NULL_ENV_FILTER, NULL_PARAM_FILTER, PAIR_RE
::ActionDispatch::Http::URL
- Included
HOST_REGEXP, IP_HOST_REGEXP, PROTOCOL_REGEXP
::ActionDispatch::ContentSecurityPolicy::Request
- Included
NONCE, NONCE_DIRECTIVES, NONCE_GENERATOR, POLICY, POLICY_REPORT_ONLY
::ActionDispatch::PermissionsPolicy::Request
- Included
::ActionDispatch::Request
- Inherited
ACTION_DISPATCH_REQUEST_ID, ENV_METHODS, HTTP_METHODS, HTTP_METHOD_LOOKUP, LOCALHOST, PASS_NOT_FOUND, RFC2518, RFC2616, RFC3253, RFC3648, RFC3744, RFC4791, RFC5323, RFC5789
::ActionDispatch::TestRequest
- Inherited
Class Attribute Summary
::ActionDispatch::Request
- Inherited
| .ignore_accept_header, | |
| .parameter_parsers | Returns the parameter parsers. |
Class Method Summary
::ActionDispatch::TestRequest
- Inherited
| .create | Create a new test request with default |
| .default_env |
::ActionDispatch::Request
- Inherited
Instance Attribute Summary
- #cookie_jar rw
- #session rw
::ActionDispatch::TestRequest
- Inherited
| #accept=, #action=, #host=, #if_modified_since=, #if_none_match=, #path=, #port=, #remote_addr=, #request_method=, #request_uri=, #user_agent= |
::ActionDispatch::Request
- Inherited
| #form_data? | Determine whether the request body contains form-data by checking the request |
| #ignore_accept_header, | |
| #local? | True if the request came from localhost, <IP_ADDRESS>, or ::1. |
| #remote_ip | Returns the IP address of client as a |
| #remote_ip=, | |
| #request_id | Returns the unique request id, which is based on either the |
| #request_method | Returns the HTTP method that the application should see. |
| #request_parameters | Alias for ActionDispatch::Request#POST. |
| #request_parameters=, #return_only_media_type_on_content_type, #return_only_media_type_on_content_type=, | |
| #route_uri_pattern | Returns the URI pattern of the matched route for the request, using the same format as ‘bin/rails routes`: |
| #session_options=, | |
| #uuid | Alias for ActionDispatch::Request#request_id. |
| #xhr? | Alias for ActionDispatch::Request#xml_http_request?. |
| #xml_http_request? | Returns true if the |
| #controller_instance, #controller_instance=, #request_id=, #request_method=, #route_uri_pattern=, #routes, #routes=, #session= |
::ActionDispatch::Flash::RequestMethods
- Included
::ActionDispatch::PermissionsPolicy::Request
- Included
::ActionDispatch::ContentSecurityPolicy::Request
- Included
::ActionDispatch::Http::URL
- Included
| #secure_protocol, | |
| #standard_port | Returns the standard port number for this request’s protocol. |
| #standard_port? | Returns whether this request is using the standard port. |
| #tld_length |
::ActionDispatch::Http::Parameters
- Included
| #path_parameters | Returns a hash with the parameters used to form the path of the request. |
| #path_parameters= |
::ActionDispatch::Http::MimeNegotiation
- Included
| #formats, | |
| #formats= | Sets the formats by string extensions. |
| #should_apply_vary_header?, #variant, | |
| #variant= | Sets the variant for template. |
| #params_readable?, #has_content_type? |
Instance Method Summary
::ActionDispatch::Request
- Inherited
| #authorization | Returns the authorization header regardless of whether it was specified directly or through one of the proxy alternatives. |
| #body | The request body is an |
| #commit_csrf_token, #commit_flash, | |
| #content_length | Returns the content length of the request as an integer. |
| #controller_class, #controller_class_for, | |
| #fullpath | Returns the |
| #GET | Override Rack’s GET method to support indifferent access. |
| #headers | Provides access to the request’s HTTP headers, for example: |
| #http_auth_salt, | |
| #ip | Returns the IP address of client as a |
| #key? | Returns true if the request has a header matching the given key parameter. |
| #logger, | |
| #media_type | The |
| #method | Returns the original value of the environment’s REQUEST_METHOD, even if it was overridden by middleware. |
| #method_symbol | Returns a symbol form of the |
| #original_fullpath | Returns a |
| #original_url | Returns the original request URL as a |
| #POST | Override Rack’s POST method to support indifferent access. |
| #query_parameters | Alias for ActionDispatch::Request#GET. |
| #raw_post | Read the request body. |
| #request_method_symbol | Returns a symbol form of the |
| #reset_csrf_token, #reset_session, | |
| #send_early_hints | Early Hints is an HTTP/2 status code that indicates hints to help a client start making preparations for processing the final response. |
| #server_software | Returns the lowercase name of the HTTP server software. |
| #check_method, #default_session, #read_body_stream, #body_stream, #commit_cookie_jar!, #engine_script_name, #engine_script_name=, #inspect, #raw_request_method |
::ActionDispatch::Flash::RequestMethods
- Included
::ActionDispatch::ContentSecurityPolicy::Request
- Included
::ActionDispatch::Http::URL
- Included
| #domain | Returns the domain part of a host, such as “rubyonrails.org” in “www.rubyonrails.org”. |
| #host | Returns the host for this request, such as “example.com”. |
| #host_with_port | Returns a host:port string for this request, such as “example.com” or “example.com:8080”. |
| #initialize, | |
| #optional_port | Returns a number port suffix like 8080 if the port number of this request is not the default HTTP port 80 or HTTPS port 443. |
| #port | Returns the port number of this request as an integer. |
| #port_string | Returns a string port suffix, including colon, like “:8080” if the port number of this request is not the default HTTP port 80 or HTTPS port 443. |
| #protocol | Returns ‘https://’ if this is an SSL request and ‘http://’ otherwise. |
| #raw_host_with_port | Returns the host and port for this request, such as “example.com:8080”. |
| #server_port | Returns the requested port, such as 8080, based on SERVER_PORT. |
| #subdomain | Returns all the subdomains as a string, so |
| #subdomains | Returns all the subdomains as an array, so |
| #url | Returns the complete URL used for this request. |
::ActionDispatch::Http::FilterParameters
- Included
| #filtered_env | Returns a hash of request.env with all sensitive data replaced. |
| #filtered_parameters | Returns a hash of parameters with all sensitive data replaced. |
| #filtered_path | Reconstructs a path with all sensitive GET parameters replaced. |
| #initialize, | |
| #parameter_filter | Returns the |
| #env_filter, #filtered_query_string, #parameter_filter_for |
::ActionDispatch::Http::Parameters
- Included
| #parameters | Returns both GET and POST parameters in a single hash. |
| #params | Alias for ActionDispatch::Http::Parameters#parameters. |
| #log_parse_error_once, #params_parsers, #parse_formatted_parameters |
::ActionDispatch::Http::MimeNegotiation
- Included
| #accepts | Returns the accepted MIME type for the request. |
| #content_mime_type | The MIME type of the HTTP request, such as Mime. |
| #format | Returns the MIME type for the format used in the request. |
| #format= | Sets the format by string extension, which can be used to force custom formats that are not controlled by the extension. |
| #negotiate_mime | Returns the first MIME type that matches the provided array of MIME types. |
| #format_from_path_extension, #use_accept_header, #valid_accept_header |
::ActionDispatch::Http::Cache::Request
- Included
| #etag_matches?, | |
| #fresh? | Check response freshness ( |
| #if_modified_since, #if_none_match, #if_none_match_etags, #not_modified? |
Constructor Details
This class inherits a constructor from ActionDispatch::Request
Instance Attribute Details
#cookie_jar (rw)
[ GitHub ]# File 'actioncable/lib/action_cable/connection/test_case.rb', line 44
attr_accessor :session, :
#session (rw)
[ GitHub ]# File 'actioncable/lib/action_cable/connection/test_case.rb', line 44
attr_accessor :session, :


<steps-unordered>
Like the <steps>
element, the <steps-unordered>
element provides the main content of a task topic, but particularly for cases in which the
order of steps may vary from one situation to another. At least one
<step>
element is required inside the
<steps-unordered>
element.
Category: Task elements


| 1 | package fr.sii.ogham.helper.email; | |
| 2 | ||
| 3 | import java.io.IOException; | |
| 4 | import java.io.InputStream; | |
| 5 | import java.nio.charset.Charset; | |
| 6 | import java.util.ArrayList; | |
| 7 | import java.util.List; | |
| 8 | import java.util.regex.Pattern; | |
| 9 | ||
| 10 | import javax.mail.Address; | |
| 11 | import javax.mail.BodyPart; | |
| 12 | import javax.mail.Message; | |
| 13 | import javax.mail.Message.RecipientType; | |
| 14 | import javax.mail.MessagingException; | |
| 15 | import javax.mail.Multipart; | |
| 16 | import javax.mail.Part; | |
| 17 | ||
| 18 | import org.apache.commons.io.IOUtils; | |
| 19 | import org.junit.Assert; | |
| 20 | import org.junit.ComparisonFailure; | |
| 21 | ||
| 22 | import fr.sii.ogham.helper.html.AssertHtml; | |
| 23 | ||
| 24 | /** | |
| 25 | * Utility class for checking if the received email content is as expected. | |
| 26 | * | |
| 27 | * @author Aurélien Baudet | |
| 28 | * | |
| 29 | */ | |
| 30 | @SuppressWarnings("squid:S1192") | |
| 31 | public final class AssertEmail { | |
| 32 | private static final Pattern HTML_PATTERN = Pattern.compile("<html", Pattern.CASE_INSENSITIVE); | |
| 33 | private static final Pattern TEXT_OR_HTML_MIMETYPES = Pattern.compile("^((text/)|(application/x?html)).*", Pattern.CASE_INSENSITIVE); | |
| 34 | ||
| 35 | /** | |
| 36 | * Assert that the fields of the received email are equal to the expected | |
| 37 | * values. The expected email contains several parts (several contents). The | |
| 38 | * received email should also have the equivalent parts. It will check that: | |
| 39 | *
 | |
| 40 | *
The received headers are respected (see | |
| 41 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 42 | *
The received message is a {@link Multipart} email
 | |
| 43 | *
The number of parts are equal
 | |
| 44 | *
Each received part body equals the expected one (order is important). | |
| 45 | * See {@link #assertBody(String, String, boolean)}
 | |
| 46 | *
Each received part Mime Type equals the expected one (order is | |
| 47 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 48 | *
 | |
| 49 | *
 | |
| 50 | * The checking of the body is done strictly (totally equal). | |
| 51 | *
 | |
| 52 | * | |
| 53 | * @param expectedEmail | |
| 54 | * all the fields with their expected values | |
| 55 | * @param actualEmail | |
| 56 | * the received email | |
| 57 | * @throws MessagingException | |
| 58 | * when accessing the received email fails | |
| 59 | * @throws IOException | |
| 60 | * when reading the content of the email fails | |
| 61 | */ | |
| 62 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message actualEmail) throws MessagingException, IOException { | |
| 63 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, true); |
| 64 | } | |
| 65 | ||
| 66 | /** | |
| 67 | *
 | |
| 68 | * Shortcut to simplify unit testing with GreenMail. See | |
| 69 | * {@link #assertEquals(ExpectedMultiPartEmail[], Message[])}. | |
| 70 | *
 | |
| 71 | * Assert that the fields of the received email are equal to the expected | |
| 72 | * values. The expected email contains several parts (several contents). The | |
| 73 | * received email should also have the equivalent parts. It will check that: | |
| 74 | *
 | |
| 75 | *
The received headers are respected (see | |
| 76 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 77 | *
The received message is a {@link Multipart} email
 | |
| 78 | *
The number of parts are equal
 | |
| 79 | *
Each received part body equals the expected one (order is important). | |
| 80 | * See {@link #assertBody(String, String, boolean)}
 | |
| 81 | *
Each received part Mime Type equals the expected one (order is | |
| 82 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 83 | *
 | |
| 84 | *
 | |
| 85 | * The checking of the body is done strictly (totally equal). | |
| 86 | *
 | |
| 87 | * | |
| 88 | * @param expectedEmail | |
| 89 | * all the fields with their expected values | |
| 90 | * @param actualEmails | |
| 91 | * the received email | |
| 92 | * @throws MessagingException | |
| 93 | * when accessing the received email fails | |
| 94 | * @throws IOException | |
| 95 | * when reading the content of the email fails | |
| 96 | */ | |
| 97 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message[] actualEmails) throws MessagingException, IOException { | |
| 98 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(new ExpectedMultiPartEmail[] { expectedEmail }, actualEmails); |
| 99 | } | |
| 100 | ||
| 101 | /** | |
| 102 | * Assert that each received email content respects the expected one. It | |
| 103 | * ensures that the number of received emails equals to the expected number. | |
| 104 | * Then for each email it calls | |
| 105 | * {@link #assertEquals(ExpectedMultiPartEmail, Message)} . | |
| 106 | * | |
| 107 | * @param expectedEmails | |
| 108 | * the list of expected emails | |
| 109 | * @param actualEmails | |
| 110 | * the received emails | |
| 111 | * @throws MessagingException | |
| 112 | * when accessing the received email fails | |
| 113 | * @throws IOException | |
| 114 | * when reading the content of the email fails | |
| 115 | */ | |
| 116 | public static void assertEquals(ExpectedMultiPartEmail[] expectedEmails, Message[] actualEmails) throws MessagingException, IOException { | |
| 117 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmails.length + " email", expectedEmails.length, actualEmails.length); |
| 118 | for (int i = 0; i < expectedEmails.length; i++) { | |
| 119 | assertEquals(expectedEmails[i], actualEmails[i]); | |
| 120 | } | |
| 121 | } | |
| 122 | ||
| 123 | /** | |
| 124 | *
 | |
| 125 | * Shortcut to simplify unit testing with GreenMail. See | |
| 126 | * {@link #assertEquals(ExpectedEmail[], Message[])}. | |
| 127 | *
 | |
| 128 | * Assert that the fields of the received email are equal to the expected | |
| 129 | * values. The expected email contains only one part (only one content). It | |
| 130 | * will check that: | |
| 131 | *
 | |
| 132 | *
The received headers are respected (see | |
| 133 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 134 | *
The body equals the expected one (order is important). See | |
| 135 | * {@link #assertBody(String, String, boolean)}
 | |
| 136 | *
The Mime Type equals the expected one (order is important). See | |
| 137 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 138 | *
 | |
| 139 | *
 | |
| 140 | * The checking of the body is done strictly (totally equal). | |
| 141 | *
 | |
| 142 | * | |
| 143 | * | |
| 144 | * @param expectedEmail | |
| 145 | * all the fields with their expected values | |
| 146 | * @param actualEmails | |
| 147 | * the received emails | |
| 148 | * @throws MessagingException | |
| 149 | * when accessing the received email fails | |
| 150 | */ | |
| 151 | public static void assertEquals(ExpectedEmail expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 152 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(new ExpectedEmail[] { expectedEmail }, actualEmails); |
| 153 | } | |
| 154 | ||
| 155 | /** | |
| 156 | * Assert that each received email content respects the expected one. It | |
| 157 | * ensures that the number of received emails equals to the expected number. | |
| 158 | * Then for each email it calls | |
| 159 | * {@link #assertEquals(ExpectedEmail, Message)} . | |
| 160 | * | |
| 161 | * @param expectedEmail | |
| 162 | * the expected email | |
| 163 | * @param actualEmails | |
| 164 | * the received emails | |
| 165 | * @throws MessagingException | |
| 166 | * when accessing the received email fails | |
| 167 | */ | |
| 168 | public static void assertEquals(ExpectedEmail[] expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 169 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmail.length + " email", expectedEmail.length, actualEmails.length); |
| 170 | for (int i = 0; i < expectedEmail.length; i++) { | |
| 171 | assertEquals(expectedEmail[i], actualEmails[i]); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | /** | |
| 176 | * Assert that the fields of the received email are equal to the expected | |
| 177 | * values. The expected email contains only one part (only one content). It | |
| 178 | * will check that: | |
| 179 | *
 | |
| 180 | *
The received headers are respected (see | |
| 181 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 182 | *
The body equals the expected one (order is important). See | |
| 183 | * {@link #assertBody(String, String, boolean)}
 | |
| 184 | *
The Mime Type equals the expected one (order is important). See | |
| 185 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 186 | *
 | |
| 187 | *
 | |
| 188 | * The checking of the body is done strictly (totally equal). | |
| 189 | *
 | |
| 190 | * | |
| 191 | * @param expectedEmail | |
| 192 | * all the fields with their expected values | |
| 193 | * @param actualEmail | |
| 194 | * the received email | |
| 195 | * @throws MessagingException | |
| 196 | * when accessing the received email fails | |
| 197 | */ | |
| 198 | public static void assertEquals(ExpectedEmail expectedEmail, Message actualEmail) throws MessagingException { | |
| 199 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, true); |
| 200 | } | |
| 201 | ||
| 202 | /** | |
| 203 | * Assert that the fields of the received email are equal to the expected | |
| 204 | * values. The expected email contains several parts (several contents). The | |
| 205 | * received email should also have the equivalent parts. It will check that: | |
| 206 | *
 | |
| 207 | *
The received headers are respected (see | |
| 208 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 209 | *
The received message is a {@link Multipart} email
 | |
| 210 | *
The number of parts are equal
 | |
| 211 | *
Each received part body equals the expected one (order is important). | |
| 212 | * See {@link #assertBody(String, String, boolean)}
 | |
| 213 | *
Each received part Mime Type equals the expected one (order is | |
| 214 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 215 | *
 | |
| 216 | *
 | |
| 217 | * The checking of the body ignores the new line characters. | |
| 218 | *
 | |
| 219 | * | |
| 220 | * @param expectedEmail | |
| 221 | * all the fields with their expected values | |
| 222 | * @param actualEmail | |
| 223 | * the received email | |
| 224 | * @throws MessagingException | |
| 225 | * when accessing the received email fails | |
| 226 | * @throws IOException | |
| 227 | * when reading the content of the email fails | |
| 228 | */ | |
| 229 | public static void assertSimilar(ExpectedMultiPartEmail expectedEmail, Message actualEmail) throws MessagingException, IOException { | |
| 230 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, false); |
| 231 | } | |
| 232 | ||
| 233 | /** | |
| 234 | *
 | |
| 235 | * Shortcut to simplify unit testing with GreenMail. See | |
| 236 | * {@link #assertSimilar(ExpectedMultiPartEmail[], Message[])}. | |
| 237 | *
 | |
| 238 | * Assert that the fields of the received email are equal to the expected | |
| 239 | * values. The expected email contains several parts (several contents). The | |
| 240 | * received email should also have the equivalent parts. It will check that: | |
| 241 | *
 | |
| 242 | *
The received headers are respected (see | |
| 243 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 244 | *
The received message is a {@link Multipart} email
 | |
| 245 | *
The number of parts are equal
 | |
| 246 | *
Each received part body equals the expected one (order is important). | |
| 247 | * See {@link #assertBody(String, String, boolean)}
 | |
| 248 | *
Each received part Mime Type equals the expected one (order is | |
| 249 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 250 | *
 | |
| 251 | *
 | |
| 252 | * The checking of the body ignores the new line characters. | |
| 253 | *
 | |
| 254 | * | |
| 255 | * @param expectedEmail | |
| 256 | * all the fields with their expected values | |
| 257 | * @param actualEmails | |
| 258 | * the received email | |
| 259 | * @throws MessagingException | |
| 260 | * when accessing the received email fails | |
| 261 | * @throws IOException | |
| 262 | * when reading the content of the email fails | |
| 263 | */ | |
| 264 | public static void assertSimilar(ExpectedMultiPartEmail expectedEmail, Message[] actualEmails) throws MessagingException, IOException { | |
| 265 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertSimilar(new ExpectedMultiPartEmail[] { expectedEmail }, actualEmails); |
| 266 | } | |
| 267 | ||
| 268 | /** | |
| 269 | * Assert that each received email content respects the expected one. It | |
| 270 | * ensures that the number of received emails equals to the expected number. | |
| 271 | * Then for each email it calls | |
| 272 | * {@link #assertSimilar(ExpectedMultiPartEmail, Message)} . | |
| 273 | * | |
| 274 | * @param expectedEmails | |
| 275 | * the list of expected emails | |
| 276 | * @param actualEmails | |
| 277 | * the received emails | |
| 278 | * @throws MessagingException | |
| 279 | * when accessing the received email fails | |
| 280 | * @throws IOException | |
| 281 | * when reading the content of the email fails | |
| 282 | */ | |
| 283 | public static void assertSimilar(ExpectedMultiPartEmail[] expectedEmails, Message[] actualEmails) throws MessagingException, IOException { | |
| 284 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmails.length + " email", expectedEmails.length, actualEmails.length); |
| 285 | for (int i = 0; i < expectedEmails.length; i++) { | |
| 286 | assertSimilar(expectedEmails[i], actualEmails[i]); | |
| 287 | } | |
| 288 | } | |
| 289 | ||
| 290 | /** | |
| 291 | *
 | |
| 292 | * Shortcut to simplify unit testing with GreenMail. See | |
| 293 | * {@link #assertSimilar(ExpectedEmail[], Message[])}. | |
| 294 | *
 | |
| 295 | * Assert that the fields of the received email are equal to the expected | |
| 296 | * values. The expected email contains only one part (only one content). It | |
| 297 | * will check that: | |
| 298 | *
 | |
| 299 | *
The received headers are respected (see | |
| 300 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 301 | *
The body equals the expected one (order is important). See | |
| 302 | * {@link #assertBody(String, String, boolean)}
 | |
| 303 | *
The Mime Type equals the expected one (order is important). See | |
| 304 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 305 | *
 | |
| 306 | *
 | |
| 307 | * The checking of the body ignores the new line characters. | |
| 308 | *
 | |
| 309 | * | |
| 310 | * | |
| 311 | * @param expectedEmail | |
| 312 | * all the fields with their expected values | |
| 313 | * @param actualEmails | |
| 314 | * the received emails | |
| 315 | * @throws MessagingException | |
| 316 | * when accessing the received email fails | |
| 317 | */ | |
| 318 | public static void assertSimilar(ExpectedEmail expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 319 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertSimilar(new ExpectedEmail[] { expectedEmail }, actualEmails); |
| 320 | } | |
| 321 | ||
| 322 | /** | |
| 323 | * Assert that each received email content respects the expected one. It | |
| 324 | * ensures that the number of received emails equals to the expected number. | |
| 325 | * Then for each email it calls | |
| 326 | * {@link #assertSimilar(ExpectedEmail, Message)} . | |
| 327 | * | |
| 328 | * @param expectedEmail | |
| 329 | * the expected email | |
| 330 | * @param actualEmails | |
| 331 | * the received emails | |
| 332 | * @throws MessagingException | |
| 333 | * when accessing the received email fails | |
| 334 | */ | |
| 335 | public static void assertSimilar(ExpectedEmail[] expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 336 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmail.length + " email", expectedEmail.length, actualEmails.length); |
| 337 | for (int i = 0; i < expectedEmail.length; i++) { | |
| 338 | assertSimilar(expectedEmail[i], actualEmails[i]); | |
| 339 | } | |
| 340 | } | |
| 341 | ||
| 342 | /** | |
| 343 | * Assert that the fields of the received email are equal to the expected | |
| 344 | * values. The expected email contains only one part (only one content). It | |
| 345 | * will check that: | |
| 346 | *
 | |
| 347 | *
The received headers are respected (see | |
| 348 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 349 | *
The body equals the expected one (order is important). See | |
| 350 | * {@link #assertBody(String, String, boolean)}
 | |
| 351 | *
The Mime Type equals the expected one (order is important). See | |
| 352 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 353 | *
 | |
| 354 | *
 | |
| 355 | * The checking of the body ignores the new line characters. | |
| 356 | *
 | |
| 357 | * | |
| 358 | * @param expectedEmail | |
| 359 | * all the fields with their expected values | |
| 360 | * @param actualEmail | |
| 361 | * the received email | |
| 362 | * @throws MessagingException | |
| 363 | * when accessing the received email fails | |
| 364 | */ | |
| 365 | public static void assertSimilar(ExpectedEmail expectedEmail, Message actualEmail) throws MessagingException { | |
| 366 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, false); |
| 367 | } | |
| 368 | ||
| 369 | /** | |
| 370 | * Assert that the fields of the received email are equal to the expected | |
| 371 | * values. The expected email contains several parts (several contents). The | |
| 372 | * received email should also have the equivalent parts. It will check that: | |
| 373 | *
 | |
| 374 | *
The received headers are respected (see | |
| 375 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 376 | *
The received message is a {@link Multipart} email
 | |
| 377 | *
The number of parts are equal
 | |
| 378 | *
Each received part body equals the expected one (order is important). | |
| 379 | * See {@link #assertBody(String, String, boolean)}
 | |
| 380 | *
Each received part Mime Type equals the expected one (order is | |
| 381 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 382 | *
 | |
| 383 | *
 | |
| 384 | * The checking of the body may be done either strictly (totally equal) or | |
| 385 | * not (new line characters are ignored). | |
| 386 | *
 | |
| 387 | * | |
| 388 | * @param expectedEmail | |
| 389 | * all the fields with their expected values | |
| 390 | * @param actualEmail | |
| 391 | * the received email | |
| 392 | * @param strict | |
| 393 | * true for strict checking (totally equals) or false to ignore | |
| 394 | * new line characters in body contents | |
| 395 | * @throws MessagingException | |
| 396 | * when accessing the received email fails | |
| 397 | * @throws IOException | |
| 398 | * when reading the content of the email fails | |
| 399 | */ | |
| 400 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message actualEmail, boolean strict) throws MessagingException, IOException { | |
| 401 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertHeaders(expectedEmail, actualEmail); |
| 402 | Object content = actualEmail.getContent(); | |
| 403 | Assert.assertTrue("should be multipart message", content instanceof Multipart); | |
| 404 | List<Part> bodyParts = getBodyParts(actualEmail); | |
| 405 | Assert.assertEquals("should have " + expectedEmail.getExpectedContents().length + " parts", expectedEmail.getExpectedContents().length, bodyParts.size()); | |
| 406 | for (int i = 0; i < expectedEmail.getExpectedContents().length; i++) { | |
| 407 | assertBody(expectedEmail.getExpectedContents()[i].getBody(), bodyParts.get(i).getContent().toString(), strict); | |
| 408 | assertMimetype(expectedEmail.getExpectedContents()[i], bodyParts.get(i).getContentType()); | |
| 409 | } | |
| 410 | } | |
| 411 | ||
| 412 | /** | |
| 413 | * Assert that the fields of the received email are equal to the expected | |
| 414 | * values. The expected email contains only one part (only one content). It | |
| 415 | * will check that: | |
| 416 | *
 | |
| 417 | *
The received headers are respected (see | |
| 418 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 419 | *
The body equals the expected one (order is important). See | |
| 420 | * {@link #assertBody(String, String, boolean)}
 | |
| 421 | *
The Mime Type equals the expected one (order is important). See | |
| 422 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 423 | *
 | |
| 424 | *
 | |
| 425 | * The checking of the body may be done either strictly (totally equal) or | |
| 426 | * not (new line characters are ignored). | |
| 427 | *
 | |
| 428 | * | |
| 429 | * @param expectedEmail | |
| 430 | * all the fields with their expected values | |
| 431 | * @param actualEmail | |
| 432 | * the received email | |
| 433 | * @param strict | |
| 434 | * true for strict checking (totally equals) or false to ignore | |
| 435 | * new line characters in body contents | |
| 436 | * @throws MessagingException | |
| 437 | * when accessing the received email fails | |
| 438 | */ | |
| 439 | public static void assertEquals(ExpectedEmail expectedEmail, Message actualEmail, boolean strict) throws MessagingException { | |
| 440 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertHeaders(expectedEmail, actualEmail); |
| 441 | assertBody(expectedEmail.getExpectedContent().getBody(), getBody(actualEmail), strict); | |
| 442 | assertMimetype(expectedEmail.getExpectedContent(), getBodyMimetype(actualEmail)); | |
| 443 | } | |
| 444 | ||
| 445 | /** | |
| 446 | * Checks that the received Mime Type for the message is like the expected | |
| 447 | * Mime Type. The expected Mime Type is a regular expression. | |
| 448 | * | |
| 449 | * @param expectedContent | |
| 450 | * the expected email content that contains the expected Mime | |
| 451 | * Type as regular expression | |
| 452 | * @param actualEmail | |
| 453 | * the received email to check | |
| 454 | * @throws MessagingException | |
| 455 | * when accessing the received email fails | |
| 456 | */ | |
| 457 | public static void assertMimetype(ExpectedContent expectedContent, Message actualEmail) throws MessagingException { | |
| 458 |
1
1. assertMimetype : All method instructions removed → NO_COVERAGE |
assertMimetype(expectedContent, actualEmail.getContentType()); |
| 459 | } | |
| 460 | ||
| 461 | /** | |
| 462 | * Checks that the received Mime Type for the message is like the expected | |
| 463 | * Mime Type. The expected Mime Type is a regular expression. | |
| 464 | * | |
| 465 | * @param expectedContent | |
| 466 | * the expected email content that contains the expected Mime | |
| 467 | * Type as regular expression | |
| 468 | * @param contentType | |
| 469 | * the received email Mime Type | |
| 470 | * @throws MessagingException | |
| 471 | * when accessing the received email fails | |
| 472 | */ | |
| 473 | public static void assertMimetype(ExpectedContent expectedContent, String contentType) throws MessagingException { | |
| 474 |
1
1. assertMimetype : All method instructions removed → NO_COVERAGE |
Assert.assertTrue("mimetype should be " + expectedContent.getMimetype() + " instead of " + contentType, expectedContent.getMimetype().matcher(contentType).matches()); |
| 475 | } | |
| 476 | ||
| 477 | /** | |
| 478 | * Checks if the received body equals the expected body. It handles HTML | |
| 479 | * content and pure text content. | |
| 480 | *
 | |
| 481 | * For text, the check can be done either strictly (totally equal) or not | |
| 482 | * (ignore new lines). | |
| 483 | *
 | |
| 484 | *
 | |
| 485 | * For HTML, the string content is parsed and DOM trees are compared. The | |
| 486 | * comparison can be done either strictly (DOM trees are totally equals, | |
| 487 | * attributes are in the same order) or not (attributes can be in any | |
| 488 | * order). | |
| 489 | *
 | |
| 490 | * | |
| 491 | * @param expectedBody | |
| 492 | * the expected content as string | |
| 493 | * @param actualBody | |
| 494 | * the received content as string | |
| 495 | * @param strict | |
| 496 | * true for strict checking (totally equals) or false to ignore | |
| 497 | * new line characters | |
| 498 | */ | |
| 499 | public static void assertBody(String expectedBody, String actualBody, boolean strict) { | |
| 500 |
1
1. assertBody : All method instructions removed → NO_COVERAGE |
if (isHtml(expectedBody)) { |
| 501 | if (strict) { | |
| 502 | AssertHtml.assertIdentical(expectedBody, actualBody); | |
| 503 | } else { | |
| 504 | AssertHtml.assertSimilar(expectedBody, actualBody); | |
| 505 | } | |
| 506 | } else { | |
| 507 | if(strict ? !expectedBody.equals(actualBody) : !sanitize(expectedBody).equals(sanitize(actualBody))) { | |
| 508 | throw new ComparisonFailure("body should be '" + expectedBody + "'", expectedBody, actualBody); | |
| 509 | } | |
| 510 | } | |
| 511 | } | |
| 512 | ||
| 513 | /** | |
| 514 | * Checks if the received headers corresponds to the expected header values. | |
| 515 | * It checks if: | |
| 516 | *
 | |
| 517 | *
The received subject equals the expected subject
 | |
| 518 | *
The email sender address equals the expected sender address
 | |
| 519 | *
The total number of recipients equals the total number of expected | |
| 520 | * recipients
 | |
| 521 | *
The number of "to" recipients equals the number of expected "to" | |
| 522 | * recipients
 | |
| 523 | *
The number of "cc" recipients equals the number of expected "cc" | |
| 524 | * recipients
 | |
| 525 | *
The number of "bcc" recipients equals the number of expected "bcc" | |
| 526 | * recipients
 | |
| 527 | *
Each "to" recipient equals the expected "to" recipient value
 | |
| 528 | *
Each "cc" recipient equals the expected "cc" recipient value
 | |
| 529 | *
Each "bcc" recipient equals the expected "bcc" recipient value
 | |
| 530 | *
 | |
| 531 | * | |
| 532 | * @param expectedEmail | |
| 533 | * the expected header values | |
| 534 | * @param actualEmail | |
| 535 | * the received header values | |
| 536 | * @throws MessagingException | |
| 537 | * when accessing the received email fails | |
| 538 | */ | |
| 539 | public static void assertHeaders(ExpectedEmailHeader expectedEmail, Message actualEmail) throws MessagingException { | |
| 540 |
1
1. assertHeaders : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("subject should be '" + expectedEmail.getSubject() + "'", expectedEmail.getSubject(), actualEmail.getSubject()); |
| 541 | Assert.assertEquals("should have only one from", 1, actualEmail.getFrom().length); | |
| 542 | Assert.assertEquals("from should be '" + expectedEmail.getFrom() + "'", expectedEmail.getFrom(), actualEmail.getFrom()[0].toString()); | |
| 543 | int recipients = expectedEmail.getTo().size() + expectedEmail.getBcc().size() + expectedEmail.getCc().size(); | |
| 544 | Assert.assertEquals("should have only " + recipients + " recipients", recipients, actualEmail.getAllRecipients().length); | |
| 545 | assertRecipients(expectedEmail.getTo(), actualEmail, RecipientType.TO); | |
| 546 | assertRecipients(expectedEmail.getCc(), actualEmail, RecipientType.CC); | |
| 547 | assertRecipients(expectedEmail.getBcc(), actualEmail, RecipientType.BCC); | |
| 548 | } | |
| 549 | ||
| 550 | /** | |
| 551 | * Checks if the received headers corresponds to the expected header values. | |
| 552 | * It checks if: | |
| 553 | *
 | |
| 554 | *
The number of recipients of the provided type equals the number of | |
| 555 | * expected recipients of the provided type
 | |
| 556 | *
Each recipient of the provided type equals the expected recipient | |
| 557 | * value of the provided type
 | |
| 558 | *
 | |
| 559 | * | |
| 560 | * @param expectedRecipients | |
| 561 | * the list of recipient string values | |
| 562 | * @param actualEmail | |
| 563 | * the received header values | |
| 564 | * @param recipientType | |
| 565 | * the type of the recipient to compare | |
| 566 | * @throws MessagingException | |
| 567 | * when accessing the received email fails | |
| 568 | */ | |
| 569 | public static void assertRecipients(List<String> expectedRecipients, Message actualEmail, RecipientType recipientType) throws MessagingException { | |
| 570 |
1
1. assertRecipients : All method instructions removed → NO_COVERAGE |
Address[] actualRecipients = actualEmail.getRecipients(recipientType); |
| 571 | if (expectedRecipients.isEmpty()) { | |
| 572 | Assert.assertTrue("should have no recipients " + recipientType, actualRecipients == null || actualRecipients.length == 0); | |
| 573 | } else { | |
| 574 | Assert.assertEquals("should have only " + expectedRecipients.size() + " " + recipientType, expectedRecipients.size(), actualRecipients.length); | |
| 575 | for (int i = 0; i < expectedRecipients.size(); i++) { | |
| 576 | Assert.assertEquals(recipientType + "[" + i + "] should be '" + expectedRecipients.get(i) + "'", expectedRecipients.get(i), actualRecipients[i].toString()); | |
| 577 | } | |
| 578 | } | |
| 579 | } | |
| 580 | ||
| 581 | /** | |
| 582 | * Remove new lines from the string. | |
| 583 | * | |
| 584 | * @param str | |
| 585 | * the string to sanitize | |
| 586 | * @return the sanitized string | |
| 587 | */ | |
| 588 | private static String sanitize(String str) { | |
| 589 |
3
1. sanitize : All method body replaced by: return "" → NO_COVERAGE 2. sanitize : All method body replaced by: return "A" → NO_COVERAGE 3. sanitize : All methods instructions replaced by: return null; → NO_COVERAGE |
return str.replaceAll("\r|\n", ""); |
| 590 | } | |
| 591 | ||
| 592 | private static Part getBodyPart(Part actualEmail) throws MessagingException { | |
| 593 |
1
1. getBodyPart : All methods instructions replaced by: return null; → NO_COVERAGE |
List<Part> bodyParts = getBodyParts(actualEmail); |
| 594 | if(bodyParts.isEmpty()) { | |
| 595 | throw new IllegalStateException("Expected at least one body part but none found"); | |
| 596 | } | |
| 597 | return bodyParts.get(0); | |
| 598 | } | |
| 599 | ||
| 600 | private static List<Part> getBodyParts(Part actualEmail) throws MessagingException { | |
| 601 |
1
1. getBodyParts : All methods instructions replaced by: return null; → NO_COVERAGE |
List<Part> founds = new ArrayList<>(); |
| 602 | getBodyParts(actualEmail, founds); | |
| 603 | return founds; | |
| 604 | } | |
| 605 | | |
| 606 | private static void getBodyParts(Part actualEmail, List<Part> founds) throws MessagingException { | |
| 607 | try { | |
| 608 |
1
1. getBodyParts : All method instructions removed → NO_COVERAGE |
Object content = actualEmail.getContent(); |
| 609 | if (content instanceof Multipart) { | |
| 610 | Multipart mp = (Multipart) content; | |
| 611 | for(int i=0 ; i<mp.getCount() ; i++) { | |
| 612 | addPart(founds, mp, i); | |
| 613 | } | |
| 614 | } | |
| 615 | } catch (IOException e) { | |
| 616 | throw new MessagingException("Failed to access content of the mail", e); | |
| 617 | } | |
| 618 | } | |
| 619 | ||
| 620 | private static void addPart(List<Part> founds, Multipart mp, int i) throws MessagingException { | |
| 621 |
1
1. addPart : All method instructions removed → NO_COVERAGE |
BodyPart part = mp.getBodyPart(i); |
| 622 | if(part.getContentType().startsWith("multipart/")) { | |
| 623 | getBodyParts(part, founds); | |
| 624 | } else if(TEXT_OR_HTML_MIMETYPES.matcher(part.getContentType()).matches()){ | |
| 625 | founds.add(part); | |
| 626 | } | |
| 627 | } | |
| 628 | ||
| 629 | private static String getBody(Part actualEmail) throws MessagingException { | |
| 630 | try { | |
| 631 |
3
1. getBody : All method body replaced by: return "" → NO_COVERAGE 2. getBody : All method body replaced by: return "A" → NO_COVERAGE 3. getBody : All methods instructions replaced by: return null; → NO_COVERAGE |
Object content = getBodyPart(actualEmail).getContent(); |
| 632 | if(content instanceof String) { | |
| 633 | return (String) content; | |
| 634 | } else if(content instanceof InputStream) { | |
| 635 | return IOUtils.toString((InputStream) content, Charset.defaultCharset()); | |
| 636 | } else { | |
| 637 | return content.toString(); | |
| 638 | } | |
| 639 | } catch (IOException e) { | |
| 640 | throw new MessagingException("Failed to access content of the mail", e); | |
| 641 | } | |
| 642 | } | |
| 643 | ||
| 644 | private static String getBodyMimetype(Part actualEmail) throws MessagingException { | |
| 645 |
3
1. getBodyMimetype : All method body replaced by: return "" → NO_COVERAGE 2. getBodyMimetype : All method body replaced by: return "A" → NO_COVERAGE 3. getBodyMimetype : All methods instructions replaced by: return null; → NO_COVERAGE |
return getBodyPart(actualEmail).getContentType(); |
| 646 | } | |
| 647 | | |
| 648 | private static boolean isHtml(String expectedBody) { | |
| 649 |
2
1. isHtml : All method body replaced by: return false → NO_COVERAGE 2. isHtml : All method body replaced by: return true → NO_COVERAGE |
return HTML_PATTERN.matcher(expectedBody).find(); |
| 650 | } | |
| 651 | | |
| 652 | private AssertEmail() { | |
| 653 | super(); | |
| 654 | } | |
| 655 | } | |
Mutations | ||
| 63 |
1.1 |
|
| 98 |
1.1 |
|
| 117 |
1.1 |
|
| 152 |
1.1 |
|
| 169 |
1.1 |
|
| 199 |
1.1 |
|
| 230 |
1.1 |
|
| 265 |
1.1 |
|
| 284 |
1.1 |
|
| 319 |
1.1 |
|
| 336 |
1.1 |
|
| 366 |
1.1 |
|
| 401 |
1.1 |
|
| 440 |
1.1 |
|
| 458 |
1.1 |
|
| 474 |
1.1 |
|
| 500 |
1.1 |
|
| 540 |
1.1 |
|
| 570 |
1.1 |
|
| 589 |
1.1 2.2 3.3 |
|
| 593 |
1.1 |
|
| 601 |
1.1 |
|
| 608 |
1.1 |
|
| 621 |
1.1 |
|
| 631 |
1.1 2.2 3.3 |
|
| 645 |
1.1 2.2 3.3 |
|
| 649 |
1.1 2.2 |


Dashboard
Scan
Search
Bins
Products
Etsy Inventory
Loading...
Dashboard
Bin Scan
Scan Bin Label
Scan a bin label to see the bins contents
Search
Products
Get Bin List


Garden design is a platform for Urban India to stay close to nature. Every city turning into a concrete jungle now, Graden World offers unique solutions for every person with beatiful plants, pots, decorative kincks-knacks to create your green patch. We strive to be the perfect Urban solution with our unique products delveloped keeping you in mind.
We wanted urbanites to rediscover nature and use it as a means for healthier living - cleaner air, less stress, organic food and much more fulfilling life. We are doing this making available a wide range of gradening products, know-how and services at your doorstep. Growing plants need not be difficult, and we are always there to help you select and nurture your greens.
As a team, we put great value on integrity, prompt customer services, quality and a shared desire to help people 'go green'
Wishing you a greener home!
Naturally yours,
Team Green World
Quicks Links
Contact for Horticulturist


Obstacles
-
The Tank
A Giant Container of Gak!
-
Sundae Slide
A Slimy Sliding Board!
-
Human Hampster Wheel
A 1-Ton Spinning Wheel!
-
Down the Hatch
6ft Slide Covered in Gunk!
-
Pick It
Pick a Winner!
-
The Wringer
2 Gigantic Rollers


|
Architecture Components |
|
As shown in Fig. 1, SimRobot consists of several modules that are linked
to one single application. This approach, which is different from many other
client/server-based simulation concepts, has been chosen because it offers the
possibility of halting or stepwise executing the whole simulation without any
concurrencies. It allows also a more comprehensive debugging of the executed
robot software.
The main components of SimRobot are:
- SimRobotCore
The simulation core, which may also be qualified as engine or
kernel, is the most important part of the application. It models the robots
and the environment, simulates sensor readings, and executes commands
given by the controller or the user. Even most parts of the visualization are
integrated into the simulation core.
The kernel is platform independent. It is connected to a user interface and
a controller via a well-defined interface. This enables an easy porting to
other platforms as well as the embedding into other applications.
- GUI
The user interface is responsible for the display of information (e. g. different
views of the simulated scene) and for the interaction with the user. It is described
in more detail in User Interface section.
- Controller
The controller implements a sense-think-act cycle. In each simulation step,
it is called by the simulation, reads the available sensors, plans the
next action, and sets the actuators to the desired states. A controller which
is suitable for the modeled scene has to be provided by the user. Normally,
it contains the control software of the simulated robots, but it may also be
left empty.
- Scene
The specification of the robots and the environment, in the context of SimRobot named as
scene, is modeled via an external XML file and loaded at runtime. It is described
in the Specification of Robotssection.


Compute Grade
Final Grade TBD
Menu
Save
The sum of all the Slider Values should be 100%.Please set them again.
Please enter all the Max Marks for items on the page.


{% extends 'program_base.html' %} {% block title %} Add {{ event_proposal.event_type.host_title }} | {{ block.super }} {% endblock %} {% block program_content %}
Either pick an existing {{ event_proposal.event_type.host_title }} from the list below, or press the button to create a new {{ event_proposal.event_type.host_title }}. Note: If you need to add a {{ event_proposal.event_type.host_title }} which was not submitted by yourself you need to tell the Content Team.


These functions are used for mutating collision shapes. More...
Functions | |
| void | cpCircleShapeSetRadius (cpShape *shape, cpFloat radius) |
| Set the radius of a circle shape. | |
| void | cpCircleShapeSetOffset (cpShape *shape, cpVect offset) |
| Set the offset of a circle shape. | |
| void | cpSegmentShapeSetEndpoints (cpShape *shape, cpVect a, cpVect b) |
| Set the endpoints of a segment shape. | |
| void | cpSegmentShapeSetRadius (cpShape *shape, cpFloat radius) |
| Set the radius of a segment shape. | |
| void | cpPolyShapeSetVerts (cpShape *shape, int numVerts, cpVect *verts, cpVect offset) |
| Set the vertexes of a poly shape. |
These functions are used for mutating collision shapes.
Chipmunk does not have any way to get velocity information on changing shapes, so the results will be unrealistic. You must explicity include the chipmunk_unsafe.h header to use them.


| Requester Information |
| Name |
baabtra Mentoring Partner |
Date |
9/9/2013 |
| Department |
Training |
| Email |
<EMAIL_ADDRESS>|
Phone |
0495 4025550 |
| Supplier Information |
| Name |
megatrade computers |
| Address 1 |
Palayam |
| Address 2 |
|
| City |
Kozhikode |
State |
Kerala |
Zip Code |
673001 |
| E-mail |
<EMAIL_ADDRESS>|
web |
www.megatrade.com |
| Phone |
0495 222222 |
Fax |
0495 222222 |
| Items |
| Item # |
Part Number |
Description |
Quantity |
Unit Cost |
Total |
| 1 |
197-545501 |
Toner Cartridge for LaserJet 4100 Series 600 |
2 |
29 |
58 |
| 2 |
555-013095 |
Ink Cartridge color for Epson Styles C62 |
3 |
25 |
75 |
| 3 |
555-011425 |
Parallel Printer Cable 10ft |
2 |
7.5 |
15 |
| sub-Total |
146.90 |
| Tax |
10.15 |
| Shipping |
15.80 |
| Total |
320.85 |
| Approval |
| Person |
Shafeeque P |
Date |
9/7/2013 |


--- layout: basic title: Releases · CellProfiler redirect_from: "/download.html" ---
| Linux | ||
| OS X (NOTE: After launching, if no window appears, click the dock icon. Bug) | ||
| Windows (NOTE: Windows is still 2.1.1. Update coming soon) | ||
| Linux | ||
| OS X (NOTE: After launching, if no window appears, click the dock icon. Bug) | ||
| Windows | ||
| Linux | ||
| OS X (NOTE: After launching, if no window appears, click the dock icon. Bug) | ||
| Windows | ||
| OS X (NOTE: After selecting properties file, if no window appears, click the dock icon. Bug) | ||
| Windows | ||
| OS X (NOTE: After selecting properties file, if no window appears, click the dock icon. Bug) | ||
| Windows | ||


Try to answer the following coding related questions before time runs out. Each incorrect answer will reduce the amount of time left by 5 seconds.
Which of the following would you use to log a message to the console?
What is the scope of a variable declared within a function?
How do you add an HTML ID into javascript?
What is an example of a conditional in javascript?