Skip to content

Instantly share code, notes, and snippets.

View geminiwen's full-sized avatar
🎯
Focusing

Gemini Wen geminiwen

🎯
Focusing
View GitHub Profile
@geminiwen
geminiwen / Main.java
Last active September 30, 2022 06:21
RBTree
package com.gemini.demo;
public class Main {
public static void main(String[] args) {
// write your code here
TreeNode root = new TreeNode();
root.setColor(TreeNode.COLOR_BLACK);
root.setData(50);
package com.segmentfault.app.utils.json;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.annotation.JSONField;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.util.Iterator;
package com.segmentfault.app.view;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ImageView;
/**
var fs = require("fs");
var fd = fs.openSync("template.html","r");
fs.readFile("template.html", {encoding:"utf-8"},function(err,data){
if(err) {
console.err("error in open file with:" + err);
return;
}
data = data.replace(/\n/g, '\\n')
.replace(/<%=([\s\S]+?)%>/,function(match,code){
return "' + " + code + " + '";
@geminiwen
geminiwen / function_in_js.js
Last active December 24, 2015 01:49
Function Object in js
var a = function() {
};
var e = [];
e[0] = a;
e[1] = function() {
};
console.log(a == e[1]);
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#define BUFSIZE 1024
int main()