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
// TODO add <meta-data android:value="GlideModule" android:name="....OkHttpProgressGlideModule" /> | |
// TODO add <meta-data android:value="GlideModule" tools:node="remove" android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule" /> | |
// or not use 'okhttp@aar' in Gradle depdendencies | |
public class OkHttpProgressGlideModule implements GlideModule { | |
@Override public void applyOptions(Context context, GlideBuilder builder) { } | |
@Override public void registerComponents(Context context, Glide glide) { | |
OkHttpClient client = new OkHttpClient(); | |
client.networkInterceptors().add(createInterceptor(new DispatchingProgressListener())); | |
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client)); | |
} |
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
// | |
// Copyright 2015 Google Inc. All Rights Reserved. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |
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
# Add project specific ProGuard rules here. | |
# By default, the flags in this file are appended to flags specified | |
# in /Users/{user}/android-sdks/tools/proguard/proguard-android.txt | |
# You can edit the include path and order by changing the ProGuard | |
# include property in project.properties. | |
# | |
# For more details, see | |
# http://developer.android.com/guide/developing/tools/proguard.html | |
# Add any project specific keep options here: |
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 os.path | |
import collections | |
from operator import itemgetter | |
WORDFILE = '/usr/share/dict/words' | |
class Autocorrect(object): | |
""" | |
Very simplistic implementation of autocorrect using ngrams. | |
""" |
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
/* | |
* Copyright 2017 Realm Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 Realm loadAssetFileOnMigration() { | |
// TODO Don't re-create this every time | |
RealmConfiguration config = new RealmConfiguration.Builder() | |
.schemaVersion(2) // Bumping the schema because new app | |
.build(); | |
Realm realm; | |
try { | |
realm = Realm.getInstance(config); |
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
# -*- coding: utf-8 -*- | |
""" | |
Scrape a table from wikipedia using python. Allows for cells spanning multiple rows and/or columns. Outputs csv files for | |
each table | |
""" | |
from bs4 import BeautifulSoup | |
import urllib2 | |
import os | |
import codecs |
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.security.MessageDigest; | |
import java.util.Arrays; | |
import javax.crypto.Cipher; | |
import javax.crypto.SecretKey; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
public class TripleDESTest { |
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
((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%-_.]).{6,32}) |
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
.table-view .column-header, | |
.table-view .column-header-background .filler { | |
-fx-background-color: #6622CC; | |
} | |
.table-view .column-header .label{ | |
-fx-text-fill: white; | |
-fx-font-weight: bold; | |
-fx-alignment: CENTER_LEFT; | |
} | |
.table-view .cell{ |
OlderNewer