Skip to content

Instantly share code, notes, and snippets.

Avatar

BigsnarfDude bigsnarfdude

View GitHub Profile
View toy_webcounter_networkx_bipartite_graph.py
import networkx as nx
B = nx.Graph()
# Add nodes with the node attribute "bipartite"
B.add_nodes_from([1, 2, 3, 4], bipartite=0)
B.add_nodes_from(["a", "b", "c"], bipartite=1)
# Add edges only between nodes of opposite node sets
B.add_edges_from([(1, "a"), (1, "b"), (2, "b"), (2, "c"), (3, "c"), (4, "a")])
def get_webpage_visitors(webpage, target_graph):
View gcn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:0fdba0788aa45ea900aa30b8375d2245
import os
import numpy as np
import tensorflow as tf
import networkx as nx
from collections import Counter
from sklearn.utils import shuffle
from sklearn.preprocessing import LabelEncoder
@bigsnarfdude
bigsnarfdude / spektral_gcn_cora_dataset_singleloader.ipynb
Created Nov 20, 2021
spektral_GCN_cora_dataset_singleloader.ipynb
View spektral_gcn_cora_dataset_singleloader.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bigsnarfdude
bigsnarfdude / gcn.py
Created Nov 20, 2021
updated singleloader cora dataset GCN using spektral
View gcn.py
"""
This example implements the experiments on citation networks from the paper:
Semi-Supervised Classification with Graph Convolutional Networks (https://arxiv.org/abs/1609.02907)
Thomas N. Kipf, Max Welling
"""
import numpy as np
import tensorflow as tf
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.losses import CategoricalCrossentropy
@bigsnarfdude
bigsnarfdude / bf.scala
Created Oct 26, 2021
spark streaming top k algebird
View bf.scala
import java.io.PrintWriter
import java.io.File
import com.twitter.algebird._
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.broadcast.Broadcast
@bigsnarfdude
bigsnarfdude / clean_up.py
Last active Oct 14, 2021
clean ascii python
View clean_up.py
import unicodedata
output = unicodedata.normalize('NFD', my_unicode).encode('ascii', 'ignore')
myfoo = u'àà'
myfoo
u'\xe0\xe0'
unicodedata.normalize('NFD', myfoo).encode('ascii', 'ignore')
'aa'
View pbi_refresh.json
{
"name": "pipeline1",
"properties": {
"activities": [
{
"name": "Call dataset refresh",
"type": "WebActivity",
"dependsOn": [
{
"activity": "Get AAD Token",
@bigsnarfdude
bigsnarfdude / trigger.py
Created Oct 13, 2021
azure app power bi trigger script
View trigger.py
import sys
import json
import urllib
import urllib2
import time
POWER_BI_RESOURCE_ENDPOINT = "https://analysis.windows.net/powerbi/api"
MICROSOFT_OAUTH2_API_ENDPOINT = "https://login.windows.net/common/oauth2/token/"
WAIT_AFTER_REFRESH_START_SECONDS = 15
@bigsnarfdude
bigsnarfdude / BMPCC4K
Created May 23, 2021
Blackmagic Pocket Cinema DCI 4K Framerates
View BMPCC4K
The Blackmagic Pocket Cinema DCI 4K resolution at 30 fps, the bitrates are as follows:
DCI 4K 30p (4096 x 2160) at 272MB/s (2176mb/s) bitrate using CinemaDNG RAW 12-bit
DCI 4K 30p (4096 x 2160) at 129MB/s (1032mb/s) bitrate using CinemaDNG RAW 3:1 12-bit
DCI 4K 30p (4096 x 2160) at 97MB/s (776mb/s) bitrate using CinemaDNG RAW 4:1 12-bit
DCI 4K 30p (4096 x 2160) at 118MB/s (944mb/s) bitrate using ProRes 422 HQ 10-bit
DCI 4K 30p (4096 x 2160) at 78.63MB/s (629mb/s) bitrate using ProRes 422 10-bit
DCI 4K 30p (4096 x 2160) at 54.63MB/s (437mb/s) bitrate using ProRes 422 LT 10-bit
DCI 4K 30p (4096 x 2160) at 24.25MB/s (220mb/s) bitrate using ProRes 422 Proxy 10-bit
The Blackmagic Pocket Cinema DCI 4K resolution at 60 fps, the bitrates are as follows: