Skip to content

Instantly share code, notes, and snippets.

View alexbrillant's full-sized avatar
🎯
Focusing

Alexandre Brillant alexbrillant

🎯
Focusing
  • Québec, Canada
View GitHub Profile
import React, { Component } from "react"
import Swiper from "react-native-deck-swiper"
import { StyleSheet, View, Text, Image, Button } from "react-native"
export default class Exemple extends Component {
constructor(props) {
super(props)
this.state = {
cards: [1, 2],
swipedAllCards: false,
// Place your settings in this file to overwrite the default settings
{
"stylelint.enable": true,
"window.zoomLevel": 0,
"workbench.colorTheme": "Nord",
"editor.fontSize": 14,
"editor.formatOnSave": true,
"editor.lineNumbers": "relative",
"vim.easymotion": true,
"vim.leader": "<space>",
export function occurenceOfCharacters (string) {
const map = new Map()
for (let i = 0; i < string.length; i++) {
const char = string[i]
if (!map.get(char)) {
map.set(char, 1)
} else {
const currentCount = map.get(char)
map.set(char, currentCount + 1)
}
nnoremap <A-q> :m .-2<CR>==
nnoremap <A-w> :m .-3<CR>==
nnoremap <A-e> :m .-4<CR>==
nnoremap <A-r> :m .-5<CR>==
nnoremap <A-t> :m .-6<CR>==
nnoremap <A-y> :m .-7<CR>==
nnoremap <A-u> :m .-8<CR>==
nnoremap <A-i> :m .-9<CR>==
nnoremap <A-o> :m .-10<CR>==
#!/usr/bin/env python
# coding=utf-8
import json
import threading
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
Exception in thread Thread-8078:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py", line 441, in wrap_socket
cnx.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1806, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/OpenSSL/SSL.py", line 1538, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (54, 'ECONNRESET')
mean = self.get_simple_moving_average(day)
derivations = [price - mean for price in self.prices[-day:]]
squared_deviations = [numpy.square(derivation) for derivation in derivations]
sum_squared_deviations = sum(squared_deviations)
return numpy.sqrt(sum_squared_deviations / day)
from queue import Queue
from threading import Thread
class DownloadWorker(Thread):
def __init__(self, queue):
Thread.__init__(self)
self.queue = queue
def run(self):
while True:
public class ValidatedObservable : ObservableBase<string> { }
public abstract class Validation
{
private readonly ValidatedObservable _validatedObservable;
private readonly bool _validated;
private readonly string _id;
private readonly ISet<string> _mustBeValidated;
protected Validation(ValidatedObservable validatedObservable, ISet<string> mustBeValidated, bool validated, string id)
{
data = data.prefetch(tf.data.experimental.AUTOTUNE)
data = data.cache(filename='tf_data_cache_filename')
data = data.shuffle()
data = data.batch(batch_size=batch_size, drop_remainder=True)