Tutorial by Examples: and

From the official documentation: Gradle. dependencies { compile "com.squareup.picasso:picasso:2.5.2" } Maven: <dependency> <groupId>com.squareup.picasso</groupId> <artifactId>picasso</artifactId> <version>2.5.2</version> </dep...
Picasso supports both download and error placeholders as optional features. Its also provides callbacks for handling the download result. Picasso.with(context) .load("YOUR IMAGE URL HERE") .placeholder(Your Drawable Resource) //this is optional the image to display while the url i...
Picasso.with(context) .load("YOUR IMAGE URL HERE") .placeholder(DRAWABLE RESOURCE) // optional .error(DRAWABLE RESOURCE) // optional .resize(width, height) // optional .rotate(degree) // optional .in...
DROP INDEX ix_cars_employee_id ON Cars; We can use command DROP to delete our index. In this example we will DROP the index called ix_cars_employee_id on the table Cars. This deletes the index entirely, and if the index is clustered, will remove any clustering. It cannot be rebuilt without rec...
Encoding //Create a Base64 Encoded NSString Object NSData *nsdata = [@"iOS Developer Tips encoded in Base64" dataUsingEncoding:NSUTF8StringEncoding]; // Get NSString from NSData object in Base64 NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0]; // Print the B...
Swift 3: let minimumVersion = OperatingSystemVersion(majorVersion: 8, minorVersion: 1, patchVersion: 2) if ProcessInfo().isOperatingSystemAtLeast(minimumVersion) { //current version is >= (8.1.2) } else { //current version is < (8.1.2) }
if #available(iOS 9, *) { // iOS 9 } else { // iOS 8 or earlier }
Modules are documented elsewhere. Compilers often generate so-called module files: usually the file containing module my_module end module will result in a file named something like my_module.mod by the compiler. In such cases, for a module to be accessible by a program unit, that module file...
#include <stdio.h> #define ARRLEN (10) int main (void) { int n[ ARRLEN ]; /* n is an array of 10 integers */ size_t i, j; /* Use size_t to address memory, that is to index arrays, as its guaranteed to be wide enough to address all of the possible availab...
You should have Elm platform installed on your computer, the following tutorial is written with the assumption, that you are familiar with terminal. Initialization Create a folder and navigate to it with your terminal: $ mkdir elm-app $ cd elm-app/ Initialize Elm project and install core depe...
git diff HEAD^ HEAD This will show the changes between the previous commit and the current commit.
import pandas as pd # Save dataframe to pickled pandas object df.to_pickle(file_name) # where to save it usually as a .plk # Load dataframe from pickled pandas object df= pd.read_pickle(file_name)
Using the Vector.<T> type and the for each loop is more performant than a conventional array and for loop: Good: var list:Vector.<Sprite> = new <Sprite>[]; for each(var sprite:Sprite in list) { sprite.x += 1; } Bad: var list:Array = []; for (var i:int = 0; i < ...
Steps to Create component: Create a folder named components in your project root folder Create your component inside components folder e.g.: MyComponent.php namespace app\components; use Yii; use yii\base\Component; use yii\base\InvalidConfigException; class MyComponent ...
So you've uploaded your files to a folder say /backend/web/uploads/ and you want these uploads to be visible on the frontend too. The easiest option is to create a symlink in the frontend that links to the backend: ln -s /path/to/backend/web/uploads/ /path/to/frontend/web/uploads In your views y...
Sometimes a element needs to be created outside of the usual object structure in the fxml. This is where Define Blocks come into play: Contents inside a <fx:define> element are not added to the object created for the parent element. Every child element of the <fx:define> needs a fx:id...
The following example encrypts data by using a hybrid cryptosystem consisting of AES GCM and OAEP, using their default parameter sizes and an AES key size of 128 bits. OAEP is less vulnerable to padding oracle attacks than PKCS#1 v1.5 padding. GCM is also protected against padding oracle attacks. ...
The official style guide is located on the homepage and generally goes for: readability (instead of compactness) ease of modification clean diffs This means that, for example, this: homeDirectory : String homeDirectory = "/root/files" evaluate : Boolean -> Bool evalua...
You can diff UTF-16 encoded files (localization strings file os iOS and macOS are examples) by specifying how git should diff these files. Add the following to your ~/.gitconfig file. [diff "utf16"] textconv = "iconv -f utf-16 -t utf-8" iconv is a program to convert differe...
The random() function can be used to generate pseudo-random numbers: void setup() { Serial.begin(9600); } void loop() { long randomNumber = random(500); // Generate a random number between 0 and 499 Serial.println(randomNumber); randomNumber = random(100, 1000); // Genera...

Page 31 of 153