Tutorial by Examples: l

This code create a producer which send two messages to a queue, and a consumer which receives all the messages from that queue. Code for producer.py (using the pika 0.10.0 Python client): import pika connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) ch...
This approach was introduced in JSR 286. In JSR 168,render parameters set in processAction of a portlet were available only in that portlet.With the Public Render Parameters feature, the render parameters set in the processAction of one portlet will be available in render of other portlets also.In ...
This is one approach which has been there since JSR 168.It allows us to share attributes using portlet session.A portlet session can have different types of scopes: Portlet scope(attributes available only within portlet) Application scope(attributes available within whole application[war]) In...
We assume a fully working UIScrollview named _scrollView; Note that UITableView, UICollectionView are also scrollviews, hence the following examples would work on those UI elements. First, creation & allocation UIRefreshControl refreshControl = new UIRefreshControl(); Second, connecting th...
This example will register an vuex module dynamically for storing custom notifications that can automatically dismissed notifications.js resolve vuex store and define some constants //Vuex store previously configured on other side import _store from 'path/to/store'; //Notification default dur...
While performing a git merge you may find that git reports a "merge conflict" error. It will report to you which files have conflicts, and you will need to resolve the conflicts. A git status at any point will help you see what still needs editing with a helpful message like On branch ma...
You can import an SVG file as a VectorDrawable in Android Studio, follow these steps : "Right-click" on the res folder and select new > Vector Asset. Select the Local File option and browse to your .svg file. Change the options to your liking and hit next. Done.
Temp tables must have unique IDs (within the session, for local temp tables, or within the server, for global temp tables). Trying to create a table using a name that already exists will return the following error: There is already an object named '#tempTable' in the database. If your query pro...
This example assumes that you have already added Fresco to your app (see this example): SimpleDraweeView img = new SimpleDraweeView(context); ImageRequest request = ImageRequestBuilder .newBuilderWithSource(Uri.parse("http://example.com/image.png")) .setProgressiveRende...
A command-line launcher is a handle tool which allows one to open WebStorm using the command-line. It can easily be created by using the menus Tools > Create Command-line Launcher... After selecting the option, you will be presented with the "Create Launcher Script" prompt for a l...
Prerequiste steps: Get dotnet core for your platform: Dotnet Core Follow instructions and make sure dotnet core is working Get Visual Studio Code for your platform: VS Code Launch Visual Studio Code (VS code) and install the C# extension then reload Create self hosted NancyFx project: ...
The following statement if (conditionA && conditionB && conditionC) //... is exactly equivalent to bool conditions = conditionA && conditionB && conditionC; if (conditions) // ... in other words, the conditions inside the "if" statement just form an...
Below is the list of some mistakes that developers often make during the use of AngularJS functionalities, some learned lessons and solutions to them. 1. Manipulating DOM through the controller It's legal, but must be avoided. Controllers are the places where you define your dependencies, bind you...
bcadd vs float+float var_dump('10' + '-9.99'); // float(0.0099999999999998) var_dump(10 + -9.99); // float(0.0099999999999998) var_dump(10.00 + -9.99); // float(0.0099999999999998) var_dump(bcadd('10', '-9.99', 20)); // string(22) "0.01000000000000000000&q...
Consider the following test: it('should test something', function() { browser.get('/dashboard/'); $("#myid").click(); expect(element(by.model('username')).getText()).toEqual('Test'); console.log("HERE"); }); In the following test, when the console.log() is ex...
It makes it easier to manage complexity by dividing an application into the model, the view, and the controller (Separation of concerns). It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an applica...
Now days many languages are supporting archive server to install their packages into your local machine. TCL also having same archive server we called it as Teacup teacup version teacup search <packageName> Example teacup install Expect
mkdir -p toplevel/sublevel_{01..09}/{child1,child2,child3} This will create a top level folder called toplevel, nine folders inside of toplevel named sublevel_01, sublevel_02, etc. Then inside of those sublevels: child1, child2, child3 folders, giving you: toplevel/sublevel_01/child1 toplevel/s...
Fibonacci numbers are used as a very common example for teaching recursion. fib 0 = 0 fib 1 = 1 fib n = fib (n-1) + fib (n-2)
public class Main extends JavaPlugin { @Override public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler public void yourEvent(Event e) { //... } }

Page 688 of 861