Skip to content

Instantly share code, notes, and snippets.

View Answeror's full-sized avatar

Cosmo Du Answeror

View GitHub Profile
@Answeror
Answeror / Dockerfile
Last active January 7, 2022 06:07
Exactly reproduce 56 layers ResNet on CIFAR10 in mxnet
FROM dmlc/mxnet:cuda
MAINTAINER answeror <answeror@gmail.com>
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
RUN cd /mxnet && git pull origin master && git submodule update
ADD src/io/image_aug_default.cc /mxnet/src/io/image_aug_default.cc
RUN cd /mxnet && make -j8 ADD_LDFLAGS=-L/usr/local/cuda/lib64/stubs
ADD example/image-classification/symbol_resnet.py /mxnet/example/image-classification/symbol_resnet.py
ADD example/image-classification/train_cifar10_resnet.py /mxnet/example/image-classification/train_cifar10_resnet.py
@Answeror
Answeror / accumulators.py
Created January 10, 2015 12:52
Statistical accumulator in Python (http://stackoverflow.com/q/3774315/238472)
from __future__ import absolute_import
import numpy as np
class Accumulators(object):
_accumulator_library = {}
def __init__(self):
self.accumulator_library = {}
@Answeror
Answeror / main.json
Created October 6, 2014 12:54
torabot lang test
{
"string": "{{ string }}",
"int": {{ int }}
}
@Answeror
Answeror / atom.xslt
Last active August 29, 2015 14:05
V2EX user replies Atom feed
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='xml' encoding='UTF-8'/>
<xsl:template match='/'>
<feed xml:lang='en-US' xmlns='http://www.w3.org/2005/Atom'>
<id>v2ex.com/member/{{ id }}</id>
<link rel='alternate' type='text/html' href='http://v2ex.com/member/{{ id }}'/>
<title>V2EX user replies of {{ id }}</title>
<xsl:for-each select='.//div[@class="dock_area"]'>
<entry>
@Answeror
Answeror / atom.xslt
Last active August 29, 2015 14:05
New York City Department of Transportation Atom feed
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet
version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>
<xsl:output method='xml' encoding='UTF-8'/>
<xsl:template match='/'>
<feed xml:lang='en-US' xmlns='http://www.w3.org/2005/Atom'>
<id>nyc</id>
<link rel='alternate' type='text/html' href='http://www.nyc.gov/html/dot/html/home/home.shtml'/>
@Answeror
Answeror / README.md
Last active February 19, 2020 09:59
page update notice based on md5
@Answeror
Answeror / replies.xml
Created July 6, 2014 13:34
v2ex评论订阅(屏蔽了answeror的发言)
<feed xml:lang='zh-CN' xmlns='http://www.w3.org/2005/Atom'>
<id>v2ex.com/t/{{ id }}</id>
<link rel='alternate' type='text/html' href='http://v2ex.com/t/{{ id }}'/>
<title>{{ id }}</title>
{% for r in replies %}
{% if r.member.username != 'answeror' %}
<entry>
<id>{{ r.id }}</id>
<published>{{ datetime.fromtimestamp(r.created).strftime('%Y-%m-%dT%H:%M:%SZ') }}</published>
<updated>{{ datetime.fromtimestamp(r.last_modified).strftime('%Y-%m-%dT%H:%M:%SZ') }}</updated>
@Answeror
Answeror / main.json
Last active August 29, 2015 14:03
v2ex评论订阅
{
"@jinja2": {
"template": {"text<": "replies.xml"},
"kargs": {
"id": "{{ id }}",
"replies": {
"@json_decode": {
"@base64_decode": [{
"[body]": {"@request": "http://www.v2ex.com/api/replies/show.json?topic_id={{ id }}"}
}]
@Answeror
Answeror / README.md
Last active August 29, 2015 14:03
Bangumi评论订阅
@Answeror
Answeror / README.md
Last active July 14, 2017 11:51
Bangumi私信订阅

Bangumi私信订阅

这个gist由torabot自动抓取并生成Atom feed.

使用方法

注意: 公开你的cookie是一件危险的事情. 别人可能利用它来滥用你的Bangumi账户! Torabot的作者保证不会使用你的cookie做这个gist功能以外的事情. 如果你不信任torabot, 请忽略这个gist.

例子: http://torabot.com/api/source/34fd6a535090ca85a2fc.atom?chii_auth=<chii_auth_in_your_cookie>