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 numpy as np # import library for linear algebra and more utilities | |
from numpy.random import randint # import random int | |
# initialize random seed | |
np.random.seed(4) | |
houses = ["Gryffindor","Slytherin", "Hufflepuff", "Ravenclaw"] | |
houses_points = [] | |
for _ in houses: | |
# houses_points.append(randint(0, 100, randint(60,100))) |
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
license: gpl-3.0 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Example of Bootstrap 3 Carousel</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> |
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
license: gpl-3.0 |
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
sudo usb_modeswitch -v 12d1 -p 1f01 -J |
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
# in root of grpc project | |
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install . |
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
#! /bin/bash | |
# path to save your ip (it shall always contain only one line, if not it can cause problems) | |
FILE_PATH=/tmp/myip.txt | |
# get your IP from an external server (with a regex to verify that it is an ip) | |
EXT_IP=$(curl http://ipecho.net/plain | grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}") | |
# if the file doesn't exist, create it | |
[ ! -f $FILE_PATH ] && touch $FILE_PATH | |
# if your ip changed, do something | |
if [ -n "$EXT_IP" ] && [ "$EXT_IP" != "$(cat $FILE_PATH)" ]; then | |
echo $EXT_IP > $FILE_PATH |
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
#! /bin/bash | |
# This code verify that the computer has an ip. When this is not true | |
# Cron command | |
# */5 * * * * /my/path/wifi_reconnect | |
# ip addr show wlan0 |awk -F ":" '/inet addr/{split($2,a," ");print a[1]}' | |
IP=$(ifconfig wlan0 | awk '$1 == "inet" {print $2}') | |
if [ -z $IP ]; then | |
# wait for 10 seconds and ask again for your ip |
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
#! /bin/bash | |
# this script is a workaround for cronjob (because my router sometimes fails to interconnect my computers) | |
ips=( "192.168.0.1" "192.168.0.2" "192.168.0.3" ) | |
for i in "${ips[@]}"; do | |
: | |
ping -c1 -W5 $i >/dev/null && echo $i' up' || echo $i' down' | |
done |
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
# code to solve https://stackoverflow.com/q/47932589/2237916 | |
import numpy as np | |
import tflearn | |
from random import shuffle | |
# parameters | |
n_input=100 | |
n_train=2000 | |
n_test = 500 | |
# generate data |