This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void meh(){ | |
//something | |
} | |
void meh() | |
{ | |
//something | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+--- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getObservable() | |
.filter { s -> someFilter(s) } | |
.let{ | |
observable -> | |
when(exteriorState){ | |
STATE_1 -> observable.debounce(3, TimeUnit.SECONDS); | |
else -> observable.skip(3, TimeUnit.SECONDS) | |
} | |
} | |
.subscribe{ v -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
observable.let { | |
stream -> | |
if(someState) | |
stream | |
else | |
stream.filter { obj -> condition(obj) } | |
} | |
.debounce(3, TimeUnit.SECONDS) | |
.let{ | |
stream -> |