Unfortunately Java's built-in cacerts
do not include StartCom SSL root certificates.
Because of this, you must tell java to trust these certificates.
The easiest way I've found to do it is as follows:
# https://superuser.com/a/1434648 | |
Add-Type -AssemblyName System.Runtime.WindowsRuntime | |
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0] | |
Function Await($WinRtTask, $ResultType) { | |
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType) | |
$netTask = $asTask.Invoke($null, @($WinRtTask)) | |
$netTask.Wait(-1) | Out-Null | |
$netTask.Result |
import android.util.Base64; | |
import android.util.Log; | |
import com.bugsnag.android.Bugsnag; | |
import com.bugsnag.android.MetaData; | |
import com.bugsnag.android.Severity; | |
import com.facebook.react.bridge.*; | |
import java.io.File; | |
import java.io.InputStream; |
# This task will notify Sentry via their API[1] that you have deployed | |
# a new release. It uses the release timestamp as the `version` | |
# (like 20151113182847) and the git ref as the optional `ref` value. | |
# | |
# This task requires several environment variables be set (or just | |
# hardcode the values in here if you like living on the edge): | |
# | |
# ENV['SENTRY_API_ENDPOINT'] : API endpoint, https://app.getsentry.com | |
# ENV['SENTRY_ORG'] : the organization for this app | |
# ENV['SENTRY_PROJECT'] : the project for this app |
Unfortunately Java's built-in cacerts
do not include StartCom SSL root certificates.
Because of this, you must tell java to trust these certificates.
The easiest way I've found to do it is as follows:
import django.db | |
import collections | |
all_models = django.db.models.get_models() | |
def find_deps(models): | |
""" return a dict of {model : [all dependent models] """ | |
deps = collections.defaultdict(set) | |
name_to_model = {} | |
for model in models: |
.DS_Store | |
tmp/ |
Questions to answer:
When an update comes into the system we fire off something like the following: | |
>>> app.buffer.incr( | |
>>> Group, # model class, | |
>>> {'times_seen': 1}, # counters | |
>>> {'id': group.id}, # filter restrictions, sometimes a composite key | |
>>> {'last_seen': now}, # metadata to update when buffer is processed | |
>>> ) | |
This would get stored in a hash key as following: |
""" | |
cramermath | |
~~~~~~~~~~ | |
Usage: | |
>>> import cramermath | |
>>> cramermath.log(10) | |
0.014728067495500818 | |
""" |
import heapq | |
from threading import Lock | |
class HeapQueue(object): | |
def __init__(self, values=None, maxsize=None, reversed=False): | |
""" | |
Create a new heap queue. | |
- ``maxsize`` will create a capped queue. |