Tutorial by Examples: c

You can get list of available commands by following way: >>> python manage.py help If you don't understand any command or looking for optional arguments then you can use -h argument like this >>> python manage.py command_name -h Here command_name will be your desire command...
Visual Basic has Left, Right, and Mid functions that returns characters from the Left, Right, and Middle of a string. These methods does not exist in C#, but can be implemented with Substring(). They can be implemented as an extension methods like the following: public static class StringExtens...
Descriptive statistics (mean, standard deviation, number of observations, minimum, maximum, and quartiles) of numerical columns can be calculated using the .describe() method, which returns a pandas dataframe of descriptive statistics. In [1]: df = pd.DataFrame({'A': [1, 2, 1, 4, 3, 5, 2, 3, 4, 1],...
$ react-native -v Example Output react-native-cli: 0.2.0 react-native: n/a - not inside a React Native project directory //Output from different folder react-native: react-native: 0.30.0 // Output from the react native project directory
In the app folder find package.json and modify the following line to include the latest version, save the file and close. "react-native": "0.32.0" In terminal: $ npm install Followed by $ react-native upgrade
Example for continue for i in [series] do command 1 command 2 if (condition) # Condition to jump over command 3 continue # skip to the next value in "series" fi command 3 done Example for break for i in [series] do command 4 if (condi...
Pass an open file object from Python to C extension code. You can convert the file to an integer file descriptor using PyObject_AsFileDescriptor function: PyObject *fobj; int fd = PyObject_AsFileDescriptor(fobj); if (fd < 0){ return NULL; } To convert an integer file descriptor back ...
You can also pattern match on Elixir Data Structures such as Lists. Lists Matching on a list is quite simple. [head | tail] = [1,2,3,4,5] # head == 1 # tail == [2,3,4,5] This works by matching the first (or more) elements in the list to the left hand side of the | (pipe) and the rest of the ...
case {1, 2} do {3, 4} -> "This clause won't match." {1, x} -> "This clause will match and bind x to 2 in this clause." _ -> "This clause would match any value." end case is only used to match the given pattern of the particular data...
cond do 0 == 1 -> IO.puts "0 = 1" 2 == 1 + 1 -> IO.puts "1 + 1 = 2" 3 == 1 + 2 -> IO.puts "1 + 2 = 3" end # Outputs "1 + 1 = 2" (first condition evaluating to true) cond will raise a CondClauseError if no conditions are true. co...
Python lists are 0-based i.e. the first element in the list can be accessed by the index 0 arr = ['a', 'b', 'c', 'd'] print(arr[0]) >> 'a' You can access the second element in the list by index 1, third element by index 2 and so on: print(arr[1]) >> 'b' print(arr[2]) >> '...
StackPane lays out its children in a back-to-front stack. The z-order of the children is defined by the order of the children list (accessible by calling getChildren): the 0th child being the bottom and last child on top of the stack. The stackpane attempts to resize each child to fill its own con...
Keyword lists are tuples of key/value, generally used as options for a function call. [{:a, 1}, {:b, 2}] // creates a non-empty keyword list Keyword lists can have the same key repeated more than once. [{:a, 1}, {:a, 2}, {:b, 2}] [{:a, 1}, {:b, 2}, {:a, 2}] Keys and values can be any type: ...
CountDownLatch A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes. A CountDownLatch is initialized with a given count. The await methods block until the current count reaches zero due to invocations of the count...
Global named functions are defined with DEFUN. (defun foobar () "Optional documentation string. Can contain line breaks. Must be at the beginning of the function body. Some will format the docstring so that lines are indented to match the first line, although the built-in DESCRIBE-func...
Functions always establish a block around the body. This block has the same name as the function name. This means you can use RETURN-FROM with this block name to return from the function and return values. You should avoid returning early whenever possible. (defun foobar (x y) (when (oddp x) ...
Simple split of an IP number string. > (lispworks:split-sequence "." "127.0.0.1") ("127" "0" "0" "1") Simple split of an URL: > (lispworks:split-sequence ".:/" "http://127.0.0.1/foo/bar.html" ...
page = PAGE page.10 = TEXT page.10.value = HELLO WORLD Usually this typoScript snippets are added to Web >> Template >> Info/Modify >> setup This snippet opens a new PAGE object. Inside the PAGE object, the 10th entry is set to be a TEXT object. The value of thus TEXT object ...
Move semantics are a way of moving one object to another in C++. For this, we empty the old object and place everything it had in the new object. For this, we must understand what an rvalue reference is. An rvalue reference (T&& where T is the object type) is not much different than a norma...
Say we have this code snippet. class A { public: int a; int b; A(const A &other) { this->a = other.a; this->b = other.b; } }; To create a copy constructor, that is, to make a function that copies an object and creates a new one, we norma...

Page 162 of 826