Skip to content

Instantly share code, notes, and snippets.

@emanonwzy
emanonwzy / Output
Created November 6, 2012 05:43 — forked from caoxudong/Output
ZZ. @老赵 生成一段Typoglycemia文本.Typoglycemia是个新词,描述的是人们识别一段文本时的一个有趣的现象:只要每个单词的首尾字母正确,中间的字母顺序完全打乱也没有关系,照样可以正常理解。
Original String:
I couldn't believe that I could actually understand what I was reading:
the phenomenal power of the human mind. According to a research team at Cambridge University,
it doesn't matter in what order the letters in a word are, the only important thing is that the
first and last letter be in the right place. The rest can be a total mess and you can still read
it without a problem. This is because the human mind does not read every letter by itself, but the
word as a whole. Such a condition is appropriately called Typoglycemia. Amazing, huh? Yeah and you
always thought spelling was important.
Converted String:
@emanonwzy
emanonwzy / ffr.c
Created December 20, 2013 07:43 — forked from cloudwu/ffr.c
#include <stdint.h>
#include <stdlib.h>
// assert(RAND_MAX >= 0x7fff)
float
random_0_to_1() {
union {
uint32_t d;
float f;
} u;
import java.io.*;
import java.nio.file.*;
import java.security.*;
import java.security.cert.*;
import javax.net.ssl.*;
import org.bouncycastle.jce.provider.*;
import org.bouncycastle.openssl.*;
public class SslUtil
///////////////////////////////////////////////////////
// Talk is cheap. Show me the code. - Linus Torvalds
///////////////////////////////////////////////////////
public abstract class CalculatorBase : IDisposable {
protected void StartCore() {
// ...
}
@emanonwzy
emanonwzy / sumup.py
Created August 23, 2014 05:53 — forked from iwinux/sumup.py
#!/usr/bin/env python
# coding: utf-8
'''
中国联不通每月通话时间统计
用法:
1. 去 http://iservice.10010.com/ 下载通话详单(Excel 格式),导出为 CSV
2. ./sumup.py *.csv
'''
public class WebImageRequestHandler extends RequestHandler {
private static final String TAG = "WebImageRequestHandler";
private static final String SCHEME_HTTP = "http";
private static final String SCHEME_HTTPS = "https";
private Downloader downloader;
public WebImageRequestHandler(Downloader downloader) {
this.downloader = downloader;
@emanonwzy
emanonwzy / DelegateTouchSpace
Created January 10, 2015 08:36
A simple view support delegate touch event to another view
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@emanonwzy
emanonwzy / HeaderGridView
Created January 10, 2015 08:36
Android Grid view support add header view
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by zeyiwu on 1/5/15.
*/
public class SquareImageView extends ImageView {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script helps removing Git branches.
# Run it from a git repo dir. It will open the Git branches list
# in your favorite editor. Delete some branches from the list.
# Save and close the file. The script applies the changes to the repo.
from subprocess import call, Popen, PIPE
from os import getenv