- 博客(11)
- 资源 (9)
- 收藏
- 关注
原创 多线程,异步 boost::future::then, std::promise, std::async, std::future etc.
see link: http://www.tuicool.com/articles/6j2u2qa http://blog.csdn.net/gw569453350game/article/details/50052909如何编写异步执行的程序(main.cpp):#include <iostream>#include <string>#include <future> /
2015-12-30 17:01:43 6630 4
原创 设计模式——状态模式(有限状态机)
状态模式适用的情况:一个context对象根据其所处的状态改变其行为。在状态模式中,我们通过创建不同的state对象来表示不同的状态,而context对象则根据不同的state对象表现出不同的行为。状态模式将不同的状态结构化,以避免过多的 if else 和 switch case 等样版代码。用设计模式中的 状态模式(行为状态) 实现一个简单的状态机(fsm),其中 class Machine 为
2015-12-29 17:11:45 8293
原创 markdown 编辑器: remarkable 安装(ubuntu)
下载安装包 http://remarkableapp.github.io/linux/download.html安装之:dpkg -i remarkable_1.62_all.deb补上依赖项:sudo apt-get install -f运行:remarkable &
2015-12-25 16:26:37 11040
原创 c/c++ ,gettext,软件的多语言支持(i18n)
一个小例程,用于演示:cat >hello.cpp <<EOF// hello.cpp#include <libintl.h>#include <locale.h>#include <iostream>int main (){ setlocale(LC_ALL, ""); bindtextdomain("hello", "."); textdomain( "hel
2015-12-24 14:34:18 7623
原创 c/c++: uint8_t & uint16_t & int32_t etc.
c++ 中: 不要在 c++ 代码中使用 c 的头文件,会污染全局空间:#include <cstdint>using namespace std; // 或者使用 std::uint16_t 等// or#include <cstdint>using std::int32_t; c 中:#include <stdint.h>see link: http://stackoverflo
2015-12-22 14:11:53 7141
原创 不同国家的小数点的表示
12,345.67 English12.345,67 German 12345,67 French1,2345.67 Asia
2015-12-21 13:40:44 11430
原创 EMI/RFI (开关电源外壳带高压?)
在使用电子器件的时候都需要考虑高频干扰(EMI/RFI—— EMI一般为150 kHz 至 30 MHz; RFI一般为 30 MHz 至 1 GHz)。 电路中具有开关电路(如开关电源)的时候就会有产生这种高频干扰(其原理所致),所以需要设计高频抑制电路(通常为 L-C 电路)来过滤输掉高频交流纹波。 开关电源电路 和其中的 EMI Filter 见下图:开关电源电路图:EMI Filter:
2015-12-21 10:20:57 4819
翻译 hash function & unordered_map & map
std::map 是通过数据结构红黑树实现的(自平衡二叉查找树)。因此,一个数据结构能够作为map的key的前提是,该数据结构能够 copiable and assignable ,并且能够被用来比较大小( overrides operator< )。 注意,这里的 operator< 要满足 strict weak ordering ,即 if( !(x<y) && !(y<x) ) 等价于 x
2015-12-16 17:19:29 2833
原创 DC Motor 参数的理解
关于如何理解电机参数:http://www.robotshop.com/blog/en/how-do-i-interpret-dc-motor-specifications-3657如何正确计算期望电机参数: http://www.gearseds.com/files/Lesson3_Mathematical%20Models%20of%20Motors.pdf
2015-12-11 16:00:35 6341
转载 C++ Has Become More Pythonic ( tuple & 可变模板参数 )
尊重作者,转载自: http://preshing.com/20141202/cpp-has-become-more-pythonic/ True and Indeed!C++ has changed a lot in recent years. The last two revisions, C++11 and C++14, introduce so many new features that
2015-12-10 09:10:29 3089
原创 orocos 的数据表示(模板template): DataObject (还有一条主线为 DataSource)
数据有不同的type(int,double,struct…),还有 c-v qualifier, 还可以是 reference、pointer、array等等。因此,在处理数据的时候要正确区分每一种数据类型的处理方法。例如——不能对引用再取引用,不能对右值取引用等等:typedef typename boost::remove_const<typename boost::remove_referen
2015-12-07 15:14:23 3162
orocos rtt with xenomai & kuka lwr
2017-03-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人