- [Data Structures] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#data-structures)
- [Linked Lists] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#linked-lists)
- [Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#trees)
- [Binary Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-trees)
- [Binary Search Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-search-tree)
- [Red-Black Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#red-black-tree)
- [AVL Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#avl-tree)
- [Tries] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#tries)
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| RecyclerItemClickListener | |
| ========================= | |
| Questions? Comments? | |
| https://twitter.com/lnikkila | |
| ----- | |
| Handles clicks and long presses out of the box. |
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.example.architector.realmrest; | |
| import android.app.IntentService; | |
| import android.content.Intent; | |
| import android.content.Context; | |
| import android.util.Log; | |
| import java.util.List; | |
| import io.realm.Realm; |
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 DebugUtil { | |
| public static String loadData(Context context, int resId) { | |
| InputStream is = context.getResources().openRawResource(resId); | |
| Writer writer = new StringWriter(); | |
| char[] buffer = new char[1024]; | |
| try { | |
| Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); | |
| int n; | |
| while ((n = reader.read(buffer)) != -1) { | |
| writer.write(buffer, 0, n); |
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
| 12-21 15:58:12.369 14095-16015/ru.yandex.weatherplugin D/WeatherRestClient: java.io.IOException: unexpected end of stream on com.squareup.okhttp.Address@44b428a9 | |
| at com.squareup.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:201) | |
| at com.squareup.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:127) | |
| at com.squareup.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:737) | |
| at com.squareup.okhttp.internal.http.HttpEngine.access$200(HttpEngine.java:87) | |
| at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:722) | |
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
| 01-16 19:49:15.360 25206-25206/ru.yandex.weatherplugin D/StrictMode: StrictMode policy violation; ~duration=30 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=65567 violation=1 | |
| at android.os.StrictMode$AndroidBlockGuardPolicy.onWriteToDisk(StrictMode.java:1253) | |
| at libcore.io.BlockGuardOs.write(BlockGuardOs.java:318) | |
| at libcore.io.IoBridge.write(IoBridge.java:496) | |
| at java.io.FileOutputStream.write(FileOutputStream.java:316) | |
| at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) | |
| at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) | |
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 us.nineworlds.serenity.ui.views.mvp; | |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.os.Build; | |
| import android.os.Parcelable; | |
| import android.support.annotation.AttrRes; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.support.annotation.StyleRes; |
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
| class AccountHolder extends MvpViewHolder implements AccountView { | |
| @InjectPresenter | |
| AccountPresenter mAccountPresenter; | |
| /** | |
| @BindView(R.id.item_account_check_box) | |
| CheckBox mCheckBox; | |
| ... | |
| **/ |
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.graphics.Rect; | |
| import android.support.v7.widget.GridLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.View; | |
| public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration { | |
| private final int spacing; | |
| private int displayMode; | |
| public static final int HORIZONTAL = 0; |
OlderNewer