Tutorial by Examples

// Instantiate Gift Card Model $gift_card = Mage::getModel('enterprise_giftcardaccount/giftcardaccount'); // Populate Gift Card values $gift_card // Your redeemable code, doesn't have to be in this format. ->setCode('2i2j2j-24k1ii1-67774k-231l') // Also has STATUS_DISABLED ...
Following code will release lock. lock(locker) { return 5; } For a detailed explanation, this SO answer is recommended.
The = operator is used for assignment. The == operator is used for comparison. One should be careful not to mix the two. Sometimes one mistakenly writes /* assign y to x */ if (x = y) { /* logic */ } when what was really wanted is: /* compare if x is equal to y */ if (x == y) { ...
Be careful with semicolons. Following example if (x > a); a = x; actually means: if (x > a) {} a = x; which means x will be assigned to a in any case, which might not be what you wanted originally. Sometimes, missing a semicolon will also cause an unnoticeable problem: if (i &lt...
Matplotlib is a mathematical plotting library for Python that provides a variety of different plotting functionality. The matplotlib documentation can be found here, with the SO Docs being available here. Matplotlib provides two distinct methods for plotting, though they are interchangable for the...
Log into a running container A user can enter a running container in a new interactive bash shell with exec command. Say a container is called jovial_morse then you can get an interactive, pseudo-TTY bash shell by running: docker exec -it jovial_morse bash Log into a running container with a s...
Installing pipeline Once Heroku Toolbelt is installed it requires Pipelines plugin too. heroku plugins:install heroku-pipelines Creating pipelines You must start with an app to add to the pipeline, although it doesn’t have to be for a particular stage. If you don’t specify --stage STAGE, the...
An instance method is a method that's available on a particular instance of a class, after the instance has been instantiated: MyClass *instance = [MyClass new]; [instance someInstanceMethod]; Here's how you define one: @interface MyClass : NSObject - (void)someInstanceMethod; // "-&qu...
Detailed instructions on getting ibm-midrange set up or installed.
This example shows setting up a small application with 3 routes, each with it's own view and controller, using the controllerAs syntax. We configure our router at the angular .config function We inject $routeProvider into .config We define our route names at the .when method with a route defini...
Collection initialization syntax can be used when instantiating any class which implements IEnumerable and has a method named Add which takes a single parameter. In previous versions, this Add method had to be an instance method on the class being initialized. In C#6, it can also be an extension me...
To create simple actors without creating a new class, you can use: import akka.actor.ActorDSL._ import akka.actor.ActorSystem implicit val system = ActorSystem("demo") val a = actor(new Act { become { case "hello" ⇒ sender() ! "hi" } })
The two possible ways of issuing a context.become (replacing or adding the new behavior) are offered separately to enable a clutter-free notation of nested receives: val a = actor(new Act { become { // this will replace the initial (empty) behavior case "info" ⇒ sender() ! "A...
Life-cycle hooks are also exposed as DSL elements, where later invocations of the methods shown below will replace the contents of the respective hooks: val a = actor(new Act { whenStarting { testActor ! "started" } whenStopping { testActor ! "stopped" } }) The above i...
It is also possible to create nested actors, i.e. grand-children, like this: // here we pass in the ActorRefFactory explicitly as an example val a = actor(system, "fred")(new Act { val b = actor("barney")(new Act { whenStarting { context.parent ! ("hello from &quot...
It is also possible to assign a supervision strategy to these actors with the following: superviseWith(OneForOneStrategy() { case e: Exception if e.getMessage == "hello" ⇒ Stop case _: Exception ⇒ Resume })
Last but not least there is a little bit of convenience magic built-in, which detects if the runtime class of the statically given actor subtype extends the RequiresMessageQueue trait via the Stash trait (this is a complicated way of saying that new Act with Stash would not work because its runtime ...
Open Control Panel -> Programs and Features, choose the Visual Studio 2015 item, and then choose the Change button. In the setup wizard for Visual Studio, choose the Modify button. In the list of optional features to install, select the HTML/JavaScript (Apache Cordova) checkbox, c...
In Visual Studio, choose Tools->Extensions and Updates. In the Updates tab of the Extensions and Updates dialog box, choose Product Updates. If an update for Visual Studio Tools for Apache appears, select it, and then choose the Update button.
C# statements executes in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated. short m = 32767; short n = 32767; int result1 = checked((short)(m + n)); //will ...

Page 297 of 1336