Skip to content

Instantly share code, notes, and snippets.

@dgmp88
dgmp88 / debug.js
Created April 23, 2022 16:58
React state doesn't work like I think it does
import { Component } from 'react';
class Test extends Component {
constructor(props) {
super(props);
this.state = {
items: [1, 2, 3],
};
}
import torch
from lifelines import CoxPHFitter
from lifelines.datasets import load_rossi
from torch import nn
DEVICE = torch.device("cpu")
MODEL = None
COX_MODEL = None
ROSSI = load_rossi()
PYTHONPATH=./ gdb --args python api/tests/crashing_models.py
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
class CircularList:
def __init__(self, list):
self.list = list
def get(self, start, end):
return [self.list[idx % len(self)] for idx in range(start, end)]
# for i in range(start, end):
# start = self.cap(start)
# end = self.cap(end)
import uuid
import sqlite3
import random
import time
import numpy as np
# Start up the high scores database
conn = sqlite3.connect('temp.db')
cur = conn.cursor()