Tutorial by Examples: ee

git diff HEAD^ HEAD This will show the changes between the previous commit and the current commit.
Freeing memory twice is undefined behavior, e.g. int * x = malloc(sizeof(int)); *x = 9; free(x); free(x); Quote from standard(7.20.3.2. The free function of C99 ): Otherwise, if the argument does not match a pointer earlier returned by the calloc, malloc, or realloc function, or if the sp...
Using ActiveCell or ActiveSheet can be source of mistakes if (for any reason) the code is executed in the wrong place. ActiveCell.Value = "Hello" 'will place "Hello" in the cell that is currently selected Cells(1, 1).Value = "Hello" 'will always place "Hello&...
So you've uploaded your files to a folder say /backend/web/uploads/ and you want these uploads to be visible on the frontend too. The easiest option is to create a symlink in the frontend that links to the backend: ln -s /path/to/backend/web/uploads/ /path/to/frontend/web/uploads In your views y...
If it is important for a sequence of numbers generated by random() to differ, it is a good idea to specify a seed with randomSeed(): void setup() { Serial.begin(9600); // If analog pin 0 is left unconnected, analogRead(0) will produce a // different random number each time the ...
composer update composer update will update our dependencies as they are specified in composer.json. For example, if our project uses this configuration: "require": { "laravelcollective/html": "2.0.*" } Supposing we have actually installed the 2.0.1 version ...
Worksheets in excel have three options for the Visible property. These options are represented by constants in the xlSheetVisibility enumeration and are as follows: xlVisible or xlSheetVisible value: -1 (the default for new sheets) xlHidden or xlSheetHidden value: 0 xlVeryHidden xlSheetVeryHidd...
CMake knows several build types, which usually influence default compiler and linker parameters (such as debugging information being created) or alternative code paths. By default, CMake is able to handle the following build types: Debug: Usually a classic debug build including debugging informa...
let x = true match x with | true -> printfn "x is true" yields a warning C:\Program Files (x86)\Microsoft VS Code\Untitled-1(2,7): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s). ...
Incorrect usage: In the following snippet, the last match will never be used: let x = 4 match x with | 1 -> printfn "x is 1" | _ -> printfn "x is anything that wasn't listed above" | 4 -> printfn "x is 4" prints x is anything that wasn't listed abov...
Predicates that produce side effects leave the realm of pure logic. These are for example: writeq/1 read/1 format/2 Side effects are phenomena that cannot be reasoned about within the program. For example, deletion of a file or output on the system terminal.
In oracle, the difference (in days and/or fractions thereof) between two DATEs can be found using subtraction: SELECT DATE '2016-03-23' - DATE '2015-12-25' AS difference FROM DUAL; Outputs the number of days between the two dates: DIFFERENCE ---------- 89 And: SELECT TO_DATE( '201...
enum class Color { RED, GREEN, BLUE } Each enum constant is an object. Enum constants are separated with commas.
Sometimes, we may open a file which we do not have permission to write in Vim without using sudo. Use this command to save a read-only file edited in Vim. :w !sudo tee > /dev/null % Which you could map to :w!! in your .vimrc: cmap w!! w !sudo tee > /dev/null % You will be presented a ...
Many times when working with the canvas you will need to have a canvas to hold some intrum pixel data. It is easy to create an offscreen canvas, obtain a 2D context. An offscreen canvas will also use the available graphics hardware to render. The following code simply creates a canvas and fills it ...
Shortest match: $ a='I am a string' $ echo "${a%a*}" I am Longest match: $ echo "${a%%a*}" I
Other examples couldn't clearly explain to me how to trigger the conditional logic. This example also shows that underlying commands will also listen to the -Confirm flag! <# Restart-Win32Computer #> function Restart-Win32Computer { [CmdletBinding(SupportsShouldProcess=$true,Conf...
Hibernate can use two types of fetch when you are mapping the relationship between two entities: EAGER and LAZY. In general, the EAGER fetch type is not a good idea, because it tells JPA to always fetch the data, even when this data is not necessary. Per example, if you have a Person entity and th...
$(window).load() was deprecated in jQuery version 1.8 (and completely removed from jQuery 3.0) and as such should not be used anymore. The reasons for the deprecation are noted on the jQuery page about this event Caveats of the load event when used with images A common challenge developers attem...
superman-directive.js angular.module('myApp', []) .directive('superman', function() { return { // restricts how the directive can be used restrict: 'E', templateUrl: 'superman-template.html', controller: function() { this.message = "I'm superman!&qu...

Page 10 of 54