Skip to content

Instantly share code, notes, and snippets.

View manifoldhiker's full-sized avatar

manifoldhiker manifoldhiker

  • 13:28 (UTC -12:00)
View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
n,Ra,dec,Mu,Mg,Mr,Mi,Mz,Mu-Mr,Mg-Mi,Mr-Mz,R50/R90,z,Ctype
2,176.009003,19.971918,-18.536882,-20.349003,-21.143179,-17.606831,-9.451928,2.606297,1.179029,0.661453,0.302287,0.021093,
3,246.920929,40.875412,-18.571484,-20.184681,-20.944054,-16.283052,-8.750608,2.37257,1.136112,0.654454,0.38336,0.033282,
4,241.343826,17.85508,-18.615803,-20.329876,-21.109322,-16.13588,-8.412383,2.493519,1.153942,0.640382,0.332436,0.036131,
5,241.478302,18.311939,-18.361891,-20.036137,-20.773384,-13.710239,-7.91717,2.411493,1.106518,0.634897,0.33532,0.03898,
6,240.415741,16.940077,-18.521437,-20.229439,-20.954092,-15.374226,-8.476183,2.432655,1.110084,0.621198,0.367814,0.035782,
7,246.688065,40.684219,-18.558308,-20.376591,-21.161524,-16.246857,-9.042726,2.603216,1.192503,0.695143,0.3392,0.029134,
8,247.567368,40.659748,-18.382961,-20.037733,-20.877279,-16.756638,-9.156488,2.494318,1.257743,0.740575,0.384992,0.028053,
9,194.775101,27.996698,-18.483904,-20.277033,-21.061373,-17.1551,-9.108328,2.577468,1.185937,0.667735,0.325289,0.0
from tqdm.auto import tqdm
import cv2
import torch
def read_video(file):
capture = cv2.VideoCapture(file)
fps = capture.get(cv2.CAP_PROP_FPS)
n_frames = capture.get(cv2.CAP_PROP_FRAME_COUNT)
frames = []
import plotly.express as px
import plotly.graph_objects as go
import numpy as np
def ms(x, y, z, radius, resolution=20):
"""Return the coordinates for plotting a sphere centered at (x,y,z)"""
u, v = np.mgrid[0:2*np.pi:resolution*2j, 0:np.pi:resolution*1j]
X = radius * np.cos(u)*np.sin(v) + x
Y = radius * np.sin(u)*np.sin(v) + y
from scipy.sparse import hstack
from sklearn.linear_model import SGDClassifier
from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
import pandas as pd
class WikiBotOnlineClassifer:
def __init__(self, tfidf_vectorizer_comments, tfidf_vectorizer_username, model):
self.tfidf_vectorizer_comments = tfidf_vectorizer_comments
@manifoldhiker
manifoldhiker / language_detection.py
Last active October 3, 2021 07:37
Language detection with fasttext
import urllib.request
from pathlib import Path
import spacy
import fasttext
FMODEL_URL = "https://dl.fbaipublicfiles.com/fasttext/supervised-models/lid.176.bin"
class FasttextLanguageDetector():
@manifoldhiker
manifoldhiker / ames.csv
Created September 18, 2020 08:59
Ames houses dataset
We can't make this file beautiful and searchable because it's too large.
"MS_SubClass","MS_Zoning","Lot_Frontage","Lot_Area","Street","Alley","Lot_Shape","Land_Contour","Utilities","Lot_Config","Land_Slope","Neighborhood","Condition_1","Condition_2","Bldg_Type","House_Style","Overall_Qual","Overall_Cond","Year_Built","Year_Remod_Add","Roof_Style","Roof_Matl","Exterior_1st","Exterior_2nd","Mas_Vnr_Type","Mas_Vnr_Area","Exter_Qual","Exter_Cond","Foundation","Bsmt_Qual","Bsmt_Cond","Bsmt_Exposure","BsmtFin_Type_1","BsmtFin_SF_1","BsmtFin_Type_2","BsmtFin_SF_2","Bsmt_Unf_SF","Total_Bsmt_SF","Heating","Heating_QC","Central_Air","Electrical","First_Flr_SF","Second_Flr_SF","Low_Qual_Fin_SF","Gr_Liv_Area","Bsmt_Full_Bath","Bsmt_Half_Bath","Full_Bath","Half_Bath","Bedroom_AbvGr","Kitchen_AbvGr","Kitchen_Qual","TotRms_AbvGrd","Functional","Fireplaces","Fireplace_Qu","Garage_Type","Garage_Finish","Garage_Cars","Garage_Area","Garage_Qual","Garage_Cond","Paved_Drive","Wood_Deck_SF","Open_Porch_SF","Enclosed_Porch","Three_season_porch","Screen_Porch","Pool_Area","Pool_QC","Fence","Misc_Feature"
%%cu
#include <stdio.h>
#include <iostream>
#include <time.h>
using namespace std;
#define N 1024
inline cudaError_t checkCudaErr(cudaError_t err, const char* msg) {
PS D:\src\modeldb-client\verta\tests> pytest
================================================= test session starts =================================================
platform win32 -- Python 3.7.1, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('D:\\src\\modeldb-client\\verta\\tests\\.hypothesis\\examples')
rootdir: D:\src\modeldb-client\verta
plugins: hypothesis-4.31.1
collected 86 items
test_artifacts.py ....FF....... [ 15%]
test_backend.py F [ 16%]
module Elmish.SimpleInput
open System
(**
Minimal application showing how to use Elmish
You can find more info about Emish architecture and samples at https://elmish.github.io/
*)
open Fable.Core.JsInterop
open Fable.Helpers.React
// Learn more about F# at http://fsharp.org
open System
type DialogGraph = Node list
and Node = { id:string; content:string; responseMatchers:ResponseMatcher list }
and ResponseMatcher = ExactMatch of ExactMatch | FallToNode of FallToNode
and ExactMatch = {option:string; nodeId:string}
and FallToNode = {nodeId:string}