Tutorial by Examples: conte

Swift UIApplication.sharedApplication().preferredContentSizeCategory Objective-C [UIApplication sharedApplication].preferredContentSizeCategory; This returns a content size category constant, or an accessibility content size category constant.
Activity class takes care of creating a window for you in which you can place your UI with setContentView. There are three setContentView methods: setContentView(int layoutResID) - Set the activity content from a layout resource. setContentView(View view) - Set the activity content to an explic...
Creating a Window with OpenGL context (extension loading through GLEW): #define GLEW_STATIC #include <GL/glew.h> #include <SDL2/SDL.h> int main(int argc, char* argv[]) { SDL_Init(SDL_INIT_VIDEO); /* Initialises Video Subsystem in SDL */ /* Setting up OpenGL version a...
A common and task of someone using the Linux Command Line (shell) is to search for files/directories with a certain name or containing certain text. There are 2 commands you should familiarise yourself with in order to accomplish this: Find files by name find /var/www -name '*.css' This will...
trigger ContactTrigger on Contact (before insert, after insert, before update, after update, before delete, after delete, after undelete) { /** Before or After trigger execution**/ /...
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context Context is important if you ship your class for others to use.Context lets your class observer verify that its you observer which is being called. The ...
Using git show we can view a single commit git show 48c83b3 git show 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Example commit 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Author: Matt Clark <[email protected]> Date: Wed May 4 18:26:40 2016 -0400 The commit message will be show...
When creating a UIView subclass, intrinsic content size helps to avoid setting hardcoded height and width constraints a basic glimpse into how a class can utilize this class ImageView: UIView { var image: UIImage { didSet { invalidateIntrinsicContentSize() } ...
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...
In this example every positioned element creates its own stacking context, because of their positioning and z-index values. The hierarchy of stacking contexts is organized as follows: Root DIV #1 DIV #2 DIV #3 DIV #4 DIV #5 DIV #6 It is important to note that DIV #4, DIV #5 and D...
Using the overflow property with a value different to visible will create a new block formatting context. This is useful for aligning a block element next to a floated element. CSS img { float:left; margin-right: 10px; } div { overflow:hidden; /* creates block formatting context...
Many bugs in knockout data binds are caused by undefined properties in a viewmodel. Knockout has two handy methods to retrieve the binding context of an HTML element: // Returns the binding context to which an HTMLElement is bound ko.contextFor(element); // Returns the viewmodel to which ...
There is an example of listing content : tar -tvf archive.tar The option -t is used for the listing. For listing the content of a tar.gz archive, you have to use the -z option anymore : tar -tzvf archive.tar.gz
filePath = "file.csv" data = np.genfromtxt(filePath) Many options are supported, see official documentation for full list: data = np.genfromtxt(filePath, dtype='float', delimiter=';', skip_header=1, usecols=(0,1,3) )
IRandomAccessStreamReference bitmap = GetBitmap(); IRandomAccessStreamWithContentType stream = await bitmap.OpenReadAsync(); BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream); var pixels = await decoder.GetPixelDataAsync(); var outStream = new InMemoryRandomAccessStream(); // Cr...
View content: adb shell ls \$EXTERNAL_STORAGE adb shell ls \$SECONDARY_STORAGE View path: adb shell echo \$EXTERNAL_STORAGE adb shell echo \$SECONDARY_STORAGE
In the above example, if we want to send out HTML content as message in the email, then create a HTML file by going to File -> New -> HTML file Now you can see a HTML file besides your gs file as follows : Now, update the getMessage() method from above example as follows : function getMes...
The FileSystem API of Java 7 allows to read and add entries from or to a Zip file using the Java NIO file API in the same way as operating on any other filesystem. The FileSystem is a resource that should be properly closed after use, therefore the try-with-resources block should be used. Reading ...
The exposition pipe operator, %$%, exposes the column names as R symbols within the left-hand side object to the right-hand side expression. This operator is handy when piping into functions that do not have a data argument (unlike, say, lm) and that don't take a data.frame and column names as arg...
Setup Spark context in R To start working with Sparks distributed dataframes, you must connect your R program with an existing Spark Cluster. library(SparkR) sc <- sparkR.init() # connection to Spark context sqlContext <- sparkRSQL.init(sc) # connection to SQL context Here are infos how...

Page 5 of 9