View change_pixel.py
import scipy.misc
def change_pixel(img, new_name):
"""
Args: img, numpy array
Returns:
new_img
View AnnotatedReview.py
class AnnotatedReview:
def __init__(self, sentence, feature_list, opinion_list):
self.sentence = sentence
self.feature_list = feature_list
self.opinion_list = opinion_list
def __str__(self):
return self.sentence
def __repr__(self):
View sniffer.py
from scapy.all import *
import atexit
#
packet_stats = {}
def print_stats():
print("\npacket statistics")
print(packet_stats)
View send-packet.py
from scapy.all import *
def main():
"""
"""
packet = IP(dst="192.168.100.123")/TCP()/"from scapy packet"
send(packet)
def packet_with_seq_n():
View ovs-example.md

install openvswitch 2.4

uninstall ovs-2.5

sudo apt autoremove  openvswitch-common openvswitch-switch-dpdk openvswitch-dbg openvswitch-pki openvswitch-ipsec openvswitch-switch openvswitch-switch-dpdk openvswitch-ipsec openvswitch-test openvswitch-testcontroller openvswitch-vtep

download source code

wget http://openvswitch.org/releases/openvswitch-2.4.0.tar.gz

unpack and compile

View install.md

Install vim vundle

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

config vimrc

add following into ~/.vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
View hunspell_config.md

install hunspell

brew install hunspell find the dictionary

en dictionary

then move dictionary to ~/Library/Spelling, thus hunspell can find it. using hunspell -D list search directories.

View Q1-e-p2
SELECT
p1.cid, p2.cid, p1.n + p2.n
FROM
(SELECT
cid, COUNT(Temp.pid) AS n
FROM
(SELECT DISTINCT
cid, pid
FROM
Purchase) AS Temp
View gist:67a859bcca05c1dd2ceaeff85faf5cee
  • Get an error while testing
Traceback (most recent call last):
  File "example/image-classification/train_mnist.py", line 1, in <module>
    import find_mxnet
  File "/Users/zarzen/Development/mxnet/example/image-classification/find_mxnet.py", line 2, in <module>
    import mxnet as mx
  File "/usr/local/lib/python2.7/site-packages/mxnet-0.7.0-py2.7.egg/mxnet/__init__.py", line 7, in <module>
    from .base import MXNetError
View spacemacs-org-pomodoro.org

Install mplayer

Download from sourceforge

Set Audio Player in .spacemacs

(setq org-pomodoro-audio-player "C:/Applications/mplayer/mplayer.exe ")

Write this code under dotspacemacs/user-config

Why not use VLC

vlc.exe only work with backslash in windows system, but org-pomodoro use slash as path separator.