This file contains hidden or 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% 18-854B scribe notes style file | |
% | |
% This file should be called scribe.sty | |
% | |
% Your main LaTeX file should look like this: | |
% | |
% \documentclass[12pt]{article} | |
% \usepackage{scribe} | |
% |
This file contains hidden or 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 torch | |
import torch_scatter | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch_geometric.nn as pyg_nn | |
import torch_geometric.utils as pyg_utils | |
from torch import Tensor | |
from typing import Union, Tuple, Optional |
This file contains hidden or 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 | |
# source this file from your ~/.bashrc, i.e. `source git_funcs.sh` | |
# run this before making changes, otherwise you'll need to deal with merge conflicts | |
# usage: gitu | |
gitu () { git pull --rebase; } | |
# add it all, push it all, fuck the police | |
# usage: gitx | |
gitx () { |
This file contains hidden or 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
configuration { | |
/* modi: "window,run,ssh";*/ | |
font: "FiraCode Nerd Font 30"; | |
/* location: 0;*/ | |
/* yoffset: 0;*/ | |
/* xoffset: 0;*/ | |
/* fixed-num-lines: true;*/ | |
/* show-icons: false;*/ | |
/* terminal: "rofi-sensible-terminal";*/ | |
/* ssh-client: "ssh";*/ |
This file contains hidden or 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
use crate::db::Conn; | |
use crate::schema::users; | |
use chrono::{DateTime, Utc}; | |
use diesel::{ | |
associations::{HasTable, Identifiable}, | |
delete, insert_into, | |
result::QueryResult, | |
ExpressionMethods, QueryDsl, RunQueryDsl, | |
}; | |
use serde::{Deserialize, Serialize}; |
This file contains hidden or 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
// inside users.rs | |
use crate::db::{traits::Model as DbModel, Conn}; | |
use crate::schema::users; | |
use chrono::{DateTime, Utc}; | |
use diesel::{ | |
associations::{HasTable, Identifiable}, | |
delete, insert_into, | |
result::QueryResult, | |
ExpressionMethods, QueryDsl, RunQueryDsl, | |
}; |
This file contains hidden or 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
fn minimize<F>(func: F) | |
where | |
F: for<'r> Fn(f64, &'r mut f64) -> f64 | |
{ | |
let mmtype: rgsl::MinimizerType<f64> = rgsl::MinimizerType::brent(); | |
let mut mm: rgsl::Minimizer<f64> = rgsl::Minimizer::new(&mmtype).unwrap(); | |
let lambda = 0.5; | |
mm.set(func, &mut lambda, 0.5, 0.0, 1.0); | |
match rgsl::minimizer::test_interval(0.0, 1.0, 1e-6, 0.0) { | |
¦ rgsl::Value::Success => p!("Lambda: {}", mm.x_minimum()), |
This file contains hidden or 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
ruby -e "('A'..'Z').each { |x| ('A'..x).each { |y| print y == 'E' ? 'X' : y }; puts }" |