Code coverage consists of a set of software metrics that can tell you how much of the production code is covered by a given test suite. It's purely quantitative, and does not say anything about the quality of either the production code or the test code. That said, the examination of code coverage reports will sometimes lead to the discovery of unreachable code which can be eliminated. But more importantly, such reports can be used as a guide for the discovery of missing tests. This is not only useful when creating tests for existing production code, but also when writing tests first, such as in the practice of TDD (Test Driven Development).
The coverage metric produced by the tool tells us how much of the executable code in a source file has been exercised by tests, and also how many of the instance and static non-final fields were fully exercised by the test run.
Each executable line of code can be uncovered, covered, or partially covered. The third case can happen, for example, with lines of code containing multiple logical conditions in a complex boolean expression. The tool identifies all three cases, computing the coverage percentage for each executable line of code accordingly: 0% for an uncovered line, 100% for a covered line, or some value in between for a partially covered line.
Regarding fields, to be fully exercised, each must have the last value assigned to it read by at least one test.
The coverage percentage for a source file is calculated as 100 * (NE + NFE) / (NS + NF)
, where NS
is the total
number of line segments, NF
the number of non-final fields, NE
the number of executed segments, and
NFE
the number of fully exercised fields.
The percentage for a package, in turn, is calculated from the total and covered numbers of segments and fields in the whole set of source files belonging to the package. Finally, the total code coverage percentage is computed by the same formula on the totals for all packages.
The JMockit Coverage tool can generate the following types of output:
.java
" source files inside all directories of name "src
" found directly or
indirectly under the current working directory; any intermediate sub-directories between "src
" and the top-level package
directory, such as "src/java
" for example, are also searched.
coverage.ser
" is written under the current
working directory or a specified output directory.
If the file already exists, its contents are either overwritten or appended with the in-memory results of the current test run, as
specified.
mockit.coverage.data.CoverageData.readDataFromFile(File)
method will create a new
CoverageData
instance with all the coverage data available in a given serialized file.
When running a test suite with the coverage tool, there is optional "call point" information which can be gathered, as selected by the user. A call point is the point in the source test code from which a specific line of production code was exercised.
Generating coverage with this extra information takes more time and produces significantly larger output; on the other hand, it can be useful to know which lines of test code caused a given line of production code to be executed during the test run. When included in the HTML report, the list of call points appears hidden at first but can be easily viewed by clicking on each executable line of code.
To activate the Coverage tool in a JUnit/TestNG test run, use the -javaagent
JVM initialization parameter, and specify at
least one of the "coverage-output
" and "coverage-classes
" system properties.
(See Running tests with JMockit for more details.)
All aspects of the tool's behavior can be configured by setting one or more of the following properties.
coverage-output
: one or more comma-separated values between html
,
html-cp
("cp" = "call points"), html-nocp
,
serial
, and serial-append
, which select the kind of output to be generated
at the end of the test run.
The default is to generate the HTML report with no call points (html
= html-nocp
).
serial
" or "serial-append
" causes a serialized data file of name
"coverage.ser
" to be generated; with "serial-append
", coverage data gathered by the current test run will be
appended to the contents of a previously existing data file (if said file doesn't exist, it has the same effect as
"serial
").
coverage-outputDir
: absolute or relative path to the output directory, to be used for writing any
"coverage.ser
" or "index.html
" files (plus the remaining ".html
" files of the HTML report, in
automatically created sub-directories).
By default, the current working directory of the running JVM is used, with all HTML pages written into a
"coverage-report
" sub-directory.
coverage-srcDirs
: comma-separated list of Java source directories to be searched when generating an HTML
report.
(This is not relevant for the serialized data file.)
Each directory is specified by an absolute or relative path.
If no such directory is specified, all "src
" directories under the current working directory are searched.
If, however, the property is set to the empty string, then no source files are searched, and only the index.html
file is
generated.
coverage-classes
:
Either an OS-like regular expression (with the typical "*
" and "?
" wildcards), or a
java.util.regex-conformable
regular expression.
The given expression will be used to select the classes (by fully qualified name) from production code which should be considered for
coverage.
By default, all classes in production code loaded during the test run and which are not inside jar files are considered.
some.package.*
" selects all classes under some.package
or any sub-package.
loaded
", then all classes will be considered, but only those which
get loaded by the JVM during the test run; classes that are part of the codebase but never get loaded are left out.
This is very useful when the test run includes only a few tests, targeting only a subset of the codebase.
coverage-excludes
:
The same as the previous property, but for class names which should be excluded from consideration when instrumenting classes for
coverage.
This property can be used together with coverage-classes
or on its own.
By default, no classes between those selected for coverage are excluded from consideration.
coverage-check
:
one or more semicolon-separated rules specifying minimum coverage checks to be performed at the end of a test run.
By default, no such checks are performed.
For details, see the Checking minimum coverage section.
Note that you should be able to easily specify these properties inside a Maven surefire
plugin configuration, or a test run
configuration for your Java IDE of choice, using either JUnit or TestNG; no JMockit-specific plugin is needed.
When the coverage tool generates a report at the end of a test run, it always overwrites any previous report. Normally, the coverage data from which the report is generated reflects only what was gathered during the current test run. Now suppose you have multiple test suites or test run configurations, and you want to generate a single aggregated HTML report for the code covered by the full set of tests. Here is where the "coverage.ser" serialized data files come in.
To activate the generation of these files, we simply set the coverage-output
system property to a value containing
"serial
" or "serial-append
".
As these two values suggest, there are different ways to combine multiple coverage data files.
The following sub-sections provide the details for each case.
Suppose we want to gather coverage data from multiple test runs and later generate an aggregate HTML report merging together the results
from all test runs.
Each test run needs to generate its own coverage.ser
file, so that later they can be merged together in a final step which
produces the report; therefore, each test run should be configured with "coverage-output=serial
".
Note that, in order to preserve the original coverage.ser
output files generated by each test run, they will need to be
written or copied into different output directories.
Assuming that two or more coverage.ser
files are available in separate directories, an aggregate report can be generated
from them by executing the mockit.coverage.CodeCoverage.main
method (a regular Java "main" method).
To facilitate this, the jmockit-1.x.jar
file is executable.
As an example, the following Ant task could be used:
<java fork="yes" dir="myBaseDir" jar="jmockit-1.x.jar">
<jvmarg line="-Dcoverage-output=html"/>
<arg line="module1-outDir anotherOutDir"/>
</java>
The example above uses "myBaseDir
" as the base directory where a separate JVM instance will run.
Two output directories containing "coverage.ser
" data files are specified, as command line arguments.
Other configuration parameters can be specified through the "coverage-xyz
" system properties.
This separate JVM instance will read each of the "coverage.ser
" data files, merge the coverage data in memory, and then
generate the aggregate HTML report before exiting.
Another way to obtain an aggregate coverage report from the execution of multiple test runs is to accumulate coverage data from all tests
into a single data file.
This can be achieved by using the same working directory for all test runs or by pointing coverage-outputDir
to a shared
directory, while having coverage-output=serial-append
for each test run.
Additionally, the last test run in the sequence should also specify html
or html-nocp
for the
coverage-output
property, together with serial-append
.
Naturally, the first test run must not read data from this file; therefore, either the file should be deleted before the first
test run, or ignored by having the first test run use coverage-output=serial
.
So, the difference between output modes "serial
" and "serial-append
" is that with the first we have multiple
"coverage.ser
" files (each in a different directory used by a separate test run), while with the second we share a single
data file between all test runs.
If desired, JMockit Coverage can check that the final coverage percentages at the end of a test run satisfy arbitrary minimum values.
Such checks can be specified through one or more checking rules assigned to the "coverage-check
" system property
(when more than one, they must be separated by ";" characters).
Each checking rule must be in the form "[scope:]min percentage". There are three types of scopes:
80
" specifies that the total coverage should be at least 80%.
perFile
: Specifies minimum percentages that each source file must satisfy. If one or more files end up with a
lower percentage, the check fails.
An example: "perFile:50
", meaning that each source file must have at least 50% of coverage.
com.important:90
" specifies that total coverage for files under "com.important
"
should be at least 90%.
All checks (if any) are performed at the end of the test run (at JVM shutdown, actually).
Other forms of output (HTML report, serialized file) are not affected.
When an individual check fails, a descriptive message is printed to standard output.
If one or more checks have failed, two final actions are taken to have the fact reported: first, an empty file of name
"coverage.check.failed
" is created in the current working directory; second, an error (specifically, an
AssertionError
) is thrown.
When checks are performed but they all pass, the "coverage.check.failed
" file, if present in the current directory, is
deleted.
The use of a file to mark the success or failure of coverage checks is meant to allow build tools to react accordingly, typically by failing the build when the file is present. For example, we can do the following in a Maven pom.xml file:
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>coverage.check</id>
<goals><goal>enforce</goal></goals>
<phase>test</phase>
<configuration>
<rules>
<requireFilesDontExist>
<files><file>target/coverage.check.failed</file></files>
</requireFilesDontExist>
</rules>
</configuration>
</execution>
</executions>
</plugin>
With Maven, the surefire
plugin is the one usually responsible for running tests.
To activate and configure the coverage tool, specify values for the appropriate "coverage-xyz
" system properties.
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}"/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar
<!-- Coverage properties -->
<!-- At least one of the following needs to be set: -->
-Dcoverage-output=html <!-- or html-cp, serial, serial-append; if not set, defaults to "html" -->
-Dcoverage-classes=loaded <!-- or a "*" expression for class names; if not set, measures all production code classes -->
<!-- Other properties, if needed: -->
-Dcoverage-outputDir=my-dir <!-- default: target/coverage-report -->
-Dcoverage-srcDirs=sources <!-- default: all "src" directories -->
-Dcoverage-excludes=some.package.* <!-- default: empty -->
-Dcoverage-check=80 <!-- default: no checks -->
</argLine>
</configuration>
</plugin>
To have the JMockit Coverage HTML report included in the generated Maven
site documentation, the src/site/site.xml
descriptor file needs to be provided, with contents similar to what's shown
below.
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/DECORATION/1.3.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0
http://maven.apache.org/xsd/decoration-1.3.0.xsd">
<body>
<menu ref="reports"/>
<menu>
<item name="Code Coverage Report" href="../../coverage-report/index.html"/>
</menu>
</body>
</project>
To temporarily turn coverage off for a particular test run, we can set the coverage-output
system property
to an unknown output format, such as "-Dcoverage-output=none
".
The same effect will be achieved by setting "-Dcoverage-classes=none
".
Another, more interactive, way is to manipulate the read-only attribute of the relevant output file, when one has already been
generated.
The particular file to be manipulated, always in the working directory, is "coverage.ser
" for serialized output or
"coverage-report/index.html
" for HTML output.
The file attribute is checked by JMockit at startup; when marked as read-only it cannot be overwritten, so JMockit avoids the attempt
entirely.
Note that the working directory can usually be selected separately for each test run configuration in the Java IDE.
Also, a Java IDE usually provides an easy mechanism to toggle the read-only status of a file in the project:
in IntelliJ IDEA it is done by double clicking the status bar, with the desired file opened in the editor;
in Eclipse there is a "Read only" check box in the "Properties" screen (which can be opened by typing "Alt+Enter") for the text file
selected in the editor.


