This file contains 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
import java.io.InputStream; | |
import java.io.FileOutputStream; | |
import java.io.OutputStream; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.io.InputStream; | |
import java.io.BufferedReader; | |
import java.util.Collections; | |
import java.io.InputStreamReader; | |
import java.io.IOException; |
This file contains 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
public ArrayDeque<PairInt> findPoints(PairInt[] points) { | |
ArrayDeque<PairInt> result = new ArrayDeque<>(); | |
int n = points.length; | |
int val, j; | |
int leftBorder, rightBorder; | |
leftBorder = Integer.MAX_VALUE; | |
rightBorder = Integer.MIN_VALUE; | |
Arrays.sort(points, new Comparator<PairInt>() { | |
@Override | |
public int compare(PairInt o1, PairInt o2) { |
This file contains 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
import java.io.OutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.PrintWriter; | |
import java.util.InputMismatchException; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.io.InputStream; | |
/** |
This file contains 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
public class TaskAcmpFast { | |
int n; | |
int m; | |
int k; | |
boolean[] used; | |
String[] tickets; | |
long[] wins; | |
public void solve(int testNumber, InputReader in, PrintWriter out) { |
This file contains 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
import java.io.OutputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.io.PrintWriter; | |
import java.util.Arrays; | |
import java.util.InputMismatchException; | |
import java.io.IOException; | |
import java.util.TreeSet; |
This file contains 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 onDestroy() { | |
if (getActivity.isFinishing()) { | |
//разрушаемся навсегда | |
} else if (getActivity.isChangingConfigurations()) { | |
//разрушаемся не навсегда | |
} else { | |
//разрушаемся навсегда | |
//кажется тут остаются варианты - удалили из бэк стека или вызвали remove у транзакции | |
//Или уничтожился процесс - тогда кеш презентеров все равно теряется | |
} |
This file contains 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
@Component(modules = MyModule.class) | |
public interface ComponentA { | |
OkHttpClient a(); | |
SubcomponentB subcomponentB(); | |
SubcomponentC subcomponentC(); | |
} |
This file contains 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
public class Main { | |
public static void main(String[] args) { | |
A a = new A(); | |
DaggerComponentA.create().inject(a); | |
B b = new B(); | |
a.injector.injectMembers(b); | |
System.out.println(b.string); |
This file contains 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
@Test | |
public void retryWhenWithoutComposingErrors() { | |
TestSubscriber subscriber = new TestSubscriber(); | |
Observable.just(1) | |
.retryWhen(errors -> Observable.never()) | |
.subscribe(subscriber); | |
subscriber.assertCompleted(); | |
} |
This file contains 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 com.guliash.dagger; | |
import dagger.Component; | |
import javax.inject.Scope; | |
public class Main { | |
public static void main(String[] args) { | |
} |
OlderNewer