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 com.itscreening.tests.faker; | |
| public class CharCount { | |
| public static void main(String[] args) { | |
| // String str1 = "aaabbccdaaee"; | |
| // String str2 = "a3b2c2da2e2"; | |
| // System.out.println(convert("").equals("")); | |
| } |
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 com.spring.api.eastates; | |
| import org.testng.annotations.Test; | |
| @Test(timeOut = 1000) | |
| public class BinaryGap { | |
| public static void main(String[] args) { | |
| System.out.println(transformBinary(4848)); |
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
| // source https://gist.github.com/tinmegali/d4a477785f01e57066915a44543db6ed#gistcomment-3013080 | |
| class ListStringConverter { | |
| @TypeConverter | |
| fun fromString(value: String): List<String> { | |
| val listType = object : TypeToken<List<String>>() {}.type | |
| return Gson().fromJson(value, listType) | |
| } |
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
| import android.widget.ArrayAdapter | |
| import android.widget.AutoCompleteTextView | |
| import androidx.annotation.LayoutRes | |
| import androidx.databinding.BindingAdapter | |
| @BindingAdapter("dropDownItems", "dropDownItemLayout", "dropDownItemsIncludeEmpty", requireAll = false) | |
| fun AutoCompleteTextView.setItems(items: Array<String>?, @LayoutRes layout: Int?, includeEmpty: Boolean?) = | |
| setAdapter( | |
| ArrayAdapter( | |
| context, |
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
| public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
| private final Context context; | |
| @Inject @ClientId String clientId; | |
| @Inject @ClientSecret String clientSecret; | |
| @Inject ApiService apiService; | |
| public AccountAuthenticator(Context context) { | |
| super(context); |
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 com.mainstreetcode.teammate.util; | |
| import android.animation.AnimatorSet; | |
| import android.animation.ObjectAnimator; | |
| import android.support.annotation.DrawableRes; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.annotation.StringRes; | |
| import android.support.constraint.ConstraintLayout; | |
| import android.support.constraint.ConstraintSet; |
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
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.module.SimpleModule; | |
| import org.threeten.bp.LocalDateTime; | |
| import javax.inject.Singleton; | |
| import dagger.Module; | |
| import dagger.Provides; | |
| import okhttp3.OkHttpClient; |
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
| // Slide up animation | |
| <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > | |
| <translate | |
| android:duration="@android:integer/config_mediumAnimTime" | |
| android:fromYDelta="100%" | |
| android:interpolator="@android:anim/accelerate_interpolator" | |
| android:toXDelta="0" /> |
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 com.your.package | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import com.your.package.R | |
| import com.google.android.material.bottomsheet.BottomSheetDialog | |
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
| /** | |
| * BottomSheetDialog fragment that uses a custom |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://code.jquery.com/jquery.js"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script> | |
| <script src="http://builds.emberjs.com.s3.amazonaws.com/ember-1.0.0-rc.6.js"></script> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> |