Tutorial by Examples: f

Enable Offline Work: Click File -> Settings. Search for "gradle" and click in Offline work box. Go to Compiler (in same settings dialog just below Gradle) and add --offline to Command-line Options text box. Improve Gradle Performance Add following two line of code in your gradle...
We want to process data in parallel and push it down the line to be processed by other workers. Since Workers both consume and produce data we have to create two queues: first_input_source = Queue.new first_output_sink = Queue.new 100.times { |i| first_input_source << i } First wave of...
q = Queue.new q << :data q.pop #=> :data #pop will block until there is some data available. #pop can be used for synchronization.
syncer = Queue.new a = Thread.new do syncer.pop puts "this happens at end" end b = Thread.new do puts "this happens first" STDOUT.flush syncer << :ok end [a, b].map(&:join)
To set LFS options that apply to all clones, create and commit a file named .lfsconfig at the repository root. This file can specify LFS options the same way as allowed in .git/config. For example, to exclude a certain file from LFS fetches be default, create and commit .lfsconfig with the followin...
public class SoundActivity extends Activity { private MediaPlayer mediaPlayer; ProgressBar progress_bar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tool_sound); ...
Problem: Vim users are not always happy. Solution: Make them happy. 7.4 :smile Note: Requires patch version ≥7.4.1005
To get the the exact size of a UIButton's text based on its font, use the function intrinsicContentSize. Swift button.intrinsicContentSize.width Objective-C button.intrinsicContentSize.width;
NSString provides method boundingRectWithSize which can be used to predict the resulting CGSize of a UILabel based on its text and font without the need of creating a UILabel Objective-C [[text boundingRectWithSize:maxSize options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineF...
SilverStripe has reasonably good support for submitting form data using AJAX requests. Below is example code of how to set up a basic Form that accepts submissions by both AJAX and traditional default browser behaviour (as is good practice). Adding the form to our controller First we need to defin...
The following class is used to demonstrate, how instances of classes can be created: JavaFX 8 The annotation in Person(@NamedArg("name") String name) has to be removed, since the @NamedArg annotation is unavailable. package fxml.sample; import javafx.beans.NamedArg; import javafx....
You should use this when you have two text fields that should receive exactly the same content. For example, you may want to confirm an email address or a password. This validation creates a virtual attribute whose name is the name of the field that has to be confirmed with _confirmation appended. ...
Angular Forms and Inputs have various states that are useful when validating content Input States StateDescription$touchedField has been touched$untouchedField has not been touched$pristineField has not been modified$dirtyField has been modified$validField content is valid$invalidField content is ...
To help you find and count characters in a string, CharMatcher provides the following methods: int indexIn(CharSequence sequence) Returns the index of the first character that matches the CharMatcher instance. Returns -­1 if no character matches. int indexIn(CharSequence sequence, int sta...
var source = new AutoCompleteStringCollection(); // Add your collection of strings. source.AddRange(new[] { "Guybrush Threepwood", "LeChuck" }); var textBox = new TextBox { AutoCompleteCustomSource = source, AutoCompleteMode = AutoCompleteMode.SuggestAppend, ...
You can configure the database settings in config/connections.js. Here's an example: postgresql: { database: 'databaseName', host: 'localhost', user: 'root', password: '', port: 5432, poolSize: 10, ssl: false }; Alternatively, you can supply the connection information in U...
Short circuiting is a functionality that skips evaluating parts of a (if/while/...) condition when able. In case of a logical operation on two operands, the first operand is evaluated (to true or false) and if there is a verdict (i.e first operand is false when using &&, first operand is tr...
From MSDN Use the CInt function to provide conversions from any other data type to an Integer subtype. For example, CInt forces integer arithmetic when currency, single-precision, or double-precision arithmetic would normally occur. Assuming that you have 1 button and 2 textbox. If you type...
TRACE and DEBUG log levels are there to be able to convey high detail about the operation of the given code at runtime. Setting the log level above these is usually recommended, however some care must be taken for these statements to not affect performance even when seemingly "turned off"....
Download the Apache Felix Framework Distribution and extract it into a directory: $ tar xf org.apache.felix.main.distribution-5.4.0.tar.gz $ cd felix-framework-5.4.0 And then start the framework with the following command: $ java -jar bin/felix.jar ____________________________ Welcome to...

Page 213 of 457