Doggo ipsum puggorino most angery pupper I have ever seen borkf heckin good boys, lotsa pats.  Long bois adorable doggo puggorino wow very biscit shibe waggy wags shibe, heckin good boys tungg very hand that feed shibe extremely cuuuuuute borking doggo. adorable doggo fluffer. Shooberino doggorino blep smol shooberino wrinkler, super chub doge waggy wags sub woofer. Boof maximum borkdrive many pats h*ck yapper, long doggo vvv many pats. Noodle horse adorable doggo heckin good boys, corgo.


A toy robot simulator written in Node.js for interview @ ZoneDigital
Check for node, npm, and npx
Alternatively if you are on Mac OSX, you can install these packages using brew package manager for Mac OSX
If you feel you have the need to become a node.js ninja, then you can always go that extra mile and install node with nvm, the Node.js version manager. With this utility application, you can have multiple Node.js versions installed on your system, and switching between them is only a command away.
The application's source code is located in src/
can built using make
. This will transpile the source code TypeScript and publish it to dist
.
This is the directory/file structure once you have checked out from the git repository.
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── docs
│ ├── assets
│ ├── classes
│ ├── enums
│ ├── globals.html
│ ├── index.html
│ ├── interfaces
│ └── modules
├── package.json
├── src
│ ├── conf.json
│ ├── commander.ts
│ ├── main.ts
│ ├── robot.ts
│ └── table.ts
├── test
│ ├── commander-test.spec.ts
│ ├── robot-test.spec.ts
│ └── table-test.spec.ts
├── toyRobot.iml
├── tsconfig.json
├── tslint.json
└── yarn.lock
Assuming you have complete the prerequisites (Node.js v6 and install yarn
as package manager), you can start the application by the commands below.
This will run the full build cycle:
$ yarn
$ yarn prod
For development, run the following commands in separate shells.
$ yarn dev
Running the application in a docker container, provided you have installed docker.
Docker containers wrap up software and its dependencies into a single unit that includes everything it needs to run. This guarantees the application will always run the same and makes collaboration as simple as sharing a container image.
Use the following command to build container from source
# The docker image for toyrobot is
tsangbot/toyrobot
# To pull the image from Docker Hub
docker pull ${IMAGE}:latest
# To build the image, replace ${IMAGE} with the desired name
docker build . -t ${IMAGE}:latest
# To run the image in a container, starts the application
docker run --rm -it ${IMAGE} /bin/ash
I am lazy, and I can easily forgot all the build commands. Make, is a great Unix tool that simplifies building programs when they are composed from many files, or building many programs simultaneously.
From Wiki
A makefile is a special file, containing shell commands, that you create and name makefile (or Makefile depending upon the system). While in the directory containing this makefile, you will type make and the commands in the makefile will be executed
Using make, the command to build and run docker container is simplified to
# To pull the image from Docker Hub
make docker-pull
# To build the image from local directory
make docker-build
# To run the image in a container, starts the application
make docker-run
# Output
toyRobot Running!
Valid commands: PLACE X,Y,F (Direction: NORTH, EAST, SOUTH, WEST) or LEFT or RIGHT or MOVE or REPORT.
I have been using VScode from Microsoft for this project. I have included the VScode project configuration in the repository, it is stored under .vscode.
You will find task originate from npm scripts stored in package.json
.
Globals
$ yarn global add tslint typescript typedoc mocha gulp-cli
toyRobot is a CLI Application that reads commands from command line stdin of the following form:
PLACE X,Y,FACE
MOVE
LEFT
RIGHT
REPORT
$ echo Compile TypeScript to JS && tsc --pretty && yarn run doc
Compile TypeScript to JS
$ typedoc
Using TypeScript 3.2.4 from /Users/ctsang201/code/mystuff/toyRobot/node_modules/typedoc/node_modules/typescript/lib
Rendering [========================================] 100%
Documentation generated at /Users/ctsang201/code/mystuff/toyRobot/docs
✨ Done in 11.78s.
yarn run v1.13.0
$ node ./dist/main
toyRobot Running!
Valid commands: PLACE X,Y,F (Direction: NORTH, EAST, SOUTH, WEST) or LEFT or RIGHT or MOVE or REPORT.
> PLACE 0,0,NORTH
> MOVE
> REPORT
0, 1, NORTH
> PLACE 0,0,NORTH
> LEFT
> REPORT
0, 0, WEST
> PLACE 1,2,EAST
> MOVE
> MOVE
> LEFT
> MOVE
> REPORT
3, 3, NORTH
>
Generated using TypeDoc


