Skip to content

Instantly share code, notes, and snippets.

View narutolby's full-sized avatar
🎯
Focusing

narutolby narutolby

🎯
Focusing
View GitHub Profile
@narutolby
narutolby / gist:8348153
Last active January 2, 2016 19:09
在有向图 ( 只有1 个开始节点, 1 个结束节点) 中判断任意两个节点是否为相同层次,不考虑环的情况,A,B为相同层次可以理解为经过A的数据流必然经过B,经过B的数据流也必然从经过了A例a>ba>cb>dc>d其中 b ,c 节点为并行节点,都完成之后到达 d 节点,其中a , d为相同层次 ,a,b;b,d;b,c 都不是相同层次另外一个例子a>ba>cb>cc>db>d其中 a,d 为相同层次,其他都不是
package com.baidu;
import java.util.*;
/**
* @author narutolby
*
* @since 2013-01-10
*

#<br>

  • br元素用来表示一行的换行符

  • 允许内容

  • 允许属性

/*
* request.js 为调用入口
* HttpClient.js 为封装类库
* 不支持https
* 使用方式:
* node request.js <URL>
* example: node request.js http://www.baidu.com
* 支持简单的添加cookie,没有解析domain,path,expire
*/
var HttpClient = require('./HttpClient.js');
var net = require('net');
module.exports = (function() {
var http = {
version: "1.0",
port: 80,
host: "127.0.0.1",
regExp: /http[s]?:\/\/([\w\.]+)(?:\:([\d]*))?.*/,
stExp: /(?:HTTP\/.*?\s+?(\d+))|(Location:(.*))/g,
cookieExp: /(?:Set-Cookie:)(.*?)(?=;)/g,
method: "GET",
###dddd###
define(['module'], function (module) {
'use strict';
var storage = (function(){
var uid = new Date,
result;
try {
localStorage.setItem(uid, uid);
result = localStorage.getItem(uid) == uid;
localStorage.removeItem(uid);