Skip to content

Instantly share code, notes, and snippets.

@gooooloo
gooooloo / DemoApproximateInDeepVoice.java
Last active May 4, 2017
Codes to implement the approximation of exp(x),tanh(x),sigmoid of DeepVoice paper https://arxiv.org/pdf/1702.07825.pdf
View DemoApproximateInDeepVoice.java
/**
* Codes to implement the approximation of compute(x) of paper https://arxiv.org/pdf/1702.07825.pdf
*/
import java.util.Random;
public class Test {
static float eTilde(float x) {
final float x2 = x * x;
final float x4 = x2 * x2;
View 打印螺旋矩阵2
public class Untitled {
public static void main(String[] args) {
final int N = 9;
int[][] a = new int[N][N];
int x = -1; int y = 0;
int dx = 0; int dy = -1;
int k = 1;
@gooooloo
gooooloo / MyLineInfo.java
Created Aug 19, 2016
get JAVA Line info for log.
View MyLineInfo.java
package info.gooooloo;
public class MyLineInfo {
public static String info() {
final StackTraceElement element = new Exception().getStackTrace()[1];
return String.format("%s#%s,%s:%d",
element.getClassName(),
element.getMethodName(),
element.getFileName(),
element.getLineNumber());
View httpsInLaymensTerms.markdown

HTTPS in laymen's terms

###HTTP的问题:

  • 传输过程没加密
  • 不能确保对方是正牌的服务器
  • 不能确保传输过程中没有被调包

举个例子讲就是,你要让快递把一个包裹寄给你朋友。有如下问题:

View 打印螺旋矩阵.java
package com.qidu.lin;
public class PrinterNumbers
{
/**
* 打印螺旋矩阵
0 31 30 29 28 27 26 25 24
1 32 55 54 53 52 51 50 23
2 33 56 71 70 69 68 49 22
3 34 57 72 79 78 67 48 21
@gooooloo
gooooloo / 用写信的方式理解网络编程.markdown
Last active Sep 18, 2015
Understanding network programming as mail system
View 用写信的方式理解网络编程.markdown

Understanding network programming as mail system

用写信的方式理解网络编程

2014/3/14

I have NO experience on network programming at all. Recently I learnt something, they are interesting. I am trying to summarize what I have learned as my own understanding way -- the mail system. Special thanks to Barteur Zhou.

我以前从没有过网络编程的经验和知识。最近学了一些,还挺好玩的。在这里,我想试试用自己的理解方式来总结下我近来所学的知识 -- 用写信的方式来类比。特别感谢 Barteur Zhou。

ip & port for net