Skip to content

Instantly share code, notes, and snippets.

View zhehaowang's full-sized avatar
🤔
🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 😂

Zhehao Wang zhehaowang

🤔
🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 🤦‍♀️ 🤦‍♂️ 😂
View GitHub Profile
@zhehaowang
zhehaowang / test_echo_consumer_multiple_interests.py
Created September 2, 2015 16:09
Test echo consumer and producer for multiple times data in interest re-expression scenario
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2014-2015 Regents of the University of California.
# Author: Jeff Thompson <jefft0@remap.ucla.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@zhehaowang
zhehaowang / karatsuba-string-multiply.py
Created September 4, 2015 21:00
Karatsuba algorithm for leetcode problem "multiply strings"; stands to be improved
class Solution(object):
# Karatsuba multiplication implementation
minimumNumOfDigits = 10
def multiply(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
create-identity-test.html dbtestpage.html icn-cert-publisher.html
zhehao@memoria:/var/www/icn-tutorial/icn-tutorial-app/tests$ vi create-identity-test.html
zhehao@memoria:/var/www/icn-tutorial/icn-tutorial-app/tests$ vi create-identity-test.html
<?xml version = "1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
@zhehaowang
zhehaowang / build-process.md
Last active October 2, 2015 16:53
ndnrtc_ubuntu_quick_test

this is the working version for Zhehao based on Jiachen's image. May or may not work for others, or have runtime errors as it's being tested

Please compile webrtc, openfec, boost, ndn-cpp and other dependencies before moving to this

NDN-CPP-0.7

(without boost:: specification for int64_t definition as in Jiachne's version; Unverified for now.)

./configure --with-std-shared-ptr=no --with-std-function=no --with-boost-libdir=/home/jcw/boost_1_54_0/build/lib --prefix=$(pwd)/build
make
@zhehaowang
zhehaowang / naive_edl_parser_and_publisher.py
Created October 26, 2015 05:05
Sample edl parser and timed ndn publisher for FoS NP
import re
import json
import time
import getopt
import sys
import logging
import random
from pyndn import Name, Data, Interest, Exclude, KeyLocator
@zhehaowang
zhehaowang / test-interest-timeout-mechanism.cpp
Last active October 30, 2015 01:06
test of timeout with two instances of different classes sharing a face, trying to mimic the case in ConferenceDiscovery and chat
/**
* Quick test of timeout with two instances of different classes sharing a face
* with nfd-0.3.4 and ndn-cpp-0.7
*
* g++ -o test test-interest-timeout-mechanism.cpp -lndn-cpp
* (ndn-cpp with boost shared ptr and functions and libc++)
*/
#include <cstdlib>
#include <iostream>
@zhehaowang
zhehaowang / baidupan_url.py
Created November 11, 2015 01:04
BaiduPan Python API get download url, so that we don't need to use YunGuanJia
from baidupcsapi import PCS
pcs = PCS('XXX','XXX')
print pcs.quota().content
print pcs.list_files('/').content
headers = {'Range': 'bytes=0-99'}
ret = pcs.download('/README.md', headers=headers)
print(ret.text)
@zhehaowang
zhehaowang / repo_ng_insertion_and_check.py
Created January 16, 2016 05:34
Repo-ng insertion and check; based on basic_insertion.py
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2014-2015 Regents of the University of California.
# Author: Jeff Thompson <jefft0@remap.ucla.edu>
# Zhehao Wang <zhehao@cs.ucla.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@zhehaowang
zhehaowang / Creating and Configuring OpenWRT virtualbox
Last active August 11, 2022 18:59
Creating and Configuring OpenWRT virtualbox
Creating and Configuring OpenWRT virtualbox
http://hoverbear.org/2014/11/23/openwrt-in-virtualbox/
Given the setup, accessing local openwrt via ssh
ssh root@localhost -p 2222
scp -P 2222 somefile root@localhost:
@zhehaowang
zhehaowang / Link test in NDN-CPP
Last active March 15, 2016 21:19
ndn-cpp link test