Principal EE - San Jose, CA 95119
Do you want to join one of the World's Most Admired Companies? Are you looking to be part of a dynamic and growing organization, who's company culture is centered on empowering its employees to make decisions? As one of the world's largest electronic manufacturing & supply chain logistics companies, Jabil is focused on hiring the best people!
JOB SUMMARY
As a Principal Engineer you will have developed an expertise in a particular field of engineering or within a particular sector. You will have lead design teams through full product development and into production. As a Principal, you will be expected to demonstrate a level of expertise in a particular area that matches or exceeds the expertise of our customers. You will consult on system architectures, assess technical requirements and competencies needed during quoting and oversee design progressions during product developments.
ESSENTIAL DUTIES AND RESPONSIBILITIES
- Meet the requirements of Lead Design Engineer in your respective expertise
- Will represent Jabil Design Engineering in technical customer discussions / meetings.
- Work with Project Managers in the quoting process.
- Provide technical input to help identify and solve project risks that may affect overall project plans and schedules.
- Is expected to support the development and utilization of processes for design.
- Mentoring of all engineering staff
- Stay abreast of the latest technology and techniques to provide designs that are competitive and cost effective.
- Raise perception of Jabil’s acumen in the industry by authoring or presenting papers, articles, etc.
- Should be associated with applicable industry trade groups/organizations maintaining active membership and participation.
- Work with Site Directors to define potential R&D project proposals that will help increase areas of competencies needed.
- Lead the development and implementation of platform and product architectures in collaboration with senior technical staff.
- Guide and oversee the development of system component requirements, interfaces, and specifications necessary to maintain the consistency and integrity of the architectures.
- Manage product design and documentation at a system level.
- Perform independent research and engineering studies.
- Lead remote development teams.
- Effectively consult on multiple projects in parallel.
- Develop IP Patents, Technical Publications or White Papers
- May perform other duties and responsibilities as assigned.
JOB QUALIFICATIONS
KNOWLEDGE REQUIREMENTS
LANGUAGE SKILLS
Ability to read, analyze, and interpret general business periodicals, professional journals, technical procedures, or governmental regulations. Ability to write reports, business correspondence, and procedure manuals. Ability to effectively present information and respond to questions from groups of managers, clients, customers, and the general public.
MATHEMATICAL SKILLS
Ability to work with mathematical concepts such as probability and statistics, and fundamentals of plane and solid geometry and trigonometry. Ability to apply concepts such as fractions, percentages, ratios, and proportions to practical situations.
REASONING ABILITY
Ability to define problems, collect data, establish facts, and draw valid conclusions. Ability to interpret an extensive variety of technical instructions in mathematical or diagram form and deal with several abstract and concrete variables. Ability to develop mathematical models of physical reality and solve them, then implement the results.
EDUCATION & EXPERIENCE REQUIREMENTS
- Masters degree in Engineering from an accredited four-year college or university
- Minimum of 11-12 years of related experience and/or training
- Minimum of 2 years experience as a Lead Engineer
- Specific requirements as defined by the market sector
- Or an equivalent combination of education, training or experience.
Jabil, including its subsidiaries, is an equal opportunity employer and considers qualified applicants for employment without regard to race, color, religion, national origin, sex, sexual orientation, gender identify, age, disability, genetic information, veteran status, or any other characteristic protected by law.


1.
Syllabus
2.
Lectures
3.
Assignments
Project
HW0: R Basics
HW1-2-3: R Programming an Data Wrangling
4.
Resources
Clear History
Built with
from
Grav
and
Hugo
Data Science for Business Analytics
> Categories
Categories
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus


Visual Studio 2019 for Mac version 8.7 is now available | Visual Studio Blog Visual Studio 2019 for Mac version 8.7 is available today and includes support for gRPC / OpenAPI client generation and improved unit testing integration. Additionally, it includes several improvements for Xamarin developers, including Xamarin.Forms 4.8 S...
Why are you testing your software? 15 years ago, automated tests didn’t exist in the Java ecosystem. One had to build the application and painfully test it manually by using it. I was later introduced to the practice of adding a main method to every class and putting some testing code ther...
Layering domains and microservices using API Gateways | Kislay Verma Microservice hell? Systems thinking and API gateways can help
Reverse Engineering Netgear's Auth to extend my Meural My adventure adding a Twilio powered MMS Integration to my digital picture frame
Consumer Data Exposed in Telemarketing Adviser Breach A California-based organization that helps telemarketing companies avoid lawsuits for unsolicited calls exposed its internal files to the internet. Ironically, the
On finding your passion — CULLIN A few years ago I was catching up with an old friend from my childhood over the phone. It was an electric conversation - we were both thrilled to hear from each other. The dreaded question came up. “What have you been up to?” I hated this question. For ...
Don't just learn to code, learn to create Learning to code is fun. It's exciting, isn't it? It gives you powers to create anything you want. But learning how to code is not enough, building real stuff is the real deal. The biggest mistake I did as a beginner was getting stuck in the tutorial...
Using .NET Core Tools to Create Reusable and Shareable Tools & Apps Dotnet Tools offer a simple way to create, publish and consume what are essentially .NET Core applications that can be published and shared using the existing NuGet infrastructure for packaging and distribution. It's y quick and easy to build tools that y...
Latest Firefox rolls out Enhanced Tracking Protection 2.0; blocking redirect trackers by default – The Mozilla Blog Today, Firefox is introducing Enhanced Tracking Protection (ETP) 2.0, our next step in continuing to provide a safe and private experience for our users. ETP 2.0 protects you from an advanced tracking technique called redirect tracking, also known as boun...
Entity Framework: .NET Community Standup - August 5th 2020 - EF Core In Depth Video Series Join members from the .NET teams for our community standup covering great community contributions for Framework, .NET Core, Languages, CLI, MSBuild, and more. Community Links: https://www.theurlist.com/efcore-standup-2020-08-05
Chris Sainty: Blazor Routing - What you need to know Mon, Aug 10, 2020, 7:30 PM: We'll open the Zoom meeting at 7:15 pm and aim to start the presentation at 7:30 pm sharp. This will give everyone time to join and get set up. Where possible, please join
GitLab Support is no longer processing MFA resets for free users From August 15th, GitLab Support will no longer be manually removing MFA from free accounts.
r/sysadmin - [Rant... sorta] Physically moved a server today... 1,739 votes and 360 comments so far on Reddit
Watch SpaceX ACTUALLY hop Starship SN-5 150m!!! Gene and Rachel from Spadre [@SouthPadreIsle] are right at the edge of the exclusion zone with one of my my slow motion cameras to catch SpaceX perform a test flight of Starship SN-5! Follow my friends @SpacePadreIsle for all their hard work and help! - ...
How to SSH into WSL2 on Windows 10 from an external machine Cool blog post eh? Good title, right? DO NOT DO THE INSTRUCTIONS IN THIS POST until you have read the FOLLOW UP THE ...
THE EASY WAY how to SSH into Bash and WSL2 on Windows 10 from an external machine This is an interesting blog post on How to SSH into WSL2 on Windows 10 from an external machine. Read it. Know how it ...
Fuzzy.Blazor.FluentRenderTreeBuilder 1.1.0 A fluent RenderTreeBuilder for Blazor Server and WebAssembly
Creating an .NET AWS serverless application using API Gateway with API Key Today at work I’ve needed to create a quick solution to provide a client application with data stored in AWS. It has been a while since the last time I’ve used C# in AWS so I thought I&…
Query Design performance issues #01 - All-in-one query When looking into performance issues on support cases there is one pattern called ALL-IN-ONE QUERY that we always sees that cause many issues. This pattern is very common and logically looks correct but will cause huge performance degradation. The idea ...
GitHub joins the Open Source Security Foundation - The GitHub Blog We are happy to announce that GitHub is joining the Open Source Security Foundation (OpenSSF) as a founding member, alongside Google, IBM, JPMorgan Chase, Microsoft, NCC Group, OWASP Foundation, Red Hat, and others.
Announcing the new TypeScript Website | TypeScript Learn about the new version of the TypeScript website, built from scratch with improvements to the handbook, playground and a new tsconfig.json reference.
Data Prep for Machine Learning: Normalization -- Visual Studio Magazine Dr. James McCaffrey of Microsoft Research uses a full code sample and screenshots to show how to programmatically normalize numeric data for use in a machine learning system such as a deep neural network classifier or clustering algorithm.
Enforcing asynchronous code good practices using a Roslyn analyzer - Gérald Barré In this post, I describe the Roslyn Analyzers that help writing good async/await code in .NET.
Microsoft joins Open Source Security Foundation Microsoft is proud to be a founding member of OpenSSF, collaborating on securing open source software with industry partners.
Creating a Progressive Web App with Blazor WebAssembly -- Visual Studio Magazine Not surprisingly, it's dead easy to create an app in Blazor that runs outside of the browser window and (potentially) in an offline mode. Before you get carried away, though, there are some key design decisions to make.
Patterns of Distributed Systems A catalog of patterns to better understand, communicate, and teach the design of distributed systems
Azure Event Hubs With Kafka So it’s been a while since I wrote a post about Kafka (and Azure too actually, at work we use AWS) But anyway someone mentioned to be the other day that Azure EventHubs come with the ability…
Anthony Levandowski sentenced to 18 months in prison, as new $4B lawsuit against Uber is filed – TechCrunch Anthony Levandowski, the former Google engineer and serial entrepreneur who was at the center of a lawsuit between Uber and Waymo, has been sentenced to 18 months on one count of stealing trade secrets. Judge Alsup said that home confinement would “[give...
TikTok and the Sorting Hat — Remains of the Day NEXT POST: Part II of my thoughts on TikTok, on how the app design is informed by its algorithm and vice versa in a virtuous circle.
restore: trying out mmap-based file extraction by zkat · Pull Request #3524 · NuGet/NuGet.Client Fixes: NuGet/Home#9807 Results are promising: Benchmark results from one of our test benchmark projects (the Orchard example) Note: I couldn't get the NuGet.Client-based benchmarks to work, ...
1Password for Linux development preview A full-featured Linux desktop app has been our most requested feature by far and responsible for the longest forum post in our history.
Story Creator - Social Media Video Editor For Brands & Agencies Story Creator is an easy and powerful social media video editor. Create your first video with subtitles, music, images to video, motion graphic elements, and much more.


Reshapes a SparseTensor
to represent values in a new dense shape.
tf.compat.v1.sparse.reshape
tf.compat.v1.sparse_reshape
tf.compat.v2.sparse.reshape
tf.sparse.reshape( sp_input, shape, name=None )
This operation has the same semantics as reshape
on the represented dense
tensor. The indices of non-empty values in sp_input
are recomputed based
on the new dense shape, and a new SparseTensor
is returned containing the
new indices and new shape. The order of non-empty values in sp_input
is
unchanged.
If one component of shape
is the special value -1, the size of that
dimension is computed so that the total dense size remains constant. At
most one component of shape
can be -1. The number of dense elements
implied by shape
must be the same as the number of dense elements
originally represented by sp_input
.
For example, if sp_input
has shape [2, 3, 6]
and indices
/ values
:
[0, 0, 0]: a [0, 0, 1]: b [0, 1, 0]: c [1, 0, 0]: d [1, 2, 3]: e
and shape
is [9, -1]
, then the output will be a SparseTensor
of
shape [9, 4]
and indices
/ values
:
[0, 0]: a [0, 1]: b [1, 2]: c [4, 2]: d [8, 1]: e
sp_input
: The input SparseTensor
.shape
: A 1-D (vector) int64 Tensor
specifying the new dense shape of the
represented SparseTensor
.name
: A name prefix for the returned tensors (optional)A SparseTensor
with the same non-empty values but with indices calculated
by the new dense shape.
TypeError
: If sp_input
is not a SparseTensor
.ValueError
: If argument shape
requests a SparseTensor
with a different
number of elements than sp_input
.ValueError
: If shape
has more than one inferred (== -1) dimension.


uberscore spec - UNOPTIMIZED, AMD/RequireJS loader
** uRequire note: **
- Dependencies (eg. `lodash`) are loaded through RequireJs loader (using `rjs.paths`)
- 'uberscore' dependency is loading through `rjs.baseUrl`, which in turn loads all bundle dependencies *as seperate files*).


