Skip to content

Instantly share code, notes, and snippets.

<?php
function pre_print_r($var){
echo "<pre>";
print_r($var);
echo "</pre>";
}
class Obj1 {
public function __call($method,$arg){
return $this; }}
<?php
function pre_print_r($var){
echo "<pre>";
print_r($var);
echo "</pre>";
}
function Bigrams($word){
<?php
function pre_print_r($var){
echo "<pre>";
print_r($var);
echo "</pre>";
echo "<br />";
}
/*
http://www.w3school.com.cn/php/func_array_splice.asp
<?php
//php中php_array(1,$arr)只能查找出数组中第一次出现的$tofind;
$arr = array(1,2,3,4,1,1,1,1);
var_dump(array_search_all($arr,3));
//返回 value符合的key所组成的数组;
library(XML)
#获取当前链接的所有评论
get_one_page_comment<-function(url){
html<-htmlParse(url)
resnodes<-getNodeSet(html,"//div[@class='review-sec']//div[@class='inner']//div[@class='body']//p[@class='read']//span[@class='read-more']//a[@class='cmn-viewmore']")
#获取当前页面中所有comment的长文链接
comments_url<-NULL
if(is.null(resnodes)){
@panfeng
panfeng / D3Learning.html
Created October 8, 2013 18:34
Tributary inlet
<!doctype html>
<html>
<head>
<title>D3 tutorial</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<p> This a paragraph</p>
<script>
d3.json("./data.json",function(data){
<!DOCTYPE html>
<html>
<head>
<link type='text/css' rel='stylesheet' href='style.css'/>
<title>More Coin Flips</title>
</head>
<body>
<p>We will keep flipping a coin as long as the result is heads!</p>
<?php
$flipCount = 0;
var xpath_query = '//ul/li/a';
var xpath_obj = document.evaluate(xpath_query ,document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
var href_list = [];
for (var m=0; m<xpath_obj.snapshotLength; m++){
href_list[m] = xpath_obj.snapshotItem(m).getAttribute("href");
}
<?php
$volcabulary =array (
0 => 'Handelsfreiheit',
1 => 'Handel (Händler)',
2 => 'Handel, auswärtiger',
3 => 'Handelsbilanz',
4 => 'Handelskapital',
5 => 'Zweck',
6 => 'Zyklus, industrieller',
@panfeng
panfeng / Note_of_Math_For_Programmers.md
Last active August 29, 2015 14:07
Note of Math For Programmers

Math For Programmers

Virtual Memory from 0 to n, map fromm virtual memory to physical memory

####Inside of Memory Location bit: 1/0

Memory Location: 8bits = 1byte Registers 64bits = 8bytes