• Life

  • macos上面import matplotlib出错

    报错:

    RuntimeError: Python is not installed as a framework.
    The Mac OS X backend will not be able to function correctly if Python is not installed as a framework.
    See the Python documentation for more information on installing Python as a framework on Mac OS X.
    Please either reinstall Python as a framework, or try one of the other backends.
    If you are using (Ana)Conda please install python.app and replace the use of ‘python’ with ‘pythonw’.
    See ‘Working with Matplotlib on OSX’ in the Matplotlib FAQ for more information.
    

    解决:

    I assume you have installed the pip matplotlib,  
    there is a directory in you root called ~/.matplotlib.
    Create a file ~/.matplotlib/matplotlibrc there and add the following code: backend: TkAgg
    
  • 酒吧

    觉得一点儿也不好玩..

  • 你还是去死吧

    昨天说到希望像医生对待病人一样有耐心, 对待问题像对待生命一样.

    我现在已经要炸了.

    医生问病人, 你多大了, 疼了多久了, 什么时候入院的, 拍过片子吗? 病人会一个个回答你.

    但某些同事不行, 他们会说, “我今年30, 今天星期二”, 星期二你MB啊, 你还是去死吧

    我真的很想结束这对话, 直接说 “算了, 就是不能做. 等你升到5级的时候再来问我, 说不定到时候就可以做了,好吧”

  • 睡到中午

    一觉醒来已经是中午了.

    还是一个人能自在一些, 可以吃个馄饨, 然后再吃个冰淇淋或者奶茶~

    https://zhuanlan.zhihu.com/p/29202351 我尝试要以对待生命的态度对待那些工作中问问题的人.

  • 生日快乐

    生日快乐.

    有时候, 其实只是想感动自己.

    让自己如死水一样的生活多一点儿涟漪.

  • 从关闭的channel读数据会怎么样?

    从关闭的channel读数据会怎么样?

  • 传指针还是传值

    type MessageSet []*Message

    传MessageSet的时候, 是传的指针还是值??

  • 如何捕获子线程里面的OOM?

    如何捕获子线程里面的OOM?

    import java.lang.management.ManagementFactory;
    import java.lang.management.MemoryMXBean;
    import java.lang.management.MemoryUsage;
    
    public class Main extends Thread {
        private static final int MEGABYTE = (1024 * 1024);
    
        public void run() {
            for (int i = 1; i <= 100; i++) {
    
                byte[] bytes = new byte[MEGABYTE * 500];
    
            }
        }
    
    
        public static void main(String args[]) {
            MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
    
            try {
                (new Main()).start();
            } catch (Exception e) {
                e.printStackTrace();
            } catch (OutOfMemoryError e) {
                MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
                long maxMemory = heapUsage.getMax() / MEGABYTE;
                long usedMemory = heapUsage.getUsed() / MEGABYTE;
                System.out.println(" : Memory Use :" + usedMemory + "M/" + maxMemory + "M");
            }
        }
    }
    
  • 稻草人

    跟稻草人一起旅行的好处是可以和很多人一起玩, 可以让自己更冷静的看这个世界