Step 4: Derby Network Server
Introduction
As explained in the "Embedded Derby" section, an application can embed Derby, which means that the Derby engine runs in the same JVM as the application.
However, an application can also access a Derby database using the more familiar client/server mode. This is achieved via a framework that embeds Derby and handles database requests from applications, including applications running in different JVMs on the same machine or on remote machines. The Derby Network Server is such a framework. It embeds Derby and manages requests from network clients, as depicted in Figure 2.
Figure 2: Derby Network Server Architecture
This section shows how to start the Derby Network Server, configure your environment to use the Derby Network Client JDBC driver, and compile and run a simple Java application that uses the network server. The information presented here is minimal, just enough to help get new users started. For complete information, see part one of the Derby Server and Administration Guide.
Derby Network Server
First set the DERBY_INSTALL environment variable.
Configure environment
To start or stop the Network Server, set your CLASSPATH to include the jar files listed below:
- derbynet.jar: contains the code for the Derby Network Server and a reference to the engine jar file (derby.jar)
- derbytools.jar: contains Derby tools
You can set your CLASSPATH explicitly with the command shown below:
Windows: C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derbytools.jar;%DERBY_INSTALL%\lib\derbynet.jar;.
UNIX: $ export CLASSPATH=$DERBY_INSTALL/lib/derbytools.jar:$DERBY_INSTALL\lib\derbynet.jar:.
You can also use the script that the Derby software distribution provides to set CLASSPATH. Change directory to the DERBY_INSTALL/bin directory, then execute setNetworkServerCP.bat (Windows) or setNetworkServerCP.ksh (UNIX), as shown below:
Windows: C:\> cd %DERBY_INSTALL%\bin C:\Apache\db-derby-<IP_ADDRESS>-bin\bin> setNetworkServerCP.bat
UNIX: $ cd $DERBY_INSTALL/bin $ . setNetworkServerCP.ksh
Start Network Server
Start the Network server by executing the startNetworkServer.bat (Windows) or startNetworkServer.ksh (UNIX) script. This will start the Network Server up on port 1527 and echo a startup message:
Windows: C:\Apache\db-derby-<IP_ADDRESS>-bin\bin> startNetworkServer.bat Security manager installed using the Basic server security policy. Apache Derby Network Server - <IP_ADDRESS> - (648739) started and ready to accept connections on port 1527 at 2008-04-28 17:13:13.921 GMT
UNIX: $ startNetworkServer.ksh Security manager installed using the Basic server security policy. Apache Derby Network Server - <IP_ADDRESS> - (648739) started and ready to accept connections on port 1527 at 2008-04-30 09:35:55.871 GMT
Messages will continue to be output to this window as the Network Server processes connection requests.
The Network Server starts Derby, so you'll find the derby.log error log in the directory where you start the Network Server.
An easier way: derbyrun.jar
Furthermore, it is much easier to start Network Server now than before, due to various jar file improvements. With the latest releases, the entire sections "Configure environment" and "Start Network Server" could actually be replaced with just one command line:
Windows: C:\Apache\db-derby-<IP_ADDRESS>-bin\lib> java -jar derbyrun.jar server start Security manager installed using the Basic server security policy. Apache Derby Network Server - <IP_ADDRESS> - (648739) started and ready to accept connections on port 1527 at 2008-04-28 17:13:13.921 GMT
UNIX: $ java -jar derbyrun.jar server start Security manager installed using the Basic server security policy. Apache Derby Network Server - <IP_ADDRESS> - (648739) started and ready to accept connections on port 1527 at 2008-04-30 09:35:55.871 GMT
Sample Application
Open a new window and set the DERBY_INSTALL environment variable.
Configure environment to use Derby Network Client JDBC driver
To use the Derby Network Client JDBC driver, set your CLASSPATH to include the jar files listed below:
- derbyclient.jar: contains the JDBC driver
- derbytools.jar: optional, provides the ij tool
You can set your CLASSPATH explicitly with the command shown below:
Windows: C:\> set CLASSPATH=%DERBY_INSTALL%\lib\derbyclient.jar;%DERBY_INSTALL%\lib\derbytools.jar;.
UNIX: $ export CLASSPATH=$DERBY_INSTALL/lib/derbyclient.jar:$DERBY_INSTALL/lib/derbytools.jar:.
You can also use the script that the Derby software distribution provides to set CLASSPATH. Change directory to the DERBY_INSTALL/bin directory, then execute the setNetworkClientCP.bat (Windows) or setNetworkClientCP.ksh (UNIX) script as shown below:
Windows: C:\Apache\db-derby-<IP_ADDRESS>-bin\bin> setNetworkClientCP.bat
UNIX: $ . setNetworkClientCP.ksh
Test network server connection with ij
An embedded connection URL that creates and connects to a database looks like this:
java org.apache.derby.tools.ij ij> connect 'jdbc:derby:MyDbTest;create=true';
A Derby Network Client connection URL is very close; just add //localhost:1527/ before the database name:
java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527/MyDbTest;create=true';
What is the physical location of the newly created database?
If you use the embedded driver, by default the database is created in the same directory in which ij was started up. If you use the Derby Network Client JDBC driver, by default the database is created in the directory where the Network Server was started up; in other words, in DERBY_INSTALL/bin.
Derby provides many ways to specify the actual location. For example, the connection URL below specifies a full path for the database location:
java org.apache.derby.tools.ij ij> connect 'jdbc:derby://localhost:1527//home/bill/DerbyDb/MyDbTest;create=true';
The Developer's Guide provides information about where Derby looks for databases:
Copy sample application
This section uses the same sample application that the "Embedded Derby" section uses.
By default this application runs in embedded mode. If you pass it the derbyclient argument at run time, then it will create and connect to the database using the Derby Network Client JDBC driver instead.
A quick look at the code
The SimpleApp.java application spends most of its time creating a table, inserting data into that table, and selecting the data back, demonstrating many JDBC calls as it does so. This section highlights the JDBC calls that make this specifically a client/server Derby application. The "Embedded Derby" section shows how to turn the same code into an embedded application.
Load the Client JDBC Driver
When executed with the derbyclient argument, the SimpleApp application loads the Derby Network Client driver with this code:
driver = "org.apache.derby.jdbc.ClientDriver"; ... Class.forName(driver).newInstance();
Get a Network Server Connection
When executed with the derbyclient argument, the SimpleApp application creates and connects to the derbyDB database with this code:
protocol = "jdbc:derby://localhost:1527/"; ... conn = DriverManager.getConnection(protocol + "derbyDB;create=true", props);
That connection URL, fully constructed, looks like this:
jdbc:derby://localhost:1527/derbyDB;create=true
Don't shut Derby down
If you look at the SimpleApp.java code you'll notice that it only shuts Derby down if it's running in embedded mode. When connecting via the Network Server, other applications might be accessing the same database you are; so, don't shut down the databases or Derby.
Compile Sample Application
Compile the sample application as shown below:
javac SimpleApp.java
Run Sample Application
Run the sample application like this:
java SimpleApp derbyclient
You should see the output shown below:
SimpleApp starting in derbyclient mode. Loaded the appropriate driver. Connected to and created database derbyDB Created table derbyDB Inserted 1956 Webster Inserted 1910 Union Updated 1956 Webster to 180 Grand Updated 180 Grand to 300 Lakeshore Verified the rows Dropped table derbyDB Closed result set and statement Committed transaction and closed connection SimpleApp finished
Quick question: Where is the physical location of the derbyDB database that the sample application creates?
(Answer: In the default $DERBY_INSTALL/bin location.)
Stop Network Server
Stop the Network server by executing the stopNetworkServer.bat (Windows) or stopNetworkServer.ksh (UNIX) script, as shown below:
Windows: C:\> cd %DERBY_INSTALL%\bin C:\Apache\db-derby-<IP_ADDRESS>-bin\bin> setNetworkServerCP.bat C:\Apache\db-derby-<IP_ADDRESS>-bin\bin> stopNetworkServer.bat
UNIX: $ cd $DERBY_INSTALL/bin $ . setNetworkServerCP.ksh $ stopNetworkServer.ksh
The window running the NetworkServer should output a message confirming the shutdown.
Note that, as with starting the server, there is also an easier way to shut down the server. For example:
Windows: C:\> java -jar %DERBY_INSTALL%\lib\derbyrun.jar server shutdown
UNIX: $ java -jar $DERBY_INSTALL/lib/derbyrun.jar server shutdown
Run derbyrun.jar without arguments for further usage information. derbyrun.jar has been included with Derby releases since the 10.2 release series.
Next Steps
Network Server Options
By default, the Derby Network Server only accepts requests from the localhost on port 1527. You can modify the Network Server to:
- Listen on a port other than the default.
- Accept requests from outside the localhost.
- Run in the Java 2 Security Manager for increased security, which we strongly recommend.
For more information about these options, and more, see the Derby Server and Administration Guide.
Embedded Server
Up until this point, this section has focused on how to start and stop the Network Server as an independent process.
Another option, called the "embedded server", allows an application to load the embedded JDBC driver for its own use and start the Network Server to allow remote access by applications running in other JVMs. The application that does this can access the database with either the embedded driver or the client driver.
Figure 3 depicts an application called MyEmbedSrvApp that loads the embedded driver and also starts up the Network Server. This allows other applications, such as ij or SimpleApp using the Derby Network Client, to connect to the same database via a client JDBC driver.
Figure 3: Derby Embedded Server Architecture
While it is certainly possible for MyEmbedSrvApp to use the Derby Network Client JDBC driver, it's probably better for it to use the embedded driver because Derby Network Client JDBC database requests incur the overhead of going out through the network. The embedded server architecture lets the application that embeds Derby retain the advantages of embedded access while also enabling remote access to the same database using another tool, such as ij. Thus, you end up with the best of both worlds: embedded and client/server.
You've reached the end of this Derby tutorial and should now understand how to use Derby in the embedded and Network Server frameworks. The "Overview" section provides suggestions for how you might use Derby with some other products.


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Shockumentary
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Dr. Sputnik
Boners
Dead Pool
NNDB
Home
Make Dailyrotten your start page
|
|
|
June 09, 2003
Starving North Koreans return to cannibalism
London Telegraph | Submitted by: Black Ops 7
"Cannibalism is increasing in North Korea following another poor harvest and a big cut in international food aid, according to refugees who have fled the stricken country.  Anyone caught selling human meat faces execution, but in a report compiled by the North Korean Refugees Assistance Fund (NKRAF), one refugee said: 'Pieces of "special" meat are displayed on straw mats for sale. People know where they came from, but they don't talk about it.'"
|
|
Read article... and
This article...
|
|
Wicked baboon kills baby, eats its brain
News 24 South Africa | Submitted by: optional
"A young mother watched helplessly as a baboon snatched and ripped open the skull of her only child and ate his brain. She believes the rare incident must be related to witchcraft. Lettie Goitsimang Tukane, 34, told City Press the baboon sank its powerful canines into the skull of her three-month-old son, removed the brain, climbed up a telephone pole and ate the brain before fleeing into nearby bushes."
|
|
Read article...
|
|
Blair's WMD reports based on Internet, not classified, info
The Scotsman | Submitted by: Ryan
"Tony Blair's first dossier on the justification for war against Iraq was almost entirely put together from information freely available on the internet, Scotland on Sunday can reveal. The crucial document purported to contain 55 pages of high-grade intelligence on the threat posed by Saddam, but was in fact largely based on unclassified CIA documents, Pentagon press releases and the published reports of American think-tanks. ... A second dossier on Saddam's weapons of mass destruction (WMD) which was released five months after the first has been dubbed the 'dodgy dossier' after it emerged much of it was based on a student's PhD thesis."
|
|
Read article...
|
|
Little girl in Germany swept away by killer balloon
BBC | Submitted by: Tim Howard
"Severe weather in Germany has left at least a dozen people dead and many others injured after high winds and thunderstorms swept across the country. Those killed included a five-year-old British girl, who was swept away by a helium balloon in a freak accident at a British military show in western Germany. ... The balloon was then torn from its anchors and lifted up into the air, with the young girl in the process becoming entangled in its ropes. The German authorities began a search and police in Hamminkeln, near Wesel -- about 70 km (45 miles) away from the site -- soon reported they had found the balloon and the child's body."
|
|
Read article... and
This article...
|
|
Malaysia, Pakistan go apeshit over U.S. registration policy
BBC | Submitted by: Tim Howard
"Under the new policy, the US Immigration and Naturalisation Service (INS) will routinely fingerprint, photograph and question potential entrants, checking their pictures and prints against criminal and terrorist databases. The policy is aimed at preventing a repeat of the security lapses which allowed the 11 September hijackers to live undetected in the US for so long. ... all citizens of Iran, Iraq, Libya, Syria and Sudan will be targeted, and visitors -- especially men -- from other Muslim and Middle Eastern countries may also be subject to the new measures."
|
|
Read article...
|
|
Man earns crack by hosting gangrape
WEWS-TV 5 | Submitted by: Reid Fleming
"Last month, a 13-year-old mentally challenged girl was waiting outside a store as her brother and a cousin went inside to buy candy. Police said the men lured her away to the basement of a nearby home where they held the girl down and forced her to perform sex acts. ... The homeowner, Dennis Tudor, faces a count of permitting drug abuse. Police said he accepted crack cocaine from the men in return for him letting them use his basement."
|
|
Read article...
|
|
Girl's cheek blown off in Congolese firefight
Wire Services | Submitted by: MikeW
"Seven year-old girl Malosi Zale arrives at the Red Cross hospital, in Bunia, the northeastern Democratic Republic of Congo, after she was injured by a bullet during an attack led by Lendu majority in Katoto, the day before." With photo.
|
|
Read article...
|
|
Wired cock gives New Zealand police a workout
News Corporation | Submitted by: Tim Howard
"A potentially explosive rooster had New Zealand police running around like headless chickens yesterday. The bird, which had canisters with protruding wires strapped to its wings, was spotted by a member of the public in the Christchurch suburb of Sydenham during the morning. Police decided to take no chances and herded the bird up an alleyway and called the army bomb disposal squad, Senior Sergeant Ian Freeman of Christchurch police said. The chicken was put down, and the contents of the canisters strapped to the body were found to be harmless."
|
|
Read article...
|
|
Michael Jackson allergic to lawsuits
BBC | Submitted by: Tim Howard
"Jackson has until Friday to complete a court-ordered deposition in Indianapolis in a legal action alleging that his family group, the Jackson Five, used two songs by another band without permission. He had been due to appear at an Indianapolis court on 21 May, but was admitted to hospital with a mystery illness hours before he was to have given his testimony. Amid allegations that he was faking the illness, a doctor who treated him submitted a statement to the court that Jackson had suffered a suspected anxiety attack, becoming dizzy, weak and dehydrated."
|
|
Read article...
|
|
Clergymen not trained in constitutional law
Cincinnati Enquirer | Submitted by: buffaloBill
"A group of ministers and local residents blocked the removal Monday of a three-foot statue bearing the Ten Commandments that stands in front of Peebles High School in Adams County. ... The displays were scheduled to be removed Monday. However, following a 90-minute rally, pastors and local residents locked arms in front of the monument. The Rev. Phil Fulton, of Union Hill Church in Adams County, said he would remain defiant despite the federal court order. 'I am willing to do whatever it takes -- to be arrested or whatever. There is no constitutional background to take these commandments out. This is our religious right. This is our freedom-of-speech right.'" [So we should assume they'd lock arms around a stone monument bearing excerpts from the Koran, or The Satanic Bible for that matter? Didn't think so.]
|
|
Read article...
|
|
Helluva way to start a marriage
Toronto Star | Submitted by: Sniffer
"A weekend wedding celebration turned deadly when a fight among feuding families claimed the life of the bride's uncle. Mohsin Seyyad, 46, died Saturday after a brawl erupted outside the Scarborough restaurant where the wedding dinner for his niece was about to be held. He was trying to be a peacemaker between the 16-year-old groom, his friends and members of the 17-year-old bride's family when he was punched repeatedly and struck his head on a parked car, police said."
|
|
Read article... and
This article...
|
|
U.S. printing Iraqi currency bearing Saddam's face
Yahoo! UK | Submitted by: DJ Hi-C
"Everybody wants their money in 250-dinar notes, even though large transactions require sackloads of them to be hauled around. To meet the demand for the smaller notes, the central bank is printing millions, each bearing the picture of a youthful Saddam with neatly combed hair and a smart jacket and tie. ... U.S. and British officials concede it is embarrassing to have to print Saddam banknotes, but say it is better to lose face -- by temporarily keeping his face on the currency -- than fan the anger of Iraqis about the dinars in their pockets."
|
|
Read article...
|
|
Fraudulent bomb-sniffing dogs on trial
SF Gate | Submitted by: Reid Fleming
"Private detectives hired by the Federal Reserve to pose as contractors drove vehicles up to three Federal Reserve building entrances. Hidden in one were 50 pounds of dynamite. In another were 50 pounds of TNT. A third carried 15 pounds of C-4 plastic explosive. According to the indictment, Ebersole's canine teams 'failed to detect the explosives, and the vehicles were permitted to enter (Federal Reserve) parking facilities.'"
|
|
Read article...
|
|
Newspaper blames Earth Liberation Front for house arsons
Detroit Free Press | Submitted by: Reid Fleming
"A group that uses the Internet to spread its message of using arson and sabotage to save the Earth and hails Unabomber Ted Kaczynski as one of its heroes is terrorizing Michigan." [And just how did the newspaper reach this conclusion?] "The calling card ELF was left in spray-painted letters at the scenes of two arsons that destroyed four luxury homes under construction. [Uh huh.] "'Just because someone spray-paints ELF somewhere is not enough for us to conclude it's ELF-related,' said Greg Stejskal, FBI special agent in charge of the Ann Arbor office, which is investigating house fires in Superior Township." [Well at least the feds have some brains.]
|
|
Read article...
|
|
Fonzy gunned down by boyfriend
caledonianrecord.com | Submitted by: BurkeVt
"According to the affidavit in support of the charges, the shooting was recorded by the 911 operator who heard McFarland screaming for police to be sent to his home as shots were fired in the background. ...   Butson also said, 'Fonzy, love you, this is too bad, it's crazy, it weren't no need of this was it? Huh? Fonzy?, Fonzy?,' followed by the sound of gunshots."
|
|
Read article...
|
|
|
|
|


