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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
class EnumTable extends React.Component { | |
render() { | |
const {propVal} = this.props; | |
return ( | |
<table className="c-codeTable"> | |
<thead> | |
<tr><th>Code</th><th>Value</th><th>Description</th></tr> |
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 RetrofitException extends RuntimeException { | |
public static RetrofitException httpError(String url, Response response, Retrofit retrofit) { | |
String message = response.code() + " " + response.message(); | |
return new RetrofitException(message, url, response, Kind.HTTP, null, retrofit); | |
} | |
public static RetrofitException networkError(IOException exception) { | |
return new RetrofitException(exception.getMessage(), null, null, Kind.NETWORK, exception, null); | |
} |
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 graphlab as gl | |
import math | |
import random | |
train = gl.SFrame.read_csv('data/train.csv') | |
test = gl.SFrame.read_csv('data/test.csv') | |
del train['id'] | |
def make_submission(m, test, filename): | |
preds = m.predict_topk(test, output_type='probability', k=9) |
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 LocaleSwitchActivity extends Activity { | |
private static final String LOG_TAG = LocaleSwitchActivity.class.getSimpleName(); | |
private static final String LOCALE_EXTRA = "locale"; | |
private Locale customLocale; | |
private boolean restartingForLocaleChangeFlag; | |
protected void useLocale(Locale locale) { | |
Intent intent = getIntent(); |
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
""" | |
Exports Issues from a specified repository to a CSV file | |
Uses basic authentication (Github username + password) to retrieve Issues | |
from a repository that username has access to. Supports Github API v3. | |
""" | |
import csv | |
import requests | |
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
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
var wg *sync.WaitGroup |