1+1=10

记记笔记,放松一下...

Qt Macro: Q_DECLARE_METATYPE

QMetaType

  • It associates a type name to a type ID, enabling construction and destruction to occur dynamically at runtime.
  • QMetaType is used as a helper in QVariant and queued signals and slots connections.

example1:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16 …

Qt Macro: Q_DECLARE_TYPEINFO

Definition

Q_DECLARE_TYPEINFO is used to specialise a template class called QTypeInfo.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) \
class QTypeInfo<TYPE > \
{ \
public: \
    enum { \
        isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0), \
        isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
        isLarge = (sizeof(TYPE …

screen.css used by octopress

screen.css

The css file used by octopress blog with the default theme is called screen.css, which locates in source/stylesheets/screen.css.

screen.scss

The screen.scss file, which locates in sass/screen.scss, is used to generate the above css file.

 1
 2
 3
 4
 5
 6 …

My first C Extension To Numpy

A Simple Example

Let's create an extension module called opee and let's say we want to create a Python interface to one C function example. This function takes a numpy array as argument and return an integer. We want this function to be callable from Python as follows:

1
2 …

Sandbox: For Octopress Usage and Markdown Syntax Test

Note: I had switched from Octopress to Pelican since 2015, so this page is not valid any more. Contents in this pages had been changed in order to make pelican happy.

Table Test

Source Code:

1
2
3
4
5
6
Left Aligned Header | Center Header | Right Aligned Header
:-------------------|:-------------:|--------------------:
Cell …

Setup and Configure My Octopress Blog

I am using Mac OS X 10.8, Ubuntu 12.10 and Windows Vista at present. I want to have a simple blog which can be coutrolled by myself …

Install Ruby 1.9.3

Octopress depends on Ruby 1.9.2 or newer.

Mac X 10.8

The Ruby provided …

VirtualBox的网络设置

VirtualBox 可以为每一个Guest分配多达8个网卡(界面上只显示了4个,其他需要通过VBoxManager modifyvm进行配置),每个网卡的连接方式可以选为下列之一:

  • Not attached
  • NAT
  • NAT Network
  • Bridged Adapter
  • Internal Network …

Apache配置入门笔记

随便记录一下,不求严谨,但求无原则性错误。-- DebaoZhang 20111023

Apache是一个http服务器,在无连接的时候,它除了监听配置文件中指定的IP地址和TCP端口号外不做任何工作;当一个请求出现在 …

从C++到Qt

原文发布在百度空间,但由于百度空间屡次改版,越改越差,以至于有关闭可能,故而转移到此 http://blog.debao.me

Qt 是 C++ 的库,Qt 在 ansi …