My name Is Jared Rose, and I'm from Tampa Bay Area(originally born in Northern Virginia), currently based in Port Orchard, WA and I am a budding Web Developer. Previous Military experience, with a background in Information Systems. My hobbies include, reading, playing video games, and coding. I have a consummate background in audio engineering as I volunteer at my church often. If you have any further questions, feel free to reach out to me via the "contact me" section of this page.


Progress: {{ progress }}
Draw bounding boxes around clouds or groups of touching clouds in the image.
Instructions:
- Only mark an item as a cloud if you are sure it is a cloud.
- Include all visible parts, including any cloud shadows, and draw as tightly as possible on each cloud. It's okay for bounding boxes to overlap.
- If there are multiple clouds and they directly touch, draw the box around the group. If the entire image is basically covered in a cloud select the "All Cloud" checkbox below then press "Done".
- If the image has lens flare or the colors are smeared across RGB, press the "Delete" button.


Temporary Buffer Words
Temporary buffers are circular buffers for allocating temporary data. Temporarily allocated space should not be relied upon to store data indefinitely, because they reallocate space allocated to old buffers when no more space for continguous blocks of memory are available.
temp
The following words are in temp
.
x-data-too-big
( – )
An exception raised when the size of the data requested to be allocated is larger than the size of the temporary buffer’s total space.
temp-size
( data-bytes – bytes )
Get the size of a temporary buffer with a given data size.
init-temp
( data-bytes addr – )
Initialize a temporary buffer with a given data size at the specified address. Note that the amount of space returned by temp-size
for the given data size should be alloted or allocated for the temporary buffer.
allocate-temp
( bytes temp – addr )
Allocate temporary space of a given data size for a given temporary buffer. If the data size is larger than the temporary buffer’s total data size, x-data-too-big
is raised.


Derwentwater
Black Forest
The Maldives
Mountains
Lhotse
Sagano Bamboo Forest
Lanikai Beach
Lakes
Kanchenjunga
Lake Tahoe
Hampton Beach
Forests
Mount Everest
Maligne Lake
Sequoia National Forest
Beaches
Bora Bora
Amazon Rainforest
Lake Lucerne
K2


A global artist who continues to impact her audience with frank and authentic conversations.
Experience
Recording Artist
Interscope Records
An award-winning and celebrated pop artist with worldwide chart-topping albums like 'Rare' and 'Revival' among others. Gomez has six albums and seventeen singles. As a solo artist, Gomez has accumulated over 20 billion global streams.
Actress
Hollywood
Gomez starred in a lot of critically acclaimed movies like 'Monte Carlo', 'The Fundamentals of Caring' and 'Spring Breakers' among others.
Producer
July Moon Productions, Inc.
Gomez is the executive producer of the hit Netflix original series '13 Reasons Why' and the critically acclaimed Netflix docu-series “Living Undocumented” among other shows and movies.
Founder
Rare Beauty
Gomez launched Rare beauty, a beauty company with a focus on mental health, one's uniqueness and inclusivity, in September 2020.
Philanthropist
Giving back has always been an important element in Gomez's life. She joined Michelle Obama’s 'When We All Vote' for the 2020 US presedential elections. She works very closely with the 'We Movement'. She was named the youngest goodwill Ambassador for UNICEF at 18 years old and continues to work with them. Gomez also works very closely with 'A21', an non-profit organization seeking to eliminate human trafficking.
Discography
Rare
Earlier in 2021, Gomez released her critically acclaimed album RARE which debuted at No. 1 on the 'Billboard 200', her third consecutive studio album to debut atop the chart. The album has been met with widespread critical acclaim.
Revival
Gomez's second studio album was met with widespread critical acclaim.
Singles
Gomez has had seventeen mega-successful singles. Some of them are 'It Ain’t Me' with Kygo, 'Bad Liar', 'Fetish', 'Wolves' with Marshmello, 'I Can’t Get Enough' with Benny Blanco, J Balvin and Tainy and 'Back to You'


Intro to Git and Github
http://womenwhocode.github.io/intro-to-git
What on earth is git?
- Version control
- Backing up code
- Code sharing
So what is "version control"?
"Version Control"
- History of your changes
- Give a little message about changes on save
- Go back in history
- Multiple versions of code with
branches
Backing up code
- 'Remote repositories'
push
-ing, pull
-ing
- Dropbox for code
Sharing Code
- Code is better with friends!
- Work remotely with a team
Recap on why you should use git
- Save yourself from losing code
- Back up your code because it's smart
- Work with other devs because code is more fun with friends
So what is Github, then?
- Website where you can backup your code (like Dropbox)
- See other people's code (open-source)
- Work with other devs to make stuff (
pull requests
)
So, let's try it.

Let's make some changes.
vim README.md
hit the letter "s"
Now we can type in the document.
how do i get out of vim?
When you're done typing, hit Control + c
and then type :wq
.
let's make another file and then push everything to github.
touch index.html
git add --all
Shorthand for 'add everything'
git commit -m "Commit message"
git push
git log


