--- layout: post title: "An example of state-based testing in C#" description: "An example of avoiding Mocks and Stubs in C# unit testing." date: 2019-04-01 5:50 UTC tags: [Unit Testing] --- {% include JB/setup %}
{{ page.description }}
This article is an instalment in an article series about how to move from interaction-based testing to state-based testing. In the previous article, you saw an example of a pragmatic state-based test in F#. You can now take your new-found knowledge and apply it to the original C# example.
In the spirit of xUnit Test Patterns, in this article you'll see how to refactor the tests while keeping the implementation code constant.
The code shown in this article is available on GitHub.
The previous article provides more details on the System Under Test (SUT), but here it is, repeated, for your convenience:
public class ConnectionsController : ApiController { public ConnectionsController( IUserReader userReader, IUserRepository userRepository) { UserReader = userReader; UserRepository = userRepository; } public IUserReader UserReader { get; } public IUserRepository UserRepository { get; } public IHttpActionResult Post(string userId, string otherUserId) { var userRes = UserReader.Lookup(userId).SelectError( error => error.Accept(UserLookupError.Switch( onInvalidId: "Invalid user ID.", onNotFound: "User not found."))); var otherUserRes = UserReader.Lookup(otherUserId).SelectError( error => error.Accept(UserLookupError.Switch( onInvalidId: "Invalid ID for other user.", onNotFound: "Other user not found."))); var connect = from user in userRes from otherUser in otherUserRes select Connect(user, otherUser); return connect.SelectBoth(Ok, BadRequest).Bifold(); } private User Connect(User user, User otherUser) { user.Connect(otherUser); UserRepository.Update(user); return otherUser; } }
This implementation code is a simplification of the code example that serves as an example running through my two Clean Coders videos, Church Visitor and Preserved in translation.
As in the previous article, you can define a test-specific Fake database:
public class FakeDB : Collection<User>, IUserReader, IUserRepository { public IResult<User, IUserLookupError> Lookup(string id) { if (!(int.TryParse(id, out int i))) return Result.Error<User, IUserLookupError>(UserLookupError.InvalidId); var user = this.FirstOrDefault(u => u.Id == i); if (user == null) return Result.Error<User, IUserLookupError>(UserLookupError.NotFound); return Result.Success<User, IUserLookupError>(user); } public bool IsDirty { get; set; } public void Update(User user) { IsDirty = true; if (!Contains(user)) Add(user); } }
This is one of the few cases where I find inheritance more convenient than composition. By deriving from Collection<User>
, you don't have to explicitly write code to expose a Retrieval Interface. The entirety of a standard collection API is already available via the base class. Had this class been part of a public API, I'd be concerned that inheritance could introduce future breaking changes, but as part of a suite of unit tests, I hope that I've made the right decision.
Although you can derive a Fake database from a base class, you can still implement required interfaces - in this case IUserReader
and IUserRepository
. The Update
method is the easiest one to implement, since it simply sets the IsDirty
flag to true
and adds the user
if it's not already part of the collection.
The IsDirty
flag is the only custom Retrieval Interface added to the FakeDB
class. As the previous article explains, this flag provides a convenient was to verify whether or not the database has changed.
The Lookup
method is a bit more involved, since it has to support all three outcomes implied by the protocol:
id
is invalid, a result to that effect is returned.id
is found, then that user is returned.
This is all you need in terms of Test Doubles. You now have a test-specific IUserReader
and IUserRepository
implementation that you can pass to the Post
method. Notice that a single class implements multiple interfaces. This is often key to be able to implement a Fake object in the first place.
Like in the previous article, you can start by exercising the happy path where a user successfully connects with another user:
[Theory, UserManagementTestConventions] public void UsersSuccessfullyConnect( [Frozen(Matching.ImplementedInterfaces)]FakeDB db, User user, User otherUser, ConnectionsController sut) { db.Add(user); db.Add(otherUser); db.IsDirty = false; var actual = sut.Post(user.Id.ToString(), otherUser.Id.ToString()); var ok = Assert.IsAssignableFrom<OkNegotiatedContentResult<User>>(actual); Assert.Equal(otherUser, ok.Content); Assert.True(db.IsDirty); Assert.Contains(otherUser.Id, user.Connections); }
This, and all other tests in this article use xUnit.net 2.3.1 and AutoFixture 4.1.0.
The test is organised according to my standard heuristic for formatting tests according to the Arrange Act Assert pattern. In the Arrange phase, it adds the two valid User
objects to the Fake db
and sets the IsDirty
flag to false.
Setting the flag is necessary because this is object-oriented code, where objects have mutable state. In the previous articles with examples in F# and Haskell, the User
types were immutable. Connecting two users didn't mutate one of the users, but rather returned a new User
value, as this F# example demonstrates:
// User -> User -> User let addConnection user otherUser = { user with ConnectedUsers = otherUser :: user.ConnectedUsers }
In the current object-oriented code base, however, connecting one user to another is an instance method on the User
class that mutates its state:
public void Connect(User otherUser) { connections.Add(otherUser.Id); }
As a consequence, the Post
method could, if someone made a mistake in its implementation, call user.Connect
, but forget to invoke UserRepository.Update
. Even if that happened, then all the other assertions would pass. This is the reason that you need the Assert.True(db.IsDirty)
assertion in the Assert phase of the test.
While we can apply to object-oriented code what we've learned from functional programming, the latter remains simpler.
While there's one happy path, there's four distinct error paths that you ought to cover. You can use the Fake database for that as well:
[Theory, UserManagementTestConventions] public void UsersFailToConnectWhenUserIdIsInvalid( [Frozen(Matching.ImplementedInterfaces)]FakeDB db, string userId, User otherUser, ConnectionsController sut) { Assert.False(int.TryParse(userId, out var _)); db.Add(otherUser); db.IsDirty = false; var actual = sut.Post(userId, otherUser.Id.ToString()); var err = Assert.IsAssignableFrom<BadRequestErrorMessageResult>(actual); Assert.Equal("Invalid user ID.", err.Message); Assert.False(db.IsDirty); } [Theory, UserManagementTestConventions] public void UsersFailToConnectWhenOtherUserIdIsInvalid( [Frozen(Matching.ImplementedInterfaces)]FakeDB db, User user, string otherUserId, ConnectionsController sut) { Assert.False(int.TryParse(otherUserId, out var _)); db.Add(user); db.IsDirty = false; var actual = sut.Post(user.Id.ToString(), otherUserId); var err = Assert.IsAssignableFrom<BadRequestErrorMessageResult>(actual); Assert.Equal("Invalid ID for other user.", err.Message); Assert.False(db.IsDirty); } [Theory, UserManagementTestConventions] public void UsersDoNotConnectWhenUserDoesNotExist( [Frozen(Matching.ImplementedInterfaces)]FakeDB db, int userId, User otherUser, ConnectionsController sut) { db.Add(otherUser); db.IsDirty = false; var actual = sut.Post(userId.ToString(), otherUser.Id.ToString()); var err = Assert.IsAssignableFrom<BadRequestErrorMessageResult>(actual); Assert.Equal("User not found.", err.Message); Assert.False(db.IsDirty); } [Theory, UserManagementTestConventions] public void UsersDoNotConnectWhenOtherUserDoesNotExist( [Frozen(Matching.ImplementedInterfaces)]FakeDB db, User user, int otherUserId, ConnectionsController sut) { db.Add(user); db.IsDirty = false; var actual = sut.Post(user.Id.ToString(), otherUserId.ToString()); var err = Assert.IsAssignableFrom<BadRequestErrorMessageResult>(actual); Assert.Equal("Other user not found.", err.Message); Assert.False(db.IsDirty); }
There's little to say about these tests that hasn't already been said in at least one of the previous articles. All tests inspect the state of the Fake database after calling the Post
method. The exact interactions between Post
and db
aren't specified. Instead, these tests rely on setting up the initial state, exercising the SUT, and verifying the final state. These are all state-based tests that avoid over-specifying the interactions.
Specifically, none of these tests use Mocks and Stubs. In fact, at this incarnation of the test code, I was able to entirely remove the reference to Moq.
The premise of Refactoring is that in order to be able to refactor, the "precondition is [...] solid tests". In reality, many development organisations have the opposite experience. When programmers attempt to make changes to how their code is organised, tests break. In xUnit Test Patterns this problem is called Fragile Tests, and the cause is often Overspecified Software. This means that tests are tightly coupled to implementation details of the SUT.
It's easy to inadvertently fall into this trap when you use Mocks and Stubs, even when you follow the rule of using Mocks for Commands and Stubs for Queries. Refactoring tests towards state-based testing with Fake objects, instead of interaction-based testing, could make test suites more robust to changes.
It's intriguing, though, that state-based testing is simpler in functional programming. In Haskell, you can simply write your tests in the State monad and compare the expected outcome to the actual outcome. Since state in Haskell is immutable, it's trivial to compare the expected with the actual state.
As soon as you introduce mutable state, structural equality is no longer safe, and instead you have to rely on other inspection mechanisms, such as the IsDirty
flag seen in this, and the previous, article. This makes the tests slightly more brittle, because it tends to pull towards interaction-based testing.
While you can implement the State monad in both F# and C#, it's probably more pragmatic to express state-based tests using mutable state and the occasional IsDirty
flag. As always, there's no panacea.
While this article concludes the series on moving towards state-based testing, I think that an appendix on Test Spies is in order.
Next: A pure Test Spy.
Comments
If we had checked the FakeDB contains to user (by retrieving, similar as in the F# case), and assert Connections property on the retrieved objects, would we still need the IsDirty flag? I think it would be good to create a couple of cases which demonstrates refactoring, and how overspecified tests break with the interaction based tests, while works nicely here.
ladeak, thank you for writing. The
The Haskell example demonstrates how noIsDirty
flag is essentially a hack to work around the mutable nature of theFakeDB
. As the previous article describes:IsDirty
flag is required, because you can simply compare the state before and after the SUT was exercised.You could do something similar in C# or F#, but that would require you to take an immutable snapshot of the Fake database before exercising the SUT, and then compare that snapshot with the state of the Fake database after the SUT was exercised. This is definitely also doable (as the Haskell example demonstrates), but a bit more work, which is the (unprincipled, pragmatic) reason I instead chose to use an
IsDirty
flag.Regarding more examples, I originally wrote another sample code base to support this talk. That sample code base contains examples that demonstrate how overspecified tests break even when you make small internal changes. I haven't yet, however, found a good home for that code base.
First of all, thank you for yet another awesome series.
The fragility of my various employers' unit tests has always bothered me, but I couldn't necessarily offer an alternative that reduced/removed that. After further thought, I initially came up with two objections to this approach (based on actual enterprise experience), but was easily able to dismiss them:
- What if the SUT has a lot of dependencies?
- Then--following best practices--the SUT is doing too much
- What if the dependency has a lot of methods
- Then--following best practices--the dependency is doing too much
The one point I wanted to seek clarification on though was that--as you spell out throughout the series--this "state-based" approach is no panacea and you may still need to do some test refactoring if you change the implementation of the SUT (e.g. if, referencing point #2 above, we break up a large dependency into a more targeted one). You may need to update your "fake" to account for that, but that that effort is much smaller than updating innumerable mock setup/verify calls, is that a correct summation? So I would have a "fake" per unit test fixture (to use nunit terminology) and would only need to update that one fake if/when the SUT for that fixture is refactored in such a way that impacts the fake.After reading this series I was trying to imagine how I could introduce this into my team's codebase where both of the objections I listed above are very real problems (I am new to the team and trying to wrangle with these issues). I imagine a pragmatic first step would be to define multiple fakes for a given large SUT that attempt to group dependency behavior in some logical fashion. Per usual, you've given me a lot to think about and some motivation to clean up some code!
Sven, thank you for writing. I think that your summary of my position is accurate. A Fake affords a 'one-stop' place where you can go and address changes in you SUT APIs. You'll still need to edit test code (your Fake implementation), but in single place.
We can, on the other hand, view multiple
Setup
/Verify
changes as a violation of the DRY principle.I don't understand, however, why you want to involve the concept of a Fixture, one way or another. A Fake is Fake, regardless of the Fixture in which it appears.
Mark, you are right and I had intended to remove that reference to fixtures but forgot to. I could easily see fakes living completely outside of any specific fixture.


SSL_CTX_set_session_cache_mode(3)
SSL_CTX_set_session_cache_mode, SSL_CTX_get_session_cache_mode -
enable/disable session caching
#include <openssl/ssl.h>
long SSL_CTX_set_session_cache_mode(SSL_CTX ctx, long mode);
long SSL_CTX_get_session_cache_mode(SSL_CTX ctx);
SSL_CTX_set_session_cache_mode() enables/disables session
caching by setting the operational mode for ctx to <mode>.
SSL_CTX_get_session_cache_mode() returns the currently used
cache mode.
The OpenSSL library can store/retrieve SSL/TLS sessions for later reuse.
The sessions can be held in memory for each ctx, if more than one SSL_CTX object is being maintained, the sessions are
unique for each SSL_CTX object.
In order to reuse a session, a client must send the session's id to the
server. It can only send exactly one id. The server then either agrees to
reuse the session or it starts a full handshake (to create a new session).
A server will lookup up the session in its internal session storage. If the
session is not found in internal storage or lookups for the internal
storage have been deactivated (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP), the
server will try the external storage if available.
Since a client may try to reuse a session intended for use in a different
context, the session id context must be set by the server (see
SSL_CTX_set_session_id_context(3)).
The following session cache modes and modifiers are available:
- SSL_SESS_CACHE_OFF
-
No session caching for client or server takes place.
- SSL_SESS_CACHE_CLIENT
-
Client sessions are added to the session cache. As there is no reliable way
for the OpenSSL library to know whether a session should be reused or which
session to choose (due to the abstract BIO layer the SSL engine does not
have details about the connection), the application must select the session
to be reused by using the SSL_set_session(3)
function. This option is not activated by default.
- SSL_SESS_CACHE_SERVER
-
Server sessions are added to the session cache. When a client proposes a
session to be reused, the server looks for the corresponding session in
(first) the internal session cache (unless
SSL_SESS_CACHE_NO_INTERNAL_LOOKUP is set), then (second) in the external
cache if available. If the session is found, the server will try to reuse
the session. This is the default.
- SSL_SESS_CACHE_BOTH
-
Enable both SSL_SESS_CACHE_CLIENT and SSL_SESS_CACHE_SERVER at the same
time.
- SSL_SESS_CACHE_NO_AUTO_CLEAR
-
Normally the session cache is checked for expired sessions every 255
connections using the
SSL_CTX_flush_sessions(3) function. Since this may lead to a delay which cannot be controlled, the
automatic flushing may be disabled and
SSL_CTX_flush_sessions(3) can be called explicitly by the application.
- SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
-
By setting this flag, session-resume operations in an SSL/TLS server will
not automatically look up sessions in the internal cache, even if sessions
are automatically stored there. If external session caching callbacks are
in use, this flag guarantees that all lookups are directed to the external
cache. As automatic lookup only applies for SSL/TLS servers, the flag has
no effect on clients.
- SSL_SESS_CACHE_NO_INTERNAL_STORE
-
Depending on the presence of SSL_SESS_CACHE_CLIENT and/or
SSL_SESS_CACHE_SERVER, sessions negotiated in an SSL/TLS handshake may be
cached for possible reuse. Normally a new session is added to the internal
cache as well as any external session caching (callback) that is configured
for the SSL_CTX. This flag will prevent sessions being stored in the
internal cache (though the application can add them manually using SSL_CTX_add_session(3)). Note: in any SSL/TLS servers where external caching is configured, any
successful session lookups in the external cache (ie. for session-resume
requests) would normally be copied into the local cache before processing
continues - this flag prevents these additions to the internal cache as
well.
- SSL_SESS_CACHE_NO_INTERNAL
-
Enable both SSL_SESS_CACHE_NO_INTERNAL_LOOKUP and
SSL_SESS_CACHE_NO_INTERNAL_STORE at the same time.
The default mode is SSL_SESS_CACHE_SERVER.
SSL_CTX_set_session_cache_mode() returns the previously set
cache mode.
SSL_CTX_get_session_cache_mode() returns the currently set
cache mode.
ssl(3), SSL_set_session(3),
SSL_session_reused(3),
SSL_CTX_add_session(3),
SSL_CTX_sess_number(3),
SSL_CTX_sess_set_cache_size(3),
SSL_CTX_sess_set_get_cb(3),
SSL_CTX_set_session_id_context(3),
SSL_CTX_set_timeout(3),
SSL_CTX_flush_sessions(3)
SSL_SESS_CACHE_NO_INTERNAL_STORE and SSL_SESS_CACHE_NO_INTERNAL were
introduced in OpenSSL 0.9.6h.
|


--- layout: post esbma_id: 1131 title: Vault users: Do NOT install SP1 date: 2004-08-31 13:53:56 ---
Service Pack 1 for the .NET Framework appears to break compatibility in a way that causes major problems for SourceGear Vault.
It is VERY IMPORTANT that Vault users do NOT install this service pack on the machine hosting the Vault server. Doing so will cause damage to your Vault database.
Vault 2.0.6 will include a workaround for this problem and will be released as soon as we finish testing it.


YAWF (yeah, a websocket framework...)
in this example, we send a string message to through a websocket with which the server echo's back to all the connected clients.
in this example, we send a string message to through a websocket with which the server echo's back to all the connected clients.


Generate a Cobertura model coverage report, coberturamodelcoverage.xml, and save it in the matlabTestArtifacts folder of the Jenkins workspace.
This report includes coverage results for Simulink® models that are tested using Simulink Test™.
Note: This feature requires a Simulink Coverage™ license and is supported only in MATLAB R2018b or a newer release.


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Forward G2 stochastic process More...
#include <ql/processes/g2process.hpp>
Public Member Functions | |
| G2ForwardProcess (Real a, Real sigma, Real b, Real eta, Real rho) | |
| Public Member Functions inherited from ForwardMeasureProcess | |
| virtual void | setForwardMeasureTime (Time) |
| Time | getForwardMeasureTime () const |
| Public Member Functions inherited from StochasticProcess | |
| ~StochasticProcess () override=default | |
| virtual Size | factors () const |
| returns the number of independent factors of the process More... | |
| virtual Array | evolve (Time t0, const Array &x0, Time dt, const Array &dw) const |
| virtual Array | apply (const Array &x0, const Array &dx) const |
| virtual Time | time (const Date &) const |
| void | update () override |
| Public Member Functions inherited from Observer | |
| Observer ()=default | |
| Observer (const Observer &) | |
| Observer & | operator= (const Observer &) |
| virtual | ~Observer () |
| std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
| void | registerWithObservables (const ext::shared_ptr< Observer > &) |
| Size | unregisterWith (const ext::shared_ptr< Observable > &) |
| void | unregisterWithAll () |
| virtual void | update ()=0 |
| virtual void | deepUpdate () |
| Public Member Functions inherited from Observable | |
| Observable () | |
| Observable (const Observable &) | |
| Observable & | operator= (const Observable &) |
| virtual | ~Observable ()=default |
| void | notifyObservers () |
StochasticProcess interface | |
| Real | x0_ = 0.0 |
| Real | y0_ = 0.0 |
| Real | a_ |
| Real | sigma_ |
| Real | b_ |
| Real | eta_ |
| Real | rho_ |
| ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > | xProcess_ |
| ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > | yProcess_ |
| Size | size () const override |
| returns the number of dimensions of the stochastic process More... | |
| Array | initialValues () const override |
| returns the initial values of the state variables More... | |
| Array | drift (Time t, const Array &x) const override |
| returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \) More... | |
| Matrix | diffusion (Time t, const Array &x) const override |
| returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \) More... | |
| Array | expectation (Time t0, const Array &x0, Time dt) const override |
| Matrix | stdDeviation (Time t0, const Array &x0, Time dt) const override |
| Matrix | covariance (Time t0, const Array &x0, Time dt) const override |
| Real | xForwardDrift (Time t, Time T) const |
| Real | yForwardDrift (Time t, Time T) const |
| Real | Mx_T (Real s, Real t, Real T) const |
| Real | My_T (Real s, Real t, Real T) const |
Additional Inherited Members | |
| Public Types inherited from Observer | |
| typedef set_type::iterator | iterator |
| Protected Member Functions inherited from ForwardMeasureProcess | |
| ForwardMeasureProcess ()=default | |
| ForwardMeasureProcess (Time T) | |
| ForwardMeasureProcess (const ext::shared_ptr< discretization > &) | |
| Protected Member Functions inherited from StochasticProcess | |
| StochasticProcess ()=default | |
| StochasticProcess (ext::shared_ptr< discretization >) | |
| Protected Attributes inherited from ForwardMeasureProcess | |
| Time | T_ |
| Protected Attributes inherited from StochasticProcess | |
| ext::shared_ptr< discretization > | discretization_ |
Forward G2 stochastic process
Definition at line 62 of file g2process.hpp.
Definition at line 127 of file g2process.cpp.
|
overridevirtual |
returns the number of dimensions of the stochastic process
Implements StochasticProcess.
Definition at line 132 of file g2process.cpp.
|
overridevirtual |
returns the initial values of the state variables
Implements StochasticProcess.
Definition at line 136 of file g2process.cpp.
returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 140 of file g2process.cpp.
returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 147 of file g2process.cpp.
returns the expectation \( E(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 156 of file g2process.cpp.
returns the standard deviation \( S(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 164 of file g2process.cpp.
returns the covariance \( V(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 180 of file g2process.cpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 76 of file g2process.hpp.
|
protected |
Definition at line 77 of file g2process.hpp.
|
protected |
Definition at line 78 of file g2process.hpp.


We apologise but there seems to be temporary problem with the service.
Problems
Found
Repaired
Repair Another File
Download


Vim is all about the modern web. Vim will help you take your web app to the next level. You know node.js. Hell, you've practically got a Ph.D in slinging code. Why should you let your text editor get in the way?
Vim comes with ready-made tools to format HTML, CSS, Javascript, Node.js, C++ and more. What happens when you suddenly need to pivot and create the next $19 billion phone number database messaging service? Boom. Vim supports Erlang.
Bottom line: Vim gets you out of the office and into the gym faster than any other editor to date.
Vim is the world-class, lightweight champion of text editors
Vim is all about packages. Remix your Vim anyway you want.
Vim not only runs on your OS X dev machine, but also on your Ubuntu Linux servers. This means you can crush code in production without sacrificing your editing experience.
 Using Vim will put a stop to that. Vim donates money to children living in Uganda. You'll look so accepting and humanitarian just by using Vim, that you won't even have to think about actual social issues. This leaves you free to go back to solving problems that really matter, like building apps that incentivize breaking up protests or apps that crowd-source date conversations.
Don't get me wrong: I know you don't actually care about human rights and social issues.
Sign up now for a chance to get an early-access invite for Vim today.
Don't make the cut? Guess you aren't ready for a next-level editor experience.


Anti-VEGF Control Odds Ratio Odds Ratio
Study or Subgroup __ Events Total Events Total Weight M-H, Fixed, 95% Cl M-H, Fixed, 95% Cl 1.2.1 Epitheliopathy or Erosions
Vandewalle2015 1 36 4 36 = 18.3% 0.23 [0.02, 2.15] SS ee Subtotal (95% Cl) 36 36 18.3% 0.23 [0.02, 2.15] i Total events 1 4
Heterogeneity: Not applicable Test for overall effect: Z = 1.29 (P = 0.20)
1.2.2 Epithelial Defect
Kasetsuwan2015 x 12 - 10 4.7% 0.82 [0.04, 15.00] ———— Shenasi, A.2011 15 33 15 33 38.4% 1.00 [0.38, 2.64]
Subtotal (95% Cl) 45 43 43.1% 0.98 [0.39, 2.46]
Total events 16 16
Heterogeneity: Chi? = 0.02, df = 1 (P = 0.90); I? = 0% Test for overall effect: Z = 0.04 (P = 0.97)
1.2.3 Corneal Ulcer/Dellen Formation
Shenasi, A.2011 1 33 3 33 13.7% 0.31 [0.03, 3.17] =e
Subtotal (95% Cl) 33 33 13.7% 0.31 [0.03, 3.17] Ee
Total events 1 3
Heterogeneity: Not applicable
Test for overall effect: Z = 0.98 (P = 0.33)
1.2.4 Endothelial folds/Corneal Edema
Saeed2014 1. 14 z 14 8.7% 0.46 [0.04, 5.77] SS.
Tai2015 4 29 4 29 16.2% 1.00 [0.22, 4.45] <a
Subtotal (95% Cl) 43 43 24.9% 0.81 [0.23, 2.89]
Total events 5 6
Heterogeneity: Chi? = 0.27, df = 1 (P = 0.61); I? = 0%
Test for overall effect: Z = 0.32 (P = 0.75)
Total (95% Cl) 157 155 100.0% 0.71 [0.37, 1.37] <p>
Total events : 23 29 :
Heterogeneity: Chi* = 2.27, df = 5 (P = 0.81); I? = 0% — a: i saa Caran Test . sc effect: Z = 1.02 (P = 0.31) oot PERVERT CONTROL ay
Test for subgroup differences: Chi? = 1.96, df = 3 (P = 0.58), I? = 0%


After clicking on the "Create" button, you would have to enter a few first user phrases for your Assistant.


See the scoreboard or read the instructions.
{% if submissions_enabled %} For the second round, the submission deadline is Sunday, 12:00, and the winners will be announced at 13:00 at the Red Hat booth. {% else %} The second round deadline has been reached and further submissions have been disabled. The winners will be announced at 13:00 at the Red Hat booth. {% endif %}


log4javascript quick start tutorial
Three step guide
-
Download the code
Unzip the distribution and copy log4javascript.js into the desired location. No other files are necessary.
-
Initialize log4javascript in your web page
Include log4javascript.js in your page using the code below. This code assumes log4javascript is stored in the same directory as your web page.
<script type="text/javascript" src="log4javascript.js"></script> <script type="text/javascript"> var log = log4javascript.getDefaultLogger(); </script>
The default logger uses a
PopUpAppender
which opens a pop-up window. By default, this window will open when the first log message is written. For this to work, you will need to disable any pop-up blockers you may have. -
Include logging statements in your code
You have six logging methods at your disposal, depending on the severity of the message you wish to log. By default, all messages are logged in the pop-up window.  Below are some examples of common types of logging.
Logging examples
-
A simple logging message string
log.info("Hello world");
displays19:52:03 INFO - Hello world
-
Logging an error with a message
try { throw new Error("Faking something going wrong!"); } catch (e) { log.error("An error occurred", e); }
displays19:52:32 ERROR - An error occurred Exception: Faking something going wrong! on line number 80 in file basic.html
-
Logging multiple messages with one logging call
var a = "Hello"; var b = 3; log.debug(a, b);
displays19:53:05 DEBUG - Hello 3
-
Logging an object
Logging an object:
var obj = new Object(); obj.name = "Octopus"; obj.tentacles = 8; log.info(obj);
displays19:53:17 INFO - { name: Octopus, tentacles: 8 }
Tweaking the default logger
The default logger is fine as a starting point, but what if you want the default logger with a few different options (say, bringing the pop-up to the front whenever a log message is logged, or having new log messages appear at the top of the pop-up rather than the bottom)?
In this case, you will need to create a new logger, then create a
PopUpAppender
, set options
on it, and add it to the logger:
<script type="text/javascript" src="log4javascript.js"></script> <script type="text/javascript"> // Create the logger var log = log4javascript.getLogger(); // Create a PopUpAppender with default options var popUpAppender = new log4javascript.PopUpAppender(); // Change the desired configuration options popUpAppender.setFocusPopUp(true); popUpAppender.setNewestMessageAtTop(true); // Add the appender to the logger log.addAppender(popUpAppender); // Test the logger log.debug("Hello world!"); </script>
See this example in action (opens in new window)
Refer to the manual for more information about
configuring appenders and more
details about PopUpAppender
.
Sending log messages to the server
For this you will need to use an AjaxAppender
as follows:
var ajaxAppender = new log4javascript.AjaxAppender(URL); log.addAppender(ajaxAppender);
Now your log messages will appear in the pop-up window and be sent asynchronously to the URL you specify in the form of HTTP post parameters. No server-side code to process these requests is provided with log4javascript.
See AjaxAppender
for more details
on formatting log messages.
Changing the format of log messages
Using a Layout
, you can
format log messages however you like. For example:
var log = log4javascript.getLogger("mylogger"); var popUpAppender = new log4javascript.PopUpAppender(); var layout = new log4javascript.PatternLayout("[%-5p] %m"); popUpAppender.setLayout(layout);
A call to
log.debug("Hello world");
will now result in output in the pop-up window of
[DEBUG] Hello world
See PatternLayout
for more details
on formatting log messages.


Do you enjoy running?
Are you just starting out?  Looking for a place to go through rehabilitation and come back stronger and in better shape than you have been?
We offer solutions for all of the above! No matter where you are in your running career, there is always room for improvement in technique, body, and mind. We have highly certified trainers who can help you improve your speed, endurance, and strength to help you make it to the next level.
-
Speed
-
Distance
-
Strength
-
Appointment


Read Block
Description
The read instruction asks the user for a value to fill the assigned variable
Syntax


--- layout: docpage title: "Documentation" is_homepage: false is_sphinx_doc: true doc-parent: "Operating Cassandra" doc-title: "Security" doc-header-links: ' ' doc-search-path: "../search.html" extra-footer: ' ' ---
There are three main components to the security features provided by Cassandra:
Cassandra provides secure communication between a client machine and a database cluster and between nodes within a cluster. Enabling encryption ensures that data in flight is not compromised and is transferred securely. The options for client-to-node and node-to-node encryption are managed separately and may be configured independently.
In both cases, the JVM defaults for supported protocols and cipher suites are used when encryption is enabled. These can
be overidden using the settings in cassandra.yaml
, but this is not recommended unless there are policies in place
which dictate certain settings or a need to disable vulnerable ciphers or protocols in cases where the JVM cannot be
updated.
FIPS compliant settings can be configured at the JVM level and should not involve changing encryption settings in cassandra.yaml. See the java document on FIPS for more details.
For information on generating the keystore and truststore files used in SSL communications, see the java documentation on creating keystores
The settings for managing inter-node encryption are found in cassandra.yaml
in the server_encryption_options
section. To enable inter-node encryption, change the internode_encryption
setting from its default value of none
to one value from: rack
, dc
or all
.
The settings for managing client to node encryption are found in cassandra.yaml
in the client_encryption_options
section. There are two primary toggles here for enabling encryption, enabled
and optional
.
true
, client connections are entirely unencrypted.enabled
is set to true
and optional
is set to false
, all client connections must be secured.true
, both encrypted and unencrypted connections are supported using the same port.
Client connections using encryption with this configuration will be automatically detected and handled by the server.As an alternative to the optional
setting, separate ports can also be configured for secure and unsecure connections
where operational requirements demand it. To do so, set optional
to false and use the native_transport_port_ssl
setting in cassandra.yaml
to specify the port to be used for secure client communication.
Cassandra uses database roles, which may represent either a single user or a group of users, in both authentication and
permissions management. Role management is an extension point in Cassandra and may be configured using the
role_manager
setting in cassandra.yaml
. The default setting uses CassandraRoleManager
, an implementation
which stores role information in the tables of the system_auth
keyspace.
See also the CQL documentation on roles.
Authentication is pluggable in Cassandra and is configured using the authenticator
setting in cassandra.yaml
.
Cassandra ships with two options included in the default distribution.
By default, Cassandra is configured with AllowAllAuthenticator
which performs no authentication checks and therefore
requires no credentials. It is used to disable authentication completely. Note that authentication is a necessary
condition of Cassandra’s permissions subsystem, so if authentication is disabled, effectively so are permissions.
The default distribution also includes PasswordAuthenticator
, which stores encrypted credentials in a system table.
This can be used to enable simple username/password authentication.
Before enabling client authentication on the cluster, client applications should be pre-configured with their intended credentials. When a connection is initiated, the server will only ask for credentials once authentication is enabled, so setting up the client side config in advance is safe. In contrast, as soon as a server has authentication enabled, any connection attempt without proper credentials will be rejected which may cause availability problems for client applications. Once clients are setup and ready for authentication to be enabled, follow this procedure to enable it on the cluster.
Pick a single node in the cluster on which to perform the initial configuration. Ideally, no clients should connect to this node during the setup process, so you may want to remove it from client config, block it at the network level or possibly add a new temporary node to the cluster for this purpose. On that node, perform the following steps:
cqlsh
session and change the replication factor of the system_auth
keyspace. By default, this keyspace
uses SimpleReplicationStrategy
and a replication_factor
of 1. It is recommended to change this for any
non-trivial deployment to ensure that should nodes become unavailable, login is still possible. Best practice is to
configure a replication factor of 3 to 5 per-DC.ALTER KEYSPACE system_auth WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': 3, 'DC2': 3};
cassandra.yaml
to change the authenticator
option like so:authenticator: PasswordAuthenticator
cqlsh
session using the credentials of the default superuser:cqlsh -u cassandra -p cassandra
QUORUM
, whereas
those for all other users (including superusers) are read at LOCAL_ONE
. In the interests of performance and
availability, as well as security, operators should create another superuser and disable the default one. This step
is optional, but highly recommended. While logged in as the default superuser, create another superuser role which
can be used to bootstrap further configuration.# create a new superuser
CREATE ROLE dba WITH SUPERUSER = true AND LOGIN = true AND PASSWORD = 'super';
ALTER ROLE cassandra WITH SUPERUSER = false AND LOGIN = false;
At the end of these steps, the one node is configured to use password authentication. To roll that out across the cluster, repeat steps 2 and 3 on each node in the cluster. Once all nodes have been restarted, authentication will be fully enabled throughout the cluster.
Note that using PasswordAuthenticator
also requires the use of CassandraRoleManager.
See also: Setting credentials for internal authentication, CREATE ROLE, ALTER ROLE, ALTER KEYSPACE and GRANT PERMISSION,
Authorization is pluggable in Cassandra and is configured using the authorizer
setting in cassandra.yaml
.
Cassandra ships with two options included in the default distribution.
By default, Cassandra is configured with AllowAllAuthorizer
which performs no checking and so effectively grants all
permissions to all roles. This must be used if AllowAllAuthenticator
is the configured authenticator.
The default distribution also includes CassandraAuthorizer
, which does implement full permissions management
functionality and stores its data in Cassandra system tables.
Permissions are modelled as a whitelist, with the default assumption that a given role has no access to any database resources. The implication of this is that once authorization is enabled on a node, all requests will be rejected until the required permissions have been granted. For this reason, it is strongly recommended to perform the initial setup on a node which is not processing client requests.
The following assumes that authentication has already been enabled via the process outlined in Enabling Password Authentication. Perform these steps to enable internal authorization across the cluster:
cassandra.yaml
to change the authorizer
option like so:authorizer: CassandraAuthorizer
cqlsh
session using the credentials of a role with superuser credentials:cqlsh -u dba -p super
GRANT SELECT ON ks.t1 TO db_user;
See also: GRANT PERMISSION, GRANT ALL <grant-all> and REVOKE PERMISSION
Enabling authentication and authorization places additional load on the cluster by frequently reading from the
system_auth
tables. Furthermore, these reads are in the critical paths of many client operations, and so has the
potential to severely impact quality of service. To mitigate this, auth data such as credentials, permissions and role
details are cached for a configurable period. The caching can be configured (and even disabled) from cassandra.yaml
or using a JMX client. The JMX interface also supports invalidation of the various caches, but any changes made via JMX
are not persistent and will be re-read from cassandra.yaml
when the node is restarted.
Each cache has 3 options which can be set:
The naming for these options in cassandra.yaml
follows the convention:
<type>_validity_in_ms
<type>_update_interval_in_ms
<type>_cache_max_entries
Where <type>
is one of credentials
, permissions
, or roles
.
As mentioned, these are also exposed via JMX in the mbeans under the org.apache.cassandra.auth
domain.
Access control for JMX clients is configured separately to that for CQL. For both authentication and authorization, two providers are available; the first based on standard JMX security and the second which integrates more closely with Cassandra’s own auth subsystem.
The default settings for Cassandra make JMX accessible only from localhost. To enable remote JMX connections, edit
cassandra-env.sh
(or cassandra-env.ps1
on Windows) to change the LOCAL_JMX
setting to yes
. Under the
standard configuration, when remote JMX connections are enabled, standard JMX authentication
is also switched on.
Note that by default, local-only connections are not subject to authentication, but this can be enabled.
If enabling remote connections, it is recommended to also use SSL connections.
Finally, after enabling auth and/or SSL, ensure that tools which use JMX, such as nodetool, are correctly configured and working as expected.
Users permitted to connect to the JMX server are specified in a simple text file. The location of this file is set in
cassandra-env.sh
by the line:
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"
Edit the password file to add username/password pairs:
jmx_user jmx_password
Secure the credentials file so that only the user running the Cassandra process can read it :
$ chown cassandra:cassandra /etc/cassandra/jmxremote.password
$ chmod 400 /etc/cassandra/jmxremote.password
Optionally, enable access control to limit the scope of what defined users can do via JMX. Note that this is a fairly
blunt instrument in this context as most operational tools in Cassandra require full read/write access. To configure a
simple access file, uncomment this line in cassandra-env.sh
:
#JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.access.file=/etc/cassandra/jmxremote.access"
Then edit the access file to grant your JMX user readwrite permission:
jmx_user readwrite
Cassandra must be restarted to pick up the new settings.
An alternative to the out-of-the-box JMX auth is to useeCassandra’s own authentication and/or authorization providers for JMX clients. This is potentially more flexible and secure but it come with one major caveat. Namely that it is not available until after a node has joined the ring, because the auth subsystem is not fully configured until that point However, it is often critical for monitoring purposes to have JMX access particularly during bootstrap. So it is recommended, where possible, to use local only JMX auth during bootstrap and then, if remote connectivity is required, to switch to integrated auth once the node has joined the ring and initial setup is complete.
With this option, the same database roles used for CQL authentication can be used to control access to JMX, so updates
can be managed centrally using just cqlsh
. Furthermore, fine grained control over exactly which operations are
permitted on particular MBeans can be acheived via GRANT PERMISSION.
To enable integrated authentication, edit cassandra-env.sh
to uncomment these lines:
#JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.remote.login.config=CassandraLogin"
#JVM_OPTS="$JVM_OPTS -Djava.security.auth.login.config=$CASSANDRA_HOME/conf/cassandra-jaas.config"
And disable the JMX standard auth by commenting this line:
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"
To enable integrated authorization, uncomment this line:
#JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.authorizer=org.apache.cassandra.auth.jmx.AuthorizationProxy"
Check standard access control is off by ensuring this line is commented out:
#JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.access.file=/etc/cassandra/jmxremote.access"
With integrated authentication and authorization enabled, operators can define specific roles and grant them access to the particular JMX resources that they need. For example, a role with the necessary permissions to use tools such as jconsole or jmc in read-only mode would be defined as:
CREATE ROLE jmx WITH LOGIN = false;
GRANT SELECT ON ALL MBEANS TO jmx;
GRANT DESCRIBE ON ALL MBEANS TO jmx;
GRANT EXECUTE ON MBEAN 'java.lang:type=Threading' TO jmx;
GRANT EXECUTE ON MBEAN 'com.sun.management:type=HotSpotDiagnostic' TO jmx;
# Grant the jmx role to one with login permissions so that it can access the JMX tooling
CREATE ROLE ks_user WITH PASSWORD = 'password' AND LOGIN = true AND SUPERUSER = false;
GRANT jmx TO ks_user;
Fine grained access control to individual MBeans is also supported:
GRANT EXECUTE ON MBEAN 'org.apache.cassandra.db:type=Tables,keyspace=test_keyspace,table=t1' TO ks_user;
GRANT EXECUTE ON MBEAN 'org.apache.cassandra.db:type=Tables,keyspace=test_keyspace,table=*' TO ks_owner;
This permits the ks_user
role to invoke methods on the MBean representing a single table in test_keyspace
, while
granting the same permission for all table level MBeans in that keyspace to the ks_owner
role.
Adding/removing roles and granting/revoking of permissions is handled dynamically once the initial setup is complete, so no further restarts are required if permissions are altered.
See also: Permissions.
JMX SSL configuration is controlled by a number of system properties, some of which are optional. To turn on SSL, edit
the relevant lines in cassandra-env.sh
(or cassandra-env.ps1
on Windows) to uncomment and set the values of these
properties as required:
com.sun.management.jmxremote.ssl
com.sun.management.jmxremote.ssl.need.client.auth
com.sun.management.jmxremote.registry.ssl
com.sun.management.jmxremote.ssl.enabled.protocols
com.sun.management.jmxremote.ssl.enabled.cipher.suites
javax.net.ssl.keyStore
javax.net.ssl.keyStorePassword
javax.net.ssl.trustStore
javax.net.ssl.trustStorePassword
See also: Oracle Java7 Docs, Monitor Java with JMX


https://en.wikipedia.org/wiki/Quaternion
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
Stanisław Dawidowicz, Symulacje Monte Carlo ciekłych kryształów nematycznych dwuosiowych, Uniwersytet Jagielloński, Kraków 2018. [Monte Carlo simulations of biaxial nematic liquid crystals]
Quaternions have practical uses in calculations involving three-dimensional rotations, such as in three-dimensional computer graphics, computer vision, and crystallographic texture analysis.
Quaternions are present in several Python libraries, but their interface may be different.
https://pypi.org/project/pyrr/ pip install pyrr
https://pypi.org/project/pyquats/ pip install pyquats
import math from pyquats.quats import Quat # quaternions based on Python lists #from pyquats.numpyquats import Quat # quaternions based on numpy arrays from pyquats.qtools import * zero = Quat() one = Quat(1) ii = Quat(0, 1, 0, 0) jj = Quat(0, 0, 1, 0) kk = Quat(0, 0, 0, 1) assert ii * jj == kk assert jj * ii == -kk assert ii.is_unit() assert abs(ii) == 1 assert Quat(0.5, 0.5, 0.5, 0.5).is_unit() assert ii.conjugate() == -ii assert ii ** 2 == -one
# Quaternions and spatial_rotations. rotZ45 = Quat.from_z_rotation(math.pi/4) # Quat(0.923879532511, 0.0, 0.0, 0.382683432365) vec1 = [2, 0, 0] rotate1(vec1, rotZ45) # [1.414213562373095, 1.4142135623730951, 0.0] rotY90 = Quat.from_y_rotation(math.pi/2) # Quat(0.707106781187, 0.0, 0.707106781187, 0.0) rotate1(vec1, rotY90) # [4.440892098500626e-16, 0.0, -2.0]


Do not write container-independent code! Iterator invalidation, insertion, deletion, push_back and push_front patterns, iterator capabilities differ widely between STL containers. Rather, encapsulate operations and interactions and use typedef or using= to not have to specify the container everywhere (makes changing later easier).
Standard STL sequence containers: vector, string, deque and list
Standard STL associative containers: set, multiset, map, multimap
Standard non-STL containers: array, bitset, stack, queue
vector: default
list: frequent insertions and deletions in the middle of the sequence
deque: insertions and deletions at the beginning and end of sequence
Contiguous-memory containers store items sequentially, contiguously in dynamically allocated chunks of memory, like an array. More than one item is stored per chunk, so insertions and deletions effect other elements and require them to be moved.
Node-based containers store single items in single chunks of dynamically allocated memory and connect them via pointers. Insertion or erasing does not affect any other nodes / elements other than the node itself and its immediate neighbors.
Do you need to be able to insert a new element at an any position in the container? No associative containers
Do you care about order? No hashed containers
What iterator categories are required? RandomAccessIterators -> vector, deque; BiDirectional -> list
Is lookup speed important? Hashed containers, sorted vectors, associate containers.
Do you need to minimize iterator invalidation? Node-based containers.


Defaults to AutoCompleteCfg
. Type of the configuration object for this widget.
Specifies the behavior of the dropdown button.
blank
: Sends an empty string.current
: Send the input value.Event to initiate the autocomplete search.
enter
: Starts the search for suggestion items when the enter key is pressed.keyup
: Starts the search for suggestion items as soon as a key is released.Specifies whether filter requests are evaluated by the client's browser or whether they are sent to the server.
Whether the autocomplete is active.
The cache for the results of an autocomplete search.
The set-interval timer ID for the cache timeout.
The configuration of this widget instance. Please note that
no property is guaranteed to be present, you should always check for undefined
before accessing a property.
This is partly because the value of a property is not transmitted from the server to the client when it equals
the default.
The DOM element for the container with the dropdown suggestions.
The DOM element for the hidden input with the selected value.
The client-side ID of this widget, with all parent naming containers, such as
myForm:myWidget
. This is also the ID of the container HTML element for this widget. In case the widget needs
multiple container elements (such as Paginator), this may also be an array if IDs.
The DOM element for the input element.
If dynamic loading is enabled, whether the content was loaded already.
Whether the tab key is currently pressed.
Whether an item was clicked.
The DOM element for the container with the suggestion items.
Whether an item was selected via the enter key.
The DOM elements for the suggestion items.
The DOM element for the tooltip of a suggestion item.
The jQuery instance of the container element of this widget. In case id is an array, it will contain multiple elements. Please note that some widgets have got not DOM elements at all, in this case this will be an empty jQuery instance.
A CSS selector for the container element (or elements, in case id is an array) of
this widget, This is usually an ID selector (that is properly escaped). You can select the container element or
elements like this: $(widget.jqId)
.
The DOM element for the container with multiple selection items.
The DOM element for the overlay panel with the suggestion items.
The client ID of the overlay panel with the suggestion items.
The DOM element for the autocomplete status ARIA element.
Whether key input events should be ignored currently.
Whether a touch is made on the dropdown button.
The name of the widget variables of this widget. The widget variable can be used to
access a widget instance by calling PF('myWidgetVar')
.
The finishing HTML with the wrapper element of the suggestions box.
The starting HTML with the wrapper element of the suggestions box.
Activates search behavior.
Lets you register a listener that is called before the component is destroyed.
When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. When the element is removed from the DOM by the update, the DOM element is detached from the DOM and all destroy listeners are called. This makes it possible to add listeners from outside the widget code.
If you call this method twice with the same listener, it will be registered twice and later also called twice.
Note that for this to work, you must not override the destroy
method; or if you do, call super
.
Also, after this widget was detached is done, all destroy listeners will be unregistered.
A destroy listener to be registered.
When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. However, no new instance of the widget is created. Instead, after the DOM element was replaced, all refresh listeners are called. This makes it possible to add listeners from outside the widget code.
If you call this method twice with the same listener, it will be registered twice and later also called twice.
Note that for this to work, you must not override the refresh
method; or if you do, call super
.
Also, after the refresh is done, all refresh listeners will be deregistered. If you added the listeners from
within this widget, consider adding the refresh listeners not only in the init
method, but also again in
the refresh
method after calling super
.
A refresh listener to be registered.
Aligns (positions) the overlay panel that shows the found suggestions.
Appends the overlay panel to the DOM.
Sets up all event listeners for the dropdown menu.
Sets up all event listeners for mouse and click events.
Sets up all keyboard related event listeners.
Sets up all global event listeners for the overlay.
Each widget may have one or several behaviors attached to it. This method calls all attached behaviors for the given event name. In case no such behavior exists, this method does nothing and returns immediately.
A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.
Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server
and processes the response once it is received. This enables several features such as updating or replacing
elements dynamically. You can add an AJAX behavior via
<p:ajax event="name" actionListener="#{...}" onstart="..." />
.
The name of an event to call.
Additional configuration that is passed to the AJAX request for the server-side callback.
Clears the cache with the results of an autocomplete search.
Hides suggested items menu.
Deactivates search behavior.
Clears the set-timeout timer for the autocomplete search.
Will be called after an AJAX request if the widget container will be detached.
When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. When the element is removed from the DOM by the update, the DOM element is detached from the DOM and this method gets called.
Please note that instead of overriding this method, you should consider adding a destroy listener instead via addDestroyListener. This has the advantage of letting you add multiple listeners, and makes it possible to add additional listeners from code outside this widget.
By default, this method just calls all destroy listeners.
Disables the input field.
Disables the dropdown menu.
Adds the given text to the ARIA status label element.
Label text to display.
Enables the input field.
Enables the dropdown menu.
Fetches the suggestion items for the current query from the server.
Finds and sets the wrapper HTML snippets on this instance.
Wrapper element with the suggestions fetched from the server.
Triggers the behavior for when the input was cleared.
Each widget may have one or several behaviors attached to it. This method returns the callback function for the given event.
Note: Do not call the method directly, the recommended way to invoke a behavior is via callBehavior.
A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.
Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server
and processes the response once it is received. This enables several features such as updating or replacing
elements dynamically. You can add an AJAX behavior via
<p:ajax event="name" actionListener="#{...}" onstart="..." />
.
The name of an event for which to retrieve the behavior.
The behavior with the given name, or null
if no such behavior
exists.
Each widget has got a container element, this method returns that container. This container element is usually also the element whose ID is the client-side ID of the JSF component.
The jQuery instance representing the main HTML container element of this widget.
Takes the available suggestion items and groups them.
Each widget may have one or several behaviors attached to it. This method checks whether this widget has got at least one behavior associated with given event name.
A behavior is a way for associating client-side scripts with UI components that opens all sorts of possibilities, including client-side validation, DOM and style manipulation, keyboard handling, and more. When the behavior is triggered, the configured JavaScript gets executed.
Behaviors are often, but not necessarily, AJAX behavior. When triggered, it initiates a request the server
and processes the response once it is received. This enables several features such as updating or replacing
elements dynamically. You can add an AJAX behavior via
<p:ajax event="name" actionListener="#{...}" onstart="..." />
.
The name of an event to check.
true
if this widget has the given behavior, false
otherwise.
Hides the panel with the suggestions.
A widget class should not have an explicit constructor. Instead, this initialize method is called after the widget was created. You can use this method to perform any initialization that is required. For widgets that need to create custom HTML on the client-side this is also the place where you should call your render method.
Please make sure to call the super method first before adding your own custom logic to the init method:
PrimeFaces.widget.MyWidget = PrimeFaces.widget.BaseWidget.extend({
init: function(cfg) {
this._super(cfg);
// custom initialization
}
});
The widget configuration to be used for this widget instance.
This widget configuration is usually created on the server by the javax.faces.render.Renderer
for this
component.
Initializes the cache that stores the retrieved suggestions for a search term.
Invokes the appropriate behavior for when a suggestion item was selected.
The event that occurred.
Value of the selected item.
Invokes the appropriate behavior when a suggestion item was unselected.
The event that occurred.
Value of the unselected item.
Invokes the appropriate behavior for when more text was selected.
Checks if this widget is detached, ie whether the HTML element of this widget is currently contained within the DOM (the HTML body element). A widget may become detached during an AJAX update, and it may remain detached in case the update removed this component from the component tree.
true
if this widget is currently detached, or false
otherwise.
Checks whether the given value is part of the available suggestion items.
A value to check.
true
if clear event should be fired.
Whether the given value matches a value in the list of available suggestion items;
or undefined
if AutoCompleteCfg.forceSelection is set to false
.
Callback for when a key event occurred.
Key event that occurred.
Used in ajax updates, reloads the widget configuration.
When an AJAX call is made and this component is updated, the DOM element is replaced with the newly rendered content. However, no new instance of the widget is created. Instead, after the DOM element was replaced, this method is called with the new widget configuration from the server. This makes it possible to persist client-side state during an update, such as the currently selected tab.
Please note that instead of overriding this method, you should consider adding a refresh listener instead via addRefreshListener. This has the advantage of letting you add multiple listeners, and makes it possible to add additional listeners from code outside this widget.
By default, this method calls all refresh listeners, then reinitializes the widget by calling the init
method.
The new widget configuration from the server.
The value as returned by the init
method, which is often undefined
.
Removes all items if in multiple mode.
Removes the widget's script block from the DOM. Currently, the ID of this script block consists of the
client-side ID of this widget with the prefix _s
, but this is subject to change.
The client-side ID of the widget.
Initiates a search with given value, that is, look for matching options and present the options that were found to the user.
Keyword for the search.
Performs a search the same ways as if the user had opened the dropdown menu. Depending on the configured
dropdownMode
, performs the search either with an empty string or with the current value.
Adds the suggestions items in the given wrapper to the local cache of suggestion items.
Wrapper element with the suggestions fetched from the server.
Sets up the event listener for the blur event to force a selection, when that feature is enabled.
Binds events for multiple selection mode
Shows the panel with the suggestions.
Shows the tooltip for the given suggestion item.
Item with a tooltip.
Performs the search for the available suggestion items.
Keyword for the search.
Generated using TypeDoc
PrimeFaces AutoComplete Widget
AutoComplete provides live suggestions while the user is entering text


--- layout: post title: ! 'IE Gotcha #3' published: true date: 2010-09-01 categories: [] posterous_url: http://blog.hungerandthirstdesign.com/post/1047070622/ie-gotcha-3 posterous_slug: post/1047070622/ie-gotcha-3 ---
Continuing the rant…
So I already knew IE7 didn’t respect the inline-block property.  Its really hard to do some types of layout without that property. So what to do?
Believe it or not, this hack works (from flipc.blogspot.com). Just add:
zoom: 1; *display: inline; _height: 30px;
to the end of your styling for the element you need inline-block to work for. It doesn’t screw with Firefox or even IE8 (which handles inline-block just fine…).
So moral of the story is still don’t use IE. Period. Solution one is Mozilla’s Firefox. Solution 2 is at least ie6update.com


Hello There
Welcome to my Homepage :)
My name is Dhruv Shah, I am a Sophomore in the Department of Electrical Engineering at IIT Bombay.
If you are looking for my CV you can find it here.
You can find the list of courses that I have taken and am doing here and the list of my projects here.
If you wish to send me an anonymous message please go here.


Overview
Given the S&P 500 Index were to dive 5% your portfolio could decrease 0.03%, amplified by your positions in Anadarko Petroleum Corp and Fedex Corp. This is offset by anticipated gains in Frontier Communications Corp and the Health Care Sector.
Detailed Analysis
The largest issuer loss came from Fedex Corp which fell by 0.68% (129% of the total change in the portfolio). The next greatest was Analog Devices Inc (0.08% decrease). The biggest rising issuer came from Amgen Inc in your Health Care holdings which increased by 0.08%. This was followed by Frontier Communications Corp which gained 0.07%.
Market Changes
We assumed a 5% conditional shock to the value of the S&P 500 Index over a one day time horizon.
Equities: The majority of equity indices went down. A decrease of about 5% was seen on European indices, whereas a drop closer to 4% was observed on the South American ones.
Rates: In general, USD rates decreased across main tenors by approximately 8%. No other interest rates were considered as this was an all US portfolio.
Spreads: In general, spreads across sectors widened. The largest widening happened in the Benchmark sector, while spreads were observed to decrease in the Capital Goods sector.
Forex: The majority of currencies saw falls under this scenario with BRL, GBP and RUB showing the biggest downward changes.
Model Details
Using the statistics we calculated, changes in indices and interest rates are on average positively correlated while credit spreads show no significant correlation to the S&P 500 Index. Of the indices changes, the European and U.K. regions have strong positive correlations.
Company
Value
Weight
P&L
Amgen Inc
99X999X99
999X99X
X99X99
Risk Factor
Shift (%)
JPY/USD FX Rate
X99X99
Chart


Posted by Jacob Lazarus
Choose who will see your question by typing a subject area, or the name of someone at your school


Currently, DEFENDANT owes PLAINTIFF:
Breakdown
Principal
$1950
Interest (16%)
Court Costs
$85
Parking
$6


Ip Permission. More...
Public Member Functions | |
| (id) | - init |
| Default constructor for a new object. | |
| (void) | - addUserIdGroupPair: |
| Adds a single object to userIdGroupPairs. | |
| (NSString *) | - description |
| Returns a string representation of this object; useful for testing and debugging. | |
Properties | |
| NSString * | ipProtocol |
| The IP protocol of this permission. | |
| NSNumber * | fromPort |
| Start of port range for the TCP and UDP protocols, or an ICMP type number. | |
| NSNumber * | toPort |
| End of port range for the TCP and UDP protocols, or an ICMP code. | |
| NSMutableArray * | userIdGroupPairs |
| The list of AWS user IDs and groups included in this permission. | |
| NSMutableArray * | ipRanges |
| The list of CIDR IP ranges included in this permission. |
Ip Permission.
| - (void EC2IpPermission.)addUserIdGroupPair: | (EC2UserIdGroupPair *) | userIdGroupPair |
Adds a single object to userIdGroupPairs.
This function will alloc and init userIdGroupPairs if not already done.
| - (NSString * EC2IpPermission.)description |
Returns a string representation of this object; useful for testing and debugging.
| - (id EC2IpPermission.)init |
Default constructor for a new object.
Callers should use the property methods to initialize this object after creating it.
- (NSNumber *) fromPort [read, write, retain] |
Start of port range for the TCP and UDP protocols, or an ICMP type number.
An ICMP type number of -1
indicates a wildcard (i.e., any ICMP type number).
- (NSString *) ipProtocol [read, write, retain] |
The IP protocol of this permission.
Valid protocol values: tcp
, udp
, icmp
- (NSNumber *) toPort [read, write, retain] |
End of port range for the TCP and UDP protocols, or an ICMP code.
An ICMP code of -1
indicates a wildcard (i.e., any ICMP code).


IMPROMPTU A film review by Frank Maloney Copyright 1991 Frank Maloney
IMPROMPTU is a film staring Judy Davis. It is itself an impromptu on the beginning of the famous liaison of George Sand, the French novelist, and Frederick Chopin, the Polish composer and pianist. If you find those attributions necessary, you may not feel drawn initially to IMPROMPTU because you have not been infected yet with these fascinating personalities and artists. If you find the attributions irritating and inadequate, you are the primary audience for this film. However, I urge people of the first category to see IMPROMPTU, too; it is a wonderful film, funny, alive, visually and musically rich, driven by complex performances by some really wonderful actors.
George Sand is played by Judy Davis, an actor I am not familiar with, but one I want to see again soon. Sand was a woman who achieved notoriety in her day by adopting a male nom de plume, wearing men's clothes, smoking cigars, being a sportswoman, conducting her love affairs openly, and being her own person; she was a kind of one-woman cause celebre in 1830s and 1840s. In IMPROMPTU Sand invites herself to a country house party to meet and seduce Chopin, for whom she has developed an obsession on the strength of his music. The socially ambitious duchess has invited him, his great friend Franz Liszt (played by Julian Sands), Liszt's lover (Bernadette Peters), Eugene Delacroix, the painter, and Edward de Muset, the poet and Sands' great (but now former) love, invited them for a fortnight in the country.
I believe this wonderful set-up is the invention of the screen writer. (You will note the lack of many names in this notice--my source material was destroyed before I could write this and I have a Emmenthalerisch memory (full of holes).) The house party is hilariously disastrous, Sand's wild children contributing not a little to the final catastrophe.
Back in Paris, Sand continues her pursuit of Chopin, who is depicted here as prim to the point of prissiness. Meanwhile another claimant has entered the lists for the reluctant Pole. And Sand is having problems with a past that continues to make claims on her, ludicrously and ridiculously. Through all this bedroom-farcical comedy runs a serious and tender love story that is finding itself as the movie unfolds.
And through it all, Davis is preposterous, impossible, tender, desperate, strong, weak, cunning, naive, awkward, and graceful, full of guile and honesty, till she near to breaks your heart with a performance that nearly turns IMPROMPTU into a one-woman show.
Fortunately, for the viewer who believes that two great performances are better than one, Peters is more than up to the challenge of holding her own on screen. For once, Peters gets a chance to *act* and in a major part. Her character, a titled lady who left her husband to be Liszt's muse (and winds up being the mother of his enormous flock of infants, whose crying he escapes by his continuous touring and concertizing), is turned from being a light, sophisticated Parisienne into a shrew and harpy by the unhappiness and unfairness of her life as a "conventional" mistress and upper-class bohemian, her life as a woman who has children, stays home, and whose role is to "inspire" her man to greatness. In the end, it ruins her, but allows Peters to register the most mature performance that I have ever seen from her.
But then this is a great ensemble cast with wonderful, memorable performances from every single member. The cast is mostly English and the Frenchness of the script is perhaps a little thin. The country nobleman who unwillingly hosts his wife's artists is an English squire of the old school, interested in hunting, not art; perhaps such types are also French. I don't know. But this is a very English film, IMHO, for all the French locales and names. The squire-type even says "Bon appetit" with an English accent. I was also slightly distracted by the resemblance between the handsome young man who plays Chopin and the Chekhov-character from the original Star Trek days, the smile, the physical business, the East Slavic accent, quite striking, actually; fortunately this Chopin is a better actor by far than the scene-chewing, "wodka" drinking Mr. Chekhov.
These minuscule cavils aside, I cheerfully recommend IMPROMPTU to you. It is a first-rate movie rich in performances.
-- Frank Richard Aloysius Jude Maloney .
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


Vizra Paths Library
A bunch of path drawing functions - each returns a Path2D object, starts from (0, 0) which is it's centre
- Author:
-
- Copyright:
- Source:
Methods
(static) circle(radius, arcFrom, arcTo, anticlockwise)
Parameters:
| Name |
Type |
Description |
radius |
int
|
half full size of circle |
arcFrom |
int
|
start |
arcTo |
int
|
end |
anticlockwise |
boolean
|
default is false |
- Source:
(static) cross(width, height, thickness)
Parameters:
| Name |
Type |
Description |
width |
int
|
pixels |
height |
int
|
pixels |
thickness |
int
|
pixels how 'thick' the cross is |
- Source:
(static) curvedCross()
returns a curved ended cross, no allowance for adjustment
- Source:
(static) diamond(style, width, height)
Parameters:
| Name |
Type |
Description |
style |
string
|
'plain', 'grid' or 'sliced' |
width |
int
|
pixels |
height |
int
|
pixels |
- Source:
(static) ellipse(width, height, rotation, arcFrom, arcTo, anticlockwise)
Parameters:
| Name |
Type |
Description |
width |
int
|
pixels |
height |
int
|
pixels |
rotation |
int
|
degrees |
arcFrom |
int
|
degrees |
arcTo |
int
|
degreed |
anticlockwise |
boolean
|
set false by default |
- Source:
(static) halfDiamond(width, height)
draws a half diamond pointing down
Parameters:
| Name |
Type |
Description |
width |
int
|
pixels |
height |
*
|
pixels height will be half |
- Source:
(static) heart()
no params, just a heart
- Source:
(static) hexagon(sideLength)
Parameters:
| Name |
Type |
Description |
sideLength |
int
|
pixels |
- Source:
(static) lantern(insideLines)
Parameters:
| Name |
Type |
Description |
insideLines |
boolean
|
true by deafult |
- Source:
(static) rectangle(width, height)
Parameters:
| Name |
Type |
Description |
width |
int
|
pixels |
height |
int
|
pixels |
- Source:


This is a single page application. Everybody can see this. The following links require authentication.
Get current user info
Check users permission
Check admin permission


BARWARE
More about custom barware...
BABYWARE
Tired of sickly-sweet?These onesies with oversized letters in bold bright patterns are a welcome change from the usual pastel fare. Monogrammed pants and baby shoes are also aailable. Tell us the initial and mix and match from 6 fun fabrix patterns and 8 edging colors. Allow 2 to 4 weeks for delivery. Sizes: 3mos, 6mos, and 12mos.


EBD - Easton Bible DIctionary
Mene
MENE
"MENE "(
Daniel 5:25, 26
), numbered, one of the words of the mysterious inscription written “upon the plaister of the wall” in Belshazzar’s palace at Babylon. The writing was explained by Daniel. (See BELSHAZZAR.)
"MENE "(Daniel 5:25, 26), numbered, one of the words of the mysterious inscription written “upon the plaister of the wall” in Belshazzar’s palace at Babylon. The writing was explained by Daniel. (See BELSHAZZAR.)


Table of Contents
Front Cover Front Matter Introduction Welcome to Season Four! What You’ll Need to Play How to Read This Book The RiM: S4E Team Character Creation D.A.S.H. Design Aspects Statistics Headway D.A.S.H. Example Playing an Episode Structure of Gameplay Making Checks Advantages & Drawbacks Acting in Harmony Damage, Recovery, & Sidelining Using & Restoring Valor Ending an Episode Character Advancement Learning Lessons Experience Points Purchasing Edges Edge List Library of Edges Magic & Spellcasting Magic Is as Magic Does Creating Spells Casting Spells The Canterlot Archives Running an Episode Being the Game Master Collaborative Storytelling Getting Things Started Checks & Difficulty Targets Damage & Sidelining Lessons & Experience Variant Rules Plot Points Equestria Girls Paragon Ponies Wide, Wide World Epic Experience Encyclopedia Equestria Premade Episodes The House of Enchanted Comics Ars Unicornia Mutants and Maresterminds Whinnystrad Miscellaneous Character Sheet A Note for Developers Updates & Resources Single Page Version (for print)Checks & Difficulty Targets
As the Episode progresses, you will inevitably need to call for, and handle, checks. These are the backbone of S4E, and knowing how to handle checks effectively can be the difference between being a good GM and a great GM. This section will discuss some of the principles of checks in S4E, and give some insight into how to handle them effectively.
Essentially, there are two schools of thought when it comes to checks. The first is the ‘technical’ method, and the second is the ‘dramatic’ method. Either one is valid (though S4E was designed based on the ‘dramatic’ method), and both have their advantages and disadvantages; more often than not, GMs end up using a combination of the two.
The ‘technical’ method is based on context and technical detail; if building a barn is X difficulty, it should always be X difficulty, unless technical factors, which should modify the X difficulty by Y amount, come into play. This method is usually math-intensive and can break the immersion many roleplayers seek to preserve, but it is also consistent, which many players highly value because it gives them a firm understanding of their character’s capabilities in any given situation.
The ‘dramatic’ method is based on narrative impact and action significance; if it is very important that a character fly fast enough to escape a collapsing cave, the GM may make that task less difficult (or make the check itself an automatic success despite its actual result). This method requires implicit trust on the part of the players in the GM’s fairness (not to mention some bluffing on the part of the GM), but it also has the possibility to create a more dynamic story in the long run.
Most GMs use both methods in combination, but tend to lean more toward one or the other. Whichever method you favor, S4E can accommodate. When a character attempts a task which has enough narrative significance for you to call for a check, that check will be based on a Difficulty Target number. Players are not required to know the Difficulty Target; only the GM is required to know it so as to relate the success or failure of the attempted task (based on the check result as compared to the Difficulty Target).
This can allow for considerable ‘wiggle room’ at any time; if the story needs a check to succeed, you can use the check result as it would translate to a Difficulty Target to determine the degree of success. For example, if a character needs to escape a collapsing cave, you may determine that the check will succeed no matter what its result is. If its result is high, you might relate that the character escaped with time to spare; if the result is low, you might relate instead that they just barely made it out (and maybe only then due to a lucky break or after taking some minor damage). The player never needs to know (and shouldn’t be told!) that they couldn’t have failed the check in the first place.
- Difficulty Targets are partially static, and partially dynamic, in S4E; the normal Difficulty Target is a set number, but the GM may also choose to include the option for 'Partial Success' and / or 'Dramatic Success' Difficulty Targets as well as the normal Difficulty Target. Normal Difficulty Targets are separated into four tiers:
- "Simple" Difficulty Target: 5
- "Average" Difficulty Target: 10
- "Difficult" Difficulty Target: 15
- "Daunting" Difficulty Target: 20
If the GM chooses to include the option for 'Partial Success' and / or 'Dramatic Success' Difficulty Targets as well as the normal Difficulty Target, doing so concerns adding or subtracting a d6 result from the normal Difficulty Target, as follows:
The Partial Success Difficulty Target is determined by subtracting 1d6 from the normal Difficulty Target. If a character meets or exceeds this number but falls short of the normal Difficulty Target, they may succeed--but at a cost or penalty the GM is free to invent on the spot. For example, on an "Average" Difficulty Target (10), subtract 1d6 to get a Partial Success Difficulty Target somewhere between 4 and 9.
The Dramatic Success Difficulty Target is determined by adding 1d6 to the normal Difficulty Target. If a character meets or exceeds this number, they succeed at the check above and beyond normal, and the GM is free to invent a bonus or reward on the spot for doing so. For example, on an "Average" Difficulty Target (10), add 1d6 to get a Dramatic Success Difficulty Target somewhere between 11 and 16.
Any result below the Partial Success Difficulty Target (or the normal Difficulty Target if Partial Success isn't allowed) means that the character has failed the check, and thus, the task they were attempting to perform. It is possible for a "Simple" Difficulty Target to have a Partial Success Difficulty Target which cannot be failed.


Learning the Secret
Turn on television at any time in the early morning hours and you will see an infomercial of some so-called expert pushing their book on how to be successful. From weight loss to financial security, everyone has some “secret,” that they would love to let you in on for two simple payments of $29.95. The fascination we have with people and commercials like this is in the word, “secret.” It implies there is a way that only they have discovered to accomplish a common goal that all of us want to achieve. Here is an even more amazing thing, if it were free you wouldn’t want it, but because there is a cost, there must be something to it. The secret to your success is found in their book and is only a phone call away.
As believers we know that there are no special formulas or hidden antidotes to living a victorious Christian life. Any success that we have is found in Christ Jesus and is given to us in the only book that really matters: our Bibles. But are there secrets in the Bible that are available to us who have put our faith in Him? Is there something that may sound so simple but many of us find hard to understand or apply to our lives? To many Christians, sometimes there are simple application of God’s word that are “secrets” that they may not have yet discovered.
In the book of Philippians, Paul gives us this verse, “I know what it is to be in need, and I know what it is to have plenty. I have learned the secret of being content in any and every situation, whether well fed or hungry, whether living in plenty or in want.” (Philippians 4:12 NIV) In this simple verse, Paul tells us that there is a secret in the Christian life to being content in every situation that we may face.  Whether he was well fed or hungry, Paul found this hidden secret in Christ Jesus.
And what is that “secret” that Paul has discovered and how can we grab hold of it for ourselves? Let’s look at the next verse, “I can do all things through Christ who strengthens me.” (Philippians 4:13 NIV) Why would Paul call this promise from God a secret? Can it be that most of us, and I can add myself to this list, don’t realize the full potential of its meaning? Can it be that something so easy to read with our minds is not so easy to obtain in our hearts and spirits? If it’s as simple as it seems, why would Paul have called it a secret?
The first half of the verse says, “I can do ALL things…” Paul doesn’t say some things, most things or even a majority of things, he stresses that he can do ALL things. How many of us really grasp the promise of the word “all”? I know I have a difficult time understanding it. Through my own fears and sometimes lack of faith, I have limited the things God wanted to do in my own life. I can honestly say there are things that I am one hundred percent certain God will take care of for me, but then there are other larger problems where my faith starts to waiver. Sometimes past failures can even convince you that obstacles in your life will never be defeated. In this verse, Paul wants to teach us this secret that with God there is no limit, but that we can do ALL THINGS.
And how are these things accomplished? How does a believer in Christ Jesus reach that potential given to us, to do “All things”? Here is the secret that we must learn.
These goals or hurdles are only accomplished through one power source, “Christ who strengthens me.” It sounds simple right? But not many Christians have such an easy grasp on this concept. I remember growing up as a little kid and into my teenage years, the church my mom took me gave me a totally different idea of what Christianity was. I thought that God and I had a 50/50 partnership. I would try my hardest or give my best effort, and seeing that God would give me just enough power to push me over the top. Some of you are even saying to yourselves right now, that sounds about right. It’s the old theory that “God helps those that helps themselves.” Although that sounds right, it is nowhere to be found in scripture. Jesus Said, “Apart from me you can do NOTHING…” He is the only supplier of the power and strength that we need to accomplish “ALL THINGS” in His name. Without God’s help of showing us this powerful secret, we can continue to fall into that endless cycle that is ultimately bound for discouragement. We’ve all done it, you try to mentally convince yourself that you can overcome some unwanted trouble or habitual sin only to have it defeat you time and time again. I’ve been there too many times. It’s only when I stopped trying and learned to believe in His power that I found victory. What a relief it is to find that the only power to be victorious was never found in me at all. All my strength can only come from one power source, who is Christ Jesus. If the secret to Christianity was you finding an internal source to defeat or overcome these trials in life, the Bible would have mentioned it. But it doesn’t. The only source of strength we can receive to be victorious is found in Christ Jesus.
So how is this secret revealed in our lives? How does God not only give us merely a mental understanding that we are powerless without Him, but place it in our hearts so that it’s something we truly believe? One way is through trials, hardships and difficulties. It can come though the loss of a loved one, a health issue or even financial troubles. Anything that seems to throw us out of our comfort zone, God will use to show us how weak we really are. I’ve noticed that the greatest lesson I’ve ever learned was when God allowed the bottom to fall out so I was helpless until He came through. When we go through times that everything seems to be fine, we seem to lose a need for God. But when everything seems to be going in the wrong direction we run for His protection and help. Now it almost sounds as though God’s intention is to make us weak. Again, I was taught that weakness was a sign of immaturity or having a lack of faith but here again is the secret. It’s the exact opposite… Only through your weakness is God’s full power revealed. Sounds strange right? Then you too need to learn the secret.
In 2 Corinthians, Paul writes this verse that goes against all of our understanding and as in my case, what I was taught as a child. The Lord said to him, “My grace is sufficient for you, for my power is made perfect in weakness.” Paul’s response was, “Therefore I will boast all the more gladly about my weaknesses, so that Christ’s power may rest on me… for when I am weak, then am I strong…” (2 Corinthians 12:9-10 NIV) In order for us Christians to fully see God’s power working in our lives, we must become weak. Seeing the full potential of God’s power is not standing up to our troubles in our own strength but down on our knees, humbly, in prayer. It’s that believer who cries out in their heart that they are helpless without Him that really taps into the full power of God himself. Strangely, boasting about your weakness allows, “Christ’s power to rest on you.” God’s strength is made perfect in your weakness.
If you’re a Believer and you’re going through a difficult time and things just don’t seem to make much sense, don’t lose hope. In our natural mind we have the tendency to believe that God is far away when in fact He may be even closer than He has ever been. Hold on to the word of God and these special promises that He has provided us. Rely not on your own strength but totally on His power. Your trials may not be as strange as they seem, it may just be God’s way of letting you in on His powerful secret….
Just Something to Consider.


Asssuming you have the demo installed, if not, dont worry, you can get all the details on installation from the install page. Once installed, follow the instructions below to do a test run of the environment.
-
Once logged in, select the project emergency-response-demo
-
In the list of applications, click the link for emergency-console
-
This link takes you to the login screen for the Emergency Web Console
-
Click the Register Now! button. This is for registering as a volunteer responder.
-
Enter the relevant information for your account. You can select any test data.
-
Make note of the fields for Boat Capacity and Medical Support.
-
You can specify how many people you can carry in your boat. Also, you can indicate if you provide medical / first-aid support.
-
-
Click Register
Explore the Application
Once you are successfully registered, you will see the main application screen.
-
This screen has the following links:
-
Dashboard: The overall view of all Incidents, Responders and Missions
-
Mission: The view for an individual responder which shows their current mission, including the router to the Incident and onward route to the shelter
-
Incidents: A list of all incidents
-
Github: Link to the Github repo
-
Dashboard
-
Select the link for Dashboard
-
This screen shows an overall view of all Incidents, Responders and Missions. At the moment the screen is empty, but in the following sections we will add data to the application.
-
Incident Status
The Incident Status section tracks the data for number of incidents requested, assigned, picked up and rescued. These values update in real-time based on application events.
Responder Utilization
The Responder Utilization section monitors the total number of responders, active and idle responders. This section is also updated in real-time based on application events.
Map
The map shows the location of the incidents, responders and their associated routes.
Mission
When a Responder is assigned an Incident, a Mission is created. The Mission defines where the Responder needs to go to collect the victims of the Incident (the Way Point) and what shelter the victims should be dropped off at (the Target Location). The mission also has details of the responders location history.
-
Select the link for Dashboard
- This screen shows the view for an individual responder which shows their current mission, including the router to the Incident and onward route to the shelter.
-
Add yourself to the map as a responder
-
Click any location on the map.
-
Click your boat icon. It will show the details of your boat profile.
-
Click the Available button.
- You are now registered as an Available responder.
-
-
Click the Dashboard link
-
In the Responder Utilization section, verify that there are 1 total responders. This is based on your recent action.
-
Incidents
An incident is a request for help from an individual (or group of individuals) that are in need of rescue. Details of an Incident include the location (Lat, Long), the number of people stranded and whether medical assistance is required.
-
Click the Incidents link
-
This screen shows a list of incidents. At the moment, this screen is empty, but we will create incidents in the next section.
-
Disaster Simulator
-
Move back to the OpenShift Web Console window
-
In the list of applications, click the link for disaster-simulator
-
This takes you to the Disaster Simulator web console.
Create Incidents
-
In the section for Create Incidents, move to the field for Number of Incidents and enter
50
. -
Click Submit
Create Responders
-
In the section for Create Responders, move to the field for Number of Responders and enter
3
. -
Click Submit
-
Move back to the Emergency Response Demo Web Console window
-
Click the Dashboard link.
-
Confirm that you have incidents and responders.
-
You will see activity as the responders are assigned to missions. The responders will start moving to rescue the stranded victims.
-
View Your Mission
By this time, your boat should have been assigned to a mission.
-
Click the Mission link.
-
You will see your boat moving towards an incident.
-
Once your boat makes it to the incident location, click the Picked Up button.
-
This confirms that you have picked up the passengers and your boat will proceed to the shelter.
-
View Incidents
You can view a list of all incidents and check their status.
-
Click the Incidents link.
Process Automation
The Process Service is responsible for managing the overall process flow of the system. The Process Service operates purely on Kafka messages and does not expose any HTTP API - although it does invoke HTTP APIs in the Responder and Incident Priority Services.
When a new Incident is reported on the topic-incident-event Topic, the process Service kicks off a new BPM process to manage the new Incident. When a Responder is shown as available (via the topic-responder-event Topic), the BPM process is updated to reflect this. As the Mission progresses and additional messages are received on the topic-mission-event Topic, the BPM process is updated to reflect the latest state.
The Process Service sends out multiple types of messages on various Topics in response to the Incident progressing through the Business Process.
Let’s view the process diagram for an incident.
-
Click the Dashboard link.
-
Click an Incident on the map.
-
This will show a pop-up for the incident.
-
-
Click the link for Process Diagram
-
This will open new tab to view the Process Diagram for this incident.
-
-
Review the process diagram for this incident.
Clean Up
Let’s clean up our application by clearing the incidents, responders and missions.
-
Move back to the Disaster Simulator web console.
-
Click the buttons to clear application data
-
Click Clear incidents
-
Click Clear responders
-
Click Clear missions
-
-
Move back to the Emergency Response Demo Web Console window
-
Click the Dashboard link.
-
Confirm that all of application data is cleared.
Congratulations! You have completed this lab. Please move on to the next lab.