Tutorial by Examples: e

def lst = ['foo', 'foo', 'bar', 'baz'] // *modifies* the list removing duplicate items lst.unique() // [foo, bar, baz] // setting to false the "mutate" argument returns a new list, leaving the original intact lst.unique(false) // [foo, bar, baz] // convert the list to a Set, thu...
The Slow Query Log consists of log events for queries taking up to long_query_time seconds to finish. For instance, up to 10 seconds to complete. To see the time threshold currently set, issue the following: SELECT @@long_query_time; +-------------------+ | @@long_query_time | +-----------------...
WebRTC is an open framework for the web that enables Real Time Communications in the browser. It includes the fundamental building blocks for high-quality communications on the web, such as network, audio and video components used in voice and video chat applications. These components, when impleme...
# operator or stringizing operator is used to convert a Macro parameter to a string literal. It can only be used with the Macros having arguments. // preprocessor will convert the parameter x to the string literal x #define PRINT(x) printf(#x "\n") PRINT(This line will be converted to...
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...
Here's a simple example that uses XSLT to convert data in an XML file into a table in an HTML file. You can use it to experiment with simple XSLT transforms. Prerequisite: Install a Java Runtime Environment and add the location of the JRE to your PATH variable. (On Windows, most installers will add...
class ImageExample extends Component { render() { return ( <View> <Image style={{width: 30, height: 30}} source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}} /> </View> ); } }
You can start the remote debugging from Developer menu. After selecting the enable remote debugging it will open Google Chrome, So that you can log the output into your console. You can also write debugger syntax into your js code.
Prefix bitwise operators Bitwise operators are like logical operators but executed per bit rather than per boolean value. // bitwise NOT ~: sets all unset bits and unsets all set bits printf("%'06b", ~0b110110); // 001001 Bitmask-bitmask operators Bitwise AND &: a bit is set onl...
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...
Set a tinting color for the image. By default, the tint will blend using SRC_ATOP mode. set tint using XML attribute: android:tint="#009c38" Note: Must be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". set tint progra...
SELECT * INTO NewTable FROM OldTable Creates a new table with structure of old table and inserts all rows into the new table. Some Restrictions You cannot specify a table variable or table-valued parameter as the new table. You cannot use SELECT…INTO to create a partitioned table, even whe...
The following example can be used to find the total row count for a specific table in a database if table_name is replaced by the the table you wish to query: SELECT COUNT(*) AS [TotalRowCount] FROM table_name; It is also possible to get the row count for all tables by joining back to the table'...
This is something that can be frustrating: you make a visualisation using D3.js but the rectangle you want on top is hidden behind another rectangle, or the line you planned to be behind some circle is actually over it. You try to solve this using the z-index in your CSS, but it doesn't work (in SVG...
enum Fruit { apple, banana } main() { var a = Fruit.apple; switch (a) { case Fruit.apple: print('it is an apple'); break; } // get all the values of the enums for (List<Fruit> value in Fruit.values) { print(value); } // get the second val...
First of all, ensure that you've enabled the 'Virtualization' in your BIOS setup. Start the Android SDK Manager, select Extras and then select Intel Hardware Accelerated Execution Manager and wait until your download completes. If it still doesn't work, open your SDK folder and run /extras/intel/Ha...
adb shell am start -n com.android.settings/.DevelopmentSettings Will navigate your device/emulator to the Developer Options section.
This is relevant for apps that implement a BootListener. Test your app by killing your app and then test with: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n your.app/your.app.BootListener (replace your.package/your.app.BootListener with proper ...
First define an ExitActivity in the AndroidManifest.xml <activity android:name="com.your_example_app.activities.ExitActivity" android:autoRemoveFromRecents="true" android:theme="@android:style/Theme.NoDisplay" /> Afterwards the ExitA...

Page 620 of 1191