- pygame_animations.Animation (classe de base)
-
pygame_animations.Animation.can_run()
-
pygame_animations.Animation.cancel()
-
pygame_animations.Animation.fastforward()
-
pygame_animations.Animation.is_running()
-
pygame_animations.Animation.match()
-
pygame_animations.Animation.start()
-
pygame_animations.Animation.stop()
- pygame_animations.AnimationGroup (classe de base)
-
pygame_animations.AnimationGroup.can_run()
-
pygame_animations.AnimationGroup.cancel()
-
pygame_animations.AnimationGroup.fastforward()
-
pygame_animations.AnimationGroup.is_running()
-
pygame_animations.AnimationGroup.match()
|
-
pygame_animations.AnimationGroup.start()
-
pygame_animations.AnimationGroup.stop()
- pygame_animations.AnimationSequence (classe de base)
-
pygame_animations.AnimationSequence.can_run()
-
pygame_animations.AnimationSequence.cancel()
-
pygame_animations.AnimationSequence.fastforward()
-
pygame_animations.AnimationSequence.is_running()
-
pygame_animations.AnimationSequence.match()
-
pygame_animations.AnimationSequence.start()
-
pygame_animations.AnimationSequence.stop()
-
pygame_animations.cancel_all()
-
pygame_animations.fastforward_all()
-
pygame_animations.stop_all()
-
pygame_animations.update_animations()
|


An investment may make sense if we expect it to return more money than it costs. But returns are only part of the story because they are risky - there may be a range of possible outcomes. How does one compare different investments that may deliver similar results on average, but exhibit different levels of risks?
The best measure to comapre two investments apple to apple with different return and risk is Sharpe Ratio.It compares the expected returns for two investment opportunities and calculates the additional return per unit of risk an investor could obtain by choosing one over the other. In particular, it looks at the difference in returns for two investments and compares the average difference to the standard deviation (as a measure of risk) of this difference.
$$ Sharpe Ratio= \frac{(R_x-R_t)}{Std R_x}$$
Where
$$ R_x= $$ Expected investment return
$$ R_t= $$ Risk free rate of return
$$ Std R_x= $$ Standard daviation of portfolio return
A higher Sharpe ratio means that the reward will be higher for a given amount of risk. It is common to compare a specific opportunity against a benchmark that represents an entire category of investments.
The Sharpe ratio is usually calculated for a portfolio and uses the risk-free interest rate as benchmark. The standard risk free interest rate is 3-month Treasury Bill Rate. Here, to make things easier I will consider S&P 500 as my risk free rate (Benchmark) and instead of entier portfolio I will just consider Amazon and Microsoft Share prices. you can easily find share prices online on websites like yahoo finance, google finance etc. If you want to follow along with me, you can find data here.
Lets get started now. ```python
import pandas as pd import numpy as np import matplotlib.pyplot as plt ```
When analyzing financial data, often its a good idea to use datatime index. You can declare that while reading your files as I am doing it over here.
```python
benchmark_data=pd.read_csv('SNP500.csv', parse_dates=['Date'], index_col=['Date']).dropna() MSFT=pd.read_csv('MSFT.csv',parse_dates=['Date'], index_col=['Date']).dropna() AMZN=pd.read_csv('AMZN.csv',parse_dates=['Date'], index_col=['Date']).dropna() ```
Lets now combine MSFT and AMZN dataframe into a single dataframe. ```python
combined_data=pd.merge(MSFT,AMZN,suffixes=['_MSFT','_AMZN'],on=['Date']) combined_data.head() ```
```python
stock_data=combined_data[['Close_AMZN','Close_MSFT']] stock_data.columns=['AMZN','MSFT'] print(stock_data.head()) ```
```python
benchmark_data=benchmark_data[['Close']] benchmark_data.columns=['S&P 500'] print(benchmark_data.head()) ```
Now lets check out our data to find out how many obsewrvations we have at our disposal.
```python
print('Stocks\n') print(stock_data.info()) print(stock_data.head())
print('\nBenchmarks\n') print(benchmark_data.info()) print(benchmark_data.head()) ```
Before we compare either Microsoft or Amazon investment with the index of the 500 largest companies in the US, let's visualize the data, so that we better understanding about what we're dealing with.
```python
stock_data.plot(subplots=True) plt.title('Stock Data', ) plt.show()
stock_data.describe() ```
Hmm... Amazon went up 2000 mark from 1350, where as microsoft went up 150 mark from 94. What do you think was a good investment decision?\ We will see that.
Let's also take a closer look at the value of the S&P 500, our benchmark for the same period.
```python
benchmark_data.plot() plt.title('S & P 500') plt.show()
benchmark_data.describe() ```
To calculate Sharepe Ratio we need returns of 2 investment opportunities under consideration, in our case return on investment for AMZN and MSFT stock.
Our data shows the historical value of each investment, not the return. To calculate the return, we need to calculate the percentage change in value from one day to the next. We'll also take a look at the summary statistics because these will become our inputs as we calculate the Sharpe Ratio.
```python
stock_returns = stock_data.pct_change()
stock_returns.plot() plt.title('Daily Returns') plt.show()
print(stock_returns.describe())
sp_returns = benchmark_data['S&P 500'].pct_change()
sp_returns.plot() plt.title('S & P 500 Daily Returns') plt.show()
print(sp_returns.describe()) ```
Now that we have daily return for each stock, we can calculate the excess return for each stock.
we need to calculate the relative performance of stocks vs. the S&P 500 benchmark. This is calculated as the difference in returns between stock_returns and sp_returns for each day.
```python
excess_returns = stock_returns.sub(sp_returns,axis=0)
excess_returns.plot() plt.title('Excess Returns') plt.show()
print(excess_returns.describe()) ```
Now we can finally start computing the Sharpe Ratio. First we need to calculate the average of the excess_returns. This tells us how much more or less the investment yields per day compared to the benchmark.
```python
avg_excess_return = excess_returns.mean()
avg_excess_return.plot.bar() plt.title('Mean of the Return Difference') plt.show() ```
It looks like there was quite a bit of a difference between average daily returns for Amazon and Microsoft. Next, we calculate the standard deviation of the excess_returns. This shows us the amount of risk an investment in the stocks implies as compared to an investment in the S&P 500.
```python
sd_excess_return = excess_returns.std()
sd_excess_return.plot.bar() plt.title('Standard Deviation of the Return Differences') plt.show() ```
Now we just need to compute the ratio of avg_excess_returns and sd_excess_returns. The result is now finally the Sharpe ratio which indicates how much more (or less) return the investment opportunity under consideration yields per unit of risk.
The Sharpe Ratio is often annualized by multiplying it by the square root of the number of periods. We have used daily data as input, so we'll use the square root of the number of trading days (5 days, 52 weeks, minus a few holidays): ���253
```python
daily_sharpe_ratio = avg_excess_return.div(sd_excess_return)
annual_factor = np.sqrt(253) annual_sharpe_ratio = daily_sharpe_ratio.mul(annual_factor)
annual_sharpe_ratio.plot.bar() plt.title('Stocks vs S&P 500') plt.show() annual_sharpe_ratio ```
In 2019, Amazon had a negative Sharpe ratio as compared to Microsoft. This means that an investment in Amazon resulted less return compared to the S&P 500 for each unit of risk an investor would have assumed. This negative Sharpe Ratio here means that Risk free rate here S&P 500 performed better than Amazon stock. On the other hand, Sharpe Ratio for Microsoft was 1.43. In risk-adjusted terms, the investment in Microsoft would have been more attractive.
This difference was mostly driven by comparatively low % returns and high standard deviation of amazon over microsoft. In nutshell, investing in Microsoft would have been resulted in better returns for 2019.
When faced with investment alternatives that have both different risk and return profile, the Sharpe Ratio helps to make a decision by adjusting the returns by the differences in risk and allows an investor to compare investment opportunities on equal terms, that is, on an 'apples-to-apples' basis.


Generates a authorization code link depending on the scopes and redirect URI set.
Gets the access token for the user to perform further functions.
Gets the connected third-party accounts of an authorized user.
Gets the guilds of an authorized user.
Gets the user who has authorized using the OAuth2 flow.
Gets a new access token for the user whose access token has expired.
Generated using TypeDoc
Create a new OAuth2 Client.


{% extends "emails/_baseemail.htm" %}
{% block greetingemail %}Hi, {{ firstname }}{% endblock greetingemail %}
{% block contentemail %}It looks like you forgot your password. No worries! We will help you. To reset your password, please go to:
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock contentemail %}


