Skip to content

Instantly share code, notes, and snippets.

@Override
public Description getDescription() {
Description spec = Description.createSuiteDescription(getName(), classAnnotations());
List<Method> testMethods = this.testMethods;
for (Method method : testMethods) {
spec.addChild(methodDescription(method));
}
return spec;
}
package io.ppoborca.anothertestingapplication;
import org.junit.Test;
import org.junit.internal.runners.ClassRoadie;
import org.junit.internal.runners.MethodRoadie;
import org.junit.internal.runners.TestClass;
import org.junit.internal.runners.TestMethod;
import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.Failure;
@objc func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let userCell = tableView.dequeueReusableCellWithIdentifier("user", forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! GithubUserCell;
if let unwrapped = users {
let user = unwrapped[indexPath.row];
userCell.userName.text = user.login;
userCell.imageView?.image = nil;
ImageLoader.load(NSURL(string: user.imageUrl!)!).completionHandler{ (u : NSURL, i : UIImage?, e : NSError?, c : CacheType) -> Void in
private void debounceWithRx(EditText text){
Observable<CharSequence> editTextStream = RxTextView.textChanges(text);
editTextStream.debounce(500, TimeUnit.MILLISECONDS)
.subscribe(input -> {
//... network request, etc...//
});
}
Handler handler = new Handler();
Runnable runnable;
void meh(){
//something
}
void meh()
{
//something
}
+--- com.android.support:appcompat-v7:23.1.1
| \--- com.android.support:support-v4:23.1.1
| \--- com.android.support:support-annotations:23.1.1
+--- com.android.support:design:23.1.1
| +--- com.android.support:appcompat-v7:23.1.1 (*)
| +--- com.android.support:recyclerview-v7:23.1.1
| | +--- com.android.support:support-annotations:23.1.1
| | \--- com.android.support:support-v4:23.1.1 (*)
| \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:cardview-v7:23.1.1
gitHubService.fetchUsers().enqueue(new Callback<List<GithubUser>>() {
@Override
public void onResponse(Response<List<GithubUser>> response) {
for(GithubUser user : response.body()){
gitHubService.fetchDetails(user.getId())
.enqueue(new Callback<GithubUserDescription>() {
@Override
public void onResponse(Response<GithubUserDescription> response) {
//do things
}
var obs = getObservable()
.filter { s -> someFilter(s) };
when(exteriorState){
STATE_1 -> obs = obs.debounce(3, TimeUnit.SECONDS)
else -> obs = obs.skip(3, TimeUnit.SECONDS)
}
obs.subscribe{
//do on sub things
}
getObservable()
.filter { s -> someFilter(s) }
.let{
observable ->
when(exteriorState){
STATE_1 -> observable.debounce(3, TimeUnit.SECONDS);
else -> observable.skip(3, TimeUnit.SECONDS)
}
}
.subscribe{ v ->
observable.let {
stream ->
if(someState)
stream
else
stream.filter { obj -> condition(obj) }
}
.debounce(3, TimeUnit.SECONDS)
.let{
stream ->