Tutorial by Examples: easy

First of all, implement your view holder: implements View.OnClickListener, View.OnLongClickListener Then, register the listeners as follows: itemView.setOnClickListener(this); itemView.setOnLongClickListener(this); Next, override the listeners as follows: @Override public void onClick(Vie...
In attempt to send a response asynchronously from chrome.runtime.onMessage callback we might try this wrong code: chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { $.ajax({ url: 'https://www.google.com', method: 'GET', success: functio...
Use quasiquotes to create a Tree in a macro. object macro { def addCreationDate(): java.util.Date = macro impl.addCreationDate } object impl { def addCreationDate(c: Context)(): c.Expr[java.util.Date] = { import c.universe._ val date = q"new java.util.Date()" // this...
python-social-auth is a framework that simplifies the social authentication and authorization mechanism. It contains many social backends (Facebook, Twitter, Github, LinkedIn, etc.) INSTALL First we need to install the python-social-auth package with pip install python-social-auth or download ...
#include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirect...
Let f(n) and g(n) be two functions defined on the set of the positive real numbers, c, c1, c2, n0 are positive real constants. Notationf(n) = O(g(n))f(n) = Ω(g(n))f(n) = Θ(g(n))f(n) = o(g(n))f(n) = ω(g(n))Formal definition∃ c > 0, ∃ n0 > 0 : ∀ n ≥ n0, 0 ≤ f(n) ≤ c g(n)∃ c > 0, ∃ n0 > 0 ...
If you want to execute synchronous code asynchronous (for example CPU extensive calculations), you can use Task.Run(() => {}). public async Task DoStuffAsync() { await DoCpuBoundWorkAsync(); } private async Task DoCpuBoundWorkAsync() { await Task.Run(() => { fo...
While the JavaScript tracking snippet described above ensures the script will be loaded and executed asynchronously on all browsers, it has the disadvantage of not allowing modern browsers to preload the script. The alternative async tracking snippet below adds support for preloading, which will pr...
Instances have a lot of metadata that gets returned from a call to describe-instances, but often times you just want to see the basics. You can use a JMESPath query combined with table output to show concise instance information in an easily readable way. aws ec2 describe-instances --output table -...
Variable declaration @buttonColor: #FF0000; /* Now you can use @buttonColor variable with css Functions. */ .product.into.detailed { additional-attributes{ .lib-table-button( background-color: @buttonColor; ); } } Here function lib-tabgle-button used v...
ChromeDriverManager.getInstance().setup(); FirefoxDriverManager.getInstance().setup(); OperaDriverManager.getInstance().setup(); PhantomJsDriverManager.getInstance().setup(); EdgeDriverManager.getInstance().setup(); InternetExplorerDriverManager.getInstance().setup();
If you have your data with each month of data arranged in rows like so: start by creating quarterly sums in the adjacent columns, D & E in our example. Start with the third row in the new column or the first quarter you want to create, in this example we'll use March 31st (2000-03-31). Use t...

Page 1 of 1