The Adventures of Tom Sawyer
by Mark Twain
Chapter 11
Additional Information
- Year Published: 1876
- Language: English
- Country of Origin: United States of America
- Source: Twain, M. (1876). The Adventures of Tom Sawyer. Hartford, CT: American Publishing Co.
-
Readability:
- Flesch–Kincaid Level: 4.5
- Word Count: 1,611
- Genre: Adventure
- ✎ Cite This
Downloads
CLOSE upon the hour of noon the whole village was suddenly electrified with the ghastly news. No need of the as yet undreamed–of telegraph; the tale flew from man to man, from group to group, from house to house, with little less than telegraphic speed. Of course the schoolmaster gave holiday for that afternoon; the town would have thought strangely of him if he had not.
A gory knife had been found close to the murdered man, and it had been recognized by somebody as belonging to Muff Potter—so the story ran. And it was said that a belated citizen had come upon Potter washing himself in the "branch" about one or two o'clock in the morning, and that Potter had at once sneaked off—suspicious circumstances, especially the washing which was not a habit with Potter. It was also said that the town had been ransacked for this "murderer" (the public are not slow in the matter of sifting evidence and arriving at a verdict), but that he could not be found. Horsemen had departed down all the roads in every direction, and the Sheriff "was confident" that he would be captured before night.
All the town was drifting toward the graveyard. Tom's heartbreak vanished and he joined the procession, not because he would not a thousand times rather go anywhere else, but because an awful, unaccountable fascination drew him on. Arrived at the dreadful place, he wormed his small body through the crowd and saw the dismal spectacle. It seemed to him an age since he was there before. Somebody pinched his arm. He turned, and his eyes met Huckleberry's. Then both looked elsewhere at once, and wondered if anybody had noticed anything in their mutual glance. But everybody was talking, and intent upon the grisly spectacle before them.
"Poor fellow!" "Poor young fellow!" "This ought to be a lesson to grave robbers!" "Muff Potter'll hang for this if they catch him!" This was the drift of remark; and the minister said, "It was a judgment; His hand is here."
Now Tom shivered from head to heel; for his eye fell upon the stolid face of Injun Joe. At this moment the crowd began to sway and struggle, and voices shouted, "It's him! it's him! he's coming himself!"
"Who? Who?" from twenty voices.
"Muff Potter!"
"Hallo, he's stopped!—Look out, he's turning! Don't let him get away!"
People in the branches of the trees over Tom's head said he wasn't trying to get away—he only looked doubtful and perplexed.
"Infernal impudence!" said a bystander; "wanted to come and take a quiet look at his work, I reckon—didn't expect any company."
The crowd fell apart, now, and the Sheriff came through, ostentatiously leading Potter by the arm. The poor fellow's face was haggard, and his eyes showed the fear that was upon him. When he stood before the murdered man, he shook as with a palsy, and he put his face in his hands and burst into tears.
"I didn't do it, friends," he sobbed; "'pon my word and honor I never done it."
"Who's accused you?" shouted a voice.
This shot seemed to carry home.  He saw Injun Joe, and exclaimed:
"Oh, Injun Joe, you promised me you'd never—"
"Is that your knife?" and it was thrust before him by the Sheriff.
Potter would have fallen if they had not caught him and eased him to the ground. Then he said:
"Something told me 't if I didn't come back and get—" He shuddered; then waved his nerveless hand with a vanquished gesture and said, "Tell 'em, Joe, tell 'em—it ain't any use any more."
 And when he had finished and still stood alive and whole, their wavering impulse to break their oath and save the poor betrayed prisoner's life faded and vanished away, for plainly this miscreant had sold himself to Satan and it would be fatal to meddle with the property of such a power as that.
"Why didn't you leave? What did you want to come here for?" somebody said.
"I couldn't help it—I couldn't help it," Potter moaned. "I wanted to run away, but I couldn't seem to come anywhere but here." And he fell to sobbing again.
Injun Joe repeated his statement, just as calmly, a few minutes afterward on the inquest, under oath; and the boys, seeing that the lightnings were still withheld, were confirmed in their belief that Joe had sold himself to the devil. He was now become, to them, the most balefully interesting object they had ever looked upon, and they could not take their fascinated eyes from his face.
They inwardly resolved to watch him nights, when opportunity should offer, in the hope of getting a glimpse of his dread master.
Injun Joe helped to raise the body of the murdered man and put it in a wagon for removal; and it was whispered through the shuddering crowd that the wound bled a little! The boys thought that this happy circumstance would turn suspicion in the right direction; but they were disappointed, for more than one villager remarked:
"It was within three feet of Muff Potter when it done it."
Tom's fearful secret and gnawing conscience disturbed his sleep for as much as a week after this; and at breakfast one morning Sid said:
"Tom, you pitch around and talk in your sleep so much that you keep me awake half the time."
Tom blanched and dropped his eyes.
"It's a bad sign," said Aunt Polly, gravely. "What you got on your mind, Tom?"
"Nothing. Nothing 't I know of." But the boy's hand shook so that he spilled his coffee.
"And you do talk such stuff," Sid said. "Last night you said, 'It's blood, it's blood, that's what it is!' You said that over and over. And you said, 'Don't torment me so—I'll tell!' Tell WHAT? What is it you'll tell?"
Everything was swimming before Tom. There is no telling what might have happened, now, but luckily the concern passed out of Aunt Polly's face and she came to Tom's relief without knowing it. She said:
"Sho! It's that dreadful murder. I dream about it most every night myself. Sometimes I dream it's me that done it."
Mary said she had been affected much the same way. Sid seemed satisfied. Tom got out of the presence as quick as he plausibly could, and after that he complained of toothache for a week, and tied up his jaws every night. He never knew that Sid lay nightly watching, and frequently slipped the bandage free and then leaned on his elbow listening a good while at a time, and afterward slipped the bandage back to its place again. Tom's distress of mind wore off gradually and the toothache grew irksome and was discarded. If Sid really managed to make anything out of Tom's disjointed mutterings, he kept it to himself.
It seemed to Tom that his schoolmates never would get done holding inquests on dead cats, and thus keeping his trouble present to his mind. Sid noticed that Tom never was coroner at one of these inquiries, though it had been his habit to take the lead in all new enterprises; he noticed, too, that Tom never acted as a witness—and that was strange; and Sid did not overlook the fact that Tom even showed a marked aversion to these inquests, and always avoided them when he could. Sid marvelled, but said nothing. However, even inquests went out of vogue at last, and ceased to torture Tom's conscience.
Every day or two, during this time of sorrow, Tom watched his opportunity and went to the little grated jail–window and smuggled such small comforts through to the "murderer" as he could get hold of. The jail was a trifling little brick den that stood in a marsh at the edge of the village, and no guards were afforded for it; indeed, it was seldom occupied. These offerings greatly helped to ease Tom's conscience.
The villagers had a strong desire to tar–and–feather Injun Joe and ride him on a rail, for body–snatching, but so formidable was his character that nobody could be found who was willing to take the lead in the matter, so it was dropped. He had been careful to begin both of his inquest–statements with the fight, without confessing the grave–robbery that preceded it; therefore it was deemed wisest not to try the case in the courts at present.


Hope Aroke: Convicted fraudster masterminds $1m scam from Kirikiri prison
- Convicted fraudster, Hope Aroke, is under investigation by the EFCC
- Aroke was said to have masterminded a fraud of $1 million from the Kirikiri prison
- The convict is already serving a 24-year jail term
There seems to be a new twist to how fraud is being perpetrated in Nigeria as a convicted internet fraudster, Hope Olusegun Aroke, who is serving a 24-year jail term at the Kirikiri maximum prison in Lagos, has been accused of masterminding a fresh mega scam to the tune of over $1,000,000.
Premium Times reports that Aroke is now being investigated by the Economic and Financial Crimes Commission (EFCC).
Legit.ng gathered that he allegedly pulled the heist right from prison using a network of accomplices, who are targets of fraud and money laundering investigation.
It was learnt that the lid on his latest fraud exploits from the bowels of the maximum correctional centre was blown following intelligence received by the EFCC.
Just in: Former attorney general Adoke ‘arrested in Dubai’
According to the report, the immediate riddle that confronted the EFCC was how it was possible for the convict to continue to ply his ignoble trade of Internet fraud from prison.
Preliminary investigation revealed that the convict, against established standard practice, had access to internet and mobile phone in the correctional centre where he is supposed to be serving his jail term.
It was also gathered that Aroke got himself admitted to the Nigeria police hospital, Falomo, Lagos for an undisclosed ailment, adding that from the hospital, he would move out to lodge in hotels, meet with his wife and two children and attend other social functions.
The EFCC is said to be investigating the circumstance of Aroke's admission into the hospital and those who aided his movement from the hospital to hotels and other social engagements.
According to the online news medium, the investigation revealed that Aroke used a fictitious name, Akinwunmi Sorinmade, to open two accounts with two new generation banks.
Kaduna lawmaker arrested for N11m fraud
He was also said to have bought a property at Fountain Spring Estate, Lekki Lagos in 2018 for N22 million and a Lexus RX 350 2018 model registered in his wife’s name, Maria Aroke.
The convict was also in possession of his wife’s bank account token in prison, which he used to freely transfer funds.
Further investigation revealed that, while his trial was ongoing in 2015, Aroke bought a four-bedroom duplex at plot 12, Deji Fadoju street, Megamounds estate Lekki County Homes , Lekki, for N48 million.
It would be recalled that Aroke was one of two Malaysia-based Nigerian undergraduate fraudsters arrested by the EFCC in 2012 at the 1004 Housing estate, Victoria Island, Lagos following a tip- off.
He had claimed to be a student of Computer Science at the Kuala Lumpur Metropolitan University, Malaysia. But the commission’s investigation fingered him as the arrow head of an intricate web of internet fraud scheme that traverses two continents.
Specialist in picking used diapers from dustbins to sell to ritualists arrested
After his arrest, a search conducted by EFCC operatives on his apartment led to the recovery of several items such as laptops, iPad, traveling documents, cheque books, flash drives, internet modem, and three exotic cars – a Mercedes Benz jeep, one 4Matic Mercedes Benz car and a Range Rover Sport SUV.
He was eventually convicted by Justice Lateefa Okunnu of a Lagos state high court on two counts of obtaining money by false pretence, cheque cloning, wire transfer and forgery. He was sentenced to twelve years imprisonment on each of the two counts.
PAY ATTENTION: Get the Latest Nigerian News Anywhere 24/7. Spend less on the Internet!
Meanwhile, Legit.ng had previously reported that the minister of interior, Rauf Aregbesola, on Thursday, October 31, said that the culprits in the investigative report by a journalist, Fisayo Soyombo, would not go scot-free.
NAIJ.com (naija.ng) -> Legit.ng We have updated to serve you better
Nigerians set 2nd term agenda for President Buhari | - on Legit TV


