Skip to content

Instantly share code, notes, and snippets.

View chihuahua's full-sized avatar

Chi Zeng chihuahua

  • Google
  • Mountain View, CA
View GitHub Profile
@chihuahua
chihuahua / bad_cross_entropy.py
Created April 10, 2018 03:44
Use this training script to repro a bug in which the debugger data channel sends corrupt tensor values to the interactive debugger plugin. Specifically, run this script with `tensorboard_debug_address` set:
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an 'AS IS' BASIS,
@chihuahua
chihuahua / mean.c
Last active December 26, 2015 06:49
/**
* Determine the mean of a list of integers in a file 'nums.txt'.
* One integer is on each line in the file. Writes the mean in a
* nicely formatted way into a file mean.txt. Will override
* mean.txt if it exists already.
* @author Chi Zeng ([email protected]) + section-mates.
* Oct. 22, 2013
*/
#include <stdio.h>
/**
* Makes a copy of a file.
* The destination file name must not already exist.
* Usage: ./executable source destination
* @author Chi Zeng ([email protected]) and section-mates
* Oct. 22, 2013
*/
#include <stdio.h>
/**
* Makes a copy of a file.
* The destination file name must not already exist.
* Usage: ./executable source destination
* @author Chi Zeng ([email protected]) and section-mates
* Oct. 22, 2013
*/
#include <stdio.h>
@chihuahua
chihuahua / mergeSort.c
Created October 9, 2013 01:40
Merge Sort
/**
* Merge sort.
*
* By Chi Zeng ([email protected]) and compatriots who cared enough about CS50 to
* come to section.
* Oct. 8, 2013
*/
#include <stdio.h>
#include <stdlib.h>
@chihuahua
chihuahua / factorial.c
Last active December 23, 2015 20:59
Calculates X! factorial.
/**
* factorial.c
* Calculates X! factorial.
*
* @author Chi Zeng ([email protected])
* Sep. 24, 2013
*/
#include <stdio.h>
@chihuahua
chihuahua / gist:6693143
Created September 25, 2013 00:11
Calculates X! factorial.
/**
* factorial.c
* Calculates X! factorial.
*
* @author Chi Zeng ([email protected])
* Sep. 24, 2013
*/
#include <stdio.h>
@chihuahua
chihuahua / makeChange.c
Last active December 23, 2015 20:59
Calculates the number of ways to make change for x cents using half dollars, quarters, dimes, nickels, pennies.
/**
* makeChange.c
* Calculates the number of ways to make change for x cents
* using half dollars, quarters, dimes, nickels, pennies.
*
* @author Chi Zeng ([email protected])
* Sep. 24, 2013
*/
#include <stdio.h>