Tutorial by Examples: er

All actions performed in a timer are handled in the "Tick" event. public partial class Form1 : Form { Timer myTimer = new Timer(); public Form1() { InitializeComponent(); myTimer.Tick += myTimer_Tick; //assign the event handler named "myT...
public partial class Form1 : Form { Timer myTimer = new Timer(); int timeLeft = 10; public Form1() { InitializeComponent(); //set properties for the Timer myTimer.Interval = 1000; myTimer.Enabled = tru...
Simple Assignment = is a simple assignment. It creates a new local variable if the variable was not previously referenced. x = 3 y = 4 + 5 puts "x is #{x}, y is #{y}" This will output: x is 3, y is 9 Parallel Assignment Variables can also be assigned in parallel, e.g. x, y = 3,...
In Ruby, a string is just a sequence of bytes along with the name of an encoding (such as UTF-8, US-ASCII, ASCII-8BIT) that specifies how you might interpret those bytes as characters. Ruby strings can be used to hold text (basically a sequence of characters), in which case the UTF-8 encoding is us...
class MyDataObject extends DataObject { private static $db = array( 'Name' => 'Varchar' ); private static $has_one = array( 'OtherDataObject' => 'OtherDataObject' ); private static $summary_fields = array( 'Name', 'OtherDat...
Objects that respond to to_proc can be converted to procs with the & operator (which will also allow them to be passed as blocks). The class Symbol defines #to_proc so it tries to call the corresponding method on the object it receives as parameter. p [ 'rabbit', 'grass' ].map( &:upcase ) ...
Numeric represents integers and doubles and is the default mode assigned to vectors of numbers. The function is.numeric() will evaluate whether a vector is numeric. It is important to note that although integers and doubles will pass is.numeric(), the function as.numeric() will always attempt to con...
To check whether a value is a character use the is.character() function. To coerce a variable to a character use the as.character() function. x <- "The quick brown fox jumps over the lazy dog" class(x) [1] "character" is.character(x) [1] TRUE Note that numerics can be ...
There are two sorts of logical operators: those that accept and return vectors of any length (elementwise operators: !, |, &, xor()) and those that only evaluate the first element in each argument (&&, ||). The second sort is primarily used as the cond argument to the if function. Logic...
Given the following DataFrame: In [11]: df = pd.DataFrame({'a':[1,1,1,2,2,3],'b':[4,4,5,5,6,7,],'c':[10,11,12,13,14,15]}) In [12]: df.set_index(['a','b'], inplace=True) In [13]: df Out[13]: c a b 1 4 10 4 11 5 12 2 5 13 6 14 3 7 15 You can iterate by any lev...
It's easier to implement some UDFs on the worksheet if full column references can be passed in as parameters. However, due to the explicit nature of coding, any loop involving these ranges may be processing hundreds of thousands of cells that are completely empty. This reduces your VBA project (and ...
Some things all beginners should know / do that will help them have a good start with VB .Net: Set the following Options: 'can be permanently set ' Tools / Options / Projects and Soluntions / VB Defaults Option Strict On Option Explicit On Option Infer Off Public Class Form1 End Class ...
The Windows.Forms.Timer component can be used to provide the user information that is not time critical. Create a form with one button, one label, and a Timer component. For example it could be used to show the user the time of day periodically. 'can be permanently set ' Tools / Options / Projec...
You can think of an OperationQueue as a line of tasks waiting to be executed. Unlike dispatch queues in GCD, operation queues are not FIFO (first-in-first-out). Instead, they execute tasks as soon as they are ready to be executed, as long as there are enough system resources to allow for it. Get th...
The Foundation framework provides the Operation type, which represents a high-level object that encapsulates a portion of work that may be executed on a queue. Not only does the queue coordinate the performance of those operations, but you can also establish dependencies between operations, create c...
public class SignUpActivity extends BaseAppCompatActivity { @BindView(R.id.tIETSignUpEmail) EditText mEditEmail; @BindView(R.id.tIETSignUpPassword) EditText mEditPassword; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCrea...
public class LoginActivity extends BaseAppCompatActivity { @BindView(R.id.tIETLoginEmail) EditText mEditEmail; @BindView(R.id.tIETLoginPassword) EditText mEditPassword; @Override protected void onResume() { super.onResume(); FirebaseUser firebaseUs...
public class ChangeEmailActivity extends BaseAppCompatActivity implements ReAuthenticateDialogFragment.OnReauthenticateSuccessListener { @BindView(R.id.et_change_email) EditText mEditText; private FirebaseUser mFirebaseUser; @OnClick(R.id.btn_change_email) void onChangeE...
public class ReAuthenticateDialogFragment extends DialogFragment { @BindView(R.id.et_dialog_reauthenticate_email) EditText mEditTextEmail; @BindView(R.id.et_dialog_reauthenticate_password) EditText mEditTextPassword; private OnReauthenticateSuccessListener mOnReauthenticat...
The remainder operator in Julia is the % operator. This operator behaves similarly to the % in languages such as C and C++. a % b is the signed remainder left over after dividing a by b. This operator is very useful for implementing certain algorithms, such as the following implementation of the Si...

Page 163 of 417