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 static Bitmap getBitmapFromView(View view) { | |
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); | |
Canvas c = new Canvas(bitmap); | |
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()); | |
view.draw(c); | |
return bitamp; | |
} |
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 interface AvailabilityChecker { | |
Observable<ValidationResult<String>> isEmailAvailable(@NonNull String email); | |
Observable<ValidationResult<String>> isUsernameAvailable(@NonNull String email); | |
ValidationResult<String> isEmailAvailableSync(@NonNull String email); | |
ValidationResult<String> isUsernameAvailableSync(@NonNull String email); | |
} |
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
""" | |
@author: jay | |
""" | |
from BeautifulSoup import BeautifulSoup | |
import gdbm | |
import pickle | |
import time | |
def main(): |
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 CardsPagerTransformerBasic implements ViewPager.PageTransformer { | |
private int baseElevation; | |
private int raisingElevation; | |
private float smallerScale; | |
public CardsPagerTransformerBasic(int baseElevation, int raisingElevation, float smallerScale) { | |
this.baseElevation = baseElevation; | |
this.raisingElevation = raisingElevation; | |
this.smallerScale = smallerScale; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.imgloader" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk | |
android:minSdkVersion="8" | |
android:targetSdkVersion="17" /> |
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 cv2 | |
import numpy as np | |
import itertools | |
lk_params = dict( winSize = (10, 10), | |
maxLevel = 5, | |
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03)) | |
feature_params = dict( maxCorners = 3000, | |
qualityLevel = 0.5, |
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
data class AppState(val searchState: SearchState = SearchState()) | |
class AppStore: Store<AppState>( | |
initialState = AppState(), | |
reducers = listOf(::reduceSearchState)) { | |
companion object { | |
val instance by lazy { | |
AppStore() | |
} |
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 ClientActivity extends Activity { | |
private String SERVICE_NAME = "Client Device"; | |
private String SERVICE_TYPE = "_http._tcp."; | |
private InetAddress hostAddress; | |
private int hostPort; | |
private NsdManager mNsdManager; | |
@Override |
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
@LayoutSpec(events = { LikeChangeEvent.class }) | |
public class FullScreenComponentSpec { | |
... other stuff | |
@OnEvent(ClickEvent.class) | |
static void onLikeButtonClicked(ComponentContext c, @State boolean isLiked, @Prop GifItem gif, @Prop Component gifComponent) { | |
FullScreenComponent.updateLikeButtonAsync(c, !isLiked); | |
FullScreenComponent.dispatchLikeChangeEvent(FullScreenComponent.getLikeChangeEventHandler(c), !isLiked, gif.getId()); |