Tutorial by Examples: st

JavaScript has native conversion from Number to it's String representation for any base from 2 to 36. The most common representation after decimal (base 10) is hexadecimal (base 16), but the contents of this section work for all bases in the range. In order to convert a Number from decimal (base...
You can use gradle to have BuildConfig constants and res values on a per flavor basis. Just add the value to the flavor you want to support. android { defaultConfig { resValue "string", "app_name", "Full App" buildConfigField "boolean",...
You can convert a numeric string to various Java numeric types as follows: String to int: String number = "12"; int num = Integer.parseInt(number); String to float: String number = "12.0"; float num = Float.parseFloat(number); String to double: String double = "1...
Pass each variable to view at a time $this->set('color', 'pink'); $this->set('color', $color); Pass multiple variables to view together via compact() function $color1 = 'pink'; $color2 = 'red'; $this->set(compact('color1', 'color2'));
You can retrieve post data as Array. $post_data= $this->request->data; You can retrieve post data for particular key. $this->request->data['field']; Retrieve specific key value $this->request->data('key_name'); Retrieve specific key value of nested array $this->requ...
Dim fso As New Scripting.FileSystemObject Debug.Print fso.GetBaseName("MyFile.something.txt") Prints MyFile.something Note that the GetBaseName() method already handles multiple periods in a file name.
Dim fso As New Scripting.FileSystemObject Debug.Print fso.GetExtensionName("MyFile.something.txt") Prints txt Note that the GetExtensionName() method already handles multiple periods in a file name.
The format of a playbook is quite straightforward, but strict in terms of spacing and layout. A playbook consists of plays. A play is a combination of targets hosts and the tasks we want to apply on these hosts, so a drawing of a playbook is this: To execute this playbook, we simply run: ansible...
Here’s a simple play: - name: Configure webserver with git hosts: webserver become: true vars: package: git tasks: - name: install git apt: name={{ package }} state=present As we said earlier, every play must contain: A set of hosts to configure A list of t...
To translate strings, you will have to create translation files. To do so, django ships with the management command makemessages. $ django-admin makemessages -l fr processing locale fr The above command will discover all strings marked as translatable within your installed apps and create one l...
The sensor values returned by Android are with respective to the phone's coordinate system (e.g. +Y points towards the top of the phone). We can transform these sensor values into a world coordinate system (e.g. +Y points towards magnetic North, tangential to the ground) using the sensor managers ro...
Every thread has access to a mutable dictionary that is local to the current thread. This allows to cache informations in an easy way without the need for locking, as each thread has its own dedicated mutable dictionary: NSMutableDictionary *localStorage = [NSThread currentThread].threadDictionary;...
$ mkdir 20{09..11}-{01..12} Entering the ls command will show that the following directories were created: 2009-01 2009-04 2009-07 2009-10 2010-01 2010-04 2010-07 2010-10 2011-01 2011-04 2011-07 2011-10 2009-02 2009-05 2009-08 2009-11 2010-02 2010-05 2010-08 2010-11 2011-02 2011-05 2011-08 2011...
If you have one of the supported Linux distributions, you can follow the steps on the .NET Core website: https://www.microsoft.com/net If you have an unsupported distribution: Download the .NET Core SDK from the links, picking the distribution closer to the used one. https://www.microsoft.com/net...
First, create a key file, e.g., vault_pass_file, which ideally contains a long sequence of random characters. In linux systems you could use pwgen to create a random password file: pwgen 256 1 > vault_pass_file Then, use this file to encrypt sensitive data, e.g., groups_vars/group.yml: ANSI...
With Vault you can also encrypt non-structured data, such as private key files and still be able to decrypt them in your play with the lookup module. --- - name: Copy private key to destination copy: dest=/home/user/.ssh/id_rsa mode=0600 content=lookup('pipe', 'ANSIBLE_VAULT_PA...
Go to the (project folder) Then app -> src -> main. Create folder 'assets -> fonts' into the main folder. Put your 'fontfile.ttf' into the fonts folder.
public void setFont(TextView textView) { textView.setTypeface(myFont); }
Grant Vibration Permission before you start implement code, you have to add permission in android manifest : <uses-permission android:name="android.permission.VIBRATE"/> Import Vibration Library import android.os.Vibrator; Get instance of Vibrator from Context Vibrator vibr...
If you want stop vibrate please call : vibrator.cancel();

Page 119 of 369