Tutorial by Examples: ee

const source = Rx.Observable.range(1, 3) .map((x, idx, obs) => `Element ${x} was at position ${idx}`); const subscription = source.subscribe( x => console.log(`Next: ${x}`), err => console.log(`Error: ${err}`), () => console.log(`Completed`) ); // => Next: Element 1...
The received bytes have to be decoded with the correct character encoding to be interpreted as text: Python 3.x3.0 import urllib.request response = urllib.request.urlopen("http://stackoverflow.com/") data = response.read() encoding = response.info().get_content_charset() html = d...
When using a WebView to display your own custom webpage and this webpage contains Javascript, it might be necessary to establish a two-way communication between the Java program and the Javascript in the web page. This example shows how to setup such a communication. The webpage shall display an i...
Bash can easily create lists from alphanumeric characters. # list from a to z $ echo {a..z} a b c d e f g h i j k l m n o p q r s t u v w x y z # reverse from z to a $ echo {z..a} z y x w v u t s r q p o n m l k j i h g f e d c b a # digits $ echo {1..20} 1 2 3 4 5 6 7 8 9 10 11...
To get started: Install celery pip install celery configure celery (head to the remarks section) from __future__ import absolute_import, unicode_literals from celery.decorators import task @task def add_number(x, y): return x + y You can run this asynchronously by using the ....
/** * Checks if a resource exists by sending a HEAD-Request. * @param url The url of a resource which has to be checked. * @return true if the response code is 200 OK. */ public static final boolean checkIfResourceExists(URL url) throws IOException { HttpURLConnection conn = (HttpURLCo...
First Initialize FirebaseDatabase: FirebaseDatabase database = FirebaseDatabase.getInstance(); Write to your database: // Write a message to the database FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference myRef = database.getReference("message"); myRef....
The evaluation of a closure is the evaluation of the result of the closure. All rules applies : if the closure returns a null , zero number or empty String, Collection, Map or Array it evaluates to false otherwise to true. // Closure return non zero number => true assert { 42 }() // closure ...
In most object oriented languages, allocating memory for an object and initializing it is an atomic operation: // Both allocates memory and calls the constructor MyClass object = new MyClass(); In Objective-C, these are separate operations. The class methods alloc (and its historic sibling allo...
This example uses C++14 and boost::any. In C++17 you can swap in std::any instead. The syntax we end up with is: const auto print = make_any_method<void(std::ostream&)>([](auto&& p, std::ostream& t){ t << p << "\n"; }); super_any<decltype(print...
context.globalCompositeOperation = "destination-out" "destination-out" compositing uses new shapes to erase existing drawings. The new shape is not actually drawn -- it is just used as a "cookie-cutter" to erase existing pixels. context.drawImage(apple,0,0); conte...
Generate code Alt+Insert Add comment lines Ctrl+Shift+C Remove comment lines Ctrl+/ Format selection Alt+Shift+F Fix all class imports Ctrl-Shift-I Fix selected class's import Alt+Shift+I Shift lines left Alt+Shift+← Shift lines right Alt+Shift+→ Shift lines up Alt+Shift+↑ Shift li...
In Gloss, one can use the display function to create very simple static graphics. To use this one needs to first import Graphics.Gloss. Then in the code there should the following: main :: IO () main = display window background drawing window is of type Display which can be constructed in two ...
https://godzillai5.wordpress.com/2016/08/20/db2-for-i-in-the-cloud-connecting-to-pub400-via-jdbc-in-netbeans/
element.style only reads CSS properties set inline, as an element attribute. However, styles are often set in an external stylesheet. The actual style of an element can be accessed with window.getComputedStyle(element). This function returns an object containing the actual computed value of all the ...
To animate the transition between fragments, or to animate the process of showing or hiding a fragment you use the FragmentManager to create a FragmentTransaction. For a single FragmentTransaction, there are two different ways to perform animations: you can use a standard animation or you can suppl...
Add code in your Activity. This would work for Fragment also, no need to add this code in Fragment. @Override public boolean dispatchTouchEvent(MotionEvent ev) { View view = getCurrentFocus(); if (view != null && (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == Moti...
Suppose you have a DataFrame of numerical values, for example: df = pd.DataFrame(np.random.randn(1000, 3), columns=['a', 'b', 'c']) Then >>> df.corr() a b c a 1.000000 0.018602 0.038098 b 0.018602 1.000000 -0.014245 c 0.038098 -0.014245 1.000000...
Prepare First create a "message.properties" file in Resources/Files/. Example: ############## # Test message.properties ############## label.age=Enter your age: validate.error.reqired.age=Sorry, but you have to give away the secret of your age ... Next, connect the resource with y...
What's the deal with the following? julia> @test 0.1 + 0.2 == 0.3 Test Failed Expression: 0.1 + 0.2 == 0.3 Evaluated: 0.30000000000000004 == 0.3 ERROR: There was an error during testing in record(::Base.Test.FallbackTestSet, ::Base.Test.Fail) at ./test.jl:397 in do_test(::Base.Test....

Page 28 of 54