Tutorial by Examples: sin

You can update multiple columns in a table in the same statement, separating col=val pairs with commas: UPDATE person SET country = 'USA', state = 'NY' WHERE city = 'New York';
Say we are working on a class representing a Person by their first and last names. We have created a basic class to do this and implemented proper equals and hashCode methods. public class Person { private final String lastName; //invariant - nonnull private final String firstName; //in...
In order to check whether a value is NaN, isnull() or notnull() functions can be used. In [1]: import numpy as np In [2]: import pandas as pd In [3]: ser = pd.Series([1, 2, np.nan, 4]) In [4]: pd.isnull(ser) Out[4]: 0 False 1 False 2 True 3 False dtype: bool Note that n...
The option -v followed by an assignment of the form variable=value can be used to pass parameters to an awk program. This is illustrated by the punishment program below, whose job is to write count times the sentence “I shall not talk in class.” on standard output. The following example uses the v...
// Returns the nth number in the Fibonacci sequence function fibonacci(n) { if (n === 1 || n === 0) { return 1; } else { return fibonacci(n - 1) + fibonacci(n - 2); } }
; We make single line comments by writing out text after a semicolon
Thread.sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to the other threads of an application or other applications that might be running on a computer system. There are two overloaded sleep methods in the Thr...
REM This is a comment REM is the official comment command.
::This is a label that acts as a comment The double-colon :: comment shown above is not documented as being a comment command, but it is a special case of a label that acts as a comment. Caution: when labels are used as comments within a bracketed code block or for command, the command processor...
It is also possible to use variables as comments. This can be useful to conditionally prevent commands being executed: @echo off setlocal if /i "%~1"=="update" (set _skip=) Else (set _skip=REM) %_skip% copy update.dat %_skip% echo Update applied ... When using the ab...
Environment variables can be defined before the meteor call, like so: PORT=4000 meteor NODE_ENV="staging" meteor
Method 1 Gson gson = new Gson(); String json = "[ \"Adam\", \"John\", \"Mary\" ]"; Type type = new TypeToken<List<String>>(){}.getType(); List<String> members = gson.fromJson(json, type); Log.v("Members", members.toString());...
To declare exposed ports from a Dockerfile use the EXPOSE instruction: EXPOSE 8080 8082 Exposed ports setting can be overridden from the Docker commandline but it is a good practice to explicitly set them in the Dockerfile as it helps understand what an application does.
_mycompletion() { local command_name="$1" # not used in this example local current_word="$2" local previous_word="$3" # not used in this example # COMPREPLY is an array which has to be filled with the possible completions # compgen is used to fi...
A powerful alternative to virtualenv is Anaconda - a cross-platform, pip-like package manager bundled with features for quickly making and removing virtual environments. After installing Anaconda, here are some commands to get started: Create an environment conda create --name <envname> pyth...
let numbers = [3, 1, 4, 1, 5] // non-functional for (index, element) in numbers.enumerate() { print(index, element) } // functional numbers.enumerate().map { (index, element) in print((index, element)) }
A HAVING clause filters the results of a GROUP BY expression. Note: The following examples are using the Library example database. Examples: Return all authors that wrote more than one book (live example). SELECT a.Id, a.Name, COUNT(*) BooksWritten FROM BooksAuthors ba INNER JOIN Aut...
Visual Studio Code is an open-source and feature-rich code editor from Microsoft. To set it up it for NativeScript development, open the Command Palette (F1 or ⌘+Shift+P) and type ext install NativeScript. Once the NativeScript extension is installed, the debugger should allow you to set breakpoint...
As we know that we should use synchronized keyword to make execution of a method or block exclusive. But few of us may not be aware of one more important aspect of using synchronized and volatile keyword: apart from making a unit of code atomic, it also provides read / write barrier. What is this re...
If you have both Python 3 and Python 2 installed, you can specify which version of Python you would like pip to use. This is useful when packages only support Python 2 or 3 or when you wish to test with both. If you want to install packages for Python 2, run either: pip install [package] or: p...

Page 47 of 161