printf»µÄ¶íÂÞ˹·½¿é(linuxÒì²½I/O,C++)
Õâ¸ö·½¿éÓÎÏ·ÊÇÓÃlinuxÖն˵Ĺâ±ê¿ØÖÆ¡¢ÑÕÉ«ÉèÖÃ×öµÄ
(ÌíÁ˸ö¹¦ÄÜ£¬×ÖĸPÔÝÍ£¡¢»Ö¸´ÓÎÏ·)
Óà A S D W ¿ØÖÆÒƶ¯¡¢×ªÏò£¬¿Õ¸ñ¼üÏÂ×¹µ½µ×£»
linuxµÄÒì²½aioº¯Êý½â¾öÁ˺ܶàÂé·³£»
ÓÃÁ˸ö¼òµ¥µÄÄ£°åµ¥Àýģʽ£¬¼Ì³ÐËü¾Í¿ÉÒÔ£»
¶ÔPOSIXÏ̼߳òµ¥·â×°³ÉjavaÏ߳̽ӿڣ»
#include <memory>
#include "Tetris.h"
#include "TtyAuto.h"
static void instruction()
{
// һЩ˵Ã÷ÐÔÎÄ×Ö
printf("\033[2J");
printf("\033[4;34;47m%s\033[0m", "\t\t\tYou can use the key 'A','S','D','W' to control the block.\n\n\t\t\tPress space key make the block down to bottom.\n\n\t\t\t'P' to pause the game.\n\n");
printf("\033[5;34;41m%s\033[0m", "\t\t\tPRESS ANY KEY TO START GAME...\n\n" );
getchar();
}
int main(int ac, char *av[])
{
std::auto_ptr<TtyAuto> autoAdjustTty(TtyAuto::getInstance());
instruction();
// ÓÎÏ·¿ªÊ¼
Tetris game;
game.start();
game.join();
printf("\r\t\t\t\t\t\r");
return 0;
}
#ifndef BERT_THREAD_H
#define BERT_THREAD_H
#include <pthread.h>
/**
* Ï̷߳â×°£¬½Ó¿ÚÄ£·ÂJAVA
*/
class Runnable
{
public:
virtual ~Runnable() { }
/**
* Ïß³ÌÂß¼ÔÚ´ËʵÏÖ
*/
virtual void run() = 0;
};
class Thread: public Runnable
{
/**
* ±¾Ïß³ÌID
*/
pthread_t m_tid;
/**
* ÊÇ·ñÔÚÔËÐеıêÖ¾
*/
bool running;
/**
* Ï̺߳¯Êý£¬ÄÚ²¿µ÷ÓÃrun
*/
static void * threadFunc(void * arg);
public:
Thread();
~Thread();
/**
* ˯Ãß Ãë
*/
static unsigned int sleep( unsigned int seconds);
/**
* ˯ÃߺÁÃë
*/
static unsigned int msleep( unsigned int mSeconds);
/**
* Æô¶¯Ïß³Ì
*/
bool start() ;
/**
* µÈ´ý±¾Ïß³ÌÔËÐÐÍê
*/
void join() const;
/**
* ÊÇ·ñÔÚÔËÐÐ
*/
bool isAlive() const
{
return running;
Ïà¹ØÎĵµ£º
/bin ´æ·Å×î³£ÓõÄÃüÁ´ËĿ¼ÏµÄÃüÁîËùÓÐÓû§¶¼ÓÐÖ´ÐеÄȨÏÞ
/boot LinuxϵͳÒýµ¼Ä¿Â¼£¬´ËĿ¼±£´æϵͳÆô¶¯Ê±µÄÄÚºËÎļþºÍÄÚºËÓ³ÏñÎļþ¼°Æô¶¯Ê±ËùÐèµÄÆäËüÎļþ
/dev É豸Îļþ£¬±£´æËùÓеÄÓ²¼þÉ豸Îļþ£¬ÈçÓ²ÅÌÉ豸Îļþ£¬ÈíÇý¡¢¹âÇýÉ豸ÎļþµÈµÈ
/etc ......
Linux¶àÏ̱߳à³Ì¼¼Êõ×ܽá
1
¡¢Ï̵߳Ĵ´½¨¡¢ÖÕÖ¹¼°¿ØÖÆ£º
Èκνø³ÌÔÚÆô¶¯Ê±¾ÍÒÑÓÐÁËÒ»¸öÖ÷Ị̈߳¬Èç¹ûÐèÒªÔÙÉú³ÉÏß³ÌÔòʹÓÃ
pthread_create
º¯Êý£¬Ôڸú¯ÊýÖпÉÒÔÖ¸¶¨Ï̵߳ÄÊôÐÔ¡¢Ïß³ÌÀý³Ì¡¢´«¸øÏß³ÌÀý³ÌµÄ²ÎÊý¡£Ïß³ÌÀý³ÌÊÇÒ»¸öÓû§×Ô¶¨ÒåµÄº¯Êý£¬¼°Ïß³ÌÖ´ÐеĴúÂë¡£µ±Ïß³ÌÀý³Ì· ......
Linux shell½Å±¾È«Ãæѧϰ
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡¡¡·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
¡¡¡¡µ±±à¼ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐ ......
Ô´´ÎÄÕ£¬×ªÔØÇë×¢Ã÷³ö´¦£¬Ð»Ð»£¡
×÷ÕߣºÇåÁÖ£¬²©¿ÍÃû£º·É¿Õ¾²¶É
ÕâÊÇһƪ×Ô¼ººÜÔçдµÄÎÄÕÂÁË£¬µ±Ê±¸ù¾ÝÍøÉϵÄһЩ½Ì³ÌÒ»²½Ò»²½ÖÆ×÷£¬±¾À´Ïë°Ñ×Ô¼º×öµÄ¹ý³Ì·Åµ½ÍøÉÏ£¬¿ÉÒÔÎ÷һֵæÓÚ¹«Ë¾ÏîÄ¿£¬Ã»ÓÐʱ ......
ÏÂÔصØÖ·£ºhttp://www.fcitx.org/main/?q=node/9
Version-°æ±¾ Update©¤¸üÐÂÈÕÆÚ±¸×¢
fcitx-3.4.tar.bz2
2006-09-21
×îÐÂÎȶ¨°æ
fcitx-060910.tar.bz2
2006-09-10
²âÊÔ°æ
fcitx-3.3.1-bin.tar.bz2
2006-08-30
Îȶ¨°æ(Ô¤±àÒë°üIA32)
Ñ¡Ôñ×îа档¡£
Ô´Âë°üµÄ°²×°£»
[root@localhost beinan]# tar jxvf fci ......