Runnable

enum Explore { HERE, THERE }


  • Home

  • Categories

  • About

  • Archives

  • Tags

polipo

Posted on 2016-11-24   |  

通过 polipo使终端翻墙

1
2
3
4
5
6
$polipo #在一个terminal(iterm)窗口输入这个指令


#在另一个terminal里输入以下指令,即可通过代理翻墙。前提是shadowsocks要先打开
$export http_proxy="http://127.0.0.1:48313"
$export https_proxy="https://127.0.0.1:48313"

cpp-note

Posted on 2016-08-10   |  

2016-08-10

  • 以下的代码编译器是支持的
1
2
3
4
int func(int * ){
print("hello");
return 0;
}
  • set_new_handler(new_handler) function,当使用new开辟内存空间失败后,会调用new_handler函数 http://en.cppreference.com/w/cpp/memory/new/set_new_handler
  • operation new http://en.cppreference.com/w/cpp/memory/new/operator_new
Read more »

Java 与 C++ “引用”的区别

Posted on 2016-07-22   |  

Java中的引用行为更类似于C++中的指针。以下代码作为C++中引用行为与Java引用行为的对比。

Read more »

intellij

Posted on 2016-06-12   |  
  • option + enter 自动导入…(可以自动生成import 代码,甚至可以自动向classpath中加入jar包)
  • cmd + b , 跳转到定义处
  • cmd + f12 ( + fn) , 查看当前文件的outline

Front Page

Posted on 2016-06-12   |  

HTML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<q></q><!--段内引用, 内联元素-->
<blockquote></blockquote> <!--段落引用, 块元素-->

<br> <!--强行换行-->
<img src="">

<ul>
<li></li> <!--list item = li-->
<li></li>
</ul> <!--无序,unordered list = ul-->
<ol>
<li></li>
<li></li>
</ol> <!--有序, ordered list = ol-->
Read more »

git-note

Posted on 2016-05-18   |  

Ignore Some Files

1
2
3
4
vim .gitignore
git rm -r --cached .
git add .
git commit -m "ignore some files"
Read more »

Markdown

Posted on 2016-05-18   |  

如下

  • 图片
1
2
3
4
5
![a](gitclone.png)

![GitHub Octocat][2]

'[2]:http://github.global.ssl.fastly.net/images/modules/logos_page/Octocat.png'//引号不带
Read more »

latex

Posted on 2016-05-18   |  

LaTeX

Environment

  • mac上推荐使用MacTex
  • 编辑器个人更喜欢TexStudio
  • 为保证中文正常显示,把默认compiler设置为xelatex,文件编码保证为UTF8。
Read more »

java-basis

Posted on 2016-05-18   |  

Java Biscs

关于程序周期,当程序退出时执行某个方法

  • 有时候想要在程序退出时执行某些特定的操作,比如说关闭网络连接。
1
2
3
4
5
6
7
public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
public void run() {
System.out.println("In shutdown hook");
}
}, "Shutdown-thread"));
}
Read more »

singleton_java

Posted on 2016-05-18   |  

Singleton

Java 线程安全单例的实现

Simplest

1
2
3
4
5
6
7
8
9
10
public final class EagerSingleton 
{

private static EagerSingleton singObj = new EagerSingleton();
private EagerSingleton(){
}

public static EagerSingleton getSingleInstance(){
return singObj;
}
}
Read more »
Dai Dongyang

Dai Dongyang

10 posts
11 tags
RSS
© 2016 Dai Dongyang
Powered by Hexo
Theme - NexT.Mist