Due to the recent research requirement, I need to replot and analysis signal of high sampling rate (several mega samples per seconds) with PCIe card.
I planned to use numpy and matplotlib to plot, but I was a bit worried on the capability of using npTDMS and matplotlib to processing big data (100MB to 1GB, but big data in modern sense)
A quick test shows it works (to draw array of several mega samples), seems not worse than NI AIdem for visualization, all subject to serious delay during zooming in. However, the loading is much slower, as npTDMS is pure python, not C API implemented.
And the program just consume as little memory as it is on disk size.
This python read from webcam and display into Qt4 widget(not highGUI) code is adapted from example code from : #http://wrdeoftheday.com/?page_id=2
since not all source code is attached, I complete the code and make it available for downland. This can serve as a better starting point for more complicated app.
zip password: iesensor.com
zip file: qtcvpy
follow the tutorial and make usbnet boot automatically
on my BBB debian wheezy:
sudo cat /etc/modprobe.d/usbnet.conf
#auto load usbnet
options g_multi file=/usbnet.img stall=0
#there is a usbnet.img already there under /
1. parse the ansys fluent profile text file into python list of dict; draw velocity profiles by matplatlib (“see source code of draw_profile.py”)
2. generate tecplot batch and macro file to draw contours automatically in batch mode. (see “vizCFDbytecplot.py”)
download the source file here,
I hope it can inspire you, but it will not serve you directly.
Edit some variables at the beginning of source code should make it work for you.
you need to record your own tecplot macro to style the plot.
Qingfeng Xia 2013
“CFD study of synthetic jet at low Reynolds numbers”
University of Manchester
(1)install unofficial python extension package binary installer
by Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine.
MinGWmay be not compatible with python pip compiler: -mno-cygwin
remove the official mingw from path. or install mingw built for python
Windows GCC (MinGW) binaries for Python developers gcc4.3
(3) Remove the
Python\Lib\distutils\cygwinccompiler.py causes this problem: see Compiling with cython and mingw produces gcc: error: unrecognized command line option ‘-mno-cygwin’ or http://korbinin.blogspot.com/2013/03/cython-mno-cygwin-problems.html.
My Python distribution (Anaconda)’s
cygwinccompiler.py does not have that though. Anyway, after removing all
-mno-cygwin in the definition of the
Mingw32CCompiler class you should be able to compile.
In a nutshell, Linux programmers will love RT-Thread API.
- Thread in RT-Thread works like POSIX thread: #include <posix_types.h>
- Each thread has TCB (task control block), like Linux kernel thread, share the global memory, but has its own stack (pre-decleared array with fixed size), has event and timer for each thread; Thescheduler, which uses bitmap algorithm, is similar with Linux kernel
- RT-Thread is high performance RTOS, mainly focusing on ARM cortex-M 32bit CPU.
- RTGUI/FTK (object-oriented style widget, just like GTK+)
- Device model like Linux device tree.
- IPv4 and IPv6 are supported by lwIP lib with <socket.h>, but 6LowPAN is not supported as Contiki.
- Simulator on Linux and Windows (32bit x86 only) and good documentation.
- Python scons building system; but it is easier than Makefile to control multiple targets building.
Most important, it is free even for commercial usage, via applying free license and keep RT-thread banner.
Finally, this is the host place: https://github.com/RT-Thread
Since there is only one hardware SPI, but it is used by Ethernet or Wifi shield. If you wantto conenct some other sensors via SPI, the Ethernet lib is reluctant to cooperate.
So a software bit-banging library may be necessary.
Four SPI modes are supported, just change the macro definition in header file.
I am tired to upload figures , I just give it as PDF file with figures inside
Setup Codelite to work with visual studio toolset (totorial version)
git clone https://github.com/qingfengxia/pinyin.py.git
Pinyin python module
Origin: Author:cleverdeng E-mail:firstname.lastname@example.org (not reachable)
forked by Qingfeng Xia based on v0.9:
(1)renamed class name from PinYin to Pinyin,
(2)dict file "word.data" is renamed as "pinyin.data"
(3) add encoding support, or it will not work for windows cmd prompt!
(4) move load_word() (renamed as loaddict() ) into __init__(), to make API concise
(5) word.data "ord(UNICODE)= list of pinyin", for quick loading and human readable check
why some unicode has multiple pinyin units???
copy the two files: pinyin.py, pinyin.data , into your project folder, or under $PYTHONPATH , or your sitepackages
test: testing code is under __main__ section
python -m pinyin.py
as a further explanation to:
” Comparsion of DateTime classes in popular programming Languages (1)”
This part is a copy and paste of lang/lib spec.
(1) Table comparison
(2) Further explanation from each language spec
Joda package for (Java) is not described here, whose API is analoguous to Qt and Python. As there is new API of LocalDateTime, it is the equivalent to QDatetime, and python’s datetime.
Table: Comparsion of DateTime classes in popular programming Languages
Author: Qingfeng Xia 2013 Versioin 0.1 http://www.iesensor.com
see attached word doc
Table Comparison of DateTime classes in popular programming Languages
Previous C++ standard is C++03 (2003); previous C std is C99.They are not released together, but they did this time as a combo of C11 and C++11.
__STDC_VERSION__ == 201112L
C11 (formerly C1X) is an informal name for ISO/IEC 9899:2011 (see wiki)
git clone https://github.com/qingfengxia/arduinorobotcar.git
Datasheets (most of them in Chinedse) for robot parts makes the git size big
Recently, I have been working on Arduino 2/4 wheel car robot in my spare time.
Robot car composing 4 DCMotors, Senors, ServoArm, BlueTooth remote control
(1) two/four wheel driving car steering,
There is no designated positive or negative pole for DC motor, swapping pin1 and pin2 can made motor rotate reversely
(2) sensors: using PID for sensor fusion ,
a) altrasound range sensors included
b) acceleration or angle speed
c) Infrared receiver
(3) Control by Infrared remote or PC control via bluetooth
(4) usb Camera supervision using Raspberry Pi usb wifi
(5) voice command recogniation by raspberry Pi connected to internet
I have made a C++ library class for Melexis90620 (in order to use multiple sensors simultanuously ), a test program to demo this class, python program to show the contour.
Also, I made I2C C program to control itby Raspberry PI, but raspberry Pi can not read from RAM (reading EEPROM is fine).
A new plan under evaluation is to use 4 Melexis90620 togother to make 16X16 pixel IR camera. The only obstacle is to change the I2C slave address. I saw some guy has change the address of Melexis90614. I dump EEPROM of reserved addr, I found some byte should be addr, but I dont know how to write EEPROM. (command sequence)
see “Count with me: how many smart pointer classes does Qt have?”
||Qt Object , guarded pointer,
set NULL after delete/deconstruction
However, pointed resource not released
||reference-counted strong sharing of pointers
||reference-counted weak sharing of pointers
||Qt (Implicit Sharing) copy-on-write
Introduction to smart pointers: http://en.wikipedia.org/wiki/Smart_pointer
|| Not recommended in C++11
||Intended for Garbage collection
||non-copyable, but can be transfered
||Equal to QScopedPointer
neither copyable nor movable.
Threading is always tricky, I dare not comment on this topics.
If some useful articles are found, this page will be updated!
just read the article: < Understand the Qt containers >
a)Qt Containers: implicitly shared (Copy-On-Write) !
b) size type: QT return signed int, while STL return size_t (unsigned int)
(2)Qt has C++ STL style API, stick to these API style(3) Usage QVector instead of QList as much as possible
Qt containers and their STL counterparts
The following table summarises the main sequential and associative Qt containers and their STL counterparts. For the most part, we will ignore the string classes, even though technically, they are also containers.
QFile is the class for everyday File IO, while C++ STL using stream
===========based class: std::stream =========
<iostream> (qDebug() or #include <iostream> cin/cout )
<boost/archive> ( QDataStream for serialization )
The QIODevice class is the base interface class of all I/O devices in Qt.
Inherited by: Q3Socket, Q3SocketDevice,
QAbstractSocket, QBuffer, QFile, QLocalSocket, QNetworkReply,
and QProcess ( just like bash shell pipe input and output, Python).