Skip to content

Instantly share code, notes, and snippets.

View sonthonaxrk's full-sized avatar
👁️
Focusing

RK sonthonaxrk

👁️
Focusing
View GitHub Profile
use std::thread::sleep;
use std::time::Duration;
mod scoped_thread {
use std::marker::PhantomData;
use std::thread::{spawn, JoinHandle};
// Remove default
pub struct ThreadScope<'thread> {
use std::marker::PhantomData;
use std::thread::{sleep, spawn, JoinHandle};
use std::time::Duration;
#[derive(Default)]
pub struct ThreadScope<'thread> {
_marker: PhantomData<&'thread ()>,
joins: Vec<JoinHandle<()>>,
}
use std::marker::PhantomData;
use std::thread::{sleep, spawn, JoinHandle};
use std::time::Duration;
#[derive(Default)]
pub struct ThreadScope<'thread> {
_marker: PhantomData<&'thread ()>,
joins: Vec<JoinHandle<()>>,
}
/// This short test is intended to determine confidence fighting the rust borrow checker.
/// Software isn't perfect and Rust often makes it tricky to pass mutable values around
/// when the type signatures aren't perfectly designed.
/// Task:
/// - Part 1: Make this compile
/// - Part 2: Make the compute function to be more readable
/// - Part 3: Write a test that asserts the cache was hit.
/// Rules
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import (declarative_base, declared_attr,
AbstractConcreteBase)
engine = create_engine('sqlite://', echo=True)
Base = declarative_base()
Base.metadata = MetaData()
drop table if exists metadata cascade ;
drop table if exists obj1;
drop table if exists obj2;
drop table if exists parent_child;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
/* This table is common across tables */
create table metadata (
id serial primary key,
@sonthonaxrk
sonthonaxrk / sql.py
Last active February 24, 2022 10:52
Contains eager, multiple of same type
from sqlalchemy import *
from sqlalchemy.orm import *
Base = declarative_base()
class Account(Base):
__tablename__ = "account"
id = Column(Integer, primary_key=True)
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import AbstractConcreteBase
Base = declarative_base()
class User(Base):
__tablename__ = "user"
@sonthonaxrk
sonthonaxrk / Old Technical Tests.md
Last active February 4, 2021 12:03
All the technical tests I have done

List of Technical Tests I Have Done

In my career I have done a great number of technical tests. Some I merely did as exercises for myself knowing that I was probably not going to get the job, and hoped to merely expand my skillset. I've obviously developed as a developer over the years, but I'm pleased with most of the tests I have done.

However, at this point I hope that anyone who wishes to hire me will examine this first, before compelling me to add yet another example of Django, Flask or a simple algorithm.

B2C2

import asyncio
import ipywidgets as widgets
from IPython.display import display
def wait_for_click(button):
future = asyncio.Future()
def getvalue(button):
# make the new value available
future.set_result(True)