Quickfix protocol in python

Quickfix official website: quickfixengine.

Quickfix python API install

Orignially, quickfix is a C++ implementation. So, quickfix module in python is an API to call class and functions of C-module.

For Windows

For windows, no offical guide for compilation yet. Easiest way is using offical built binary package (python 2.7):
x86 & amd64

Installation: pip install quickfix-1.14.3-cp27-none-win_amd64.whl

For Linux

Requirement: gcc, gcc-c++, python-devel (centOS 6)

Installation: pii install quickfix. Then compilcation will start automatically.

Specail case in VPS or Cloud server. Since for a virtual instance, the memory may be small, say less than 1G. Swap is disable by default. Thus, an error might occur because of lack of memory.

1
gcc: Intermal error: Killed (program cc1plus)

To temporarily increase the swap memory:

1
2
3
dd if=/dev/zero of=/var/swapfile bs=64M count=32 #Creating 4G memory
mkswap /var/swapfile
swapon /var/swapfile

To release aforementioned memory:

1
2
swapoff /var/swapfile
rm /var/swapfile

For Cygwin

The way is same as for linux: pip install quickfix

Usage of quickfix module

For python, an application should be built as shown in the doc.
Some usage to get message field:

1
2
3
4
5
6
7
8
9
10
import quickfix as fix

msgType = fix.MsgType() # Define msgType
sendingTime = fix.SendingTime() # Define sendingTime
message.getHeader().getField(msgType)
message.getHeader().getField(SendingTime)

# To obtain value
msgType.getValue()
sendingTime.getString()

Auto-layout Script Pushed to Github

Auto-layout script is pushed to Github

This script can help automatically run DRC and LVS with Calibre flow, also 100% compatible with Cadence Layout XL.

The simple usage is typing make all TOP_MODULE=XX and assigning TOP_MODULE name.

Welcome follow and fork.

Python Learning Miscellaneous

Start to learn Python this week, from very fundamental knowledge. Mark issues I meet in this hard and happy process. :)

Encoding for Chinese

Difference systems have different method of encoding. Windows is GBK and linux is UTF8. Whether Chinese can be displayed normally is depended on the correct encoding way. The translate method is:

1
2
3
l_example = "中文" #Original GBK
print l_example #for Windos
print l_example.decode('gbk').encode('utf8') #for Linux

Read more

Phase Theme Optimization

Add Google Analylytics Code

The easiest way is to put Google’s Js code into one main js file, so that every page will include this source code.

  1. Create google.anlysis.js and this file in:

    1
    ..\themes\phase\source\js\google.anlysis.js
  2. Put Google source code into google.anlysis.js

  3. Inculde google.anlysis.js in

    1
    2
    ..\themes\phase\layout\_partial\after_footer.ejs
    <script src="<%- config.root %>js/google.anlysis.js"></script>

Done.

Add Read More

Replace the below codes in layout\_partial\article.ejs

1
2
3
4
5
<% if (item.excerpt && index){ %>
<%- item.excerpt %>
<% } else { %>
<%- item.content %>
<% } %>

to

1
2
3
4
5
6
7
8
<% if (item.excerpt && index){ %>
<%- item.excerpt %>
<p class="article-more-link">
<a href="<%- config.root %><%- item.path %>#more"><%= 'read more' %></a>
</p>
<% } else { %>
<%- item.content %>
<% } %>

Usage of Read More: add <!--more--> in markdown file.

Read more

Hello Junmin Blog

Welcome to My Blog! This is sub-part of my personal website. Some staffs not raleted to my research area will
be posted here. :)

For my research information, please refer to my bio.