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.util.Arrays; | |
public class GiftSorter{ | |
public String sortGiftCode(String code){ | |
String[] arrayOfSymbol = code.split(""); | |
Arrays.sort(arrayOfSymbol); | |
StringBuilder sb = new StringBuilder(); | |
for (String oneSymbol: arrayOfSymbol) | |
sb.append(oneSymbol); |
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.util.*; | |
public class Clock | |
{ | |
public static int Past(int h, int m, int s) | |
{ | |
Date d = new Date(); | |
int year = d.getYear(); | |
int month = d.getMonth(); | |
int day = d.getDate(); |
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 DivisibleNb { | |
public static Boolean isDivisible(long n, long x, long y) { | |
return (n % x == 0 && n % y == 0); | |
} | |
} |
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 Vowels { | |
public static int getCount(String str) { | |
int vowelsCount = 0; | |
vowelsCount = str.length() - str.replaceAll("a|e|i|o|u", "").length(); | |
return vowelsCount; | |
} |
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 ExampleActivity extends AppCompatActivity implements SmartTimer.OnSecondTickListener { | |
private static final String TAG = TimerActivity.class.getSimpleName(); | |
private TextView mTextViewTime; | |
private Button mButtonStart; | |
private Button mButtonStop; | |
private Button mButtonClear; | |
private SmartTimer mSmartTimer = new SmartTimer(this, this); |
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
override fun intercept(chain: Interceptor.Chain): Response { | |
val request = chain.request() | |
val response: Response? | |
try { | |
response = chain.proceed(request) | |
val responseBody = response.body() |
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
# By default, the flags in this file are appended to flags specified | |
# in /usr/share/android-studio/data/sdk/tools/proguard/proguard-android.txt | |
# For more details, see | |
# http://developer.android.com/guide/developing/tools/proguard.html | |
##---------------Begin: proguard configuration common for all Android apps ---------- | |
-optimizationpasses 5 | |
-dontusemixedcaseclassnames | |
-dontskipnonpubliclibraryclasses |
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
#retrofit | |
# Platform calls Class.forName on types which do not exist on Android to determine platform. | |
-dontnote retrofit2.Platform | |
# Platform used when running on Java 8 VMs. Will not be used at runtime. | |
-dontwarn retrofit2.Platform$Java8 | |
# Retain generic type information for use by reflection by converters and adapters. | |
-keepattributes Signature | |
# Retain declared checked exceptions for use by a Proxy instance. | |
-keepattributes Exceptions |
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
class A { | |
val b: B | |
val c: String = "" | |
fun a(value: Int) { | |
b.doSomething( | |
value, | |
{ | |
c = it + "result good" |
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
Метод класса B | |
fun reserveBadCaseDevice(workerId: Int, | |
condition: DeviceCondition, | |
result: (Unit) -> Unit, | |
errorText: (String) -> Unit, | |
errorId: (Int) -> Unit) { | |
val data = ReservedWorkerData( | |
DeviceState.TAKE, | |
condition, null, |
OlderNewer