|
time_series
|
Interface for time series. More...
#include <interface.hpp>
Public Member Functions | |
| virtual Index | newest_timeindex (bool wait=true)=0 |
| returns index. If argument wait is true, waits if the time_series is empty. If argument wait is false and the time series is empty, returns time_series::EMPTY immediately. | |
| virtual Index | count_appended_elements ()=0 |
| returns the number of element that has been contained in the queue, i.e. the number of elements that have been added from the start. | |
| virtual Index | oldest_timeindex (bool wait=true)=0 |
| returns . waits if the time_series is empty. If argument wait is false and the time series is empty, returns time_series::EMPTY immediately. | |
| virtual T | newest_element ()=0 |
| returns . waits if the time_series is empty. | |
| virtual T | operator[] (const Index &timeindex)=0 |
| returns . waits if the time_series is empty or if . | |
| virtual Timestamp | timestamp_ms (const Index &timeindex)=0 |
| returns the time in miliseconds when was appended. Waits if the time_series is empty or if . | |
| virtual Timestamp | timestamp_s (const Index &timeindex)=0 |
| returns the time in seconds when was appended. Waits if the time_series is empty or if . | |
| virtual bool | wait_for_timeindex (const Index &timeindex, const double &max_duration_s=std::numeric_limits< double >::quiet_NaN())=0 |
| Wait until the defined time index is reached. If the input time is below the oldest time index that have been registered read an exception is return. | |
| virtual std::size_t | length ()=0 |
| returns the length of the time_series, i.e. if it is empty, otherwise . | |
| virtual std::size_t | max_length ()=0 |
| returns the maximum length of the time serie. More... | |
| virtual bool | has_changed_since_tag ()=0 |
| returns boolean indicating whether new elements have been appended since the last time the tag() function was called. | |
| virtual void | tag (const Index &timeindex)=0 |
| tags the current time_series, can later be used to check whether new elements have been added | |
| virtual Index | tagged_timeindex ()=0 |
| returns the index at which the time series has been tagged. Returns the newest timeindex if the time series has never been tagged. | |
| virtual void | append (const T &element)=0 |
| appends a new element to the time_series, e.g. we go from to (where element). if the time_series length is already equal to its max_length, then the oldest element is discarded, e.g. for a max_length = 10 we would go from to . | |
| virtual bool | is_empty ()=0 |
| returns true if no element has ever been appended to the time series. | |
Interface for time series.
A time_series implements which can safely be accessed from either multiple threads or multiple processes.
this object has the following properties:
|
pure virtual |
returns the maximum length of the time serie.


