Tutorial by Examples: ti

In most other languages indentation is not compulsory, but in Python (and other languages: early versions of FORTRAN, Makefiles, Whitespace (esoteric language), etc.) that is not the case, what can be confusing if you come from another language, if you were copying code from an example to your own, ...
Once using is used to introduce the name cout from the namespace std into the scope of the main function, the std::cout object can be referred to as cout alone. #include <iostream> int main() { using std::cout; cout << "Hello, world!\n"; }
C++11 As a special case, a using-declaration at class scope can refer to the constructors of a direct base class. Those constructors are then inherited by the derived class and can be used to initialize the derived class. struct Base { Base(int x, const char* s); }; struct Derived1 : Base {...
Detailed instructions on getting asynchronous set up or installed.
Detailed instructions on getting hadoop2 set up or installed.
public abstract class BaseActivity extends AppCompatActivity { private Map<Integer, PermissionCallback> permissionCallbackMap = new HashMap<>(); @Override protected void onStart() { super.onStart(); ... } @Override public void setConten...
It is basically address of a variable in memory. It allows us to indirectly access a variable. So using pointers we can talk about a variable's address(as well as its value by dereferencing the pointer). They are useful when we want to deal with address of a memory location rather than its value. C...
This example uses <md-chips> and <md-chip>. NOTE: Static chips cannot be selected, removed or edited, and are not part of any model. If no ng-model is provided, there are no input elements in <md-chips>. index.html: <md-content ng-controller="ChipController"> &...
Detailed instructions on getting web2py set up or installed.
Detailed instructions on getting point-cloud-library set up or installed.
Sometimes you may want to have some login to determine where the user gets redirected to after submitting a form. Form Requests give a variety of ways. By default there are 3 variables declared in the Request $redirect, $redirectRoute and $redirectAction. On top of those 3 variables you can overr...
from bs4 import BeautifulSoup import requests main_url = "https://fr.wikipedia.org/wiki/Hello_world" req = requests.get(main_url) soup = BeautifulSoup(req.text, "html.parser") # Finding the main title tag. title = soup.find("h1", class_ = "firstHeading&qu...
import time def timer(func): def inner(*args, **kwargs): t1 = time.time() f = func(*args, **kwargs) t2 = time.time() print 'Runtime took {0} seconds'.format(t2-t1) return f return inner @timer def example_function(): #do stuff exa...
Vertical Index Match =INDEX(A1:A3,MATCH(E2,C1:C3,0))
// gets the Class objects from the net.mminecraft.server package with the given name public Class<?> getNmsClass(String name) throws ClassNotFoundException { // explode the Server interface implementation's package name into its components String[] packageArray = Bukkit.getServer()....
public class CustomSurfaceView extends SurfaceView { @Override public boolean onTouchEvent(MotionEvent e) { super.onTouchEvent(e); if(e.getPointerCount() > 2){ return false; // If we want to limit the amount of pointers, we return false //...
NLTK provides the FreqDist class that let's us easily calculate a frequency distribution given a list as input. Here we are using a list of part of speech tags (POS tags) to see which lexical categories are used the most in the brown corpus. import nltk brown_tagged = nltk.corpus.brown.tagged_w...
A function is defined by at least its return type and an unique name. void say_hello () { print ("Hello, world!\n"); } Then, to call it just use the name of the function followed by a parenthese. say_hello (); Functions can also have parameters between the parentheses, d...
Parameters can be marked as optional by giving them a default value. Optional parameters can be omitted when calling the function. string greet (string name, string language = "English") { if (language == "English") { return @"Hello, $name!"; } else ...
A key part of the Reader monad is the ask (https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Reader.html#v:ask) function, which is defined for illustrative purposes: import Control.Monad.Trans.Reader hiding (ask) import Control.Monad.Trans ask :: Monad m => ReaderT r m r ask ...

Page 439 of 505