ArrayList is one of the inbuilt data structures in Java. It is a dynamic array (where the size of the data structure not needed to be declared first) for storing elements (Objects).
It extends AbstractList class and implements List interface. An ArrayList can contain duplicate elements where it mai...
Test classes are created as local classes in a special unit test include.
This is the basic structure of a test class:
CLASS lcl_test DEFINITION
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA:
mo_cut TYPE REF TO zcl_...
This example assumes that your lookup column is named MultiLookupColumnName and that you want to set your multi-lookup field to lookup to the items with IDs 1 and 2.
Using jQuery AJAX
2010
var listName = "YourListName";
var lookupList = "LookupListName";
var idOfItemToUpdate...
If you want to change the order of a character strings you can use parentheses in the pattern to group parts of the string together. These groups can in the replacement argument be addresed using consecutive numbers.
The following example shows how you can reorder a vector of names of the form &quo...
get_posts() is a wrapper for a separate instance of a WP_Query object. The returned value is an array of post object.
global $post;
$args = array(
'numberposts' => 5,
'offset'=> 1,
'category' => 1
);
$myposts = get_posts( $args );
foreach( $myposts as $post ) :
...
Enable and configure the experimental Gradle plugin to improve AndroidStudio's NDK support. Check that you fulfill the following requirements:
Gradle 2.10 (for this example)
Android NDK r10 or later
Android SDK with build tools v19.0.0 or later
Configure MyApp/build.gradle file
Edit the dep...
When to use abstract classes: To implement the same or different behaviour among multiple related objects
When to use interfaces: to implement a contract by multiple unrelated objects
Abstract classes create "is a" relations while interfaces provide "has a" capability.
This c...
sudo apt-add-repository ppa:brightbox/ruby-ng
Hit Enter to confirm
sudo apt-get update
Then you can install your ruby version of choice (the ppa supports ruby2.0 ruby2.1 ruby2.2 ruby2.3 and legacy versions ruby1.8 ruby1.9.1) Don't forget to include the respective -dev package for your version. Ot...
With implicit keys:
key: value
another key:
- some
- more
- values
[1, 2, 3]: last value, which has a flow style key
With implicit and explicit keys:
? key
: value
another key:
- some
- more
- values
? [1, 2, 3]
: last value, which has a flow style key
key, another ...
Let's say your launch activity is called MainActivity, in your app com.example.myapp.
In the manifest:
<activity
android:name=".MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
...
SUB function allows to substitute text inside awk
sub(regexp, replacement, target)
where regexp could be a full regular expression
$ cat file
AAAAA
BBBB
CCCC
DDDD
EEEE
FFFF
GGGG
$ awk '{sub("AAA","XXX", $0); print}' file
XXXAA
BBBB
CCCC
DDDD
EEEE
FFFF
GGGG
...
(This is a request for a good example that shows how to construct a SELECT using CONCAT, then prepare+execute it. Please emphasize the use of @variables versus DECLAREd variables -- it makes a big difference, and it is something that novices (include myself) stumble over.)
Setup Ruby On Rails on Ubuntu 16.04 Xenial Xerus
All commands should be run in Linux terminal (hotkey: Ctrl + Alt + T)
You need to install Ruby on your local machine in development environment.
The first step is to install some dependencies for Ruby.
sudo apt-get update
sudo apt-get install git...
JUnit is the leading testing framework used for testing Java code.
The class under test models a simple bank account, that charges a penalty when you go overdrawn.
public class BankAccount {
private int balance;
public BankAccount(int i){
balance = i;
}
public Bank...
Configuring your environment
RabbitMQ looks for an set of environment variables in /etc/rabbitmq/rabbitmq-env.conf. If it does not exist, it assumes default values. All values in rabbitmq-env.conf get exported to the environment the RabbitMQ server runs in with a RABBITMQ_ prefix; this prefix is no...
The DATE data type does not handle time zones or changes in daylight savings time.
Either:
use the TIMESTAMP WITH TIME ZONE data type; or
handle the changes in your application logic.
A DATE can be stored as Coordinated Universal Time (UTC) and converted to the current session time zone like...
If your team is following a rebase-based workflow, it may be a advantageous to setup git so that each newly created branch will perform a rebase operation, instead of a merge operation, during a git pull.
To setup every new branch to automatically rebase, add the following to your .gitconfig or .gi...