import numpy as np
face_nodes = np.array([
[1, 2, 6, np.nan],
[1, 6, 5, np.nan],
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from functools import reduce | |
from typing import Any | |
from typing import Dict | |
def merge(a, b, path=None): | |
""" Merge dictionary a into b (in-place)""" | |
# source: https://stackoverflow.com/a/7205107/592289 | |
if path is None: path = [] | |
for key in b: |
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 pyproj | |
# Use the "new" numpy API for the random number generation (requires numpy >=1.17) | |
rng = np.random.default_rng(seed=1) | |
# Create arrays with random points | |
no_points = 5 | |
longitudes = rng.uniform(low=10, high=20, size=no_points) | |
latitudes = rng.uniform(low=33, high=45, size=no_points) |
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 hcitool lescan | |
AA:BB:CC:DD:EE:FF Polar H10 ABCDEFGH | |
$ gatttool -t random --device=AA:BB:CC:DD:EE:FF --interactive | |
[AA:BB:CC:DD:EE:FF][LE]> connect | |
Attempting to connect to AA:BB:CC:DD:EE:FF | |
Connection successful | |
[AA:BB:CC:DD:EE:FF][LE]> primary | |
attr handle: 0x0001, end grp handle: 0x0009 uuid: 00001800-0000-1000-8000-00805f9b34fb | |
attr handle: 0x000a, end grp handle: 0x000d uuid: 00001801-0000-1000-8000-00805f9b34fb |
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
#!/usr/bin/env python3 | |
import datetime | |
import numpy as np | |
import tensorflow as tf | |
# Processing Units logs | |
log_device_placement = True |
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 hashlib | |
import sys | |
if len(sys.argv) != 3: | |
sys.exit("Usage: python3 verify.py hash passphrase") | |
provided_hash = sys.argv[1] | |
passphrase = sys.argv[2] | |
salt = provided_hash.split(":")[1] |
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
from __future__ import print_function | |
''' | |
Basic Multi GPU computation example using TensorFlow library. | |
Author: Aymeric Damien | |
Project: https://github.com/aymericdamien/TensorFlow-Examples/ | |
''' | |
''' | |
This tutorial requires your machine to have 1 GPU | |
"/cpu:0": The CPU of your machine. |
This is important because it is a security risk
Some typical example of the problem:
- https://cidportal.jrc.ec.europa.eu/apps/gitlab/jeodpp/data-management/data-catalog/blob/2e2687193b52f1b44e3194dcb23a76c50ee06588/search.py#L82-84
- https://cidportal.jrc.ec.europa.eu/apps/gitlab/jeodpp/data-management/data-catalog/blob/2e2687193b52f1b44e3194dcb23a76c50ee06588/src/sql.py#L19-22
- https://cidportal.jrc.ec.europa.eu/apps/gitlab/jeodpp/data-management/data-catalog/blob/2e2687193b52f1b44e3194dcb23a76c50ee06588/search.py#L439
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 | |
import pathlib | |
import sys | |
import typing | |
# The exact values of these paths depend on your QGIS installation | |
QGIS_ROOT = pathlib.Path("/opt/qgis-git") | |
QGIS_PATH = QGIS_ROOT / "share/qgis/python" | |
QGIS_PLUGIN_PATH = QGIS_PATH / "plugins" |
NewerOlder