2014年11月12日 星期三

django + scrapy + celery + redis +

# setup virtual env
mkdir test
cd test
virtualenv .env
source .env/bin/activate

# install scrapy
pip uninstall lxml
STATIC_DEPS=true pip install -U lxml
pip install scrapy
pip install service_identity
# install mongodb
brew install mongodb --with-openssl
pip install pymongo
pip install mongoengine

#install celery
port install openssl  
pip install celery
pip install celery-with-mongodb

#install django

# install 3rd part libs
pip install pandas
pip install numpy
pip install zipline
port install cython
port install TA-Lib
easy_install TA-Lib

# install supervisor
pip install supervisor

# explore $PATH
.bash_profile
export PATH=".env/bin:/Users/seanchen/anaconda/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:$PATH"
export PATH="$PATH:/Users/seanchen/tool/mongodb/mongodb-osx-x86_64-2.6.4/bin:/Users/seanchen/prj/talib/src/ta-lib/bin"

export LD_LIBRARY_PATH=".env/lib:/usr/local/lib:$LD_LIBRARY_PATH" 

export C_FORCE_ROOT=true

2014年6月10日 星期二

remoteLED


  • remote LED
    • Server
      • raspberry pi control LED on/off
      • control GPIO pin 16, 18 to turn on/off led
    • client 
      • android phone
      • send remote control command to Server
  • prj path
    • https://github.com/funningboy/remoteLED

2014年2月9日 星期日

raspberry pi + microcontroller


  • RAM size 256/512 
    • http://openenergymonitor.blogspot.tw/2013/10/raspberry-pi-new-type-of-ram.html
  • FTDI USB 2 UART adaptor (JTAG) shared with GPIO
    • http://www.ftdichip.com/Products/Modules/RPi.htm
    • FT232 JTAG
      • https://github.com/progranism/FT232R-JTAG
      • https://github.com/dwelch67/raspberrypi/tree/master/armjtag
  • openOCD
    • JTAG driver
    • USB or the Parallel Printer Port (USB to rs232)
    • arm instruction disassembly
    • http://visualgdb.com/tutorials/arm/openocd/
    • http://openenergymonitor.blogspot.tw/2013/10/raspberry-pi-new-type-of-ram.html
  • mount JTAG with GDB(Eclipse)
    • http://www.ethernut.de/en/tools/eclipse/confdebug.html
  • convert arm assembly to c
    • Hex-Rays
    • https://www.hex-rays.com/products/decompiler/compare_arm0.shtml
  • bootloader

  • adafruit (extend hardware models,such as motor, led, mcu)
    • GPIO export
    • http://www.adafruit.com/
    • http://learn.adafruit.com/category/learn-raspberry-pi


  • 開發板教學
    • http://ruten-proteus.blogspot.tw/

xbus UVM example

purpose

a sample bus UVM/SV verification env that contains direct pattern, random pattern, trx replay pattern

pattern definition

  1. direct pattern : normal read/write test, like read after write test, the expected and answer had already known
  2. random pattern : random test based on it's constrain rule set
  3. trx replay pattern : replay trx via DPI interface supported

how to run it?

1.you can check our testsuites first, we provide three kinds of test at path ./sv/pat
1.1. for direct pattern +UVM_TESTNAME=test_xbus_normal_rw_seq_lib
1.2. for random pattern +UVM_TESTNAME=test_xbus_random_rw_seq_lib
1.3. for trx replay pattern +UVM_TESTNAME=test_xbus_adaptor_seq_lib
2.setup irun env please make sure your irun version is > 12.x
3.% irun -f run.f

carCV

purpose

car and lane detection example
ScreenShot

method

-lane detection
  • houghlines
  • houghlinesP
  • fitlines
-car detection
  • haar cascades

how to run it?

step1. get video source %python get_video.py
step2. lane detection %python detect_lane.py
step3. car detection %python detect_car.py
Ref

remote openCV with raspberry pi




this is an example about how to use remote object detection based on openCV and zeromq framework.

requirements

  • opencv(python) as cv(opencv) and cv2(numpy)
  • zeromq(python)
  • gevent(light weight switch)
  • knowledge about img process
  • profile, logging each stage mem and cpu time

method

  • Server
    • capture img
    • send img to clinet
    • wait for next command from client
    • update status by new command
  • Client
    • receive img
    • run all detection
    • build up a new command based on detection results

detections

  • face detect
  • circle detect
  • line detect
  • find attribute obj

how to run it?

  • python poll_camera.py (using cv to capture/show img via remote protocol)
  • python poll_camera2.py (using cv2 to capture/show img ...)
  • python poll_thread_run2.py (using cv2 to run all thread detection based on CPU num)
  • python poll_series_run2.py (using cv2 to run all series detection ...)