- 博客(28)
- 收藏
- 关注
原创 How to do non greedy regex match in command line
I want to do a non greedy regex replace on a text file. But “sed” does not work.“perl” is suitable for this:out of place:perl -pe 's|textA.+?textB|textC|g' file in place:perl -pe 's|textA.+?textB|textC
2016-11-09 07:44:57
330
原创 How-to create a Windows 10 usb installation media in Linux
create a Windows 10 usb installation media in Linux
2016-10-27 19:35:08
998
转载 Career Management Lession 2/6 - Forge Relationships
Forge Relationships Career success is complex today—you’ll encounter many opportunities and navigate lots of change. Discover how to enlist smart people to help you on your journey.
2016-10-27 10:34:29
576
转载 Career Management Lession 1/6 - Chart Your Career Path
Chart Your Career Path Don’t wait for someone else to decide the direction of your career. When it comes to managing your career, you are in charge.
2016-10-26 20:55:42
537
转载 Career management
Career management is the combination of structured planning and the active management choice of one’s own professional career.
2016-10-26 20:18:04
761
原创 Generate C enum define from python dict
First we need to prepare the dict, then sort and format it: text = """#ifndef bb2421a299d24d4abbe59c3721a794f9#define bb2421a299d24d4abbe59c3721a794f9enum {{{}}};#endif//bb2421a299d24d4abbe5
2015-09-24 12:01:32
367
原创 How to disable compiler optimization for a piece of code
Preface:In a C++ project, a source file contains a very large array, which contains unions, template function pointers ..., on Windows & Mac, the compilation time is 20 minutes, but on Linux, it's 2
2015-09-21 19:59:49
1072
转载 Xen in WiFi networks
From: Xen in WiFi networksSuccessfully running Xen on a machine with a single WiFi card can be tricky. In my situation the network indom0 worked fine but in domU I could only see incoming pa
2015-01-23 19:28:31
530
原创 ipmi IP setup
I have acquired a static IP for IPMI, then try to configure it in Linux.ipmitool lan set 1 access off ## must set, or the following command will have no effect.ipmitool lan set 1 ipsrc static
2014-12-24 17:23:38
624
原创 IPMI SOL setup in Ubuntu Linux
Pre-request:Server has IPMI SOL feature.Client setup:sudo aptitude install ipmitoolServer setup:Enter BIOS setup, enable console redirect, SOL, and set serial connection parameters.In Ub
2014-12-19 11:22:55
1984
转载 C++ template instanctiation process
From: http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.htmlNext: Bound member functions,Previous: C++ Interface,Up: C++ Extensions7.5 Where's the Template?C++ templates are the
2014-12-03 13:15:49
685
转载 Visual Studio 2013 has a powerful code analyis tool
From MSDN: Analyzing Managed Code Quality by Using Code Analysis
2014-11-21 16:44:35
573
原创 example: call cuda toolkit curand API from common lisp
continue example: call cuda toolkit API from python, curand
2014-10-16 11:48:27
779
转载 Common Lisp the Language, 2nd Edition
Common Lisp the Language, 2nd Edition
2014-10-12 13:01:08
744
转载 Native Client (NaCl) is an open-source technology for running native compiled code in the browser
Technical Overview
2014-10-06 17:21:04
514
转载 Mounting Individual Parititons in RAW Disk Images
From: http://blog.lifebloodnetworks.com/?p=934Let us say, for the sake of simplicity, that you backup whole disks by using dd in Linux. Now let us assume that you need just a single file out o
2014-09-25 22:14:53
448
原创 My X window config: .xinitrc
First, install stumpwm, xrandr .then, add a file ~/.xi
2014-09-18 14:55:07
938
原创 C++: Function as template parameter, example
Function as template parameter.Code:#include template D Funcall(F f, D a, D b) { return f(a, b);}template D Add(D a, D b) { return a + b;}template D Sub(D a, D b) { return a - b;}i
2014-09-07 14:45:42
763
原创 C++ 11: simple map reduce functions
Try to simulate common lisp's map/reduce functions in C++11.#include #include #include #include #include #include template T reduce(std::function afun, std::list& somenums, T init = 0) { T
2014-09-02 15:30:38
1714
原创 C++ 11 : Variadic Templates , Example
In Lisp, we can use variadic function parameters like this:
2014-09-01 16:30:52
582
原创 C++: template meta programming, emample 1
#include template struct Factorial { enum { value = N * Factorial::value };};template <>struct Factorial { enum { value = 1 };};int main() { std::cout ::value << std::endl;
2014-08-31 11:13:39
646
原创 C++ 11: lexical closure in lambda function, example 1
We know#include #include auto makeAdder = [](int n) { return [=](int val) { return val + n; };};int main() { int n = 0; std::cin >> n; auto addn = makeAdder(n); std::cou
2014-08-30 21:26:08
615
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人