Tutorial by Examples: f

NA is a logical type and a logical operator with an NA will return NA if the outcome is ambiguous. Below, NA OR TRUE evaluates to TRUE because at least one side evaluates to TRUE, however NA OR FALSE returns NA because we do not know whether NA would have been TRUE or FALSE NA | TRUE # [1] TRUE ...
A For Loop is great for doing things a certain amount of time. It's like a While Loop but the increment is included with the condition. A For Loop is set up like this: for (Initialization; Condition; Increment) { // Code } Initialization - Makes a new local variable that can only be us...
Analysis of Variance (aov) is used to determine if the means of two or more groups differ significantly from each other. Responses are assumed to be independent of each other, Normally distributed (within each group), and the within-group variances are assumed equal. In order to complete the analys...
[ alias ] ignored = ! git ls-files --others --ignored --exclude-standard --directory \ && git ls-files --others -i --exclude-standard Shows one line per file, so you can grep (only directories): $ git ignored | grep '/$' .yardoc/ doc/ Or count: ~$ git ignored | ...
The year, month or day components of a DATE data type can be found using the EXTRACT( [ YEAR | MONTH | DAY ] FROM datevalue ) SELECT EXTRACT (YEAR FROM DATE '2016-07-25') AS YEAR, EXTRACT (MONTH FROM DATE '2016-07-25') AS MONTH, EXTRACT (DAY FROM DATE '2016-07-25') AS DAY FROM D...
In some cases you might want to add an additional description to an enum value, for instance when the enum value itself is less readable than what you might want to display to the user. In such cases you can use the System.ComponentModel.DescriptionAttribute class. For example: public enum Possibl...
Detecting the current state of the network connection and responding to any changes that might occur, can be done by using one of several plugins. This example is about the cordova-plugin-network-information plugin. Add the plugin to the project: cordova plugin add cordova-plugin-network-informati...
echo "Prints only the matching part of the lines" | grep -o "matching" # prints matching
Counting rows based on a specific column value: SELECT category, COUNT(*) AS item_count FROM item GROUP BY category; Getting average income by department: SELECT department, AVG(income) FROM employees GROUP BY department; The important thing is to select only columns specified in the GRO...
There are three types of code swaps that Instant run enables to support faster debugging and running app from your code in Android Studio. Hot Swap Warm Swap Cold Swap When are each of these swaps triggered? HOT SWAP is triggered when an existing method's implementation is changed. WARM SW...
We have a C library named my_random that produces random numbers from a custom distribution. It provides two functions that we want to use: set_seed(long seed) and rand() (and many more we do not need). In order to use them in Cython we need to define an interface in the .pxd file and call the f...
On of the overloads of the Select extension methods also passes the index of the current item in the collection being selected. These are a few uses of it. Get the "row number" of the items var rowNumbers = collection.OrderBy(item => item.Property1) .ThenBy...
DataTables has the capability to enable or disable a number of its features, such as paging or searching. To choose these options, simply select them in your initialization: $(document).ready(function() { $('#tableid').DataTable( { "paging": false, //Turn off paging, all r...
Swing supports quite a few native L&Fs. You can always easily install one without calling for a specific L&F class: public class SystemLookAndFeel { public static void main ( final String[] args ) { // L&F installation should be performed within EDT (Event Dispatch ...
public class CustomLookAndFeel { public static void main ( final String[] args ) { // L&F installation should be performed within EDT (Event Dispatch Thread) // This is important to avoid any UI issues, exceptions or even deadlocks SwingUtilities.invokeLater...
Lambdas are meant to provide inline implementation code for single method interfaces and the ability to pass them around as we have been doing with normal variables. We call them Functional Interface. For example, writing a Runnable in anonymous class and starting a Thread looks like: //Old way n...
One way to calculate the Big-O value of a procedure you've written is to determine which line of code runs the most times in your function, given your input size n. Once you have that number, take out all but the fastest-growing terms and get rid of the coefficents - that is the Big-O notation of yo...
Open Repo Create new repo (My advice first add pods on a temporary repo before adding to your original project) Fill Repository name with your repo name. I'll use "myrepo" for this tutorial and will use "<" and ">" symbols for the parts you should change to yo...
To get the IP address of a docker machine, you can do that with this command : docker-machine ip machine-name
Dim aList As New List(Of String) aList.Add("Hello") aList.Add("Delete Me!") aList.Add("World") 'Remove the item from the list at index 1 aList.RemoveAt(1) 'Remove a range of items from a list, starting at index 0, for a count of 1) 'This will remove index 0, ...

Page 156 of 457