This file contains 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
//------------------------------------------------------------------------------ | |
// pdbdump.c - dump symbols from .pdb and executable files (public domain). | |
// - to compile; cl.exe /Ox /Zi pdbdump.c | |
// - | |
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk | |
//------------------------------------------------------------------------------ | |
#include <stdio.h> | |
#include <Windows.h> | |
#include <DbgHelp.h> |
This file contains 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
%# -*- coding:utf-8 -*- | |
\documentclass[11pt,a4paper]{moderncv} | |
\usepackage{fontspec,xunicode} | |
%\usepackage[slantfont,boldfont]{xeCJK} | |
\usepackage{xcolor} % replace by the encoding you are using | |
%\defaultfontfeatures{Mapping=tex-text} | |
%\XeTeXlinebreaklocale "zh" | |
%\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt |
This file contains 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
#!/usr/bin/env python | |
# Sat 21 Nov 2020 10:12:23 PM PST | |
def permutation(lst): | |
assert len(lst) > 0 | |
result = [] | |
def helper(): | |
if len(lst) == 0: | |
yield result[:] |
This file contains 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
from __future__ import print_function | |
import numpy as np | |
import tensorflow as tf | |
import time | |
# Import MNIST data | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) |
This file contains 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
/** | |
* Copyright (c) Rich Hickey. All rights reserved. | |
* The use and distribution terms for this software are covered by the | |
* Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
* which can be found in the file epl-v10.html at the root of this distribution. | |
* By using this software in any fashion, you are agreeing to be bound by | |
* the terms of this license. | |
* You must not remove this notice, or any other, from this software. | |
**/ |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import traceback | |
import sqlite3 | |
import logging | |
from Queue import Queue | |
from Queue import Empty |
This file contains 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
pub struct Tree<T> { | |
root: Link<T>, | |
size: usize, | |
} | |
type Link<T> = Option<Box<Node<T>>>; | |
struct Node<T> { | |
elem: T, | |
left: Link<T>, |
This file contains 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
struct ListNode<'a, T> where T: PartialOrd + 'a { | |
val: &'a T, | |
next: Option<Box<ListNode<'a, T>>>, | |
} | |
fn reverse_list<'a, T>(head: Option<Box<ListNode<'a, T>>>) -> Option<Box<ListNode<'a, T>>> | |
where T: 'a + PartialOrd { | |
if let Some(mut p) = head { | |
let mut tail = None; | |
loop { |
This file contains 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
#!/usr/bin/env python | |
class TreeNode: | |
def __init__(self, val): | |
self.val = val | |
self.left = None | |
self.right = None | |
def printTreeWithDistance(root, k): | |
def impl(root, path): |
This file contains 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
/* | |
时间限制:10000ms | |
单点时限:1000ms | |
内存限制:256MB | |
描述 | |
Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of fibonacci sequence. | |
A sub-sequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. | |
The fibonacci sequence is defined as below: |
NewerOlder