Tutorial by Examples: al

In order to call a function through a function pointer, the function pointer's type must exactly match the function's type. Otherwise, the behaviour is undefined. Example: int f(); void (*p)() = reinterpret_cast<void(*)()>(f); p(); // undefined
To build up an expression like _ => _.Field == "VALUE" at runtime. Given a predicate _ => _.Field and a string value "VALUE", create an expression that tests whether or not the predicate is true. The expression is suitable for: IQueryable<T>, IEnumerable<T>...
To get the time at which your app was installed or updated, you should query Android's package manager. try { // Reference to Android's package manager PackageManager packageManager = this.getPackageManager(); // Getting package info of this application PackageInfo info = pack...
Since Yii2 version 2.0.4 there is the EachValidator used to validate each item in an array. [ // ... other rules ['userIDs', 'each', 'rule' => ['integer']], ] The ['integer'] part can be every other validator object that Yii2 offers and can hold the specific arguments for the valid...
The java.util.Locale class is used to represent a "geographical, political or cultural" region to localize a given text, number, date or operation to. A Locale object may thus contain a country, region, language, and also a variant of a language, for instance a dialect spoken in a certain ...
A function is a block of organised, reusable code that is used to perform a single, related action. Functions usually "take in" data, process it, and "return" a result. User defined function A function defined by user. Example in PHP //Function definition function a...
Rebuilding indexes is done using the following statement ALTER INDEX All ON tableName REBUILD; This drops the index and recreates it, removing fragementation, reclaims disk space and reorders index pages. One can also reorganize an index using ALTER INDEX All ON tableName REORGANIZE; which ...
EXEC sp_MSForEachTable 'ALTER INDEX ALL ON ? REBUILD'
Sub Main() Dim People = New List(Of String)({"Bob Barker", "Ricky Bobby", "Jeff Bridges"}) Console.WriteLine(People.Contains("Rick James")) Console.WriteLine(People.Contains("Ricky Bobby")) Console.WriteLine(Pe...
OVERVIEW cocos2d-x is an open source, cross-platform game engine. It allows developers to code in C++, Lua and Javascript deployment into iOS, Android, Windows Phone, Mac OS X, Windows Desktop and Linux. PREREQUISITES Build Requirements Mac OS X 10.7+, Xcode 4.6+ Windows 7+, VS 2012+ Ubunt...
Description: Evaluate expression after user's confirmation. Arguments: ng-confirm-click:(expression) Expression to evaluate when confirmed. ng-confirm-message:(template) Message to be shown in confirm dialog. Code: Directives.directive("ngConfirmClick", ["$parse","...
YAML does not come with a standard PHP installation, instead it needs to be installed as a PECL extension. On linux/unix it can be installed with a simple pecl install yaml Note that libyaml-dev package must be installed on the system, as the PECL package is simply a wrapper around libYAML call...
General log - all queries - see VARIABLE general_log Slow log - queries slower than long_query_time - slow_query_log_file Binlog - for replication and backup - log_bin_basename Relay log - also for replication general errors - mysqld.err start/stop - mysql.log (not very interesting) - log_err...
How to use conditional execution of command lists Any builtin command, expression, or function, as well as any external command or script can be executed conditionally using the &&(and) and ||(or) operators. For example, this will only print the current directory if the cd command was succ...
def lst = [10, 20, 30, 40] lst.findAll { it > 25 } // [30, 40]
This is an example on how to use React Native's BackAndroid along with the Navigator. componentWillMount registers an event listener to handle the taps on the back button. It checks if there is another view in the history stack, and if there is one, it goes back -otherwise it keeps the default beha...
While catching the Throwable, Exception, Error and RuntimeException exceptions is bad, throwing them is even worse. The basic problem is that when your application needs to handle exceptions, the presence of the top level exceptions make it hard to discriminate between different error conditions. ...
Controls how the image should be resized or moved to match the size of ImageView. XML attribute: android:scaleType="..." i will illustrate different scale types with a square ImageView which has a black background and we want to display a rectangular drawable in white background in Im...
Detailed instructions on getting azure-service-fabric set up or installed.
The General Query Log contains a listing of general information from client connects, disconnects, and queries. It is invaluable for debugging, yet it poses as a hindrance to performance (citation?). An example view of a General Query Log is seen below: To determine if the General Log is current...

Page 136 of 269