Tutorial by Examples: e

Following query will provide information about TempDb usage. Analyzing the counts you can identify which thing is impacting TempDb SELECT SUM (user_object_reserved_page_count)*8 as usr_obj_kb, SUM (internal_object_reserved_page_count)*8 as internal_obj_kb, SUM (version_store_reserved_page_cou...
Below query can be used to get TempDB database details: USE [MASTER] SELECT * FROM sys.databases WHERE database_id = 2 OR USE [MASTER] SELECT * FROM sys.master_files WHERE database_id = 2 With the help of below DMV, you can check how much TempDb space does your session is using. This query...
using System; using System.Linq; using System.Security.Cryptography; namespace YourCryptoNamespace { /// <summary> /// Salted password hashing with PBKDF2-SHA1. /// Compatibility: .NET 3.0 and later. /// </summary> /// <remarks>See http://crackstation.net/h...
When a single parameter is passed to the .attr() function it returns the value of passed attribute on the selected element. Syntax: $([selector]).attr([attribute name]); Example: HTML: <a href="/home">Home</a> jQuery: $('a').attr('href'); Fetching data attributes: jQue...
If you want to add an attribute to some element you can use the attr(attributeName, attributeValue) function. For example: $('a').attr('title', 'Click me'); This example will add mouseover text "Click me" to all links on the page. The same function is used to change attributes' values...
To remove an attribute from an element you can use the function .removeAttr(attributeName). For example: $('#home').removeAttr('title'); This will remove title attribute from the element with ID home.
attr() gets/sets the HTML attribute using the DOM functions getAttribute() and setAttribute(). prop() works by setting the DOM property without changing the attribute. In many cases the two are interchangeable, but occasionally one is needed over the other. To set a checkbox as checked: $('#tosAcc...
$q is a built-in service which helps in executing asynchronous functions and using their return values(or exception) when they are finished with processing. $q is integrated with the $rootScope.Scope model observation mechanism, which means faster propagation of resolution or rejection into your m...
(.) lets us compose two functions, feeding output of one as an input to the other: (f . g) x = f (g x) For example, if we want to square the successor of an input number, we can write ((^2) . succ) 1 -- 4 There is also (<<<) which is an alias to (.). So, (+ 1) <<&lt...
Control.Category defines (>>>), which, when specialized to functions, is -- (>>>) :: Category cat => cat a b -> cat b c -> cat a c -- (>>>) :: (->) a b -> (->) b c -> (->) a c -- (>>>) :: (a -> b) -> (b -> c) -> (a -> c...
The ng-pattern directive accepts an expression that evaluates to a regular expression pattern and uses that pattern to validate a textual input. Example: Lets say we want an <input> element to become valid when it's value (ng-model) is a valid IP address. Template: <input type="tex...
The angular.identity function returns the first argument passed to it. angular.identity(argument) This function is useful for functional programming, you can provide this function as a default in case an expected function was not passed. Examples: angular.identity(42) // 42 var mutate = f...
The angular.forEach accepts an object and an iterator function. It then runs the iterator function over each enumerable property/value of the object. This function also works on arrays. Like the JS version of Array.prototype.forEach The function does not iterate over inherited properties (prototype...
Google App scripts are of three types. Standalone Bound to Google Apps Web Apps Standalone script Standalone scripts are not bound to any Google apps i.e Docs, Sheets or Forms etc. Standalone script can either be created by visiting script.google.com or by connecting Google app script with ...
Transform tr = GetComponent<Transform>().Find("NameOfTheObject"); GameObject go = tr.gameObject; Find returns null if none is found ProsConsLimited, well defined search scopeStrings are weak references
#include <stdio.h> #include <threads.h> #include <stdlib.h> struct my_thread_data { double factor; }; int my_thread_func(void* a) { struct my_thread_data* d = a; // do something with d printf("we found %g\n", d->factor); // return an succes...
Like normal HTML elements, it is possible for $scopes to have their own events. $scope events can be subscribed to using the following manner: $scope.$on('my-event', function(event, args) { console.log(args); // { custom: 'data' } }); If you need unregister an event listener, the $on func...
ALTER TABLE fish_data.fish DROP PRIMARY KEY; ALTER TABLE fish_data.fish MODIFY COLUMN fish_id DECIMAL(20,0) NOT NULL PRIMARY KEY; An attempt to modify the type of this column without first dropping the primary key would result in an error.
In Insert mode, press <C-r> and then % to insert the filename. This technique is applicable to all registers. For e.g. if in insert mode, you want to paste the current search pattern, you can type <C-r> and then /.
Formatting a JavaScript date in modern browsers In modern browsers (*), Date.prototype.toLocaleDateString() allows you to define the formatting of a Date in a convenient manner. It requires the following format : dateObj.toLocaleDateString([locales [, options]]) The locales parameter should be...

Page 528 of 1191