tset
Section: User Commands (1)Updated:
Index Return to Main Contents
NAME
tset, reset - terminal initializationSYNOPSIS
tset [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]reset [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]
DESCRIPTION
Tset initializes terminals. Tset first determines the type of terminal that you are using. This determination is done as follows, using the first terminal type found.1. The terminal argument specified on the command line.
2. The value of the TERM environmental variable.
3. (BSD systems only.) The terminal type associated with the standard error output device in the /etc/ttys file. (On Linux and System-V-like UNIXes, getty does this job by setting TERM according to the type passed to it by /etc/inittab.)
4. The default terminal type, ``unknown''.
If the terminal type was not specified on the command-line, the -m option mappings are then applied (see the section TERMINAL TYPE MAPPING for more information). Then, if the terminal type begins with a question mark (``?''), the user is prompted for confirmation of the terminal type. An empty response confirms the type, or, another type can be entered to specify a new type. Once the terminal type has been determined, the terminfo entry for the terminal is retrieved. If no terminfo entry is found for the type, the user is prompted for another terminal type.
Once the terminfo entry is retrieved, the window size, backspace, interrupt and line kill characters (among many other things) are set and the terminal and tab initialization strings are sent to the standard error output. Finally, if the erase, interrupt and line kill characters have changed, or are not set to their default values, their values are displayed to the standard error output. Use the -c or -w option to select only the window sizing versus the other initialization. If neither option is given, both are assumed.
When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state. Note, you may have to type
<LF>reset<LF>
(the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. Also, the terminal will often not echo the command.
The options are as follows:
- -c
- Set control characters and modes. -e Set the erase character to ch.
- -I
- Do not send the terminal or tab initialization strings to the terminal.
- -i
- Set the interrupt character to ch.
- -k
- Set the line kill character to ch.
- -m
- Specify a mapping from a port type to a terminal. See the section TERMINAL TYPE MAPPING for more information.
- -Q
- Do not display any values for the erase, interrupt and line kill characters. Normally tset displays the values for control characters which differ from the system's default values.
- -q
- The terminal type is displayed to the standard output, and the terminal is not initialized in any way. The option `-' by itself is equivalent but archaic.
- -r
- Print the terminal type to the standard error output.
- -s
- Print the sequence of shell commands to initialize the environment variable TERM to the standard output. See the section SETTING THE ENVIRONMENT for details.
- -V
- reports the version of ncurses which was used in this program, and exits.
- -w
- Resize the window to match the size deduced via setupterm. Normally this has no effect, unless setupterm is not able to detect the window size.
The arguments for the -e, -i, and -k options may either be entered as actual characters or by using the `hat' notation, i.e. control-h may be specified as ``^H'' or ``^h''.
SETTING THE ENVIRONMENT
It is often desirable to enter the terminal type and information about the terminal's capabilities into the shell's environment. This is done using the -s option.When the -s option is specified, the commands to enter the information into the shell's environment are written to the standard output. If the SHELL environmental variable ends in ``csh'', the commands are for csh, otherwise, they are for sh. Note, the csh commands set and unset the shell variable noglob, leaving it unset. The following line in the .login or .profile files will initialize the environment correctly:
TERMINAL TYPE MAPPING
When the terminal is not hardwired into the system (or the current system information is incorrect) the terminal type derived from the /etc/ttys file or the TERM environmental variable is often something generic like network, dialup, or unknown. When tset is used in a startup script it is often desirable to provide information about the type of terminal used on such ports.The purpose of the -m option is to map from some set of conditions to a terminal type, that is, to tell tset ``If I'm on this port at a particular speed, guess that I'm on that kind of terminal''.
The argument to the -m option consists of an optional port type, an optional operator, an optional baud rate specification, an optional colon (``:'') character and a terminal type. The port type is a string (delimited by either the operator or the colon character). The operator may be any combination of ``>'', ``<'', ``@'', and ``!''; ``>'' means greater than, ``<'' means less than, ``@'' means equal to and ``!'' inverts the sense of the test. The baud rate is specified as a number and is compared with the speed of the standard error output (which should be the control terminal). The terminal type is a string.
If the terminal type is not specified on the command line, the -m mappings are applied to the terminal type. If the port type and baud rate match the mapping, the terminal type specified in the mapping replaces the current type. If more than one mapping is specified, the first applicable mapping is used.
For example, consider the following mapping: dialup>9600:vt100. The port type is dialup , the operator is >, the baud rate specification is 9600, and the terminal type is vt100. The result of this mapping is to specify that if the terminal type is dialup, and the baud rate is greater than 9600 baud, a terminal type of vt100 will be used.
If no baud rate is specified, the terminal type will match any baud rate. If no port type is specified, the terminal type will match any port type. For example, -m dialup:vt100 -m :?xterm will cause any dialup port, regardless of baud rate, to match the terminal type vt100, and any non-dialup port type to match the terminal type ?xterm. Note, because of the leading question mark, the user will be queried on a default port as to whether they are actually using an xterm terminal.
No whitespace characters are permitted in the -m option argument. Also, to avoid problems with meta-characters, it is suggested that the entire -m option argument be placed within single quote characters, and that csh users insert a backslash character (``\'') before any exclamation marks (``!'').
HISTORY
The tset command appeared in BSD 3.0. The ncurses implementation was lightly adapted from the 4.4BSD sources for a terminfo environment by Eric S. Raymond<EMAIL_ADDRESS>The tset utility has been provided for backward-compatibility with BSD environments (under most modern UNIXes, /etc/inittab and getty(1) can set TERM appropriately for each dial-up line; this obviates what was tset's most important use). This implementation behaves like 4.4BSD tset, with a few exceptions specified here.The -S option of BSD tset no longer works; it prints an error message to stderr and dies. The -s option only sets TERM, not TERMCAP. Both these changes are because the TERMCAP variable is no longer supported under terminfo-based ncurses, which makes tset -S useless (we made it die noisily rather than silently induce lossage).
There was an undocumented 4.4BSD feature that invoking tset via a link named `TSET` (or via any other name beginning with an upper-case letter) set the terminal to use upper-case only. This feature has been omitted.
The -A, -E, -h, -u and -v options were deleted from the tset utility in 4.4BSD. None of them were documented in 4.3BSD and all are of limited utility at best. The -a, -d, and -p options are similarly not documented or useful, but were retained as they appear to be in widespread use. It is strongly recommended that any usage of these three options be changed to use the -m option instead. The -n option remains, but has no effect. The -adnp options are therefore omitted from the usage summary above.
It is still permissible to specify the -e, -i, and -k options without arguments, although it is strongly recommended that such usage be fixed to explicitly specify the character.
As of 4.4BSD, executing tset as reset no longer implies the -Q option. Also, the interaction between the - option and the terminal argument in some historic implementations of tset has been removed.
ENVIRONMENT
The tset command uses these environment variables:- SHELL
- tells tset whether to initialize TERM using sh or csh syntax.
- TERM
- Denotes your terminal type. Each terminal type is distinct, though many are similar.
- TERMCAP
- may denote the location of a termcap database. If it is not an absolute pathname, e.g., begins with a `/', tset removes the variable from the environment before looking for the terminal description.
FILES
- /etc/ttys
- system port name to terminal type mapping database (BSD versions only).
- /usr/share/terminfo
- terminal capability database
SEE ALSO
csh(1), sh(1), stty(1), curs_terminfo(3X), tty(4), terminfo(5), ttys(5), environ(7)This describes ncurses version 5.7 (patch 20090207).
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- SETTING THE ENVIRONMENT
- TERMINAL TYPE MAPPING
- HISTORY
- COMPATIBILITY
- ENVIRONMENT
- FILES
- SEE ALSO
This document was created by man2html, using the manual pages.
Time: 05:29:10 GMT, December 24, 2015


Counseling Services will provide quality mental health service to enhance the overall mental health of Winthrop University students along cognitive, emotional, personal, and interpersonal dimensions.
Contrary to popular belief, Lorem Ipsum is not simply random text.
The Office of Victims Assistance is committed to providing quality services and advocacy to victims and survivors of sexual assault, stalking, and domestic and dating violence through a concentrated community response.
Wellness Services provides a collaborative, evidence-based approach to individual and community wellness through health promotion, educational programming, and service to the Winthrop community.


{% extends 'base.html' %} {% import 'macros.html' as macro %} {% block styles%} {{ super() }} {% endblock %} {% block content %}
Category: {{pitch.title}}
Add a pitch: {{pitch.content}}
{{pitch.user}}
{% for comment in pitch.comments%}comment:{{comment.description}}
{%endfor%}Already signed in? Write a pitch here.
{% endfor %}


1. Introduction
The Groovy programming language comes with great support for writing tests. In addition to the language features and test integration with state-of-the-art testing libraries and frameworks, the Groovy ecosystem has born a rich set of testing libraries and frameworks.
This chapter will start with language specific testing features and continue with a closer look at JUnit integration, Spock for specifications and Geb for functional tests. Finally, we an overview of other testing libraries known to be working with Groovy.
2. Language Features
Besides integrated support for JUnit, the Groovy programming language comes with features that have proven to be very valuable for test-driven development. This section gives insight on them.
2.1. Power Assertions
Writing tests means formulating assumptions by using assertions. In Java this can be done by using the assert
keyword that has been added in J2SE 1.4. In Java, assert
statements can be enabled via the JVM parameters -ea
(or -enableassertions
) and -da
(or -disableassertions
). Assertion statements in Java are disabled by default.
Groovy comes with a rather powerful variant of assert
also known as power assertion statement. Groovy’s power
assert
differs from the Java version in its output given the boolean expression validates to false
:
def x = 1
assert x == 2
// Output: (1)
//
// Assertion failed:
// assert x == 2
// | |
// 1 false
| 1 | This section shows the std-err output |
The java.lang.AssertionError
that is thrown whenever the assertion can not be validated successfully, contains
an extended version of the original exception message. The power assertion output shows evaluation results from
the outer to the inner expression.
The power assertion statements true power unleashes in complex Boolean statements, or statements with
collections or other toString
-enabled classes:
def x = [1,2,3,4,5]
assert (x << 6) == [6,7,8,9,10]
// Output:
//
// Assertion failed:
// assert (x << 6) == [6,7,8,9,10]
// | | |
// | | false
// | [1, 2, 3, 4, 5, 6]
// [1, 2, 3, 4, 5, 6]
Another important difference from Java is that in Groovy assertions are enabled by default. It has been a language design
decision to remove the possibility to deactivate assertions. Or, as Bertrand Meyer stated, it makes no sense to take
off your swim ring if you put your feet into real water
.
One thing to be aware of are methods with side-effects inside Boolean expressions in power assertion statements. As the internal error message construction mechanism does only store references to instances under target, it happens that the error message text is invalid at rendering time in case of side-effecting methods involved:
assert [[1,2,3,3,3,3,4]].first().unique() == [1,2,3]
// Output:
//
// Assertion failed:
// assert [[1,2,3,3,3,3,4]].first().unique() == [1,2,3]
// | | |
// | | false
// | [1, 2, 3, 4]
// [1, 2, 3, 4] (1)
| 1 | The error message shows the actual state of the collection, not the state before the unique method was applied |
If you choose to provide a custom assertion error message this can be done by using the Java syntax assert
expression1 : expression2 where expression1 is the Boolean expression and expression2 is the custom error message.
Be aware though that this will disable the power assert and will fully fallback to custom
error messages on assertion errors.
|
2.2. Mocking and Stubbing
Groovy has excellent built-in support for a range of mocking and stubbing alternatives. When using Java, dynamic mocking frameworks are very popular. A key reason for this is that it is hard work creating custom hand-crafted mocks using Java. Such frameworks can be used easily with Groovy if you choose but creating custom mocks is much easier in Groovy. You can often get away with simple maps or closures to build your custom mocks.
The following sections show ways to create mocks and stubs with Groovy language features only.
2.2.1. Map Coercion
By using maps or expandos, we can incorporate desired behaviour of a collaborator very easily as shown here:
class TranslationService {
String convert(String key) {
return "test"
}
}
def service = [convert: { String key -> 'some text' }] as TranslationService
assert 'some text' == service.convert('key.text')
The as
operator can be used to coerce a map to a particular class. The given map keys are interpreted as
method names and the values, being groovy.lang.Closure
blocks, are interpreted as method code blocks.
Be aware that map coercion can get into the way if you deal with custom java.util.Map descendant classes in combination
with the as operator. The map coercion mechanism is targeted directly at certain collection classes, it doesn’t take
custom classes into account.
|
2.2.2. Closure Coercion
The 'as' operator can be used with closures in a neat way which is great for developer testing in simple scenarios. We haven’t found this technique to be so powerful that we want to do away with dynamic mocking, but it can be very useful in simple cases none-the-less.
Classes or interfaces holding a single method, including SAM (single abstract method) classes, can be used to coerce a closure block to be an object of the given type. Be aware that for doing this, Groovy internally create a proxy object descending for the given class. So the object will not be a direct instance of the given class. This important if, for example, the generated proxy object’s meta-class is altered afterwards.
Let’s have an example on coercing a closure to be of a specific type:
def service = { String key -> 'some text' } as TranslationService
assert 'some text' == service.convert('key.text')
Groovy supports a feature called implicit SAM coercion. This means that the as
operator is not necessary in situations
where the runtime can infer the target SAM type. This type of coercion might be useful in tests to mock entire SAM
classes:
abstract class BaseService {
abstract void doSomething()
}
BaseService service = { -> println 'doing something' }
service.doSomething()
2.2.3. MockFor and StubFor
The Groovy mocking and stubbing classes can be found in the groovy.mock.interceptor
package.
The MockFor
class supports (typically unit) testing of classes in isolation by allowing a strictly ordered expectation
of the behavior of collaborators to be defined. A typical test scenario involves a class under test and one or more collaborators. In such a scenario it is
often desirable to just test the business logic of the class under test. One strategy for doing that is to replace
the collaborator instances with simplified mock objects to help isolate out the logic in the test target. MockFor
allows such mocks to be created using meta-programming. The desired behavior of collaborators is defined as a behavior
specification. The behavior is enforced and checked automatically.
Let’s assume our target classes looked like this:
class Person {
String first, last
}
class Family {
Person father, mother
def nameOfMother() { "$mother.first $mother.last" }
}
With MockFor
, a mock expectation is always sequence dependent and its use automatically ends with a call to verify
:
def mock = new MockFor(Person) (1)
mock.demand.getFirst{ 'dummy' }
mock.demand.getLast{ 'name' }
mock.use { (2)
def mary = new Person(first:'Mary', last:'Smith')
def f = new Family(mother:mary)
assert f.nameOfMother() == 'dummy name'
}
mock.expect.verify() (3)
| 1 | a new mock is created by a new instance of MockFor |
| 2 | a Closure is passed to use which enables the mocking functionality |
| 3 | a call to verify checks whether the sequence and number of method calls is as expected |
The StubFor
class supports (typically unit) testing of classes in isolation by allowing a loosely-ordered expectation
of the behavior of collaborators to be defined. A typical test scenario involves a class under test and one or more
collaborators. In such a scenario it is often desirable to just test the business logic of the CUT. One strategy for
doing that is to replace the collaborator instances with simplified stub objects to help isolate out the logic
in the target class. StubFor
allows such stubs to be created using meta-programming. The desired behavior of
collaborators is defined as a behavior specification.
In contrast to MockFor
the stub expectation checked with verify
is sequence independent and its use is optional:
def stub = new StubFor(Person) (1)
stub.demand.with { (2)
getLast{ 'name' }
getFirst{ 'dummy' }
}
stub.use { (3)
def john = new Person(first:'John', last:'Smith')
def f = new Family(father:john)
assert f.father.first == 'dummy'
assert f.father.last == 'name'
}
stub.expect.verify() (4)
| 1 | a new stub is created by a new instance of StubFor |
| 2 | the with method is used for delegating all calls inside the closure to the StubFor instance |
| 3 | a Closure is passed to use which enables the stubbing functionality |
| 4 | a call to verify (optional) checks whether the number of method calls is as expected |
MockFor
and StubFor
can not be used to test statically compiled classes e.g for Java classes or Groovy classes that
make use of @CompileStatic
. To stub and/or mock these classes you can use Spock or one of the Java mocking libraries.
2.2.4. Expando Meta-Class (EMC)
Groovy includes a special MetaClass
the so-called ExpandoMetaClass
(EMC). It allows to dynamically add methods,
constructors, properties and static methods using a neat closure syntax.
Every java.lang.Class
is supplied with a special metaClass
property that will give a reference to an
ExpandoMetaClass
instance. The expando meta-class is not restricted to custom classes, it can be used for
JDK classes like for example java.lang.String
as well:
String.metaClass.swapCase = {->
def sb = new StringBuffer()
delegate.each {
sb << (Character.isUpperCase(it as char) ? Character.toLowerCase(it as char) :
Character.toUpperCase(it as char))
}
sb.toString()
}
def s = "heLLo, worLD!"
assert s.swapCase() == 'HEllO, WORld!'
The ExpandoMetaClass
is a rather good candidate for mocking functionality as it allows for more advanced stuff
like mocking static methods
class Book {
String title
}
Book.metaClass.static.create << { String title -> new Book(title:title) }
def b = Book.create("The Stand")
assert b.title == 'The Stand'
or even constructors
Book.metaClass.constructor << { String title -> new Book(title:title) }
def b = new Book("The Stand")
assert b.title == 'The Stand'
Mocking constructors might seem like a hack that’s better not even to be considered but even there might be valid
use cases. An example can be found in Grails where domain class constructors are added at run-time with the
help of ExpandoMetaClass . This lets the domain object register itself in the Spring application context and allows
for injection of services or other beans controlled by the dependency-injection container.
|
If you want to change the metaClass
property on a per test method level you need to remove the changes that were
done to the meta-class, otherwise those changes would be persistent across test method calls. Changes are removed by
replacing the meta-class in the GroovyMetaClassRegistry
:
GroovySystem.metaClassRegistry.setMetaClass(java.lang.String, null)
Another alternative is to register a MetaClassRegistryChangeEventListener
, track the changed classes and remove
the changes in the cleanup method of your chosen testing runtime. A good example can be found
in the Grails web
development framework.
Besides using the ExpandoMetaClass
on a class-level, there is also support for using the meta-class on a per-object
level:
def b = new Book(title: "The Stand")
b.metaClass.getTitle {-> 'My Title' }
assert b.title == 'My Title'
In this case the meta-class change is related to the instance only. Depending on the test scenario this might be a better fit than the global meta-class change.
2.3. GDK Methods
The following section gives a brief overview on GDK methods that can be leveraged in test case scenarios, for example for test data generation.
2.3.1. Iterable#combinations
The combinations
method that is added on java.lang.Iterable
compliant classes can be used to get a list of
combinations from a list containing two or more sub-lists:
void testCombinations() {
def combinations = [[2, 3],[4, 5, 6]].combinations()
assert combinations == [[2, 4], [3, 4], [2, 5], [3, 5], [2, 6], [3, 6]]
}
The method could be used in test case scenarios to generate all possible argument combinations for a specific method call.
2.3.2. Iterable#eachCombination
The eachCombination
method that is added on java.lang.Iterable
can be used to apply a function (or in this
case a groovy.lang.Closure
) to each if the combinations that has been built by the combinations
method:
eachCombination
is a GDK method that is added to all classes conforming to the java.lang.Iterable
interface.
It applies a function on each combination of the input lists:
void testEachCombination() {
[[2, 3],[4, 5, 6]].eachCombination { println it[0] + it[1] }
}
The method could be used in the testing context to call methods with each of the generated combinations.
2.4. Tool Support
2.4.1. Test Code Coverage
Code coverage is a useful measure of the effectiveness of (unit) tests. A program with high code coverage has a lower chance to hold critical bugs than a program with no or low coverage. To get code coverage metrics, the generated byte-code usually needs to be instrumented before the tests are executed. One tool with Groovy support for this task is Cobertura.
Various frameworks and build tools come with Cobertura integration. For Grails, there is the code coverage plugin based on Cobertura, for Gradle there is the gradle-cobertura plugin, to name only two of them.
The following code listing shows an example on how to enable Cobertura test coverage reports in a Gradle build script from a Groovy project:
def pluginVersion = '<plugin version>'
def groovyVersion = '<groovy version>'
def junitVersion = '<junit version>'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-cobertura-plugin:${pluginVersion}'
}
}
apply plugin: 'groovy'
apply plugin: 'cobertura'
repositories {
mavenCentral()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:${groovyVersion}"
testCompile "junit:junit:${junitVersion}"
}
cobertura {
format = 'html'
includes = ['**/*.java', '**/*.groovy']
excludes = ['com/thirdparty/**/*.*']
}
Several output formats can be chosen for Cobertura coverage reports and test code coverage reports can be added to continuous integration build tasks.
3. Unit Tests with JUnit 3 and 4
Groovy simplifies JUnit testing, making it more Groovy. In the following sections we will have a closer look at JUnit 3/4 Groovy integration.
3.1. JUnit 3
Maybe one of the most prominent Groovy classes supporting JUnit 3 tests is the GroovyTestCase
class. Being
derived from junit.framework.TestCase
it offers a bunch of additional methods that make testing in Groovy a breeze.
Although GroovyTestCase inherits from TestCase doesn’t mean you can’t use JUnit 4 features in your project. In fact,
the most recent Groovy versions come with a bundled JUnit 4 and that comes with a backwards compatible TestCase
implementation. There have been some discussion on the Groovy mailing-list on whether to use GroovyTestCase or JUnit 4
with the result that it is mostly a matter of taste, but with GroovyTestCase you get a bunch of methods for free that
make certain types of tests easier to write.
|
In this section, we will have a look at some of the methods provided by GroovyTestCase
. A full list of these can be
found in the JavaDoc documentation for groovy.util.GroovyTestCase ,
don’t forget it is inherited from junit.framework.TestCase
which inherits all the assert*
methods.
3.1.1. Assertion Methods
GroovyTestCase
is inherited from junit.framework.TestCase
therefore it inherits a large number of assertion methods
being available to be called in every test method:
class MyTestCase extends GroovyTestCase {
void testAssertions() {
assertTrue(1 == 1)
assertEquals("test", "test")
def x = "42"
assertNotNull "x must not be null", x
assertNull null
assertSame x, x
}
}
As can be seen above, in contrast to Java it is possible to leave out the parenthesis in most situations which leads to even more readability of JUnit assertion method call expressions.
An interesting assertion method that is added by GroovyTestCase
is assertScript
. It ensures that the given Groovy
code string succeeds without any exception:
void testScriptAssertions() {
assertScript '''
def x = 1
def y = 2
assert x + y == 3
'''
}
3.1.2. shouldFail Methods
shouldFail
can be used to check whether the given code block fails or not. In case it fails, the assertion does hold,
otherwise the assertion fails:
void testInvalidIndexAccess1() {
def numbers = [1,2,3,4]
shouldFail {
numbers.get(4)
}
}
The example above uses the basic shouldFail
method interface that takes a groovy.lang.Closure
as a single argument.
The Closure
instance holds the code that is supposed to be breaking during run-time.
If we wanted to assert shouldFail
on a specific java.lang.Exception
type we could have done so by using the shouldFail
implementation that takes the Exception
class as first argument and the Closure
as second argument:
void testInvalidIndexAccess2() {
def numbers = [1,2,3,4]
shouldFail IndexOutOfBoundsException, {
numbers.get(4)
}
}
If anything other than IndexOutOfBoundsException
(or a descendant class of it) is thrown, the test case will fail.
A pretty nice feature of shouldFail
hasn’t been visible so far: it returns the exception message. This is really
useful if you want to assert on the exception error message:
void testInvalidIndexAccess3() {
def numbers = [1,2,3,4]
def msg = shouldFail IndexOutOfBoundsException, {
numbers.get(4)
}
assert msg.contains('Index: 4, Size: 4')
}
3.1.3. notYetImplemented Method
The notYetImplemented
method has been greatly influenced by HtmlUnit. It allows to write a test method but mark it
as not yet implemented. As long as the test method fails and is marked with notYetImplemented
the test goes green:
void testNotYetImplemented1() {
if (notYetImplemented()) return (1)
assert 1 == 2 (2)
}
| 1 | a call to notYetImplemented is necessary for GroovyTestCase to get the current method stack. |
| 2 | as long as the test evaluates to false the test execution will be successful. |
An alternative to the notYetImplemented
method is the @NotYetImplemented
annotation. It allows for annotating a
method as not yet implemented, with the exact same behavior as GroovyTestCase#notYetImplemented
but without the need
for the notYetImplemented
method call:
@NotYetImplemented
void testNotYetImplemented2() {
assert 1 == 2
}
3.2. JUnit 4
Groovy can be used to write JUnit 4 test cases without any restrictions. The groovy.test.GroovyAssert
holds
various static methods that can be used as replacement for the GroovyTestCase
methods in JUnit 4 tests:
import org.junit.Test
import static groovy.test.GroovyAssert.shouldFail
class JUnit4ExampleTests {
@Test
void indexOutOfBoundsAccess() {
def numbers = [1,2,3,4]
shouldFail {
numbers.get(4)
}
}
}
As can be seen in the example above, the static methods found in GroovyAssert
are imported at the beginning of the
class definition thus shouldFail
can be used the same way it can be used in a GroovyTestCase
.
groovy.test.GroovyAssert descends from org.junit.Assert that means it inherits all JUnit assertion methods. However,
with the introduction of the power assertion statement, it turned out to be good practice to rely on assertion statements
instead of using the JUnit assertion methods with the improved message being the main reason.
|
It is worth mentioning that GroovyAssert.shouldFail
is not absolutely identical to GroovyTestCase.shouldFail
. While
GroovyTestCase.shouldFail
returns the exception message, GroovyAssert.shouldFail
returns the exception itself. It
takes a few more keystrokes to get the message, but in return you can access other properties and methods of the
exception:
@Test
void shouldFailReturn() {
def e = shouldFail {
throw new RuntimeException('foo',
new RuntimeException('bar'))
}
assert e instanceof RuntimeException
assert e.message == 'foo'
assert e.cause.message == 'bar'
}
4. Testing with Spock
Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful and highly expressive specification DSL. In practice, Spock specifications are written as Groovy classes. Although written in Groovy they can be used to test Java classes. Spock can be used for unit, integration or BDD (behavior-driven-development) testing, it doesn’t put itself into a specific category of testing frameworks or libraries.
| Beside these awesome features Spock is a good example on how to leverage advanced Groovy programming language features in third party libraries, for example, by using Groovy AST transformations. |
| This section should not serve as detailed guide on how to use Spock, it should rather give an impression what Spock is about and how it can be leveraged for unit, integration, functional or any other type of testing. |
The next section we will have an first look at the anatomy of a Spock specification. It should give a pretty good feeling on what Spock is up to.
4.1. Specifications
Spock lets you write specifications that describe features (properties, aspects) exhibited by a system of interest. The "system" can be anything between a single class and an entire application, a more advanced term for it is system under specification. The feature description starts from a specific snapshot of the system and its collaborators, this snapshot is called the feature’s fixture.
Spock specification classes are derived from spock.lang.Specification
. A concrete specification class might consist
of fields, fixture methods, features methods and helper methods.
Let’s have a look at a simple specification with a single feature method for an imaginary Stack
class:
class StackSpec extends Specification {
def "adding an element leads to size increase"() { (1)
setup: "a new stack instance is created" (2)
def stack = new Stack()
when: (3)
stack.push 42
then: (4)
stack.size() == 1
}
}
| 1 | Feature method, is by convention named with a String literal. |
| 2 | Setup block, here is where any setup work for this feature needs to be done. |
| 3 | When block describes a stimulus, a certain action under target by this feature specification. |
| 4 | Then block any expressions that can be used to validate the result of the code that was triggered by the when block. |
Spock feature specifications are defined as methods inside a spock.lang.Specification
class. They describe the feature
by using a String literal instead of a method name.
A feature method holds multiple blocks, in our example we used setup
, when
and then
. The setup
block is special
in that it is optional and allows to configure local variables visible inside the feature method. The when
block
defines the stimulus and is a companion of the then
block which describes the response to the stimulus.
Note that the setup
method in the StackSpec
above additionally
has a description String. Description Strings are optional and can be added after block labels (like setup
, when
,
then
).
4.2. More Spock
Spock provides much more features like data tables or advanced mocking capabilities. Feel free to consult the Spock GitHub page for more documentation and download information.
5. Functional Tests with Geb
Geb is a functional web testing and scraper library that integrates with JUnit and Spock. It is based upon the Selenium web drivers and, like Spock, provides a Groovy DSL to write functional tests for web applications.
Geb has great features that make it a good fit for a functional testing library:
-
DOM access via a JQuery-like
$
function -
implements the page pattern
-
support for modularization of certain web components (e.g. menu-bars, etc.) with modules
-
integration with JavaScript via the JS variable
| This section should not serve as detailed guide on how to use Geb, it should rather give an impression what Geb is about and how it can be leveraged functional testing. |
The next section will give an example on how Geb can be used to write a functional test for a simple web page with a single search field.
5.1. A Geb Script
Although Geb can be used standalone in a Groovy script, in many scenarios it’s used in combination with other testing frameworks. Geb comes with various base classes that can be used in JUnit 3, 4, TestNG or Spock tests. The base classes are part of additional Geb modules that need to be added as a dependency.
For example, the following @Grab
dependencies have to be used to run Geb with the Selenium Firefox driver in
JUnit4 tests. The module that is needed for JUnit 3/4 support is geb-junit
:
@Grapes([
@Grab("org.gebish:geb-core:0.9.2"),
@Grab("org.gebish:geb-junit:0.9.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.26.0"),
@Grab("org.seleniumhq.selenium:selenium-support:2.26.0")
])
The central class in Geb is the geb.Browser
class. As its name implies it is used
to browse pages and access DOM elements:
def browser = new Browser(driver: new FirefoxDriver(), baseUrl: 'http://myhost:8080/myapp') (1)
browser.drive {
go "/login" (2)
$("#username").text = 'John' (3)
$("#password").text = 'Doe'
$("#loginButton").click()
assert title == "My Application - Dashboard"
}
| 1 | A new Browser instance is created. In this case it uses the Selenium FirefoxDriver and sets the baseUrl . |
| 2 | go is used to navigate to an URL or relative URI |
| 3 | $ together with CSS selectors is used to access the username and password DOM fields. |
The Browser
class comes with a drive
method that delegates all method/property calls to the current
browser
instance. The Browser
configuration must not be done inline, it can also be externalized in a
GebConfig.groovy
configuration file for example. In practice, the usage of the Browser
class is mostly hidden
by Geb test base classes. They delegate all missing properties and method calls to the current browser
instance
that exists in the background:
class SearchTests extends geb.junit4.GebTest {
@Test
void executeSeach() {
go 'http://somehost/mayapp/search' (1)
$('#searchField').text = 'John Doe' (2)
$('#searchButton').click() (3)
assert $('.searchResult a').first().text() == 'Mr. John Doe' (4)
}
}
| 1 | Browser#go takes a relative or absolute link and calls the page. |
| 2 | Browser#$ is used to access DOM content. Any CSS selectors supported by the underlying Selenium drivers are allowed |
| 3 | click is used to click a button. |
| 4 | $ is used to get the first link out of the searchResult block |
The example above shows a simple Geb web test with the JUnit 4 base class geb.junit4.GebTest
. Note that in this case
the Browser
configuration is externalized. GebTest
delegates methods like go
and $
to the underlying browser
instance.
5.2. More Geb
In the previous section we only scratched the surface of the available Geb features. More information on Geb can be found at the project homepage.


This page tracks the new paper links made to my list of SGP 2012 papers.
Page maintained by Ke-Sen Huang.
If you have additions or changes, send an e-mail.
February 27, 2013
- Radial Symmetry Detection and Shape Characterization with the Multiscale Area Projection Transform
October 17, 2012
- Example-Driven Deformations Based on Discrete Shells
- Flexible Developable Surfaces
- Soft Maps Between Surfaces
- Smooth Shape-Aware Functions with Controlled Extrema
- Finding Surface Correspondences Using Symmetry Axis Curves
- A Linear Variational System for Modeling from Curves
- Shape-Up: Shaping Discrete Geometry with Projections
- Radial Symmetry Detection and Shape Characterization with the Multiscale Area Projection Transform
- Computing Extremal Quasi-Conformal Maps
- Co-Segmentation of 3D Shapes via Subspace Clustering
- Stream Surface Parametrization by Flow-Orthogonal Front Lines
- Can Mean-Curvature Flow Be Made Non-Singular
- Time-discrete Geodesics in the Space of Shells
- Scale Space Meshing of Raw Data Point Sets
- Feature-Preserving Reconstruction of Singular Surfaces
July 29, 2012
- Fast Normal Estimation for Point Clouds with Sharp Features using a Robust Randomized Hough Transform
- Microtiles: Extracting Building Blocks from Correspondences
July 14, 2012
- Growing Least Squares for the Continuous Analysis of Manifolds in Scale-Space
July 11, 2012
June 28, 2012
- Smooth Shape-Aware Functions with Controlled Extrema
- Parallel Blue-noise Sampling by Constrained Farthest Point Optimization
- Page published
kesen.huang@gmail.com


Now that the Beta is out, we're focusing our time on bug fixes, performance and polish. This week we've released a number of patches to libraries that fix bugs and enhance performance in certain scenarios. To get the latest, simply run jspm update
. You can find the release notes below. Stay tuned for tomorrow's post on performance...
aurelia-history-browser 1.0.0-beta.1.0.1
Bug Fixes
- history-browser: open link in new tab when it clicked with middle button ( 8acf18fe )
aurelia-fetch-client 1.0.0-beta.1.0.1
Bug Fixes
aurelia-binding 1.0.0-beta.1.0.2
Bug Fixes
- AccessKeyed: evaluate null/undefined object should return undefined ( be97c8b6 , closes #241 )
- Parser: parse parent in LiteralObject ( c62280e4 )
- typings: add missing argument types ( 2662f7f6 , closes #232 )
Features
aurelia-templating 1.0.0-beta.1.0.1
Bug Fixes
aurelia-templating-binding 1.0.0-beta.1.0.1
Bug Fixes
- binding-language: apply default modes to options props ( d025af9b )
aurelia-templating-resources 1.0.0-beta.1.0.2
Bug Fixes
aurelia-templating-router 1.0.0-beta.1.0.2
Bug Fixes
aurelia-skeleton-navigation 1.0.0-beta.1.0.2
Bug Fixes
- build: do not reload after CSS injection ( 00bab07a )
Features
- build: add CSS injecting ( fb620e72 )
aurelia-dialog 0.5.1
Bug Fixes
- Destroy modal only when modalContainer ends its transition
- incorrect DialogFooter name


JaneRecipes
New
Popular
Blog
Instactivity
Request
Jane
Recipes
TM
New
Popular
Blog
Instactivity
Request
Jane
Recipes
TM
Find the best recipes by the best cook
Check Recipes
Newest Recipes
Meat Pasta
View the Recipe
Chicken Rice
View the Recipe
Egg-Meat Burger
View the Recipe
Advertisement:
The Best Recipes in one E-book
Download Now
Tequila Patron
View the Recipe
Cream Waffle
View the Recipe
Jane
Recipes
TM
Newsletter
Subscribe to the JaneRecipes Newsletter to get daily, weekly or biweekly newsletters for my latest recipes with cooking tips, deals, free perks, discounts and more...
Subscribe me now
Popular & Trending Recipes
Chicken Foot
View the Recipe
Chicken Veggies Sandwich
View the Recipe
Clubs Sandwich
View the Recipe
Crabs Dish
View the Recipe
Cupcakes
View the Recipe
Fried Potatoes
View the Recipe
Fruit Cocktail
View the Recipe
Ham Sandwich
View the Recipe
Hot Dish
View the Recipe
Latte Coffee
View the Recipe
Red Dark Wine
View the Recipe
Salmon Fish + special Sauce
View the Recipe
Salmon Fish
View the Recipe
Sausage Egg
View the Recipe
Strawberry Fresh
View the Recipe
Special Cheese Bread
View the Recipe
Sweet Crepe
Download Now
Tequila Agavero
View the Recipe
Veggie Cheese Bread
View the Recipe
Veggie Pasta
View the Recipe
Waffle Cake
View the Recipe
Load More
@JaneRecipes on Instagram
Check More on her


influenza epidemic epidemics cases ILI [.; incidence age ;():�?. value French Influenza surveillance {border-style population primary seasonal size A(HN) px;} #ffffff;} care data viruses dominated estimated A(HN)a Sentinelles circulating illness observed years reported France. dominant rate study using (Figure average elderly peak rates virus weekly time used vaccine Epidemic France: SGPs associated decrease detection health height higher impact influenza�?like px; season type week {font-family < .). France France, However, September SoutyC, collab: collected definition duration font-size general network, number period respiratory viruses. (�? ;():e. Health. Public Victoria children defined des distribution double; epidemics, epidemics. mean pandemic population, ratio regression subtype vaccination years) (since Table according accounted adults based border-color border-width burden case changes decreased factors group groups highlighted hygiene larger lower national network people related size, solid; time. trend trends virological weeks {font-style {font-weight (%) .), ;:. Control Council Epidemiol Epidemiol. Figure GPs Incidence Infect Methods Mortality ONE. Paris RIR TurbelinC, Université Yamagata activity allowed bold care. comparison control courier; co�?dominant co�?dominated cumulative em; estimates hospitalization including monitoring occurred older past periodic practitioners previous profiles pt;} public start total years; −).


StoredObject
yaacovCR.storedObject
The StoredObject service consists of a "class" object, (i.e. a constuctor function) which, when instantiated (i.e. when called via new), returns a new


PSALMS 105
1 Give thanks to Yahweh; worship him and pray to him.
Tell everyone in the world what he has done!
2 Sing to him; praise him as you sing to him;
tell others about his wonderful miracles.
3 Be proud of Yahweh, who alone is God.
You people who worship Yahweh, rejoice!
4 Ask Yahweh to help you and give you his strength,
and always seek to be with him!
5-6 You people who are descendants of God's servant Abraham,
you descendants of Jacob, the people whom God has chosen,
think about all the wonderful things that he has done;
he performed miracles, and he punished all our enemies.
7 He is Yahweh, our God.
He rules and judges people throughout the earth.
8 He never forgets the covenant that he made;
he made a promise that will last for a thousand generations.
9 That is the covenant that he made with Abraham,
and he repeated that covenant with Isaac.
10 Later he confirmed it again to Jacob
as a covenant for the Israelite people that would last forever.
11 What he said was, "I will give you the region of Canaan;
it will belong to you and your descendants forever."
12 He said that to them when there were only a few of them,
a tiny group of people who were living in that land like strangers.
13 They continued to wander from one place to another,
from one kingdom to another.
14 But he did not allow others to oppress them.
He warned those kings by saying to them,
15 "Do not do harm to the people whom I have chosen!
Do not harm my prophets!"
16 He sent a famine to Canaan, and as a result all the people had no food to eat.
17 So his people went to Egypt, but first he sent someone there.
He sent Joseph, who had been sold to be a slave.
18 Later, while Joseph was in prison in Egypt,
they put his legs in shackles that bruised his feet,
and they put an iron collar around his neck.
19 Joseph was in prison
until what he predicted would happen came true and showed him to be right.
20 The king of Egypt sent servants, who set him free;
this ruler released Joseph from prison.
21 Then he appointed him to take care of everything in the king's household,
to take care of everything that the king possessed.
22 Joseph was permitted to command the king's important servants
to do anything that Joseph wanted them to do,
and even to tell the king's advisors the things that they should do for the people of Egypt.
23 Later, Joseph's father Jacob arrived in Egypt.
He lived like a foreigner in the land that belonged to the descendants of Ham.
24 Years later Yahweh caused the descendants of Jacob to become very numerous.
As a result, their enemies, the Egyptians, considered that the Israelites were too strong.
25 So Yahweh caused the rulers of Egypt to turn against the Israelite people,
and they began to oppress his people.
26 But then Yahweh sent his servant Moses
along with Moses' older brother Aaron, whom Yahweh had also chosen to be his servant.
27 Those two performed amazing miracles among the people of Egypt
in that land where the descendants of Ham lived.
28 Yahweh sent darkness so that the people of Egypt could not see anything,
but the rulers of Egypt refused to obey when Moses and Aaron commanded them to let the Israelite people leave Egypt.
29 Yahweh caused all the water in Egypt to become blood,
and his doing that caused all the fish to die.
30 Then he caused the land to become full of frogs;
the king and his officials even had frogs in their bedrooms.
31 Then Yahweh commanded that flies come, and swarms of them descended on the people of Egypt,
and gnats also swarmed across the whole country.
32 Instead of sending rain, Yahweh sent terrible hail,
and lightning flashed throughout the land.
33 The hail ruined their grapevines and fig trees
and shattered all the other trees.
34 He commanded locusts to come, and hordes of them came;
so many came that they could not be counted.
35 The locusts ate every green plant in the land,
ruining all the crops.
36 Then Yahweh killed the oldest son in every house of the people of Egypt.
37 Then he brought the Israelite people out from Egypt;
they were carrying heavy loads of jewelry made of silver and gold that the people of Egypt had given to them.
No one was left behind because of being sick.
38 The people of Egypt were glad when the Israelite people left
because they had become very afraid of the Israelites.
39 Then Yahweh spread a cloud to cover the Israelites;
and at night it became a big fire in the sky to give them light.
40 Later the Israelites asked for meat to eat,
and Yahweh sent flocks of quail to them,
and he gave them plenty of manna, food from the sky, each morning.
41 One day he caused a rock to open up, and water poured out for them to drink;
it was like a river flowing in that desert.
42 He did that because he kept thinking about the sacred promise that he had given to his servant, Abraham.
43 So his people were joyful as he brought them out from Egypt;
these people whom he had chosen were shouting joyfully as they went.
44 He gave to them the land that belonged to the people groups that lived there in Canaan,
and the Israelites took all their wealth.
45 Yahweh did all these things
so that his people would do all the things that he had commanded them to do.
Praise Yahweh!


back to list
<%- include partials/services-sidebar.html %>
{{serviceDetails.service.name}}
edit
Site is down!. Error:
{{serviceDetails.status.currentOutage.error}}
Outage started
{{serviceDetails.status.currentOutage.timestamp | amDateFormat:'MMMM Do, HH:mm:ss'}}
-
Last hour
{{serviceDetails.status.lastHour.uptime}}% uptime
{{serviceDetails.status.lastHour.latency.mean}} ms. avg latency
downtime:
Last 24 hours
{{serviceDetails.status.last24Hours.uptime}}% uptime
{{serviceDetails.status.last24Hours.latency.mean}} ms. avg latency
downtime:
Last week
{{serviceDetails.status.lastWeek.uptime}}% uptime
{{serviceDetails.status.lastWeek.latency.mean}} ms. avg latency
downtime:
<%- include partials/outages.html %>


public class IOUtils
extends java.lang.Object
This class provides static utility methods for input/output operations.
The byte-to-char methods and char-to-byte methods involve a conversion step. Two methods are provided in each case, one that uses the platform default encoding and the other which allows you to specify an encoding. You are encouraged to always specify an encoding because relying on the platform default can lead to unexpected results, for example when moving from development to production.
All the methods in this class that read a stream are buffered internally.
This means that there is no cause to use a BufferedInputStream
or BufferedReader
. The default buffer size of 4K has been shown
to be efficient in tests.
Wherever possible, the methods in this class do not flush or close the stream. This is to avoid making non-portable assumptions about the streams' origin and further use. Thus the caller is still responsible for closing streams after use.
Origin of code: Excalibur.
| 限定符和类型 | 字段和说明 |
|---|---|
static char |
DIR_SEPARATOR
The system directory separator character.
|
static char |
DIR_SEPARATOR_UNIX
The Unix directory separator character.
|
static char |
DIR_SEPARATOR_WINDOWS
The Windows directory separator character.
|
static java.lang.String |
LINE_SEPARATOR
The system line separator string.
|
static java.lang.String |
LINE_SEPARATOR_UNIX
The Unix line separator string.
|
static java.lang.String |
LINE_SEPARATOR_WINDOWS
The Windows line separator string.
|
| 构造器和说明 |
|---|
IOUtils()
Instances should NOT be constructed in standard programming.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closeQuietly(java.io.InputStream input)
Unconditionally close an
InputStream . |
static void |
closeQuietly(java.io.OutputStream output)
Unconditionally close an
OutputStream . |
static void |
closeQuietly(java.io.Reader input)
Unconditionally close an
Reader . |
static void |
closeQuietly(java.io.Writer output)
Unconditionally close a
Writer . |
static boolean |
contentEquals(java.io.InputStream input1,
java.io.InputStream input2)
Compare the contents of two Streams to determine if they are equal or
not.
|
static boolean |
contentEquals(java.io.Reader input1,
java.io.Reader input2)
Compare the contents of two Readers to determine if they are equal or
not.
|
static int |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from an
InputStream to an
OutputStream . |
static void |
copy(java.io.InputStream input,
java.io.Writer output)
Copy bytes from an
InputStream to chars on a
Writer using the default character encoding of the platform. |
static void |
copy(java.io.InputStream input,
java.io.Writer output,
java.lang.String encoding)
Copy bytes from an
InputStream to chars on a
Writer using the specified character encoding. |
static void |
copy(java.io.Reader input,
java.io.OutputStream output)
Copy chars from a
Reader to bytes on an
OutputStream using the default character encoding of the
platform, and calling flush. |
static void |
copy(java.io.Reader input,
java.io.OutputStream output,
java.lang.String encoding)
Copy chars from a
Reader to bytes on an
OutputStream using the specified character encoding, and
calling flush. |
static int |
copy(java.io.Reader input,
java.io.Writer output)
Copy chars from a
Reader to a Writer . |
static long |
copyLarge(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from a large (over 2GB)
InputStream to an
OutputStream . |
static long |
copyLarge(java.io.Reader input,
java.io.Writer output)
Copy chars from a large (over 2GB)
Reader to a Writer . |
static java.util.List |
readLines(java.io.InputStream input)
Get the contents of an
InputStream as a list of Strings,
one entry per line, using the default character encoding of the platform. |
static java.util.List |
readLines(java.io.InputStream input,
java.lang.String encoding)
Get the contents of an
InputStream as a list of Strings,
one entry per line, using the specified character encoding. |
static java.util.List |
readLines(java.io.Reader input)
Get the contents of a
Reader as a list of Strings,
one entry per line. |
static byte[] |
toByteArray(java.lang.String input)
已过时。
Use
String.getBytes() |
static char[] |
toCharArray(java.io.InputStream is)
Get the contents of an
InputStream as a character array
using the default character encoding of the platform. |
static char[] |
toCharArray(java.io.InputStream is,
java.lang.String encoding)
Get the contents of an
InputStream as a character array
using the specified character encoding. |
static char[] |
toCharArray(java.io.Reader input)
Get the contents of a
Reader as a character array. |
static java.io.InputStream |
toInputStream(java.lang.String input)
Convert the specified string to an input stream, encoded as bytes
using the default character encoding of the platform.
|
static java.io.InputStream |
toInputStream(java.lang.String input,
java.lang.String encoding)
Convert the specified string to an input stream, encoded as bytes
using the specified character encoding.
|
static java.lang.String |
toString(byte[] input)
已过时。
Use
String.String(byte[]) |
static java.lang.String |
toString(byte[] input,
java.lang.String encoding)
已过时。
Use
String.String(byte[],String) |
static java.lang.String |
toString(java.io.InputStream input)
Get the contents of an
InputStream as a String
using the default character encoding of the platform. |
static java.lang.String |
toString(java.io.InputStream input,
java.lang.String encoding)
Get the contents of an
InputStream as a String
using the specified character encoding. |
static java.lang.String |
toString(java.io.Reader input)
Get the contents of a
Reader as a String. |
static void |
write(byte[] data,
java.io.OutputStream output)
Writes bytes from a
byte[] to an OutputStream . |
static void |
write(byte[] data,
java.io.Writer output)
Writes bytes from a
byte[] to chars on a Writer
using the default character encoding of the platform. |
static void |
write(byte[] data,
java.io.Writer output,
java.lang.String encoding)
Writes bytes from a
byte[] to chars on a Writer
using the specified character encoding. |
static void |
write(char[] data,
java.io.OutputStream output)
Writes chars from a
char[] to bytes on an
OutputStream . |
static void |
write(char[] data,
java.io.OutputStream output,
java.lang.String encoding)
Writes chars from a
char[] to bytes on an
OutputStream using the specified character encoding. |
static void |
write(char[] data,
java.io.Writer output)
Writes chars from a
char[] to a Writer
using the default character encoding of the platform. |
static void |
write(java.lang.StringBuffer data,
java.io.OutputStream output)
Writes chars from a
StringBuffer to bytes on an
OutputStream using the default character encoding of the
platform. |
static void |
write(java.lang.StringBuffer data,
java.io.OutputStream output,
java.lang.String encoding)
Writes chars from a
StringBuffer to bytes on an
OutputStream using the specified character encoding. |
static void |
write(java.lang.StringBuffer data,
java.io.Writer output)
Writes chars from a
StringBuffer to a Writer . |
static void |
write(java.lang.String data,
java.io.OutputStream output)
Writes chars from a
String to bytes on an
OutputStream using the default character encoding of the
platform. |
static void |
write(java.lang.String data,
java.io.OutputStream output,
java.lang.String encoding)
Writes chars from a
String to bytes on an
OutputStream using the specified character encoding. |
static void |
write(java.lang.String data,
java.io.Writer output)
Writes chars from a
String to a Writer . |
static void |
writeLines(java.util.Collection lines,
java.lang.String lineEnding,
java.io.OutputStream output)
Writes the
toString() value of each item in a collection to
an OutputStream line by line, using the default character
encoding of the platform and the specified line ending. |
static void |
writeLines(java.util.Collection lines,
java.lang.String lineEnding,
java.io.OutputStream output,
java.lang.String encoding)
Writes the
toString() value of each item in a collection to
an OutputStream line by line, using the specified character
encoding and the specified line ending. |
static void |
writeLines(java.util.Collection lines,
java.lang.String lineEnding,
java.io.Writer writer)
Writes the
toString() value of each item in a collection to
a Writer line by line, using the specified line ending. |
public static final char DIR_SEPARATOR_UNIX
public static final char DIR_SEPARATOR_WINDOWS
public static final char DIR_SEPARATOR
public static final java.lang.String LINE_SEPARATOR_UNIX
public static final java.lang.String LINE_SEPARATOR_WINDOWS
public static final java.lang.String LINE_SEPARATOR
public static void closeQuietly(java.io.Reader input)
Reader
.
Equivalent to Reader.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
input
- the Reader to close, may be null or already closedpublic static void closeQuietly(java.io.Writer output)
Writer
.
Equivalent to Writer.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
output
- the Writer to close, may be null or already closedpublic static void closeQuietly(java.io.InputStream input)
InputStream
.
Equivalent to InputStream.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
input
- the InputStream to close, may be null or already closedpublic static void closeQuietly(java.io.OutputStream output)
OutputStream
.
Equivalent to OutputStream.close()
, except any exceptions will be ignored.
This is typically used in finally blocks.
output
- the OutputStream to close, may be null or already closedpublic static byte[] toByteArray(java.lang.String input) throws java.io.IOException
String.getBytes()
String
as a byte[]
using the default character encoding of the platform.
This is the same as String.getBytes()
.
input
- the String
to convertjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurs (never occurs)public static char[] toCharArray(java.io.InputStream is) throws java.io.IOException
InputStream
as a character array
using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
is
- the InputStream
to read fromjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static char[] toCharArray(java.io.InputStream is, java.lang.String encoding) throws java.io.IOException
InputStream
as a character array
using the specified character encoding.
Character encoding names can be found at IANA.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
is
- the InputStream
to read fromencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static char[] toCharArray(java.io.Reader input) throws java.io.IOException
Reader
as a character array.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
input
- the Reader
to read fromjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.lang.String toString(java.io.InputStream input) throws java.io.IOException
InputStream
as a String
using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read fromjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.lang.String toString(java.io.InputStream input, java.lang.String encoding) throws java.io.IOException
InputStream
as a String
using the specified character encoding.
Character encoding names can be found at IANA.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read fromencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.lang.String toString(java.io.Reader input) throws java.io.IOException
Reader
as a String.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
input
- the Reader
to read fromjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.lang.String toString(byte[] input) throws java.io.IOException
String.String(byte[])
byte[]
as a String
using the default character encoding of the platform.input
- the byte array to read fromjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurs (never occurs)public static java.lang.String toString(byte[] input, java.lang.String encoding) throws java.io.IOException
String.String(byte[],String)
byte[]
as a String
using the specified character encoding.
Character encoding names can be found at IANA.
input
- the byte array to read fromencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurs (never occurs)public static java.util.List readLines(java.io.InputStream input) throws java.io.IOException
InputStream
as a list of Strings,
one entry per line, using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read from, not nulljava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.util.List readLines(java.io.InputStream input, java.lang.String encoding) throws java.io.IOException
InputStream
as a list of Strings,
one entry per line, using the specified character encoding.
Character encoding names can be found at IANA.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read from, not nullencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.util.List readLines(java.io.Reader input) throws java.io.IOException
Reader
as a list of Strings,
one entry per line.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
input
- the Reader
to read from, not nulljava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static java.io.InputStream toInputStream(java.lang.String input)
input
- the string to convertpublic static java.io.InputStream toInputStream(java.lang.String input, java.lang.String encoding) throws java.io.IOException
Character encoding names can be found at IANA.
input
- the string to convertencoding
- the encoding to use, null means platform defaultjava.io.IOException
- if the encoding is invalidpublic static void write(byte[] data, java.io.OutputStream output) throws java.io.IOException
byte[]
to an OutputStream
.data
- the byte array to write, do not modify during output,
null ignoredoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(byte[] data, java.io.Writer output) throws java.io.IOException
byte[]
to chars on a Writer
using the default character encoding of the platform.
This method uses String.String(byte[])
.
data
- the byte array to write, do not modify during output,
null ignoredoutput
- the Writer
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(byte[] data, java.io.Writer output, java.lang.String encoding) throws java.io.IOException
byte[]
to chars on a Writer
using the specified character encoding.
Character encoding names can be found at IANA.
This method uses String.String(byte[], String)
.
data
- the byte array to write, do not modify during output,
null ignoredoutput
- the Writer
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(char[] data, java.io.Writer output) throws java.io.IOException
char[]
to a Writer
using the default character encoding of the platform.data
- the char array to write, do not modify during output,
null ignoredoutput
- the Writer
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(char[] data, java.io.OutputStream output) throws java.io.IOException
char[]
to bytes on an
OutputStream
.
This method uses String.String(char[])
and
String.getBytes()
.
data
- the char array to write, do not modify during output,
null ignoredoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(char[] data, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
char[]
to bytes on an
OutputStream
using the specified character encoding.
Character encoding names can be found at IANA.
This method uses String.String(char[])
and
String.getBytes(String)
.
data
- the char array to write, do not modify during output,
null ignoredoutput
- the OutputStream
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.String data, java.io.Writer output) throws java.io.IOException
String
to a Writer
.data
- the String
to write, null ignoredoutput
- the Writer
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.String data, java.io.OutputStream output) throws java.io.IOException
String
to bytes on an
OutputStream
using the default character encoding of the
platform.
This method uses String.getBytes()
.
data
- the String
to write, null ignoredoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.String data, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
String
to bytes on an
OutputStream
using the specified character encoding.
Character encoding names can be found at IANA.
This method uses String.getBytes(String)
.
data
- the String
to write, null ignoredoutput
- the OutputStream
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.StringBuffer data, java.io.Writer output) throws java.io.IOException
StringBuffer
to a Writer
.data
- the StringBuffer
to write, null ignoredoutput
- the Writer
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.StringBuffer data, java.io.OutputStream output) throws java.io.IOException
StringBuffer
to bytes on an
OutputStream
using the default character encoding of the
platform.
This method uses String.getBytes()
.
data
- the StringBuffer
to write, null ignoredoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void write(java.lang.StringBuffer data, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
StringBuffer
to bytes on an
OutputStream
using the specified character encoding.
Character encoding names can be found at IANA.
This method uses String.getBytes(String)
.
data
- the StringBuffer
to write, null ignoredoutput
- the OutputStream
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if output is nulljava.io.IOException
- if an I/O error occurspublic static void writeLines(java.util.Collection lines, java.lang.String lineEnding, java.io.OutputStream output) throws java.io.IOException
toString()
value of each item in a collection to
an OutputStream
line by line, using the default character
encoding of the platform and the specified line ending.lines
- the lines to write, null entries produce blank lineslineEnding
- the line separator to use, null is system defaultoutput
- the OutputStream
to write to, not null, not closedjava.lang.NullPointerException
- if the output is nulljava.io.IOException
- if an I/O error occurspublic static void writeLines(java.util.Collection lines, java.lang.String lineEnding, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
toString()
value of each item in a collection to
an OutputStream
line by line, using the specified character
encoding and the specified line ending.
Character encoding names can be found at IANA.
lines
- the lines to write, null entries produce blank lineslineEnding
- the line separator to use, null is system defaultoutput
- the OutputStream
to write to, not null, not closedencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the output is nulljava.io.IOException
- if an I/O error occurspublic static void writeLines(java.util.Collection lines, java.lang.String lineEnding, java.io.Writer writer) throws java.io.IOException
toString()
value of each item in a collection to
a Writer
line by line, using the specified line ending.lines
- the lines to write, null entries produce blank lineslineEnding
- the line separator to use, null is system defaultwriter
- the Writer
to write to, not null, not closedjava.lang.NullPointerException
- if the input is nulljava.io.IOException
- if an I/O error occurspublic static int copy(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
InputStream
to an
OutputStream
.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
Large streams (over 2GB) will return a bytes copied value of
-1
after the copy has completed since the correct
number of bytes cannot be returned as an int. For large streams
use the copyLarge(InputStream, OutputStream)
method.
input
- the InputStream
to read fromoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occursjava.lang.ArithmeticException
- if the byte count is too largepublic static long copyLarge(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
InputStream
to an
OutputStream
.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
input
- the InputStream
to read fromoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static void copy(java.io.InputStream input, java.io.Writer output) throws java.io.IOException
InputStream
to chars on a
Writer
using the default character encoding of the platform.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
This method uses InputStreamReader
.
input
- the InputStream
to read fromoutput
- the Writer
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static void copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding) throws java.io.IOException
InputStream
to chars on a
Writer
using the specified character encoding.
This method buffers the input internally, so there is no need to use a
BufferedInputStream
.
Character encoding names can be found at IANA.
This method uses InputStreamReader
.
input
- the InputStream
to read fromoutput
- the Writer
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static int copy(java.io.Reader input, java.io.Writer output) throws java.io.IOException
Reader
to a Writer
.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
Large streams (over 2GB) will return a chars copied value of
-1
after the copy has completed since the correct
number of chars cannot be returned as an int. For large streams
use the copyLarge(Reader, Writer)
method.
input
- the Reader
to read fromoutput
- the Writer
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occursjava.lang.ArithmeticException
- if the character count is too largepublic static long copyLarge(java.io.Reader input, java.io.Writer output) throws java.io.IOException
Reader
to a Writer
.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
input
- the Reader
to read fromoutput
- the Writer
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static void copy(java.io.Reader input, java.io.OutputStream output) throws java.io.IOException
Reader
to bytes on an
OutputStream
using the default character encoding of the
platform, and calling flush.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
Due to the implementation of OutputStreamWriter, this method performs a flush.
This method uses OutputStreamWriter
.
input
- the Reader
to read fromoutput
- the OutputStream
to write tojava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static void copy(java.io.Reader input, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
Reader
to bytes on an
OutputStream
using the specified character encoding, and
calling flush.
This method buffers the input internally, so there is no need to use a
BufferedReader
.
Character encoding names can be found at IANA.
Due to the implementation of OutputStreamWriter, this method performs a flush.
This method uses OutputStreamWriter
.
input
- the Reader
to read fromoutput
- the OutputStream
to write toencoding
- the encoding to use, null means platform defaultjava.lang.NullPointerException
- if the input or output is nulljava.io.IOException
- if an I/O error occurspublic static boolean contentEquals(java.io.InputStream input1, java.io.InputStream input2) throws java.io.IOException
This method buffers the input internally using
BufferedInputStream
if they are not already buffered.
input1
- the first streaminput2
- the second streamjava.lang.NullPointerException
- if either input is nulljava.io.IOException
- if an I/O error occurspublic static boolean contentEquals(java.io.Reader input1, java.io.Reader input2) throws java.io.IOException
This method buffers the input internally using
BufferedReader
if they are not already buffered.
input1
- the first readerinput2
- the second readerjava.lang.NullPointerException
- if either input is nulljava.io.IOException
- if an I/O error occurs


Manuel Neuer
"Before I started using Optimalbnb I would really struggle to choose the right price for my listings. I would do research for hours to come up with a number, but never felt confident in the answer that I would settle on.Now, I don't have to go through this hassle and can focus on being a great host to my visitors!"


When you register for Cityfos, we ask you for your name, contact information, and basic company information. These information lets us provide you personalized services and communicate separately with you. We also use aggregated information about the use of our services to evaluate our users' preferences and improve our programming. Like most websites, we use small bits of data called cookies stored on users' computers to simulate a continuous connection. Cookies let us "remember" information about your preferences and allow you to move within our Service without reintroducing yourself. Recent versions of Cityfos browsers let you easily see and control cookies.
There is certain information we need to register you as a unique user and let you access personalized services such as the Cityfos Marketing Center. Other requested information is optional and may be given at your discretion.
We encourage Cityfos members to update and edit their personal information and keep it current. You can easily correct or update your personal information at any time by visiting your account management section and make necessary changes.
We store all user information in secure databases protected by a variety of access controls. Access to this data is limited to a minimum number of employees and this data is accessed only for the purposes specified in this privacy statement.
We do not share personally identifiable data with other companies (apart from those acting as our agents in providing our Service to you, who agree to use it only for that purpose), except when it is necessary to fulfill a transaction you have requested or you otherwise give us permission to do so. Cityfos may also share such information in response to the legal process, such as a court order or subpoena.
You may separately agree to provide your information to other companies who provide content for various parts of our Service, in order to use their services or receive offers from them. If you agree to provide information to these companies, that information will be subject to their privacy policies.
Please contact us directly with any questions or comments.
This site uses third-party advertising companies to serve ads when the site is visited. Google, as a third party vendor, uses the DoubleClick cookie to serve ads to users based on their visit to this site and to other sites on the Internet. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites to advertise goods and services. For more information about this practice and your choices about not having this information used by these companies, go to http://www.google.com/privacy_ads.html.


|
| static void | enableTestAds (boolean test) |
| |
|
| static boolean | getAd (Context context, String adSpace, ViewGroup viewGroup, FlurryAdSize size, long timeout) |
| | Request an ad from the Flurry ad server then render it. MUST be called from the main thread. More...
|
| |
| static void | initializeAds (Context context) |
| | Request ads from the Flurry ad server for ad spaces with pre-caching enabled. More...
|
| |
| static boolean | isAdAvailable (Context context, String adSpace, FlurryAdSize size, long timeout) |
| | Returns true if an ad is available from the Flurry ad server for the specified ad space. More...
|
| |
| static boolean | isAdReady (String adSpace) |
| | Returns true if an ad has been fetched and prepared by a previous call to fetchAd. More...
|
| |
| static void | fetchAd (Context context, String adSpace, ViewGroup viewGroup, FlurryAdSize size) |
| | Makes zero or one asynchronous ad requests and prepares an ad for display. More...
|
| |
| static void | displayAd (Context context, String adSpace, ViewGroup viewGroup) |
| | Displays an ad that was previously fetched and prepared This method should be used in conjunction with fetchAd. More...
|
| |
| static void | removeAd (Context context, String adSpace, ViewGroup viewGroup) |
| | Remove the adSpace ad from the specified viewGroup If it is necessary to remove an ad from the view of the user, calling removeAd(context, adSpace, viewGroup) will remove the ad for the specified adSpace. More...
|
| |
| static void | setAdListener (FlurryAdListener listener) |
| | Set the FlurryAdListener for asynchronous ad serving. The FlurryAdListener is an interface which can be implemented to receive notification of various events associated with ads. If this method is called more than once, the previously set listener will be overridden, i.e. there can only be one listener. More...
|
| |
| static void | setLocation (float lat, float lon) |
| | Set the default location. Useful when it is necessary to test ads from other countries or places, or if your app is location-aware and you do not wish the Flurry SDK to determine the user location via GPS. More...
|
| |
|
static void | clearLocation () |
| | Clear the default location.
|
| |
|
static void | setCustomAdNetworkHandler (ICustomAdNetworkHandler handler) |
| | Sets the class which handles custom ad networking. Useful when creating an interface to third party network mediation.
|
| |
| static void | setUserCookies (Map< String, String > userCookies) |
| | Set a Map<String,String> of key/value pairs that will be transmitted to the Flurry servers when an ad is clicked. More...
|
| |
| static void | clearUserCookies () |
| | Clear the UserCookies object. More...
|
| |
| static void | setTargetingKeywords (Map< String, String > targetingKeywords) |
| | Set a Map<String,String> of key/value pairs to send to the Flurry servers when an ad is requested. More...
|
| |
| static void | clearTargetingKeywords () |
| | Clear the targeting keywords of the app. More...
|
| |
The Flurry Android Advertising SDK.
- Author
- 2009-2014 Flurry, Inc. All Rights Reserved
AppSpot is the data-powered monetization platform that delivers targeted audience segments to your advertisers and networks. Powered by Flurry's enormous dataset with audience insights gathered from 700M devices, AppSpot enables you to maximize CPMs and fill rates across your iOS and Android applications.
- See Also
- AppSpot support site for more information
| static void fetchAd |
( |
Context |
context, |
|
|
String |
adSpace, |
|
|
ViewGroup |
viewGroup, |
|
|
FlurryAdSize |
size |
|
) |
| |
|
static |
Makes zero or one asynchronous ad requests and prepares an ad for display.
In order to use this method correctly, you should implement @c FlurryAdListener.
After an ad is successfully fetched and prepared, the SDK will call @c
FlurryAdListener.spaceDidReceiveAd. Your implementation of this method should call @c
FlurryAds.displayAd. public class Example extends Activity implements FlurryAdListener
{ FrameLayout mBanner; public void onCreate(Bundle bundle) { super.onCreate(bundle);
setContentView(R.layout.example); mBanner = (FrameLayout)findViewById(R.id.banner);
FlurryAds.setAdListener(this); } public void onStart() { super.onStart();
FlurryAgent.onStartSession(this, mApiKey); FlurryAds.fetchAd(this, mAdSpaceName,
mBanner, FlurryAdSize.BANNER_BOTTOM); } public void spaceDidReceiveAd(String adSpace)
{ FlurryAds.displayAd(this, mAdSpaceName, mBanner); } }
- Since
- 3.0.9
- Parameters
-
| context | A reference to a Context object such as an Activity or an Service. |
| adSpace | The placement of the ad within your app. For example, for a splash screen ad, it might be named "SPLASH_SCREEN" |
| size | The default size of the adSpace. This can be overridden on the server. See FlurryAdSize for more details. |
- Returns
- void