Skip to content

Instantly share code, notes, and snippets.

@wendazhou
wendazhou / ManualValidation.cs
Created March 26, 2013 16:10
A simple helper to manually toggle WPF validation on FrameworkElements.
/// <summary>
/// Provides helpers to manually toggle validation errors.
/// </summary>
public static class ManualValidation
{
// this dummy attached property is used as a source
// of the binding.
static readonly DependencyProperty DummyProperty =
DependencyProperty.RegisterAttached("DummyProperty", typeof(object), typeof(ManualValidation), new PropertyMetadata(null));
@wendazhou
wendazhou / A modern introduction to tensorflow.ipynb
Last active January 3, 2021 21:41
Quick tensorflow tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wendazhou
wendazhou / submit.sh
Last active January 29, 2020 07:33
Tutorial job
#! /bin/bash
#SBATCH -c 1
#SBATCH --mem 1GB
#SBATCH --time 10:00
#SBATCH -A stats
#SBATCH --array 0-8
module load anaconda
conda load pytorch
python tutorial.py --shard $SLURM_ARRAY_TASK_ID
@wendazhou
wendazhou / pump.py
Last active February 21, 2020 19:00
Pytorch distributed pump
import torch
import time
def _send(buffer_size, dest):
x = torch.zeros((buffer_size,))
while True:
torch.distributed.send(x, dest)