ARTEMISIA
Reviewed by Harvey Karten, Ph.D. Miramax Films/Zoe Director: Agnes Merlet Writer: Agnes Merlet Cast: Valentina Cervi, Michel Serrault, Miki Manojlovic, Yahn Tregoulet, Dominique Reymond
If you've ever visited the Offices Gallery in Florence, Italy, you doubtless saw the most dramatic painting in the hall, "Judith Beheading Holofemis," inspired by a biblical story. You don't have to look closely at it to guess that it's the work of a woman painter. Two women are standing over the bearded, defeated general Holofemis, one holding a sword at his neck, the other helping to hold him down to a bed. It almost looks like a rape scene initiated by the women, and perhaps its passionate painter wanted to give the work a double meaning. Any art student worth his or her palette would be impatient to know more about the painter, and any generalist with a broad education would be enthusiastic about hearing the story. If you were accompanied in the gallery by a decent guide with the appropriate background and an ardor for teaching his tourists and students, your curiosity would be at a fever pitch.
Luckily, there is now a film about the painter, and what an artist she was...in fact she was for all practical purposes the first woman painter in art history--just as Aphra Behn is today considered (for the same practical purposes) to be the first woman playwright. Why? Both Behn and the subject of the movie, Artemisia Gentileschi, were paid for what they did. Essentially, Artemisia was the first woman painter we know who was commissioned for her work. Agnes Merlet's "Artemisia" is a French production featuring in the starring roles an Italian, Valentina Cervi, whom you might have recognized for her role in "Portrait of a Lady;" a Frenchman, Michel Serrault, who should need no introduction and would be known even by the general audience who saw him in "The Birdcage;" and a Serb, Miki Manojlovic, who played a starring role in Emil Kusturica's "Underground." All speak French fluently in the film.
You don't have to be an artist or student of painting to know that there's an intimate connection between passion and creativity. Often the passion is of a sexual nature. We observe that the great Florentine painter of the Seventeenth Century, Agostino Tassi (Miki Manojlovic), was a frequent guest at bordellos, and modern audience will accept the fact that Artemisia (Valentina Cervi) is herself inspired in her own work by her intimate relationship with Agostino. But in the year 1610, the idea that a 17-year-old woman would have an interest in drawing the nude male body or would cavort with a man not her husband was anathema; positively sinful. Artemisia had such interests--not that this preoccupation prevented her from acceptance in the prestigious Academy in which her father, Orazio Gentileschi (Michel Serrault) and Agostino are members. She was a woman and painting was simply not considered the proper occupation for the fair sex, even if she were concerned only with landscapes.
"Artemesia," then, is based on the true story of the world's first recognized woman artist, written by its director, who was a student at the School of Fine Arts in Orleans. Using her imagination to fill in the blanks where the actual facts are a matter of conjecture, she displays for us a colorful account. There is one major disappointment: it exhibits the subject's works only superficially, preferring to concentrate on the romance between Artemisia and her teacher, Agostino, as if Ms. Merlet felt that the movie would thereby appeal to a larger audience. For better or worse (depending on the viewer's predilections), she avoids the gauzy look of the Merchant- Ivory films, portraying her characters with almost matter-of- fact realism. Perhaps Ms. Merlet wants to impress us with the truthfulness of the account, fearing that a gossamer look would have us believe the story was simply the product of an energetic imagination.
Merlet takes us first to a scene in Rome where an ensemble of painters are belting out a flurry of drawings and paintings of saints and angels, all inspired by a Papal commission. Orazio seems to have been the most successful of the group, and has taught her daughter Artemisia all that he knows. But now a younger man, Agostino, is gaining favor, particularly with the nobility, for exploiting innovations in the field, particularly with the use of light and shade to enhance the stories portrayed on the canvasses. While Artemisia is refused admission to the Academy purely on gender grounds, her father convinces the great Agostino to take her on as a pupil. Artemisia, who has shown a healthy desire to paint the nude male body and who has used a fisherman, Fulvio (Yahn Tregouet) as a model, is enthusiastic. When Artemisia and Agostino's relationship evolve to more than that of a student and pupil, her father is incensed and accuses the young man of rape. A trial ensues. Given the subordinate position of women throughout most of civilization, it is no wonder that this tribunal is one of the first in history ever to consider such a charge.
A film of this nature runs the risk of being considered a woman's movie and, in fact, at a recent critics's screening, over 3/4 of the audience were women. Given the feminist emphasis of the film, such an constituency is more likely than one composed of painters. To ghettoize this--or any other film--based on genre or accent would be to do it a disservice, and "Artemisia" deserves to be seen by film buffs of both genders. "Artemisia" is well-acted, with an imposing soundtrack of both baroque and contemporary music, which avoids pontification and any form of didactic narration. Merely a second feature of a gifted director, "Artemisia" will hopefully encourage Ms. Merlet to tackle similar films of prominent women who have made historic firsts but who even today are known only by others in similar fields of endeavor. Not Rated. Running time: 96 minutes. (C) Harvey Karten 1998
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Upgrade Guide
- Upgrading To 7.0 From 6.x
- Upgrading To 6.0 From 5.8
- Upgrading To 5.8 From 5.7
- Upgrading To 5.7 From 5.6
- Upgrading To 5.6 From 4.0
Upgrading To 7.0 From 6.x
Estimated Upgrade Time: 5-10 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
PHP 7.2.5 required
The new minimum PHP version is now 7.2.5.
Updating Dependencies
Update your laravel-zero/framework
dependency to ^7.0
in your composer.json
file.
Symfony 5 required
Laravel Zero 7 upgraded its underlying Symfony components to the 5.x series, which is now also the new minimum compatible version.
Update any symfony/*
dependencies to ^5.0
in your composer.json
file where necessary.
PHPUnit changes
Laravel Zero 7 now requires a minimum of Collision v4.1.0 which updated the PHPUnit adapter class name.
Remove the NunoMaduro\Collision\Adapters\Phpunit\Listener
class from your listeners
block in your phpunit.xml.dist
file.
If you are using the Logo component
The Logo component now depends on the Laminas Text package for Figlet generation.
Replace your zendframework/zend-text
dependency with "laminas/laminas-text": "^2.7"
in your composer.json
.
Configuration changes
The app.production
configuration value has been removed and replaced by an app.env
value in order to match Laravel.
Replace 'production' => false
with 'env' => 'development'
in your config/app.php
file.
Upgrading To 6.0 From 5.8
Estimated Upgrade Time: 2 - 5 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
Updating Dependencies
Update your laravel-zero/framework
dependency to ^6.0
in your composer.json
file.
If you are using Laravel's String & Array Helper
All str_
and array_
helpers have been moved to the new laravel/helpers
Composer package and removed from the framework. If desired, you may update all calls to these helpers to use the Illuminate\Support\Str
and Illuminate\Support\Arr
classes. Alternatively, you can add the new laravel/helpers
package to your application to continue using these helpers:
composer require laravel/helpers
Upgrading To 5.8 From 5.7
Estimated Upgrade Time: 2 - 5 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
Updating Dependencies
Update your laravel-zero/framework
dependency to 5.8.*
in your composer.json
file.
If you are using the menu method
The command::menu()
method got removed from the core of Laravel Zero to an optional component. Using the app:install
Artisan command you can install the menu
component again:
php <your-app-name> app:install menu
If you are using the dotenv addon
Update your vlucas/phpdotenv
dependency to ^3.0
in your composer.json
file.
Upgrading To 5.7 From 5.6
Estimated Upgrade Time: 2 - 5 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
Updating Dependencies
Update your laravel-zero/framework
dependency to 5.7.*
in your composer.json
file.
Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel Zero 5.7 support.
If you are using testing
Add the mockery/mockery
package with version ^1.0 to the require-dev section of your composer.json file.
Update the contents of the following files:
- tests/CreatesApplication.php:
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}
- tests/TestCase.php:
<?php
namespace Tests;
use LaravelZero\Framework\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
}
If you are using the build feature
The internal behavior of build feature has changed. We are now using humbug/box
to provide fast application bundling.
You should create a new file box.json
on the root folder of your application with the following content:
{
"chmod": "0755",
"directories": [
"app",
"bootstrap",
"config",
"vendor"
],
"files": [
"composer.json"
],
"exclude-composer-files": false,
"compression": "GZ",
"compactors": [
"Herrera\\Box\\Compactor\\Php",
"Herrera\\Box\\Compactor\\Json"
]
}
The option app:build with-dev
option no longer exists, and the config/app.php structure
parameter also no longer exists. In order to configure your build, you should configure the box.json
file. Check github.com/humbug/box/blob/master/doc/configuration.md for more details.
Upgrading To 5.6 From 4.0
Estimated Upgrade Time: 5 - 15 Minutes
We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application.
PHP
Laravel Zero 5.6 requires PHP 7.1.3 or higher.
Updating Dependencies
Update your laravel-zero/framework
dependency to 5.6.*
in your composer.json
file.
Of course, don't forget to examine any 3rd party packages consumed by your application and verify you are using the proper version for Laravel 5.6 support.
PHPUnit
You must update the phpunit/phpunit
dependency of your application to ~7.0
.
Bootstrap
You must create the bootstrap/cache folder to hold application services cache. The content
of this new folder should be a single .gitignore
with the following content:
*
!.gitignore
Please remove the files bootstrap/autoload.php
and bootstrap/init.php
. And create the file bootstrap/app.php
with the
contents of the file: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/bootstrap/app.php.
Application entry point
The file that you use to interact with your application should contain now the following content: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/application.
Configs
The commands.php
File
You should create a config/commands.php
with the contents of https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/config/commands.php. Please
customize the created file in order to determine the commands that should appear in your ListCommand.
The app.php
File
- App config
with-scheduler
is no longer available. You should useconfig/commands.php
for it. - App config
default-command
is no longer available. You should useconfig/commands.php
for it. - App config
commands-paths
is no longer available. You should useconfig/commands.php
for it. - App config
commands
is no longer available. You should useconfig/commands.php
for it.
The value version on config/app.php
should be updated to app('git.version')
.
The database.php
File
If you have the database component installed, please take into consideration the following updates:
- Database config
with-migrations
is no longer available. You should use config/commands.php for it. - Database config
with-seeds
is no longer available. You should use config/commands.php for it.
Tests
- The file
/tests/TestCase.php
should now contain the following contents: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/tests/TestCase.php. - The file
/tests/CreatesApplication.php
should now contain the following contents: https://github.com/laravel-zero/laravel-zero/blob/v5.6.6/tests/CreatesApplication.php.
On every tests, you should replace $this->app->call()
and $this->app->output()
by the Artisan facade. Example: Artisan::call
and Artisan::output
.
The variable $this->app
will now contain a base application class of Laravel, that is the container itself.


|
Groovy JDK |
| Method Summary | |
|---|---|
Date
|
clearTime()
Clears the time portion of this Date instance; useful utility where it makes sense to compare month/day/year only portions of a Date. |
String
|
format(String format)
Create a String representation of this date according to the given format pattern. |
String
|
format(String format, TimeZone tz)
Create a String representation of this date according to the given format pattern and timezone. |
int
|
getAt(int field)
Support the subscript operator for a Date. |
String
|
getDateString()
Return a string representation of the 'day' portion of this date according to the locale-specific DateFormat#SHORT default format. |
String
|
getDateTimeString()
Return a string representation of the date and time time portion of this Date instance, according to the locale-specific format used by DateFormat. |
String
|
getTimeString()
Return a string representation of the time portion of this date according to the locale-specific DateFormat#MEDIUM default format. |
Date
|
minus(int days)
Subtract a number of days from this date and returns the new date. |
int
|
minus(Date then)
Subtract another Date from this one and return the number of days of the difference. |
Date
|
next()
Increment a Date by one day. |
static Date
|
parse(String format, String input)
Parse a String into a Date instance using the given pattern. |
static Date
|
parseToStringDate(String dateToString)
Parse a String matching the pattern EEE MMM dd HH:mm:ss zzz yyyy containing US-locale-constants only (e.g. |
Date
|
plus(int days)
Add a number of days to this date and returns the new date. |
Date
|
previous()
Decrement a Date by one day. |
void
|
putAt(int field, int value)
Support the subscript operator for mutating a Date. |
void
|
set(Map updates)
Support mutating a Date with a Map. |
Calendar
|
toCalendar()
Convert a Date to a Calendar. |
Timestamp
|
toTimestamp()
Return a java.sql.Timestamp given a java.util.Date. |
Date
|
updated(Map updates)
Support creating a new Date having similar properties to an existing Date (which remains unaltered) but with some fields updated according to a Map of changes. |
| Method Detail |
|---|
public Date clearTime()
public String format(String format)
Create a String representation of this date according to the given format pattern.
For example, if the system timezone is GMT,
new Date(0).format('MM/dd/yy')
would return the string
"01/01/70"
. See documentation for SimpleDateFormat
for format pattern use.
Note that a new DateFormat instance is created for every invocation of this method (for thread safety).
format
- the format pattern to use according to SimpleDateFormat.public String format(String format, TimeZone tz)
Create a String representation of this date according to the given format pattern and timezone.
For example:
def d = new Date(0)
def tz = TimeZone.getTimeZone('GMT')
println d.format('dd/MMM/yyyy', tz)
would return the string
"01/Jan/1970"
. See documentation for SimpleDateFormat
for format pattern use.
Note that a new DateFormat instance is created for every invocation of this method (for thread safety).
format
- the format pattern to use according to SimpleDateFormat.tz
- the TimeZone to use.public int getAt(int field)
field
- a Calendar field, e.g. MONTH.public String getDateString()
Return a string representation of the 'day' portion of this date
according to the locale-specific DateFormat#SHORT default format.
For an "en_UK" system locale, this would be dd/MM/yy
.
Note that a new DateFormat instance is created for every invocation of this method (for thread safety).
public String getDateTimeString()
Return a string representation of the date and time time portion of this Date instance, according to the locale-specific format used by DateFormat. This method uses the DateFormat#SHORT preset for the day portion and DateFormat#MEDIUM for the time portion of the output string.
Note that a new DateFormat instance is created for every invocation of this method (for thread safety).
public String getTimeString()
Return a string representation of the time portion of this date
according to the locale-specific DateFormat#MEDIUM default format.
For an "en_UK" system locale, this would be HH:MM:ss
.
Note that a new DateFormat instance is created for every invocation of this method (for thread safety).
public Date minus(int days)
days
- the number of days to subtract.public int minus(Date then)
Date self = Date then + (Date self - Date then)
IOW, if self is before then the result is a negative value.
then
- another Date.public Date next()
public static Date parse(String format, String input)
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
format
- pattern used to parse the input string..input
- String to be parsed to create the date instance.public static Date parseToStringDate(String dateToString)
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
dateToString
- String to be parsed to create the date instance. Must match the pattern EEE MMM dd HH:mm:ss zzz yyyy with US-locale symbols.public Date plus(int days)
days
- the number of days to increase.public Date previous()
public void putAt(int field, int value)
field
- A Calendar field, e.g. MONTH.value
- The value for the given field, e.g. FEBRUARY.public void set(Map updates)
Example usage:
import static java.util.Calendar.YEAR def date = new Date() def nextYear = date[YEAR] + 1 date.set(year: nextYear) println date
updates
- A Map of Calendar keys and values.public Calendar toCalendar()
public Timestamp toTimestamp()
public Date updated(Map updates)
Example usage:
import static java.util.Calendar.YEAR def today = new Date() def nextYear = today[YEAR] + 1 def oneYearFromNow = today.updated(year: nextYear) println today println oneYearFromNow
updates
- A Map of Calendar keys and values.
|
Groovy JDK |


Hey so for a GUI I'm designing I came up with an idea of having the main window then sort of a container panel which would hold all of the other widgets. I'm using a static window for the panels and I'm not at all happy with how it's turning out. It has a gray background color even when when I set the window style to WS_EX_TRANSPARENT and I set the background color to Transparent in WM_PAINT using SetBkMode(hdc, TRANSPARENT). Basically what I want to be able to do is have a solid window as the frame, transparent window as the panels, and solid windows as the widgets.
Here's a basic picture of what I am trying to accomplish:
I've searched around and I can't seem to find anything on how to properly do this. Reason that I want to do this is because I feel as though this is a lot more structured/better organized and will be able to be easily expandable upon. Each window component has its own class and within their class they contain a vector of the other components they contain. So my Frame class has a vector of all the panels contains and the panel class has a vector of all the widgets it contains.
Perhaps if you handle that message and return a null brush it will make the static control transparent...
return (LONG_PTR)GetStockObject(NULL_BRUSH);
My other idea was to make the panel a popup layered window, but apparently layered child windows are only supported in Windows 8.
Come to think of it, using a window for the panel seems kind of superfluous. It is already a control container. So in place of a window you could get by with a RECT to define the area in which the contained controls are aligned.
Come to think of it, using a window for the panel seems kind of superfluous. It is already a control container. So in place of a window you could get by with a RECT to define the area in which the contained controls are aligned.
That's actually a great idea. Not sure how that slipped past me. Nonetheless, thank you both for the help!