package path
Type Members
-
class
FreeSpec
extends FreeSpecLike
A sister class to
org.scalatest.FreeSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.A sister class to
org.scalatest.FreeSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.Class
path.FreeSpec
behaves similarly to classorg.scalatest.FreeSpec
, except that tests are isolated based on their path. The purpose ofpath.FreeSpec
is to facilitate writing specification-style tests for mutable objects in a clear, boilerpate-free way. To test mutable objects, you need to mutate them. Using a path class, you can make a statement in text, then implement that statement in code (including mutating state), and nest and combine these test/code pairs in any way you wish. Each test will only see the side effects of code that is in blocks that enclose the test. Here's an example:import org.scalatest.path import org.scalatest.matchers.Matchers import scala.collection.mutable.ListBuffer class ExampleSpec extends path.FreeSpec with Matchers { "A ListBuffer" - { val buf = ListBuffer.empty[Int] // This implements "A ListBuffer" "should be empty when created" in { // This test sees: // val buf = ListBuffer.empty[Int] // So buf is: ListBuffer() buf should be ('empty) } "when 1 is appended" - { buf += 1 // This implements "when 1 is appended", etc... "should contain 1" in { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // So buf is: ListBuffer(1) buf.remove(0) should equal (1) buf should be ('empty) } "when 2 is appended" - { buf += 2 "should contain 1 and 2" in { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // So buf is: ListBuffer(1, 2) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf should be ('empty) } "when 2 is removed" - { buf -= 2 "should contain only 1 again" in { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // buf -= 2 // So buf is: ListBuffer(1) buf.remove(0) should equal (1) buf should be ('empty) } } "when 3 is appended" - { buf += 3 "should contain 1, 2, and 3" in { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // buf += 3 // So buf is: ListBuffer(1, 2, 3) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3) buf should be ('empty) } } } "when 88 is appended" - { buf += 88 "should contain 1 and 88" in { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 88 // So buf is: ListBuffer(1, 88) buf.remove(0) should equal (1) buf.remove(0) should equal (88) buf should be ('empty) } } } "should have size 0 when created" in { // This test sees: // val buf = ListBuffer.empty[Int] // So buf is: ListBuffer() buf should have size 0 } } }
Note that the above class is organized by writing a bit of specification text that opens a new block followed by, at the top of the new block, some code that "implements" or "performs" what is described in the text. This is repeated as the mutable object (here, a
ListBuffer
), is prepared for the enclosed tests. For example:"A ListBuffer" - { val buf = ListBuffer.empty[Int]
Or:
"when 2 is appended" - { buf += 2
Note also that although each test mutates the
ListBuffer
, none of the other tests observe those side effects:"should contain 1" in { buf.remove(0) should equal (1) // ... } "when 2 is appended" - { buf += 2 "should contain 1 and 2" in { // This test does not see the buf.remove(0) from the previous test, // so the first element in the ListBuffer is again 1 buf.remove(0) should equal (1) buf.remove(0) should equal (2)
This kind of isolation of tests from each other is a consequence of running each test in its own instance of the test class, and can also be achieved by simply mixing
OneInstancePerTest
into a regularorg.scalatest.FreeSpec
. However,path.FreeSpec
takes isolation one step further: a test in apath.FreeSpec
does not observe side effects performed outside tests in earlier blocks that do not enclose it. Here's an example:"when 2 is removed" - { buf -= 2 // ... } "when 3 is appended" - { buf += 3 "should contain 1, 2, and 3" in { // This test does not see the buf -= 2 from the earlier "when 2 is removed" block, // because that block does not enclose this test, so the second element in the // ListBuffer is still 2 buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3)
Running the full
ExampleSpec
, shown above, in the Scala interpeter would give you:scala> import org.scalatest._ import org.scalatest._ scala> run(new ExampleSpec) ExampleSpec: A ListBuffer - should be empty when created when 1 is appended - should contain 1 when 2 is appended - should contain 1 and 2 when 2 is removed - should contain only 1 again when 3 is appended - should contain 1, 2, and 3 when 88 is appended - should contain 1 and 88 - should have size 0 when created
Note: class
path.FreeSpec
's approach to isolation was inspired in part by the specsy framework, written by Esko Luontola.Shared fixtures
A test fixture is objects or other artifacts (such as files, sockets, database connections, etc.) used by tests to do their work. If a fixture is used by only one test, then the definitions of the fixture objects can be local to the method. If multiple tests need to share an immutable fixture, you can simply assign them to instance variables. If multiple tests need to share mutable fixture objects or
var
s, there's one and only one way to do it in apath.FreeSpec
: place the mutable objects lexically before the test. Any mutations needed by the test must be placed lexically before and/or after the test. As used here, "Lexically before" means that the code needs to be executed during construction of that test's instance of the test class to reach the test (or put another way, the code is along the "path to the test.") "Lexically after" means that the code needs to be executed to exit the constructor after the test has been executed.The reason lexical placement is the one and only one way to share fixtures in a
path.FreeSpec
is because all of its lifecycle methods are overridden and declaredfinal
. Thus you can't mix inBeforeAndAfter
orBeforeAndAfterEach
, because both overriderunTest
, which isfinal
in apath.FreeSpec
. You also can't overridewithFixture
, becausepath.FreeSpec
extendsSuite
notTestSuite
, wherewithFixture
is defined. In short:In a path.FreeSpec
, if you need some code to execute before a test, place that code lexically before the test. If you need some code to execute after a test, place that code lexically after the test.The reason the life cycle methods are final, by the way, is to prevent users from attempting to combine a
path.FreeSpec
's approach to isolation with other ways ScalaTest provides to share fixtures or execute tests, because doing so could make the resulting test code hard to reason about. Apath.FreeSpec
's execution model is a bit magical, but because it executes in one and only one way, users should be able to reason about the code. To help you visualize how apath.FreeSpec
is executed, consider the following variant ofExampleSpec
that includes print statements:import org.scalatest.path import org.scalatest.matchers.Matchers import scala.collection.mutable.ListBuffer class ExampleSpec extends path.FreeSpec with Matchers { println("Start of: ExampleSpec") "A ListBuffer" - { println("Start of: A ListBuffer") val buf = ListBuffer.empty[Int] "should be empty when created" in { println("In test: should be empty when created; buf is: " + buf) buf should be ('empty) } "when 1 is appended" - { println("Start of: when 1 is appended") buf += 1 "should contain 1" in { println("In test: should contain 1; buf is: " + buf) buf.remove(0) should equal (1) buf should be ('empty) } "when 2 is appended" - { println("Start of: when 2 is appended") buf += 2 "should contain 1 and 2" in { println("In test: should contain 1 and 2; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf should be ('empty) } "when 2 is removed" - { println("Start of: when 2 is removed") buf -= 2 "should contain only 1 again" in { println("In test: should contain only 1 again; buf is: " + buf) buf.remove(0) should equal (1) buf should be ('empty) } println("End of: when 2 is removed") } "when 3 is appended" - { println("Start of: when 3 is appended") buf += 3 "should contain 1, 2, and 3" in { println("In test: should contain 1, 2, and 3; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3) buf should be ('empty) } println("End of: when 3 is appended") } println("End of: when 2 is appended") } "when 88 is appended" - { println("Start of: when 88 is appended") buf += 88 "should contain 1 and 88" in { println("In test: should contain 1 and 88; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (88) buf should be ('empty) } println("End of: when 88 is appended") } println("End of: when 1 is appended") } "should have size 0 when created" in { println("In test: should have size 0 when created; buf is: " + buf) buf should have size 0 } println("End of: A ListBuffer") } println("End of: ExampleSpec") println() }
Running the above version of
ExampleSpec
in the Scala interpreter will give you output similar to:scala> import org.scalatest._ import org.scalatest._ scala> run(new ExampleSpec) ExampleSpec: Start of: ExampleSpec Start of: A ListBuffer In test: should be empty when created; buf is: ListBuffer() End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended In test: should contain 1; buf is: ListBuffer(1) ExampleSpec: End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended In test: should contain 1 and 2; buf is: ListBuffer(1, 2) End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended Start of: when 2 is removed In test: should contain only 1 again; buf is: ListBuffer(1) End of: when 2 is removed End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended Start of: when 3 is appended In test: should contain 1, 2, and 3; buf is: ListBuffer(1, 2, 3) End of: when 3 is appended End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 88 is appended In test: should contain 1 and 88; buf is: ListBuffer(1, 88) End of: when 88 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer In test: should have size 0 when created; buf is: ListBuffer() End of: A ListBuffer End of: ExampleSpec A ListBuffer - should be empty when created when 1 is appended - should contain 1 when 2 is appended - should contain 1 and 2 when 2 is removed - should contain only 1 again when 3 is appended - should contain 1, 2, and 3 when 88 is appended - should contain 1 and 88 - should have size 0 when created
Note that each test is executed in order of appearance in the
path.FreeSpec
, and that only thoseprintln
statements residing in blocks that enclose the test being run are executed. Anyprintln
statements in blocks that do not form the "path" to a test are not executed in the instance of the class that executes that test.How it executes
To provide its special brand of test isolation,
path.FreeSpec
executes quite differently from its sister class inorg.scalatest
. Anorg.scalatest.FreeSpec
registers tests during construction and executes them whenrun
is invoked. Anorg.scalatest.path.FreeSpec
, by contrast, runs each test in its own instance while that instance is being constructed. During construction, it registers not the tests to run, but the results of running those tests. Whenrun
is invoked on apath.FreeSpec
, it reports the registered results and does not run the tests again. Ifrun
is invoked a second or third time, in fact, apath.FreeSpec
will each time report the same results registered during construction. If you want to run the tests of apath.FreeSpec
anew, you'll need to create a new instance and invokerun
on that.A
path.FreeSpec
will create one instance for each "leaf" node it contains. The main kind of leaf node is a test, such as:// One instance will be created for each test "should be empty when created" in { buf should be ('empty) }
However, an empty scope (a scope that contains no tests or nested scopes) is also a leaf node:
// One instance will be created for each empty scope "when 99 is added" - { // A scope is "empty" and therefore a leaf node if it has no // tests or nested scopes, though it may have other code (which // will be executed in the instance created for that leaf node) buf += 99 }
The tests will be executed sequentially, in the order of appearance. The first test (or empty scope, if that is first) will be executed when a class that mixes in
path.FreeSpec
is instantiated. Only the first test will be executed during this initial instance, and of course, only the path to that test. Then, the first time the client uses the initial instance (by invoking one ofrun
,expectedTestsCount
,tags
, ortestNames
on the instance), the initial instance will, before doing anything else, ensure that any remaining tests are executed, each in its own instance.To ensure that the correct path is taken in each instance, and to register its test results, the initial
path.FreeSpec
instance must communicate with the other instances it creates for running any subsequent leaf nodes. It does so by setting a thread-local variable prior to creating each instance (a technique suggested by Esko Luontola). Each instance ofpath.FreeSpec
checks the thread-local variable. If the thread-local is not set, it knows it is an initial instance and therefore executes every block it encounters until it discovers, and executes the first test (or empty scope, if that's the first leaf node). It then discovers, but does not execute the next leaf node, or discovers there are no other leaf nodes remaining to execute. It communicates the path to the next leaf node, if any, and the result of running the test it did execute, if any, back to the initial instance. The initial instance repeats this process until all leaf nodes have been executed and all test results registered.Ignored tests
You mark a test as ignored in an
org.scalatest.path.FreeSpec
in the same manner as in anorg.scalatest.FreeSpec
. Please see the Ignored tests section in its documentation for more information.Note that a separate instance will be created for an ignored test, and the path to the ignored test will be executed in that instance, but the test function itself will not be executed. Instead, a
TestIgnored
event will be fired.Informers
You output information using
Informer
s in anorg.scalatest.path.FreeSpec
in the same manner as in anorg.scalatest.FreeSpec
. Please see the Informers section in its documentation for more information.Pending tests
You mark a test as pending in an
org.scalatest.path.FreeSpec
in the same manner as in anorg.scalatest.FreeSpec
. Please see the Pending tests section in its documentation for more information.Note that a separate instance will be created for a pending test, and the path to the ignored test will be executed in that instance, as well as the test function (up until it completes abruptly with a
TestPendingException
).Tagging tests
You can place tests into groups by tagging them in an
org.scalatest.path.FreeSpec
in the same manner as in anorg.scalatest.FreeSpec
. Please see the Tagging tests section in its documentation for more information.Note that one difference between this class and its sister class
org.scalatest.FreeSpec
is that because tests are executed at construction time, rather than each time run is invoked, anorg.scalatest.path.FreeSpec
will always execute all non-ignored tests. Whenrun
is invoked on apath.FreeSpec
, if some tests are excluded based on tags, the registered results of running those tests will not be reported. (But those tests will have already run and the results registered.) By contrast, because anorg.scalatest.FreeSpec
only executes tests afterrun
has been called, and at that time the tags to include and exclude are known, only tests selected by the tags will be executed.In short, in an
org.scalatest.FreeSpec
, tests not selected by the tags to include and exclude specified for the run (via theFilter
passed torun
) will not be executed. In anorg.scalatest.path.FreeSpec
, by contrast, all non-ignored tests will be executed, each during the construction of its own instance, and tests not selected by the tags to include and exclude specified for a run will not be reported. (One upshot of this is that if you have tests that you want to tag as being slow so you can sometimes exclude them during a run, you probably don't want to put them in apath.FreeSpec
. Because in apath.Freespec
the slow tests will be run regardless, with only their registered results not being reported if you exclude slow tests during a run.)Shared tests
You can factor out shared tests in an
org.scalatest.path.FreeSpec
in the same manner as in anorg.scalatest.FreeSpec
. Please see the Shared tests section in its documentation for more information.Nested suites
Nested suites are not allowed in a
path.FreeSpec
. Because apath.FreeSpec
executes tests eagerly at construction time, registering the results of those test runs and reporting them later whenrun
is invoked, the order of nested suites versus test runs would be different in aorg.scalatest.path.FreeSpec
than in anorg.scalatest.FreeSpec
. Inorg.scalatest.FreeSpec
's implementation ofrun
, nested suites are executed then tests are executed. Aorg.scalatest.path.FreeSpec
with nested suites would execute these in the opposite order: first tests then nested suites. To help makepath.FreeSpec
code easier to reason about by giving readers of one less difference to think about, nested suites are not allowed. If you want to add nested suites to apath.FreeSpec
, you can instead wrap them all in aSuites
object. They will be executed in the order of appearance (unless a Distributor is passed, in which case they will execute in parallel).Durations
Many ScalaTest events include a duration that indicates how long the event being reported took to execute. For example, a
TestSucceeded
event provides a duration indicating how long it took for that test to execute. ASuiteCompleted
event provides a duration indicating how long it took for that entire suite of tests to execute.In the test completion events fired by a
path.FreeSpec
(TestSucceeded
,TestFailed
, orTestPending
), the durations reported refer to the time it took for the tests to run. This time is registered with the test results and reported along with the test results each timerun
is invoked. By contrast, the suite completion events fired for apath.FreeSpec
represent the amount of time it took to report the registered results. (These events are not fired bypath.FreeSpec
, but instead by the entity that invokesrun
on thepath.FreeSpec
.) As a result, the total time for running the tests of apath.FreeSpec
, calculated by summing the durations of all the individual test completion events, may be greater than the duration reported for executing the entire suite. -
trait
FreeSpecLike
extends Suite with OneInstancePerTest with Informing with Notifying with Alerting with Documenting
Implementation trait for class
path.FreeSpec
, which is a sister class toorg.scalatest.FreeSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.Implementation trait for class
path.FreeSpec
, which is a sister class toorg.scalatest.FreeSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.path.FreeSpec
is a class, not a trait, to minimize compile time given there is a slight compiler overhead to mixing in traits compared to extending classes. If you need to mix the behavior ofpath.FreeSpec
into some other class, you can use this trait instead, because classpath.FreeSpec
does nothing more than extend this trait and add a nicetoString
implementation.See the documentation of the class for a detailed overview of
path.FreeSpec
. -
class
FunSpec
extends FunSpecLike
A sister class to
org.scalatest.FunSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.A sister class to
org.scalatest.FunSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.Class
path.FunSpec
behaves similarly to classorg.scalatest.FunSpec
, except that tests are isolated based on their path. The purpose ofpath.FunSpec
is to facilitate writing specification-style tests for mutable objects in a clear, boilerpate-free way. To test mutable objects, you need to mutate them. Using a path class, you can make a statement in text, then implement that statement in code (including mutating state), and nest and combine these test/code pairs in any way you wish. Each test will only see the side effects of code that is in blocks that enclose the test. Here's an example:import org.scalatest.path import org.scalatest.matchers.Matchers import scala.collection.mutable.ListBuffer class ExampleSpec extends path.FunSpec with Matchers { describe("A ListBuffer") { val buf = ListBuffer.empty[Int] // This implements "A ListBuffer" it("should be empty when created") { // This test sees: // val buf = ListBuffer.empty[Int] // So buf is: ListBuffer() buf should be ('empty) } describe("when 1 is appended") { buf += 1 // This implements "when 1 is appended", etc... it("should contain 1") { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // So buf is: ListBuffer(1) buf.remove(0) should equal (1) buf should be ('empty) } describe("when 2 is appended") { buf += 2 it("should contain 1 and 2") { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // So buf is: ListBuffer(1, 2) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf should be ('empty) } describe("when 2 is removed") { buf -= 2 it("should contain only 1 again") { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // buf -= 2 // So buf is: ListBuffer(1) buf.remove(0) should equal (1) buf should be ('empty) } } describe("when 3 is appended") { buf += 3 it("should contain 1, 2, and 3") { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 2 // buf += 3 // So buf is: ListBuffer(1, 2, 3) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3) buf should be ('empty) } } } describe("when 88 is appended") { buf += 88 it("should contain 1 and 88") { // This test sees: // val buf = ListBuffer.empty[Int] // buf += 1 // buf += 88 // So buf is: ListBuffer(1, 88) buf.remove(0) should equal (1) buf.remove(0) should equal (88) buf should be ('empty) } } } it("should have size 0 when created") { // This test sees: // val buf = ListBuffer.empty[Int] // So buf is: ListBuffer() buf should have size 0 } } }
Note that the above class is organized by writing a bit of specification text that opens a new block followed by, at the top of the new block, some code that "implements" or "performs" what is described in the text. This is repeated as the mutable object (here, a
ListBuffer
), is prepared for the enclosed tests. For example:describe("A ListBuffer") { val buf = ListBuffer.empty[Int]
Or:
describe("when 2 is appended") { buf += 2
Note also that although each test mutates the
ListBuffer
, none of the other tests observe those side effects:it("should contain 1") { buf.remove(0) should equal (1) // ... } describe("when 2 is appended") { buf += 2 it("should contain 1 and 2") { // This test does not see the buf.remove(0) from the previous test, // so the first element in the ListBuffer is again 1 buf.remove(0) should equal (1) buf.remove(0) should equal (2)
This kind of isolation of tests from each other is a consequence of running each test in its own instance of the test class, and can also be achieved by simply mixing
OneInstancePerTest
into a regularorg.scalatest.FunSpec
. However,path.FunSpec
takes isolation one step further: a test in apath.FunSpec
does not observe side effects performed outside tests in earlier blocks that do not enclose it. Here's an example:describe("when 2 is removed") { buf -= 2 // ... } describe("when 3 is appended") { buf += 3 it("should contain 1, 2, and 3") { // This test does not see the buf -= 2 from the earlier "when 2 is removed" block, // because that block does not enclose this test, so the second element in the // ListBuffer is still 2 buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3)
Running the full
ExampleSpec
, shown above, in the Scala interpeter would give you:scala> import org.scalatest._ import org.scalatest._ scala> run(new ExampleSpec) ExampleSpec: A ListBuffer - should be empty when created when 1 is appended - should contain 1 when 2 is appended - should contain 1 and 2 when 2 is removed - should contain only 1 again when 3 is appended - should contain 1, 2, and 3 when 88 is appended - should contain 1 and 88 - should have size 0 when created
Note: class
path.FunSpec
's approach to isolation was inspired in part by the specsy framework, written by Esko Luontola.Shared fixtures
A test fixture is objects or other artifacts (such as files, sockets, database connections, etc.) used by tests to do their work. If a fixture is used by only one test, then the definitions of the fixture objects can be local to the method. If multiple tests need to share an immutable fixture, you can simply assign them to instance variables. If multiple tests need to share mutable fixture objects or
var
s, there's one and only one way to do it in apath.FunSpec
: place the mutable objects lexically before the test. Any mutations needed by the test must be placed lexically before and/or after the test. As used here, "Lexically before" means that the code needs to be executed during construction of that test's instance of the test class to reach the test (or put another way, the code is along the "path to the test.") "Lexically after" means that the code needs to be executed to exit the constructor after the test has been executed.The reason lexical placement is the one and only one way to share fixtures in a
path.FunSpec
is because all of its lifecycle methods are overridden and declaredfinal
. Thus you can't mix inBeforeAndAfter
orBeforeAndAfterEach
, because both overriderunTest
, which isfinal
in apath.FunSpec
. You also can't overridewithFixture
, becausepath.FreeSpec
extendsSuite
notTestSuite
, wherewithFixture
is defined. In short:In a path.FunSpec
, if you need some code to execute before a test, place that code lexically before the test. If you need some code to execute after a test, place that code lexically after the test.The reason the life cycle methods are final, by the way, is to prevent users from attempting to combine a
path.FunSpec
's approach to isolation with other ways ScalaTest provides to share fixtures or execute tests, because doing so could make the resulting test code hard to reason about. Apath.FunSpec
's execution model is a bit magical, but because it executes in one and only one way, users should be able to reason about the code. To help you visualize how apath.FunSpec
is executed, consider the following variant ofExampleSpec
that includes print statements:import org.scalatest.path import org.scalatest.matchers.Matchers import scala.collection.mutable.ListBuffer class ExampleSpec extends path.FunSpec with Matchers { println("Start of: ExampleSpec") describe("A ListBuffer") { println("Start of: A ListBuffer") val buf = ListBuffer.empty[Int] it("should be empty when created") { println("In test: should be empty when created; buf is: " + buf) buf should be ('empty) } describe("when 1 is appended") { println("Start of: when 1 is appended") buf += 1 it("should contain 1") { println("In test: should contain 1; buf is: " + buf) buf.remove(0) should equal (1) buf should be ('empty) } describe("when 2 is appended") { println("Start of: when 2 is appended") buf += 2 it("should contain 1 and 2") { println("In test: should contain 1 and 2; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf should be ('empty) } describe("when 2 is removed") { println("Start of: when 2 is removed") buf -= 2 it("should contain only 1 again") { println("In test: should contain only 1 again; buf is: " + buf) buf.remove(0) should equal (1) buf should be ('empty) } println("End of: when 2 is removed") } describe("when 3 is appended") { println("Start of: when 3 is appended") buf += 3 it("should contain 1, 2, and 3") { println("In test: should contain 1, 2, and 3; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (2) buf.remove(0) should equal (3) buf should be ('empty) } println("End of: when 3 is appended") } println("End of: when 2 is appended") } describe("when 88 is appended") { println("Start of: when 88 is appended") buf += 88 it("should contain 1 and 88") { println("In test: should contain 1 and 88; buf is: " + buf) buf.remove(0) should equal (1) buf.remove(0) should equal (88) buf should be ('empty) } println("End of: when 88 is appended") } println("End of: when 1 is appended") } it("should have size 0 when created") { println("In test: should have size 0 when created; buf is: " + buf) buf should have size 0 } println("End of: A ListBuffer") } println("End of: ExampleSpec") println() }
Running the above version of
ExampleSpec
in the Scala interpreter will give you output similar to:scala> import org.scalatest._ import org.scalatest._ scala> run(new ExampleSpec) ExampleSpec: Start of: ExampleSpec Start of: A ListBuffer In test: should be empty when created; buf is: ListBuffer() End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended In test: should contain 1; buf is: ListBuffer(1) ExampleSpec: End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended In test: should contain 1 and 2; buf is: ListBuffer(1, 2) End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended Start of: when 2 is removed In test: should contain only 1 again; buf is: ListBuffer(1) End of: when 2 is removed End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 2 is appended Start of: when 3 is appended In test: should contain 1, 2, and 3; buf is: ListBuffer(1, 2, 3) End of: when 3 is appended End of: when 2 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer Start of: when 1 is appended Start of: when 88 is appended In test: should contain 1 and 88; buf is: ListBuffer(1, 88) End of: when 88 is appended End of: when 1 is appended End of: A ListBuffer End of: ExampleSpec Start of: ExampleSpec Start of: A ListBuffer In test: should have size 0 when created; buf is: ListBuffer() End of: A ListBuffer End of: ExampleSpec A ListBuffer - should be empty when created when 1 is appended - should contain 1 when 2 is appended - should contain 1 and 2 when 2 is removed - should contain only 1 again when 3 is appended - should contain 1, 2, and 3 when 88 is appended - should contain 1 and 88 - should have size 0 when created
Note that each test is executed in order of appearance in the
path.FunSpec
, and that only thoseprintln
statements residing in blocks that enclose the test being run are executed. Anyprintln
statements in blocks that do not form the "path" to a test are not executed in the instance of the class that executes that test.How it executes
To provide its special brand of test isolation,
path.FunSpec
executes quite differently from its sister class inorg.scalatest
. Anorg.scalatest.FunSpec
registers tests during construction and executes them whenrun
is invoked. Anorg.scalatest.path.FunSpec
, by contrast, runs each test in its own instance while that instance is being constructed. During construction, it registers not the tests to run, but the results of running those tests. Whenrun
is invoked on apath.FunSpec
, it reports the registered results and does not run the tests again. Ifrun
is invoked a second or third time, in fact, apath.FunSpec
will each time report the same results registered during construction. If you want to run the tests of apath.FunSpec
anew, you'll need to create a new instance and invokerun
on that.A
path.FunSpec
will create one instance for each "leaf" node it contains. The main kind of leaf node is a test, such as:// One instance will be created for each test it("should be empty when created") { buf should be ('empty) }
However, an empty scope (a scope that contains no tests or nested scopes) is also a leaf node:
// One instance will be created for each empty scope describe("when 99 is added") { // A scope is "empty" and therefore a leaf node if it has no // tests or nested scopes, though it may have other code (which // will be executed in the instance created for that leaf node) buf += 99 }
The tests will be executed sequentially, in the order of appearance. The first test (or empty scope, if that is first) will be executed when a class that mixes in
path.FunSpec
is instantiated. Only the first test will be executed during this initial instance, and of course, only the path to that test. Then, the first time the client uses the initial instance (by invoking one ofrun
,expectedTestsCount
,tags
, ortestNames
on the instance), the initial instance will, before doing anything else, ensure that any remaining tests are executed, each in its own instance.To ensure that the correct path is taken in each instance, and to register its test results, the initial
path.FunSpec
instance must communicate with the other instances it creates for running any subsequent leaf nodes. It does so by setting a thread-local variable prior to creating each instance (a technique suggested by Esko Luontola). Each instance ofpath.FunSpec
checks the thread-local variable. If the thread-local is not set, it knows it is an initial instance and therefore executes every block it encounters until it discovers, and executes the first test (or empty scope, if that's the first leaf node). It then discovers, but does not execute the next leaf node, or discovers there are no other leaf nodes remaining to execute. It communicates the path to the next leaf node, if any, and the result of running the test it did execute, if any, back to the initial instance. The initial instance repeats this process until all leaf nodes have been executed and all test results registered.Ignored tests
You mark a test as ignored in an
org.scalatest.path.FunSpec
in the same manner as in anorg.scalatest.FunSpec
. Please see the Ignored tests section in its documentation for more information.Note that a separate instance will be created for an ignored test, and the path to the ignored test will be executed in that instance, but the test function itself will not be executed. Instead, a
TestIgnored
event will be fired.Informers
You output information using
Informer
s in anorg.scalatest.path.FunSpec
in the same manner as in anorg.scalatest.FunSpec
. Please see the Informers section in its documentation for more information.Pending tests
You mark a test as pending in an
org.scalatest.path.FunSpec
in the same manner as in anorg.scalatest.FunSpec
. Please see the Pending tests section in its documentation for more information.Note that a separate instance will be created for a pending test, and the path to the ignored test will be executed in that instance, as well as the test function (up until it completes abruptly with a
TestPendingException
).Tagging tests
You can place tests into groups by tagging them in an
org.scalatest.path.FunSpec
in the same manner as in anorg.scalatest.FunSpec
. Please see the Tagging tests section in its documentation for more information.Note that one difference between this class and its sister class
org.scalatest.FunSpec
is that because tests are executed at construction time, rather than each time run is invoked, anorg.scalatest.path.FunSpec
will always execute all non-ignored tests. Whenrun
is invoked on apath.FunSpec
, if some tests are excluded based on tags, the registered results of running those tests will not be reported. (But those tests will have already run and the results registered.) By contrast, because anorg.scalatest.FunSpec
only executes tests afterrun
has been called, and at that time the tags to include and exclude are known, only tests selected by the tags will be executed.In short, in an
org.scalatest.FunSpec
, tests not selected by the tags to include and exclude specified for the run (via theFilter
passed torun
) will not be executed. In anorg.scalatest.path.FunSpec
, by contrast, all non-ignored tests will be executed, each during the construction of its own instance, and tests not selected by the tags to include and exclude specified for a run will not be reported. (One upshot of this is that if you have tests that you want to tag as being slow so you can sometimes exclude them during a run, you probably don't want to put them in apath.FunSpec
. Because in apath.Freespec
the slow tests will be run regardless, with only their registered results not being reported if you exclude slow tests during a run.)Shared tests
You can factor out shared tests in an
org.scalatest.path.FunSpec
in the same manner as in anorg.scalatest.FunSpec
. Please see the Shared tests section in its documentation for more information.Nested suites
Nested suites are not allowed in a
path.FunSpec
. Because apath.FunSpec
executes tests eagerly at construction time, registering the results of those test runs and reporting them later whenrun
is invoked, the order of nested suites versus test runs would be different in aorg.scalatest.path.FunSpec
than in anorg.scalatest.FunSpec
. Inorg.scalatest.FunSpec
's implementation ofrun
, nested suites are executed then tests are executed. Aorg.scalatest.path.FunSpec
with nested suites would execute these in the opposite order: first tests then nested suites. To help makepath.FunSpec
code easier to reason about by giving readers of one less difference to think about, nested suites are not allowed. If you want to add nested suites to apath.FunSpec
, you can instead wrap them all in aSuites
object. They will be executed in the order of appearance (unless a Distributor is passed, in which case they will execute in parallel).Durations
Many ScalaTest events include a duration that indicates how long the event being reported took to execute. For example, a
TestSucceeded
event provides a duration indicating how long it took for that test to execute. ASuiteCompleted
event provides a duration indicating how long it took for that entire suite of tests to execute.In the test completion events fired by a
path.FunSpec
(TestSucceeded
,TestFailed
, orTestPending
), the durations reported refer to the time it took for the tests to run. This time is registered with the test results and reported along with the test results each timerun
is invoked. By contrast, the suite completion events fired for apath.FunSpec
represent the amount of time it took to report the registered results. (These events are not fired bypath.FunSpec
, but instead by the entity that invokesrun
on thepath.FunSpec
.) As a result, the total time for running the tests of apath.FunSpec
, calculated by summing the durations of all the individual test completion events, may be greater than the duration reported for executing the entire suite. -
trait
FunSpecLike
extends Suite with OneInstancePerTest with Informing with Notifying with Alerting with Documenting
Implementation trait for class
path.FunSpec
, which is a sister class toorg.scalatest.FunSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.Implementation trait for class
path.FunSpec
, which is a sister class toorg.scalatest.FunSpec
that isolates tests by running each test in its own instance of the test class, and for each test, only executing the path leading to that test.path.FunSpec
is a class, not a trait, to minimize compile time given there is a slight compiler overhead to mixing in traits compared to extending classes. If you need to mix the behavior ofpath.FunSpec
into some other class, you can use this trait instead, because classpath.FunSpec
does nothing more than extend this trait and add a nicetoString
implementation.See the documentation of the class for a detailed overview of
path.FunSpec
.


A
B
B
A
A/B testing statistics
Label Test
Number of successes
Number of trials
Remove
Interval confidence level:
Use multiple testing correction:
Compute
Add another group
Success metric:
a
Current date:
a
Download


Professional Skills
Top Skills
Customer Service
Advanced, 4 years
I have been working as some type of a customer service agent since 2013. I believe that I
have a lot of experience in this skill and I will be able to bring in a lot to a customer
service position.
Python
Beginner, 1 year
I started using Python3 in my introductory programming class in the spring of 2017. I have
been working with it and have been trying to enhance my skills to be able to do more complex
tasks with it.
HTML and CSS
Beginner, 1 year
I started working with HTML and CSS over the summer of 2017 and because of that, I don't
have much knowledge in it. I am able to find relevant information on Google and try to get
things to work. I am also able to put in content to pre-existing templates.
Other Skills
Leadership
Microsoft Word
Microsoft Excel
Microsoft Powerpoint
Microsoft Access
English
Nepali
Hindi
Urdu


Woman dragged by van in Vancouver is awake and aware of life-altering facial injuries
by Rob MunroA 24-year-old woman who was dragged by a van for several blocks in Vancouver last month suffering both life-threatening and life-altering injuries, is now awake and on the road to recovery.
Desiree Evancio has undergone multiple surgeries to reconstruct her face after she walked between a van and a trailer it was towing before she was dragged for several blocks in downtown Vancouver on Oct. 12.
Police said she walked between the van and trailer as it was stopped at a traffic light.
“She is very awake and I believe will be fully awake moving forward until her next operation,” Desiree Evancio's sister Ashley Danh wrote on a GoFundMe page.
"She is now aware of all of her injuries. I think she understands the extent of everything and how she was close to dying."
Evancio will need a prosthetic eye and nose, and surgery has been done to restore her upper lip, Dahl wrote, noting that her sister is now able to contribute to the medical decisions.
“She was heavily sedated for just under two weeks so her face could heal from the surgery they performed. She's been quite awake for a number of days now, and has been able to write to communicate with family and friends and the nurses which is so great.”
Dahl says her sister can't remember the accident.
The GoFundMe campaign has raised more than $236,000 so far.
— With files from The Canadian Press


People may add some plugin which may block video's interact.To avoid this, they can do in servel way.
set operable to be true. That will set it's pointer-events into none.
set penetrate to be true. That will let Chimee pass it's event to other plugin
You may want to block some event, but pass some event. Which you run evt.stopPropagation in plugin's $dom element's chidren.


--- layout: post date: 2012-09-12 time: "09:00:00" authors: ["Greg Wilson"] title: Patterns Wanted tags: ["Content", "Education"] ---
At some point or other, most programmers have encountered the idea of design patterns in software, and many (including myself) have been zealous about them, at least for a while. They haven't actually revolutionized either the practice of software development or the way we teach it, but becoming familiar with them is to programmers what learning the Beatles' greatest hits is to musicians.
That presents us with a problem. We have deliberately chosen not to include object-oriented programming in the core of Software Carpentry: it's too big to fit into the time we have, and too far beyond what our learners bring with them. However, almost all discussion of design patterns is phrased in terms of classes and objects. It doesn't have to be—the ideas behind Proxy, Singleton, and Iterator are frequently used in procedural languages like C—but:
The biggest problem, though, is that most discussion of patterns is over our learners' heads, i.e., it addresses problems they haven't reached yet. The scientists we're helping are still trying to figure out what aliasing is, or why it's usually better for a function to take an open stream as an argument rather than a filename. The patterns they need are so simple that most programmers have forgotten that they need to be learned.
There are a couple of exceptions, though. One is the "Roles of Variables" work that Sajaniemi and others did a few years ago. By looking at the kinds of programs people write in introductory courses, they classified variables as follows:
Fixed value and organizer contain the same data throughout the program; only the order of data elements may be changed. Most-recent holder and stepper record data flow sources; either coming from outside or generated internally. The net effect of all items in a data flow is represented by a one-way flag, most-wanted holder, or gatherer; while a manipulation of a single element is recorded in a follower or temporary. Data may be stored in a container which can be traversed with a walker. Finally, a data entity not covered by any of the previous roles is considered to have the role other.
Their classification scheme is not unambiguous (i.e., different experts can label a particular variable in different ways) but the same thing happens with design patterns, but that's OK—defensible differences are informative. The real benefit of this scheme is that it gives novices a way to organize and plan programs: once they've learned to recognize roles, they can start to create variables with roles in mind, which saves them from having to reinvent or rediscover the idioms that distinguish experts from novices.
Another piece of work aimed at the same level is Michael de Raadt's dissertation on novice-level programming plans. He described 18 of them:
|
|
Both pieces of work are a great start, but we want to teach people the craft of (scientific) programming, we need more. That's where you come in: what patterns have you used in your programs? When do you use them? When don't you (i.e., what are their boundary or limiting cases)? And do you know of any other catalogs or summaries that we could link to?


Sub-Saharan Africa’s infrastructure needs by sector (2006–2015).
Source: African Development Monitor ( 2012)
GDP, gross domestic product; ICT, information and communication technology.


Just chill, Grab a cup of coffee While we are getting things Done
Top
Body
ADMIN PAGE
Logout
Homepage
Users
Add Food
Ordered Items
Payment
$56677.87
Naira
Food Name:
Price:
Food Image


Actress Lee Young Ae says she didn't know her BTS concert photo would be hot topic
by germainejActress Lee Young Ae says she didn't know her photo at a recent BTS concert would become such a hot topic.
On November 2, Lee Young Ae shared the photo below on her Weibo account with the message, "I went to see a BTS concert. I'm looking forward to their new song." The photo shows the actress and her friends in front of the Jamsil Olympic Stadium looking excited before the concert.
She commented on MBC FM4U's 'Bae Chul Soo's Music Camp' on November 12, "I posted a photo after going to the BTS concert, and I didn't know it'd become a hot topic. I posted it kind of tacitly, and I was shocked. It made me realize how popular BTS is. It ended up making people know about me too."
Stay tuned for updates on Lee Young Ae and BTS!


[gecode-users] svn: bug in sudoku.cc
Filip Konvička
filip.konvicka at logis.cz
Mon Nov 26 15:36:47 CET 2007
Hi,
trying to compile trunk with MSVC 9, I got an error compiling sudoku.cc,
can be probably fixed with
Index: C:/cygwin/tmp/gecode_build/gecode_trunk/examples/sudoku.cc
===================================================================
--- C:/cygwin/tmp/gecode_build/gecode_trunk/examples/sudoku.cc
(revision 5423)
+++ C:/cygwin/tmp/gecode_build/gecode_trunk/examples/sudoku.cc
(working copy)
@@ -495,7 +495,7 @@
}
/// Print solution
- virtual void print(void) { SudokuInt::print(); }
+ virtual void print(std::ostream& os) { SudokuInt::print(os); }
};
Otherwise, compilation went extremely smooth with a fresh install of
MSVC 9 Express Edition, with the following commands under cygwin:
export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio
9.0/Common7/IDE:$PATH"
export PATH="/cygdrive/c/Program Files/Microsoft Visual Studio
9.0/VC/bin:$PATH"
export INCLUDE='C:\Program Files\Microsoft Visual Studio
9.0\VC\include;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include'
export LIB='C:\Program Files\Microsoft Visual Studio
9.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib'
./configure CC=cl CXX=cl
make
Trying to build outside of the source tree failed somehow, though.
Nevermind, excellent!
Cheers,
Filip
More information about the gecode-users
mailing list


Beer2Beer
Home
Source
Beer2Beer
The beer preferences directory
Person
Provide the name of the person whose beer preferences you want to look up.

Favourite beers


Step 1 of 4
This is the developer information that will be saved in the Open Data CHPL database and associated with this Certified Product.
This is the developer information that will be saved in the Open Data CHPL database and associated with this Certified Product.
This is the developer information from your Upload File. A matching developer has been found in the Open Data CHPL database. To update this developer's information in the Open Data CHPL, click the Save as Developer Information button.


- tearDown() - Method in class TestEnigmaMachine.TestCog
-
This method is used for getting rid of the testing variables and checking they have been
successfully removed.
- tearDown() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for getting rid of the testing variables and checking they have been
successfully removed.
- tearDown() - Method in class TestEnigmaMachine.TestConversion
-
This method is used for getting rid of the testing variables and checking they have been
successfully removed.
- tearDown() - Method in class TestEnigmaMachine.TestEncryption
-
This method is used for getting rid of the testing variables and checking they have been
successfully removed.
- testCipherText - Variable in class TestEnigmaMachine.TestEncryption
-
- TestCog - Class in TestEnigmaMachine
-
- TestCog() - Constructor for class TestEnigmaMachine.TestCog
-
- testCog - Variable in class TestEnigmaMachine.TestCog
-
These are the variables used in the Test class.
- testCogLarge - Variable in class TestEnigmaMachine.TestCogRotate
-
- testCogMedium - Variable in class TestEnigmaMachine.TestCogRotate
-
- TestCogRotate - Class in TestEnigmaMachine
-
- TestCogRotate() - Constructor for class TestEnigmaMachine.TestCogRotate
-
- testCogRotateBack() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateBack() method in the CogRotate class.
- testCogRotateForward() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateForward() method in the CogRotate class.
- testCogSmall - Variable in class TestEnigmaMachine.TestCogRotate
-
These are the variables to be used in the Test class.
- TestConversion - Class in TestEnigmaMachine
-
- TestConversion() - Constructor for class TestEnigmaMachine.TestConversion
-
- testConvert - Variable in class TestEnigmaMachine.TestConversion
-
These are the variables to be used in the Test class.
- testConvertToLetter() - Method in class TestEnigmaMachine.TestConversion
-
This method is used for testing the convertToLetter() method in the Conversion class.
- testConvertToValue() - Method in class TestEnigmaMachine.TestConversion
-
This method is used for testing the convertToValue() method in the Conversion class.
- testCRot - Variable in class TestEnigmaMachine.TestCogRotate
-
- testCurrentVal - Variable in class TestEnigmaMachine.TestCog
-
- testCurrentVal - Variable in class TestEnigmaMachine.TestCogRotate
-
- testDecryptPlainTextArray() - Method in class TestEnigmaMachine.TestEncryption
-
This method is used for testing the decryptionPlainTextArray() method in the Encryption class.
- testEncrypt - Variable in class TestEnigmaMachine.TestEncryption
-
These are the variables to be used in the Test class.
- TestEncryption - Class in TestEnigmaMachine
-
- TestEncryption() - Constructor for class TestEnigmaMachine.TestEncryption
-
- testEncryptPlainTextArray() - Method in class TestEnigmaMachine.TestEncryption
-
This method is used for testing the encryptPlainTextArray() method in the Encryption class.
- TestEnigmaMachine - package TestEnigmaMachine
-
- testExistence() - Method in class TestEnigmaMachine.TestCog
-
- testExistence() - Method in class TestEnigmaMachine.TestCogRotate
-
- testExistence() - Method in class TestEnigmaMachine.TestConversion
-
- testExistence() - Method in class TestEnigmaMachine.TestEncryption
-
- testGetCogKey() - Method in class TestEnigmaMachine.TestEncryption
-
This method is used for testing the getCogKey() method which takes all of the values of each of
the Cogs and performs a calculation using those values to get a key value used in the
encryption and decryption of the plaintext and ciphertext respectively.
- testGetCurrentValue() - Method in class TestEnigmaMachine.TestCog
-
This method is used for testing the getCurrentValue() method in the Cog class.
- testGetNumOfVals() - Method in class TestEnigmaMachine.TestCog
-
This method is used for testing the getNumOfVals() method in the Cog class.
- testLCog - Variable in class TestEnigmaMachine.TestEncryption
-
- testLib - Variable in class TestEnigmaMachine.TestConversion
-
- testLib - Variable in class TestEnigmaMachine.TestEncryption
-
- testLibVals - Variable in class TestEnigmaMachine.TestEncryption
-
- testLibValues - Variable in class TestEnigmaMachine.TestConversion
-
- testMCog - Variable in class TestEnigmaMachine.TestEncryption
-
- testNumOfVals - Variable in class TestEnigmaMachine.TestCog
-
- testNumOfVals - Variable in class TestEnigmaMachine.TestCogRotate
-
- testPlainText - Variable in class TestEnigmaMachine.TestEncryption
-
- testRotateBackLargeCogAtMin() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateBack() method in the CogRotate class.
- testRotateBackMediumCogAtMin() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateBack() method in the CogRotate class.
- testRotateBackSmallCogAtMin() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateBack() method in the CogRotate class.
- testRotateForwardLargeCogAtMax() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateForward() method in the CogRotate class.
- testRotateForwardMediumCogAtMax() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateForward() method in the CogRotate class.
- testRotateForwardSmallCogAtMax() - Method in class TestEnigmaMachine.TestCogRotate
-
This method is used for testing the cogRotateForward() method in the CogRotate class.
- testSCog - Variable in class TestEnigmaMachine.TestEncryption
-
- testSetCurrentValue() - Method in class TestEnigmaMachine.TestCog
-
This method is used for testing the setCurrentValue() method in the Cog class.
- testSetNumberOfValues() - Method in class TestEnigmaMachine.TestCog
-
This method is used for testing the setNumberOfValues() method in the Cog class.


| Expand Dir:
|
|
Open Dir:
|
|
Icon Width:
|
|
Grow Percent:
|
| Items |
| Selected Item Info | ||
| Label: |
|
|
| Image Source: |
|
|
| OnClick: |
|
|
|
|


16 - 17 November 2019
TU Wien
#DevFest19 #Vienna
Powered By See all our sponsors
DevFest Vienna 2017 is powered by
All our 2017 sponsors


When I was younger (I am now 19) I used to be very depressed and have many suicidal tendancies. All I ever wanted was a solution, something that could make me happy and loving. I went to many psychiatrists and they were never any real help. I hadn't done very many drugs in the past but I decided that I would try ecstacy because it looked like something I may enjoy. So the day came when I asked my 'dealer' about obtaining some tabs of x. I took one that night and to my astonishment nothing happened. Feeling even more depressed I got more and eventually after dosing myself started feeling the effects. It was paradise! I was in love with ecstacy.
So being that I lived in Louisiana, Katrina hit. I was devastated. No longer was I free and able to smoke weed and roll and trip and all my other fun adventures of the mind. I had to find a new dealer, and eventually did. That is when I started rolling very heavily every week. I was still depressed around these times, but the x helped cheer me up. After a while when I would take the x I would do some soul searching. And like a butterfly I evolved from a manically depressed, suicidal, teen, to a happy energetic loving person. Soon enough I did not even need the x to be happy. I learned to love and respect myself and others. I am currently the happiest I have ever been. I am still an ecstacy user and ecstacy changed my life for the better.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


MongoDB is a free and open-source cross-platform document-oriented database program. This NoSQL database program uses JSON-like documents with schemas.
NodeJS
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
Angular 2
Angular is a development platform for building mobile and desktop web applications. Ut dignissim eleifend maximus. Ut dignissim eleifend maximus. Ut dignissim eleifend.
ExpressJS
Express.js is a Node.js framework. Node.js is a platform that allows JavaScript to be used outside the Web Browsers, for creating web and network applications.
About me
I am a new graduate student enrolled in University of Ottawa who is comprehensively trained in computer technologies.
Lorem Ipsum
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.


fun Throwable.analyse(): ExceptionAnalysis
Returns this Throwable as an ExceptionAnalysis which provides a breakdown of the exception.
Author bright_spark
Since 2.2.5


This tool's purpose is to make you aware when market stocks run out. It is therefore perfect for the lazy importer who lists and forgets their market orders.
Eve Market Watch allows you to define stock thresholds for items and markets. It will then notify you if that item's stock for the selected market reaches the threshold. Notifications are currently done via ingame mail. Discord/Slack integrations are on the todo list.
Log in to try it out!
1. Read markets
2. Check thresholds
3. Send mail
Send an ingame mail to Rihan Shazih if you have more ideas!
Ingame mail showing you what's missing.
Recommended by Dunk Dinkle!


Account Activating.....
Please take a note of the details below these are needed to access your account
gungoos.com
Your order summary
DescriptionAmount
- Free Hosting $0.00
- Item price: $0.00
- Item total $0.00
- Total $0.00
Your Account Details
Your account is now active.
Your account is now active.
| Main Hosting
Details |
|
| Control panel username |
gungo_19107931 |
| Control panel password | ********** |
| Control panel URL |
cpanel.gungoos.com |
| MySQL username |
gungo_19107931 |
| MySQL password |
********** |
| MySQL hostname |
sql304.gungoos.com |
| FTP username |
gungo_19107931 |
| FTP password |
********** |
| FTP host name | ftp.gungoos.com |
| Your Website URL's |
|
| Home page |
http://jbkilat.gungoos.com |
Thank you for choosing us to host your websites!


{% load staticfiles %}
Paste the lines below into "custom parameters" settings when modifying the external tool
Would you like the students to view their answers?
Set maximum number of attempts (default is infinite number of attempts)


- Platforms >
- Amazon EC2
Amazon EC2¶
On this page
To deploy MongoDB on Amazon EC2, you can either:
- Set up a new instance manually, or
- Use MongoDB Atlas or MongoDB Cloud Manager.
MongoDB Atlas and EC2¶
MongoDB Atlas is a hosted database as a service from the team that engineers the database. Atlas deploys MongoDB on AWS EC2 instances. The MongoDB Atlas GUI allows you:
- Set up and manage your clusters
- Scale up or out with automated sharding
- Monitor your MongoDB deployments running in MongoDB Atlas
- Configure security controls
- Manage automated backups and failure recovery
MongoDB Cloud Manager and EC2¶
MongoDB Cloud Manager is a management platform for MongoDB, delivered as a cloud service. MongoDB Cloud Manager allows you to:
- Monitor your deployment and set custom alerts
- Automate database setup and maintenance
- Visualize and optimize query performance
- Manage automated backups and recovery
Storage Considerations¶
EC2 instances can be configured with either ephemeral storage or persistent storage using the Elastic Block Store (EBS). Ephemeral storage is lost when instances are terminated, so it is generally not recommended unless you understand the data loss implications.
For almost all deployments EBS will be the better choice. For production systems we recommend using
- EBS-optimized EC2 instances
- Provisioned IOPS (PIOPS) EBS volumes
Storage configuration needs vary among deployments, but for best performance we recommend separate volumes for data files, the journal, and the log. Each has different write behavior, and placing them on separate volumes reduces I/O contention.
Note
Using different storage devices will affect your ability to create snapshot-style backups of your data, since the files will be on different devices and volumes.
For optimal performance in terms of the storage layer, use disks backed by RAID-10. RAID-5 and RAID-6 do not typically provide sufficient performance to support a MongoDB deployment.
Avoid RAID-0 with MongoDB deployments. While RAID-0 provides good write performance, it also provides limited availability and can lead to reduced performance on read operations, particularly when using Amazon’s EBS volumes.
Manually Deploy MongoDB on EC2¶
The following steps can be used to deploy MongoDB on EC2 yourself. The instances will be configured with the following characteristics:
- Amazon Linux
- MongoDB installed via
yum
- Individual PIOPS EBS volumes for data (1000 IOPS), journal (250 IOPS), and log (100 IOPS)
- Updated read-ahead values for each block device
- Update ulimit settings
Before continuing be sure to have the following:
- Install EC2 command line tools
- Generate an EC2 key pair for connecting to the instance via SSH
- Create a security group that allows SSH connections
Create the instance using the key pair and security group previously
created and also include the --ebs-optimized
flag and
specify individual PIOPS EBS volumes (/dev/xvdf
for data,
/dev/xvdg
for journal, /dev/xvdh
for log). Refer to the
documentation for ec2-run-instances
for more information on devices and parameters.:
ec2-run-instances ami-05355a6c -t m1.large -g [SECURITY-GROUP] -k [KEY-PAIR] -b "/dev/xvdf=:200:false:io1:1000" -b "/dev/xvdg=:25:false:io1:250" -b "/dev/xvdh=:10:false:io1:100" --ebs-optimized true
You can use the returned instance-id to ascertain the IP Address or DNS information for the instance:
ec2-describe-instances [INSTANCE-ID]
Now SSH into the instance:
ssh -i /path/to/keypair.pem<EMAIL_ADDRESS>After login, update installed packages, add the MongoDB yum repo, and install MongoDB:
echo "[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc" |
sudo tee -a /etc/yum.repos.d/mongodb-org-3.4.repo
sudo yum -y update && sudo yum install -y mongodb-org-server \
mongodb-org-shell mongodb-org-tools
Next, create/configure the mount points, mount each volume, set
ownership (MongoDB runs under the mongod
user/group), and
set the /journal
link:
sudo mkdir /data /log /journal
sudo mkfs.xfs /dev/xvdf
sudo mkfs.xfs /dev/xvdg
sudo mkfs.xfs /dev/xvdh
echo '/dev/xvdf /data xfs defaults,auto,noatime,noexec 0 0
/dev/xvdg /journal xfs defaults,auto,noatime,noexec 0 0
/dev/xvdh /log xfs defaults,auto,noatime,noexec 0 0' | sudo tee -a /etc/fstab
sudo mount /data
sudo mount /journal
sudo mount /log
sudo chown mongod:mongod /data /journal /log
sudo ln -s /journal /data/journal
Now configure the following MongoDB parameters by editing the
configuration file /etc/mongod.conf
so that it contains the
following:
dbpath = /data
logpath = /log/mongod.log
If you don’t want MongoDB to start at boot, you can issue the following command:
sudo chkconfig mongod off
By default Amazon Linux uses ulimit
settings that are not
appropriate for MongoDB. To setup ulimit
to match the
documented ulimit settings, run the
following command:
echo '* soft nofile 64000
* hard nofile 64000
* soft nproc 64000
* hard nproc 64000' | sudo tee /etc/security/limits.d/90-mongodb.conf
Additionally, default read ahead settings on EC2 may not be optimized for MongoDB. Refer to the Production Notes for the recommended configuration for your Linux distribution and selected MongoDB storage engine. For example, to set readahead to 0 for use with the WiredTiger storage engine,
sudo blockdev --setra 0 /dev/xvdf
To make this change persistent across system boot, issue the following command:
echo 'ACTION=="add|change", KERNEL=="xvdf", ATTR{bdi/read_ahead_kb}="0"' | sudo tee -a /etc/udev/rules.d/85-ebs.rules
Once again, repeat the above command for all required volumes (note:
the device we created was named /dev/xvdf
but the name used by
the system is xvdf
).
To start mongod
, issue the following command:
sudo service mongod start
Then connect to the MongoDB instance using the mongo
shell:
mongo
To have MongoDB startup automatically at boot issue the following command:
sudo chkconfig mongod on
For production deployments consider using Replica Sets or Sharding.
Backup, Restore, Verify¶
Depending upon the configuration of your EC2 instances, there are a number of ways to conduct regular backups of your data. For specific instructions on backing up, restoring and verifying refer to EC2 Backup and Restore.
Deployment Notes¶
Instance Types¶
MongoDB works on most 64-bit EC2 types including Linux and Windows. Refer to the Supported Platforms documentation to ensure your selected platform is compatible with your version of MongoDB.
Running MongoDB¶
Before starting a mongod
instance, decide where to put your
data files. Run df -h
to see a list of available
volumes. On some images, /mnt
will be the locally-attached
storage volume. Alternatively, you may want to use Elastic Block Store which will have a different mount
point.
Mounting the filesystem with the mount -o noatime
option can
improve disk performance. For example, the following is an example
of an /etc/fstab
stanza with this option:
/dev/mapper/my_vol /var/lib/mongodb xfs noatime,noexec 0 0
Create the mongodb data file directory in the desired location and then
start the mongod
server:
mkdir /mnt/db
./mongod --fork --logpath ~/mongod.log --dbpath /mnt/db/
Operating System¶
Refer to the MongoDB on Virtual Environments section of the Production Notes for configuration recommendations.
Networking¶
Port Management¶
By default, the mongod
listens on port 27017
. To change
the default port, use the net.port
setting or
--port
option.
Keepalive¶
Change the default TCP keepalive time to 300 seconds. See our troubleshooting page for details.
Enhanced Networking on Supported Instance Types¶
When available, enable AWS’s Enhanced Networking for your instance. Not all instance types support Enhanced Networking. Refer to the AWS documentation for more information.
Secure Instances¶
Restrict access to your instances by using the Security Groups feature within AWS. A Security Group is a set of firewall rules for incoming packets that can apply to TCP, UDP or ICMP.
A common approach is to create a MongoDB security group that contains the nodes of your cluster (replica set members or sharded cluster members), followed by the creation of a separate security group for your app servers or clients.
Create a rule in your MongoDB security group with the “source” field set to the Security Group name containing your app servers and the port set to 27017 (or whatever port you use for your MongoDB). This will ensure that only your app servers have permission to connect to your MongoDB instances.
Remember that Security Groups only control ingress traffic.
Communication Across Regions¶
Every EC2 instance will have a private IP address that can be used to communicate within the EC2 network. It is also possible to assign a public “elastic” IP to communicate with the servers from another network. If using different EC2 regions, servers can only communicate via public IPs.
To set up a cluster of servers that spans multiple regions, it is recommended to name the server hostname to the “public dns name” provided by EC2. This will ensure that servers from a different network use the public IP, while the local servers use the private IP, thereby saving costs. This is required since EC2 security groups are local to a region.
To control communications between instances in different regions (for example, if you have two members of a replica set in one region and a third member in another), it is possible to use a built-in firewall (such as IPtables on Linux) to restrict allowed traffic to certain (elastic) IP addresses or ports.
For example one solution is following, on each server:
- set the hostname of the server
sudo hostname server1
- install “bind”, it will serve as local resolver
- add a zone for your domain, say “myorg.com”, and add the CNAMEs for all your servers
server1 IN CNAME ec2-50-19-237-42.compute-1.amazonaws.com.
server2 IN CNAME ec2-50-18-157-87.us-west-1.compute.amazonaws.com.
- restart bind and modify /etc/resolv.conf to use the local bind
search myorg.conf
nameserver <IP_ADDRESS>
Then:
- verify that you can properly resolve server1, server2, … using a tool like dig.
- when running mongod,
db.serverStatus()
should show the correct hostname, e.g. “server1:27017”. - you can then set up replica sets or shards using the simple
hostname. For example connect to server1 and run
rs.initiate()
, thenrs.add('server2:27017')
.


This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Published: {{ book.published }}
Count:{{ $index }}


Content
Save
Cancel
Content
Roles Resources
Role user
Logs
Backend Operation
Sub category
Vendor Panel Operation
Frontend Operation
Name
Status
choose
Enable
Disable
Created date :
4 may 2019
Created by :
Shihab
Updated date :
4 may 2019
Updated By :
Ajmal
Country
choose
India
USA
State
choose
Kerala
Tamilnadu
District
choose
Thiruvanathapuram
Kollam
Post/Zipcode
choose
695310
675423
Shareholder
choose
Submit
Sl
User
Name
First
Name
Last
Name
Email
Created
Date
Updated
Date
Status
Action
1
Admin
Shihab
up
<EMAIL_ADDRESS>Aug 1st 2018
Aug 10th 2018
Enabled
Edit
Delete


Stock Commander
An intranet control software by Group 2 ©2015.
DayTrading - Dashboard Login Page
User ID
*must be 10 characters


Nodemailer is a module for Node.js applications to allow easy as cake email sending.
The project got started back in 2010 when there was no sane option to send email messages, today it is the
solution most Node.js users turn to by default.
Nodemailer features
A single module with zero dependencies – code is easily auditable, as there are no dark corners
Heavy focus on security, no-one likes RCE vulnerabilities
Unicode support to use any characters, including emoji 💪
Windows support – install it with npm on Windows . Use it hassle free from Azure or your Windows box
Use HTML content, as well as plain text alternative
Add Attachments to messages
Embedded image attachments for HTML content – your design does not get blocked
Secure email delivery using TLS/STARTTLS
Different transport methods in addition to the built-in SMTP support
Sign messages with DKIM
Custom Plugin support for manipulating messages
Sane OAuth2 authentication
Proxies for SMTP connections
ES6 code – no more unintentional memory leaks, due to hoisted var‘s
Autogenerated email test accounts from Ethereal.email


JALLA! JALLA! A film review by Mark R. Leeper
CAPSULE: This super-light situation comedy from Sweden tells the story of two close friends with romantic problems. The script involves formerly taboo subjects like erotic toys and sexual enhancers but otherwise the writing is not a lot different from what is shown free on television. The characters are paper-thin and the interesting ideas purely non-existent. This is a decrement-life-by-90-minutes card. Rating: 4 (0 to 10), 0 (-4 to +4)
JALLA! JALLA! is basically an exuberant TV situation comedy written instead for the wide screen. It tells the story of two park custodians and the problems they are finding on the path to true love. The film is set in Sweden where Roro and Mans (Fares Fares and Torkel Petersson) are custodians at a public park. Roro is from a tightly knit Lebanese family who control him very closely, Mans is a Swede from a much more liberal background. They spend most of the day in the bushes at their park, cleaning up after dogs. Roro and Mans each have girlfriends, but each has a problem. Roro (nicknamed "Jalla") is having family problems. It seems that his family wants to arrange a marriage between him and a nice Lebanese woman, Yasmin (Laleh Pourkarim), but he is already in love with Lisa (Tuva Novotny). Yasmin likes Roro, but does not want to get married either. Mans on the other hand has been having a problem of sexual impotence. The two friends worry about their problems and discuss the problems with each other. Mans thinks the answer to his problem is to purchase sexual enhancers. The one catch is that he is too shy to go in and buy them. Roro and Yasmin decide to give themselves some time by telling the families that they want to marry each other, but then plan to break up before the wedding. Not too surprisingly neither finds that his idea works out the way he quite expected.
The plot turns in several places are contrived. One knows fairly quickly that if things are going to work our happily for everybody certain plot contrivances have to happen. Lebanese-born Josef Fares who wrote and directed is perhaps a better director than he is a writer. When things start to get slow, he just adds throws in another story. For example halfway into the film Mans innocently antagonizes some local toughs and a long chase is added to the film. Characterization is a little better with Roro than it is with Mans who does not seem to have a whole lot more personality beyond fear for losing a biological function. We do see some of Roro's family life and his concerns. That may be because Roro's background is a lot like that of the director.
While the story was entertaining, I did not feel that I got anything worthwhile from the film. It was just a way to pass about an hour and a half in my life. One does not have to go to the movies to see entertainment like this. I rate it a 4 on the 0 to 10 scale and a 0 on the -4 to +4 scale.
Mark R. Leeper<EMAIL_ADDRESS>Copyright 2001 Mark R. Leeper
-- Mark R. Leeper,http://www.geocities.com/markleeper/ Or try your search engine on "Mark Leeper"
========== X-RAMR-ID: 29625 X-Language: en X-RT-AuthorID: 1309 X-RT-RatingText: 4/10
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


We vouch for the best comfort and trendy designs with customization for Bridal wear, Designer Blouses, Traditional dresses and all other ladies outfits!


S H E R L O C K
Tv Series | 2010 |
9.5 /10 |
In Collection
My Rating /10
Episode Seen /8
Add to:
In Collection
Episode Seen /8
Add to:
In Collection
Synopsis
Centuries ago, mankind was slaughtered to near extinction by monstrous humanoid creatures called titans, forcing humans to hide in fear behind enormous concentric walls. What makes these giants truly terrifying is that their taste for human flesh is not born out of hunger but what appears to be out of pleasure. To ensure their survival, the remnants of humanity began living within defensive barriers, resulting in one hundred years without a single titan encounter. However, that fragile calm is soon shattered when a colossal titan manages to breach the supposedly impregnable outer wall, reigniting the fight for survival against the man-eating abominations.


It looks like the Clean.Data. server is having a moment. Please check back shortly, or email<EMAIL_ADDRESS>if the problem persists.


Loading...
T
Keys
Tab
Keys
Team
Team
Object::Team()
Team::Team()
team.cc
team.h
team_event_type
types.h
teamHealth
Team
TeamManager
TeamManager
TeamManager::TeamManager()
Engine::teammanager()
teammanager.cc
teammanager.h
teamName
Team
teams
TeamManager
Text
Text
Texture::Text()
Text::Text()
text.cc
text.h
text_alignment
types.h
text_object
types.h
Texture
Texture
Animation::texture()
explosionEntry::texture()
mapEntry::texture()
Texture::Texture()
texture.cc
texture.h
TextureManager
TextureManager
Engine::texturemanager()
texturemanager.cc
texturemanager.h
threshold
Physics::threshold()
THRESHOLD(): physics.h
timeBetweenEachFiring
Team::timeBetweenEachFiring()
TIMEBETWEENEACHFIRING(): team.h
timerId
Animation
ToggleFullScreen
Video
toggleLevelDestruction
Level
togglePhysics
Object
toggleVisibility
Object
top
Side
transparent
TextureManager
turnTo
PhysicalObject
type
wep
types.h
Searching...
No Matches


Unsupervised orientation¶
Here, I briefly discuss the behavior of the simplest possible nonlinear geometric model. It mostly consists of products of previous code made more easily accessible.
Task¶
The task is to distinguish between orientation (which is predictable) and position (which is unpredictable). The setting is as small as possible.
[3]:
import lettertask as lt
agbm = lt.data.AtomicGeometricBinaryModel(width=2, samples=50, change_probability=0.2)
agbm.animate()
[3]:
<IPython.core.display.Image object>
In the case discussed below, the probability of change is 0.05 and we consider 100000 samples (which seems like too much).
Model notation¶
I am using an arrow notation to denote the different models. The nonlinearity \(\sigma\) is a rectified linear unit, numbers represent dimensions at a certain stage, i. e.
is a notation for a network where a four dimensional stimulus is densely connected to a two-dimensional layer, which is nonlinearly transformed and then densely connected a one-dimensional layer.
Way too small¶
First, I estimated a model using one latent feature:
Though this could not have solved the task completely, I wanted to see whether it would extract one feature. Even with respect to this, the model seemed challenged.
Still too small¶
The model
is sufficient for the problem. I demonstrated this by using such a model to solve the supervised task. However, in practice, the contrastive coding algorithm found two latent categories: left vertical rectangles and everything else. It was therefore not completely unsuccessful, but also not optimal.
Too big¶
Before I made the previous model work, I studied the general feasibility by using on overly complex model:
This model appeared to already have converged, but by further running the optimization, it eventually recovered the correct dimension:
This suggests a highly nonlinear loss landscape with sudden gradient changes – an interesting dynamic I hope to explore further.
Minimal expressiveness?¶
The minimally expressive model capable of recovering orientation for contrastive coding appears to be given by
if we restrict ourselves to this depth.
Next steps¶
In order to make the above observation more reliable, I will implement an unsupervised predictive autoencoder solving these tasks and then study the performances of these two algorithms as compared to their supervised versions in an extensive manner. I aim to use the pipeline presented on the message board for this purpose.


index.html
This is text written in the index.html
This is text written in the index.html
This is text written in the index.html
This is text written in the index.html
This is text written in the index.html
This is text written in the index.html
index.html
This is text written in the index.html


What does this thing do?
This page will show a list of the numbers from 1 up to a number that you enter, unless the number:
- is a multiple of 3, in which case it becomes "Ping!"
- is a multiple of 5, in which case it becomes "Pong!"
- is a multiple of both 3 and 5, in which case it becomes "Pingpong!"
Made by Charlie Baxter as a part of my coursework at
Epicodus. Check out
my GitHub page!


Add your four mochi images from your tutorial here.
Let's make an unordered list. Here are my favorite foods:
And now, one in order. Here are my top 5 favorite albums:
Sometimes you want to draw attention to something in a line of text.
Sometimes you want to strongly emphasize something in the text.
Sometimes you want to do both.
Soft line breaks can't wrap anything.
Neither can image tags, or hard lines.


This is the user guide for working with Confine. A more detailed step-by-step tutorial can be found here.
NOTE: It is assumed that the Installation Guide has been followed.
There are four main sections in this guide:
Confine generates Seccomp profiles which can be used in launching Docker containers. In this section, we will show the basics of running and killing containers. All Docker commands should be run as root, so we will be using sudo.
1. View list of containers:
sudo docker container ls -a
The output will show a list of containers both running and killed. The format is as follows:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2. Let's launch a container with the default Seccomp policy. The format of the command format is: sudo docker run --name [any-name] -td [docker-image-name].
sudo docker run --name test1 -td nginx
3. Now let's view the list of containers again:
sudo docker container ls -a
The output will show a list of containers both running and killed. The format is as follows:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [long hash] nginx "/docker-entrypoint.…" 2 seconds ago Up 1 second 80/tcp test1
4. If we try to launch another container with the same name we will get an error from Docker. So each container should have a unique name. Run the following command:
sudo docker run --name test1 -td nginx
You should get an error with the following format:
docker: Error response from daemon: Conflict. The container name "/test1" is already in use by container "[long hash]". You have to remove (or rename) that container to be able to reuse that name.
5.  Let's view the list of containers again.
sudo docker container ls -a
The output should be as follows:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES [long hash] nginx "/docker-entrypoint.…" [x] minutes ago Exited(137) seconds ago 80/tcp test1
7. Now we will delete the previously launched container.
sudo docker rm test1
8. Run a container with a custom Seccomp profile. sudo docker run --name [any-name] --security-opt seccomp=[path-to-seccomp-profile] -td [docker-image-name]
sudo docker run --name container-hardened --security-opt seccomp=results/nginx.seccomp.json -td nginx
9. Connect to a running container instance and launch bash/sh/. sudo docker exec -it [container-name] [any-shell]
sudo docker exec -it nginx-container /bin/bash
10. Extract IP address of running container: sudo docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' [container-name]
sudo docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx-container
The main script in this repo is the confine.py file which uses previously created call graphs for musl-libc and glibc, along with a list of images and creates respective Seccomp profiles for each.
-l: glibc callgraph -m: musl-libc callgraph -i: input file containing JSON of images (more details provided below) -o: path to store binaries and libraries extracted from container -p: path to Docker default seccomp profile -r: path to store results (seccomp profiles created) -g: path to special cases containers like golang ones (more details provided below) -d: debugging enabled or disabled --skip: [Optional] In case you set this option, the script will not run the analysis for previously run images which have their results inserted into the profile.results.csv file. -f: [Optional] glibc shared object -n: [Optional] musl-libc shared object --finegrain: [Optional] Passing this argument enables the fine grained policy generation. Using this feature is not advised, since it is under development. --othercfgfolder: [Optional] In case you enable the fine grained analysis through setting --finegrain, you must set this option as well. This folder should contain the call graph for the other libraries used in the fine grained analysis. --allbinaries: [Optional] Passing this argument causes the extraction of all binaries instead of only the ones run during the 30 seconds. This would cause an extremely more conservative filter.
Change your current working directory to the root of the respository (/home/ubuntu/confine).
cd /home/ubuntu/confine
Execute the main script to generate Seccomp profiles for the enabled images.
sudo python3.7 confine.py -l libc-callgraphs/glibc.callgraph -m libc-callgraphs/musllibc.callgraph -i images.json -o output/ -p default.seccomp.json -r results/ -g go.syscalls/
The JSON input file has the following format:
{ "nginx": { "enable": "false", "image-name": "nginx", "image-url": "nginx", "category": [ "ApplicationInfrastructure" ], "options": "", "args": "", "dependencies": {} } }
Note:
The only keys which are required for any item in the JSON file are
enable, image-name
and image-url. The rest are optional. Some Docker images
need a set of options to run correctly. Such as passing configuration options
or setting environment variables. Docker supports two types of arguments, one
is for options which are used by Docker and
the other is args which are
arguments passed directly to the application running in the container.
For example the MySQL Docker
image must be run with the options below:
-e MYSQL_ROOT_PASSWORD=my-secret-pw
These options are typically specified in the image page on
Docker Hub.


Disable the button CSS animation (true disables)
Maximum X distance the touch can travel in pixels before being discarded
Maximum Y distance the touch can travel in pixels before being discarded
Storage document element for the button
Press callback, designed to be overriden by the extending class
Long press callback, designed to be overriden by the extending class. Defaults to ButtonUI.callback if falsey.
Receive parameters, or objects which specify what kind of data (events, schedule, etc.) the UIItem needs to function. Determines the contents passed to the onInit and onUpdate functions, and is parsed by the DataManage class. More information on what is done with these parameters can be found in DataManage.
Time in milliseconds to consider a press a long press and run the long press action
CSS class for animations
Generic wrapper div template for use in an extending class
Use the ID to get our button element and put it into ButtonUI.buttonStore, then bind event listeners to touch events.
Utility TouchList search function, matches a touch to an identifier stored in ButtonUI.touchStore.
The TouchList from the touch event
The matching touch or false
Called when the item has come into focus on the page. 'into focus' implementation depends on UIItem's parent class, for example SlideTabUI calls onFocus when the item has finished sliding into view.
Uses the event/schedule/whatever data to construct the HTML string, and return it to be dropped into the app. This function should be called before UIUtil.UIItem.buildJS.
An HTML string
Called when a signifigant time change (one minuete as of writing) has occured.Implementing class should update the HTML to reflect this new time using document queries.
Called when new data (usually over the internet) has been received. Implementing class should update the HTML to reflect this new data using document queries.
The DataManage generated data
Generated using TypeDoc
Simple UI Item to implement a clickable button.
Handles all the javascript to detect if a touch is on/off your button and has short and long press actions. Uses touch events, clientX and clientY, and getBoundingClientRect to acomplish this. Only supports single touch. Also includes CSS animations.
Note: Extending class MUST create an element selectable by '#(this.id)' where (this.id) is the id object given by UIUtil.UIItem.id. ButtonUI will use this selector to create a button around that element.