Tutorial by Examples

TL;DR It basically allows us to simulate real devices and test our apps without a real device. According to Android Developer Documentation, an Android Virtual Device (AVD) definition lets you define the characteristics of an Android Phone, Tablet, Android Wear, or Android TV device that you w...
(require '[clj-time.core :as t]) (def example-time (t/date-time 2016 12 5 4 3 27 456)) (t/year example-time) ;; 2016 (t/month example-time) ;; 12 (t/day example-time) ;; 5 (t/hour example-time) ;; 4 (t/minute example-time) ;; 3 (t/second example-time) ;; 27
Create Selector for Enable/Disable Menu Item. selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/white" android:state_enabled="true&q...
(require '[clj-time.core :as t]) (def date1 (t/date-time 2016 12 5)) (def date2 (t/date-time 2016 12 6)) (t/equal? date1 date2) ;; false (t/equal? date1 date1) ;; true (t/before? date1 date2) ;; true (t/before? date2 date1) ;; false (t/after? date1 date2) ;; false (t/after? date2 dat...
This will add a simple widget which displays just a small message. add_action('wp_dashboard_setup', 'register_my_dashboard_widgets'); function register_my_dashboard_widgets() { wp_add_dashboard_widget('myInfo_widget', 'Important Information', 'display_infoWidget'); } ...
In the following we will install Plesk Onyx on Windows Server (2016) using the Plesk Installer GUI. Preparations For installing Plesk we need a running Windows Server (2012/2016) installation. The Hardware recommendation is a minimum of 2GB RAM and 30GB free disk space. Have a look at the official...
strComputer = "." Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSettings = objWMIService.ExecQuery _("Select * from Win32_ComputerSystem") For Each objCompu...
strComputer = "." instances = 0 processName = "chrome.exe" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process") For Each objProcess in colP...
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_DesktopMonitor",,48) For Each objItem in colItems WScript.Echo "ScreenHeight: " &am...
The sample command can be used to simulate classic probability problems like drawing from an urn with and without replacement, or creating random permutations. Note that throughout this example, set.seed is used to ensure that the example code is reproducible. However, sample will work without expl...
The set.seed function is used to set the random seed for all randomization functions. If you are using R to create a randomization that you want to be able to reproduce, you should use set.seed first. set.seed(1643) samp1 <- sample(x = 1:5,size = 200,replace = TRUE) set.seed(1643) samp2 &lt...
To calculate the sum of terms (of type float, int or big integer) of a number list, it is preferable to use List.sum In other cases, List.fold is the function that is best suited to calculate such a sum. Sum of complex numbers In this example, we declare a list of complex numbers and we calcu...
Bukkit uses an event based system that allows plugin developers to interact with and modify the server and specific actions that occur in the world. Creating an Event Handler Event handlers are methods that get called when their event occurs. They are generally public and void as well as named o...
One of the most critical parts of dealing with NMS code is being able to support mulitple Minecraft versions. There are numerous ways to do this, but a simple solution is to use this code to store the version as a public static field: public static final String NMS_VERSION = Bukkit.getServer().getC...
One very simple thing that you might want to do with NMS that Bukkit doesn't support is get the player's ping. This can be done like this: /** * Gets the players ping by using NMS to access the internal 'ping' field in * EntityPlayer * * @param player * the player whose ping t...
Create a new folder called MyClasses and create and add the following class public class GmailEmailService:SmtpClient { // Gmail user-name public string UserName { get; set; } public GmailEmailService() : base(ConfigurationManager.AppSettings["GmailHost"], Int32.Parse...
This example shows how to obtain the ancestry of a component using the ClassType and ClassParent properties. It uses a button Button1: TButton and a list box ListBox1: TListBox on a form TForm1. When the user clicks the button, the name of the button’s class and the names of its parent classes are ...
New-S3Bucket -BucketName trevor The Simple Storage Service (S3) bucket name must be globally unique. This means that if someone else has already used the bucket name that you want to use, then you must decide on a new name.
Set-Content -Path myfile.txt -Value 'PowerShell Rocks' Write-S3Object -BucketName powershell -File myfile.txt Uploading files from your local filesystem into AWS S3 is easy, using the Write-S3Object command. In its most basic form, you only need to specify the -BucketName parameter, to indicate ...
Get-S3Object -BucketName powershell | Remove-S3Object -Force Remove-S3Bucket -BucketName powershell -Force In order to remove a S3 bucket, you must first remove all of the S3 objects that are stored inside of the bucket, provided you have permission to do so. In the above example, we are retriev...

Page 1202 of 1336