在15年前我们上中学的时候我们就已经被告知这条真理。但是正确的运用他却从未被认真对待。谋篇如摄影或绘画中的构图。如tactoth这类geeek所写的如这种《高速写作指南》，自然是最八股，最常见，最无技术含量的"总分总”格式。但是如果你想写点有风格的散文，肯定会有更好的组织结构 —— anyway，都应该先想清楚。
'Simple Chinese' here will be Google Translate friendly.
编 程和软件开发是我最热爱的话题，也是这个博客的志向所在。为了获得最广阔的读者，tactoth一直致力于用简单英语书写。可是由于tactoth语言能 力欠缺，导致汉语和英语为母语的访客都没有阅读本博客的兴趣（前者排斥自己不熟悉的语言，后者看不懂自己熟悉的语言@_@）。
Programming and software development are my favorite topic, and what this blog is for. To reach the biggest audience, this blog has been in simple English. Dues to my limited language skill, neither Chinese speakers nor English speakers are interested in reading this blog(The former leave when they see English; the latter leave because they see English they don't quite understand@_@).
因此tactoth决定用汉语写作本博客。这样母语为汉语的读者肯定会很高兴。 但是为了兼顾英语为母语的读者（比如某老外搜索某个Windows API进入本博客），本博客所用汉语为最简化版本。读者可以用右侧的谷歌翻译按钮直接翻译。为了对谷歌翻译友好，本博客会避免汉语中所有生僻字眼和复杂句 式。
That's why tactoth decided to make this blog be in Chinese, which Chinese readers definitely love. To make sure those who don't speak Chinese also can read this blog (Usually you are here because you searched for a Windowws API, C++ keyword, ...), the Chinese you see here is a 'simplified edition': rarely used words and complicated sentences has been carefully avoided so that it's directly translatable to English with Google Translate.
I wish you find pleasant reading experience, tech & programming stuff you were looking for, and fun in this blog!
We are a new company. In our first weeks we had daily progress meeting, on which people share the work they've finished and their plan. As new employees kept joining our development team, the meeting took longer and longer, so long that people think they wasted time listenning to things that's totally irrelevant to their work. So we decided to make that meeting be in smaller teams. For example, we desktop-client team could have our daily meeting, while the web UI team have theirs.
However what happened later is: other teams stopped having any meetings! We became the only team that continued meeting on a daily basis. Sometimes you feel the pressure of being 'the only one', but when you skip that meeting even for one day, you find performance and communication suffers.
After arround one month, one of the other team began to have their daily meeting too. The expressed the same concern: "It's very hard to let the project goal drive project progress and communication, which could be improved dramatically by daily face-to-face status update".
It's quite common that the company hired a group of new engineers to expand the team. Then how to train them so that they adapt themselves well in the company culture, understand the business quickly, and produce quality codes. Here's some tips.
1. Inform everyone duties of each division and individual, and principles of time management. This can quickly make everyone be self organized and motivated.
2. The business logic. All company knows how to inform engineers this part. Usually it's done by ask the new engineers to use the product.
3. Coding style. Soon after an engineer is hired he'll begin to code. Then making sure everyone work in the same coding style can help greatly on creat code that fit well to the company's existing system.
3. Code refactoring, Object oriented design, and the use of basic frameworks. Because engineers are from different companies, with different backgroud, this train is crucial for creating reusable and consistent code.
Nearly all morden frameworks provide built-in thread pool implementation. However C++ does't. Here's a list of implementations of thread pool in C++.
threadpool is a cross-platform C++ thread pool library based on Boost. The threadpool library provides a convenient way for dispatching asynchronous tasks. Pools can be customized, managed dynamically and easily integrated into your software. The library is used by several commercial server applicaions and an handle high work load without problems.
Sample code: #include "threadpool.hpp"
using namespace boost::threadpool;
void important_task(); void execute_prioritized()
// Create prioritized thread pool container without any threads.
scoped_pool<prio_pool, 0> tp;
// Add some tasks to the pool.
tp += prio_task_func(5, &normal_task);
tp += prio_task_func(100, &important_task);
tp += prio_task_func(7, &normal_task);
// Add the some threads to the pool. This will start the execution of the tasks.
// The tasks are processed according to their priority:
// important_task(100), nonrelevant_task(7), nonrelevant_task(5).
// Now all tasks are finished and the pool will be destroyed safely when tp goes out of scope.
Quite simple implementation based on lib_pthread. You can base your code on it and it's very likely some further modification is required. As is introduced in its homepage, it's:"An implementation of a thread-pool based on POSIX-threads. It builds a pool of p threads which are blocked until a job was given to the pool. Then an idle thread is chosen and the job is executed at this thread. If no idle thread is available, the pool blocks until one of the running jobs terminates." ffead-cpp http://code.google.com/p/ffead-cpp/
It's an ambitious project that aims to bring C++ to the world of web development. As is stated in it's introduction page:
"The framework is developed for rapid development of Enterprise application on the C++ platform. It is a c++ web framework, c++ application framework, c++ rest framework and c++ soap framework all bundled into one. It consists of the following and is currently implemented for LINUX/WINDOWS(Cygwin)
. It is the first and only
C++ Application framework to provide non-intrusive Dependency Injection and Business Driven Component Logic and POCO based Development
. Most of the features are controlled by configuration files." poco c++ libraries http://pocoproject.org/
Poco is a framework written in modern, standard ansi C++ using C++ standard library. The framework seems perfectly complete(compression, data access, ssl, crypto, xml, threading, ipc - Anything you could think of in application development, it incudes.) It uses Boost license, and seems has lots of users. Windows API http://msdn.microsoft.com/en-us/library/windows/desktop/ms686766%28v=vs.85%29.aspx
Supprisingly, Windows provides API for thread-pool management.And they have two sets of them. There was one shipped with Windows XP, and then in Windows Vista they upgrade the API by providing the second set. libcurl http://curl.haxx.se/libcurl/c/curl_multi_perform.html
If you are planning to use a thread-pool along with curl. The answer is, you don't need a thread-pool! This function provides all what you need. With asynchronous socket you can handle many connections with one thread, and curl has perfect support for this. It's fast, robust and handy.
Now smile :)
Obviously I'm not the kind of people who can enjoy a long trip - I'm so poor at planning it. But I went there! The aim of the trip is actually for some life stuff which the readers won't be interested. Anyway, I went there and traveled in the city for 2 days. And most part of the journey was nice.
We launched on Dec. 31 at night, spent the night in train, and arrived the second morning. It was really cold outside (-20 C), soon after we left the train my face was almost frozen. The air wasn't nice. You can smell the dusts from vehicles - even when you are inside a cab, which takes us to the place where we lived for 2 days.
The hotel was beside Songhua River. On our way to the hotel, we met Zheng Lvcheng Memorial Hall.
photos of the man
Should be him ... oh my Music teacher :D
Songhua River is big. In it it's all ice. No water. There's even cars moving above it, and there doesn't seem to be any problem. Here's some photos taken there.
Building with ice, they are everywhere in Harbin
On the river
Seems to be a cake
In the afternoon we went to Sofia Church. The church was surrounded by shopping malls but it manage to keep it's regional style. There're many pidgins on the roof. For a visit in the church you need to buy a ticket with 30 RMB. We bought and we entered. In the church it's like a big lobby, there were many people inside. A group of singers were singing on the platform in the center. I believe they sing well, though it's definitely not for me.
On the walls there're pictures telling the history of Harbin, the city in the very North of China, but grows to one of the 'second-biggest' cities in the country. From the pictures you know that there used to be a district in the city for Russian. But now you see less and less Russian. Nobody knows where they went. However there's still a Russian dacnging show. The cab driver said it's fantastic. However I never saw. - OMG, what a unfortunate trip.
BTW I didn't see many beautiful Russian girls :(
We had dinner at a restaurant in Center Avenue. It was a Russian restaurant. The food was good, but the price is no less than what's in Beijing: 400 RMB for 5 persons, including 4 adults and one 3-year-old girl, all simple Russian foods. So I guess the best place to enjoy nice food all over the world is still Beijing.
The restaurant, love it because it spells like 'tactoth'
Western Cold Steak?
Violin on the wall
After the meal, we saw this
Then it came the next. The original plan was to visit Sun Island. Then when we arrived there, we were told that the price is 240RMB per person. Usually it's 30RMB. The reason why it's much expensive is that there's a 'Snow sculpture show'. Many people decided to leave and we are among them of cause - we are poor, stingy, and lacks a taste of arts.
So we turn to Pole Show (130 RMB for each person, kids doesn't need a ticket). It's really a fantastic place.
promise me that you recognized me~
the two fat boys
the artificial scene is nice too
“my land, go away!”
Please .. let me be there
'you human is boring'
it's a real shark.. OMG, hope the glass is not made in china
For some reason my journey stopped after I visited the Pole Show. I also bought some nice stuff from Russian Shops, which is everywhere in the city.
things to give out~ it's not expensive but i'm a great friend, haha
When 8 years ago I was in college I never expected my self to be a programmer. When 4 years ago I started working for Autodesk as a software engineer I never expected it to be my life time career. So I'm quite surprised that I've being working as a software engineer for nearly 5 years and am determined to do it really well. 5 years, it's long, and thing happen in between teaches you something, here I list some conclusions.
1. Always do projects that brings most cash.
I started doing projects on TopCoder when I was in my last Year in Tongji University. The payment was actually excellent. I got 20k per month, even now after tax I don't make as much. However I choose to go to a big Corp. (Autodesk) to be a 'decent' software engineer. Sucks! - I don't mean Autodesk is bad, it an excellent company. However it's not the best for me, but I went there!
The logic is simple, people are willing to pay more cash for some project, it's because the project is more valuable. You should simply work on valuable project because then the experience you got is for more valuable things.
2. Impress your co-workers.
I believe that excellent engineers should earn big cash. Because of their solid programming skills, that can quickly build systems that seldom has bugs, are maintainable, robust, and create great value to the world. As long as there's someone realize some needs from the market, gather smart engineers to build them become crucial.
Your coworkers, knowing themselves to be excellent people, are always seeking this kind of market needs, and when they find it, make sure they believes you to be highly professional and have great team spirit.
3. When you've finally impressed someone, cherish it.
An valuable impression costs time and hard work to build up, and easy to destroy. I've lost something really big, then I know it's so valuable.
To be trusted, you must have been watched on for a few years. So always cherish things that you build up with time.
4. Quit bad companies ASAP.
Yes they do can manage to make the business run, because the boss is already rich and important. But what about you? Are you rich enough to kill time in this way? Do you enjoy wasting your time with no joy?
Don't judge a company by corporate culture/..., just by money. If it's about future money, make sure you can get it.
i now live dozens of meters away from here -_-
I've recently moved to Sanlitun
, not because I love night life, nor do I go there to save commute time - I send more time on the road actually (and unfortunately). I go there just because everywhere in Beijing has similarly high rent, and surprising enough, the rent different between Sanlitun and other places are minor.So it reminds me that - as I know, most people want to live a family life. I'm like those home builders. I want to make a powerful, comfortable and beautiful home. To be such it needs to be BIG, so big that it can hold lots of things I buy and build. But the expensive house price makes the dream impossible.
It upsets me.Each time I feels this frustration, I hope I'm teleworking. In that way I can connect myself to the most developed economy, and yet enjoy a peaceful family life, do some gardening/cooking/etc(which is absolutely a luxury for salary slaves in the city). I'll buy a car and actually drive it (In Beijing of cause it's impossible, there are too many.), and fixing it of cause will become a big source of fun too.This will be perfect! I believe in the future jobs that doesn't require employees to work in an office will provide such flexibility. More and more people will be working in front of a laptop in their garden, on the roof, in the kitchen(to smell the food his wife is cooking), or even in bath room?Probably I should build some software to make teleworking easier, for the world :D
“有一天我们有公司组织的篮球赛，我们在大街上走的时候，突然出现了很多女的，穿着短裙，上面是学生的打扮，在发传单，哈哈哈哈，你不知道他们传单上面写的是什么。。。 专车接送。。。。服务一流。。。 哈哈哈哈，据说东莞的话要更加夸张一些！我以前在西安有听到过这种事情，但是这种成群结队在大街上发传单的还真是少见”