A drawable can be tinted a certain color. This is useful for supporting different themes within your application, and reducing the number of drawable resource files.
Using framework APIs on SDK 21+:
Drawable d = context.getDrawable(R.drawable.ic_launcher);
d.setTint(Color.WHITE);
Using android...
Copy the package installer unit file to /etc where changes will not be overwritten on an upgrade:
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
Update /etc/systemd/system/docker.service with your options on ExecStart:
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0...
TRUNCATE TABLE Helloworlds
This code will delete all the data from the table Helloworlds. Truncate table is almost similar to Delete from Table code. The difference is that you can not use where clauses with Truncate. Truncate table is considered better than delete because it uses less transacti...
trigger ContactTrigger on Contact (before insert, after insert,
before update, after update,
before delete, after delete,
after undelete) {
/** Before or After trigger execution**/
/...
To reference a variable in a query, add a colon (:) before the variable name.
Datetime targetDate = Datetime.now().addDays(-7);
List<Lead> recentLeads = [SELECT Id FROM Lead WHERE CreatedDate > :targetDate];
string targetName = 'Unknown';
List<Contact> incompleteContacts = [SELE...
Add following Paths to the PATH-Enviromentvariable
[Path to CMake]\bin
[Path to Git]\bin
[Path to SDK]\tools
[Path to SDK]\platform-tools
[Path to NDK]
[Path to ANT]\bin
[Path to MinGW]\bin
[Path to MinGW]\msys\1.0\bin
[Path to Java jre]\bin
[Path to Java jdk]\bin
Make sure you use ba...
RxSwift offers many ways to create an Observable, let's take a look:
import RxSwift
let intObservale = Observable.just(123) // Observable<Int>
let stringObservale = Observable.just("RxSwift") // Observable<String>
let doubleObservale = Observable.just(3.14) // Observable&...
Any nullable type is a generic type. And any nullable type is a value type.
There are some tricks which allow to effectively use the result of the Nullable.GetUnderlyingType method when creating code related to reflection/code-generation purposes:
public static class TypesHelper {
public stat...
You can check if a variable has been defined in a scope by using ColdFusion's built in StructKeyExists() function. This can be used inside a <cfif> tag to prevent error messages in the event you attempt to refer to a variable that does not exist. You can also use this function to determine whe...
The IEnumerable<T> interface is the base interface for all generic enumerators and is a quintessential part of understanding LINQ. At its core, it represents the sequence.
This underlying interface is inherited by all of the generic collections, such as Collection<T>, Array, List<T&g...
Custom Setting
Custom Setting Field
Custom Setting Field Value
When the field is checked the validation rule will be disabled, for the running user or in this example, their profile -
The rule can also be disabled for a whole Salesforce org -
Validation Rule
AND(
/* the below is the...
Explanation
In this example a simple Trigger has been created to change the Close Date of an Opportunity, that's about to be inserted or updated, to a date 10 days in the future.
The Apex Controller custom setting's checkbox field enables the code to be disabled at the user / profile / org level.
...
How to create User Model Class
namespace App\Model\Table;
use Cake\ORM\Table;
class UsersTable extends Table {
public function initialize(array $config) {
$this->table('users'); //define table name
$this->displayField('username'); // unique or other special field of...
HTML
<div>
Even if this div is too small to display its contents, the content is not clipped.
</div>
CSS
div {
width:50px;
height:50px;
overflow:visible;
}
Result
Content is not clipped and will be rendered outside the content box if it exceeds its co...
EditableAttribute sets whether users should be able to change the value of the class property.
public class Employee
{
[Editable(false)]
public string FirstName { get; set; }
}
Simple usage example in XAML application
<Window x:Class="WpfApplication.MainWindow"
...
If a type t is Traversable then values of t a can be split into two pieces: their "shape" and their "contents":
data Traversed t a = Traversed { shape :: t (), contents :: [a] }
where the "contents" are the same as what you'd "visit" using a Foldable insta...
The TIMESTAMP column will show when the row was last updated.
CREATE TABLE `TestLastUpdate` (
`ID` INT NULL,
`Name` VARCHAR(50) NULL,
`Address` VARCHAR(50) NULL,
`LastUpdate` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
COMMENT='Last Update'
;