Tutorial by Examples: ar

public void setCardColorTran(CardView card) { ColorDrawable[] color = {new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)}; TransitionDrawable trans = new TransitionDrawable(color); if(Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { card.setB...
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner ; +Owner avoids a taskbar button. Gui, Add, Text,, Some text to display. Gui, Show, NoActivate, Title of Window ; NoActivate avoids deactivating the currently active window.
As already mentioned you can declare an unordered map of any type. Let's have a unordered map named first with string and integer type. unordered_map<string, int> first; //declaration of the map first["One"] = 1; // [] operator used to insert the value first["Two"] = 2...
Suppose you are comparing value with some variable if ( i == 2) //Bad-way { doSomething; } Now suppose you have mistaken == with =. Then it will take your sweet time to figure it out. if( 2 == i) //Good-way { doSomething; } Then, if an equal sign is accidentally left out, the ...
In PHP, variable values have an associated "truthiness" so even non-boolean values will equate to true or false. This allows any variable to be used in a conditional block, e.g. if ($var == true) { /* explicit version */ } if ($var) { /* $var == true is implicit */ } Here are some fun...
Suppose you are creating a function that requires no arguments when it is called and you are faced with the dilemma of how you should define the parameter list in the function prototype and the function definition. You have the choice of keeping the parameter list empty for both prototype and d...
There are two ways to uninstall a particular version of Ruby. The easiest is to simply remove the directory from ~/.rbenv/versions: $ rm -rf ~/.rbenv/versions/2.1.0 Alternatively, you can use the uninstall command, which does exactly the same thing: $ rbenv uninstall 2.1.0 If this version ha...
Array ( [0] => Array ( [id] => 13 [category_id] => 7 [name] => Leaving Of Liverpool [description] => Leaving Of Liverpool [price] => 1.00 [virtual] => 1 [active] =...
Since BackAndroid is deprecated. Use BackHandler instead of BackAndroid. import { BackHandler } from 'react-native'; {...} ComponentWillMount(){ BackHandler.addEventListener('hardwareBackPress',()=>{ if (!this.onMainScreen()) { this.goBack(); return true; ...
Lets have the following example.bat and call it with arguments 1 ,2 and 3: @echo off ( shift shift echo %1 ) As the variable expansion will change after the the end brackets context is reached the output will be: 1 As this might be an issue when shifting inside brackets ...
Declaring a DLL procedure to work with different VBA versions: Option Explicit #If Win64 Then Private Declare PtrSafe Sub xLib "Kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) #ElseIf Win32 Then Private Declare Sub apiSleep Lib "Kernel32" Ali...
val a = arrayOf(1, 2, 3) // creates an Array<Int> of size 3 containing [1, 2, 3].
val a = Array(3) { i -> i * 2 } // creates an Array<Int> of size 3 containing [0, 2, 4]
val a = arrayOfNulls<Int>(3) // creates an Array<Int?> of [null, null, null] The returned array will always have a nullable type. Arrays of non-nullable items can't be created uninitialized.
General-purpose stopwatch for timing how long a function takes to run: object Benchmark { fun realtime(body: () -> Unit): Duration { val start = Instant.now() try { body() } finally { val end = Instant.now() return Duration.b...
PGSQL> SELECT COALESCE(NULL, NULL, 'HELLO WORLD'); coalesce -------- 'HELLO WORLD'
PGSQL> SELECT COALESCE(NULL, NULL, 'first non null', null, null, 'second non null'); coalesce -------- 'first non null'
PGSQL> SELECT COALESCE(NULL, NULL, NULL); coalesce --------
let imagePath = require("../../assets/list.png"); <Image style={{height: 50, width: 50}} source={imagePath} /> From external resource: <Image style={{height: 50, width: 50}} source={{uri: userData.image}} />
As mentioned here, the old-school method to run another script is by using temporary files. Simple echo it into a file and then run it(and remove it optionally). Here's the basic concept: @echo off echo //A JS Comment > TempJS.js echo //Add your code>>TempJS.js cscript //nologo //e...

Page 209 of 218