12 ASP.NET MVC Best Practices
M
DomainModel != ViewModel
Use ActionFilters for “shared” data
V
Do NEVER user code-behind
Write HTML each time you can
If there is an if, write an HtmlHelper
Choose your view engine carefully
C
Delete the AccountController
Isolate Controllers from the outside World
Use an IoC Container
Say NO to “magic strings”
Build your own “personal conventions”
Pay attention to the Verbs
ASP.NET MVC Best Practices
Use
Use jQuery and jQuery UI
Use Bootstrapper in Global.asax
Use Action Filter to Convert to compatible Action Methods parameters
Use UpdateModel Carefully
Use PRG Pattern for Data Modification
Do Not
Do not make any hard dependency on the DI Container, use Common Service Locator
Do not put your JavaScript codes in your View
Avoid ViewData, use ViewData.Model
Do not make any hard dependency on the DI Container, use Common Service Locator
Controller will not contain any Domain logi ......
ÔÚÍêÉÆÎÒµÄ¿çÆ½Ì¨µÄ·¢ÓʼþÀà¿âʱ£¬select×öÑÓʱwindowsûЧ¹û£¬LinuxÕý³££¬»¹ÒÔΪÎÒ´úÂëд´íÁËÄØ£»ÔÚÍøÉÏËÑËØÏÂҲû·¢ÏÖÀàËÆËµ·¨£¬ÓÚÊÇÎÒ¾ÍдÁ˶ÎС²âÁË£¬¹ûÈ»selectÑÓʱÔÚwindowsÉÏËõË®ÁË
#include <iostream>
#include <time.h>
#ifdef WIN32
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib")
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
using namespace std;
int main()
{
struct timeval timeWait;
timeWait.tv_sec = 0;
timeWait.tv_usec = 10000;
int liRecvCnt = 0;
time_t t1, t2;
time(&t1);
while(liRecvCnt < 10)
& ......
×î½üÔÚѧϰLinuxϵÄC±à³Ì£¬ÂòÁËÒ»±¾½Ð¡¶Linux»·¾³ÏµÄC±à³ÌÖ¸ÄÏ¡·¶Áµ½makefile¾ÍÔ½¿´Ô½ÃÔºý£¬¿ÉÄÜÊÇÎÒµÄÀí½âÄܲ»ÐС£
ÓÚÊÇgoogleµ½ÁËÒÔÏÂÕâÆªÎÄÕ¡£Í¨Ë×Ò×¶®¡£È»ºó°ÑËüÌù³öÀ´£¬·½±ãѧϰ¡£
ºó¼Ç£¬¿´Íê·¢ÏÖÕâÆªÎÄÕº͡¶Linux»·¾³ÏµÄC±à³ÌÖ¸ÄÏ¡·µÄmakefileÒ»ÕÂËù½²ÊöµÄ¾ªÈ˵ÄÏàËÆ£¬Ö»ÊÇÕâÆªÎÄÕ´ÓÒ»¸öʵÀýÇÐÈ룬ÔÚÓÐЩµØ·½±È½ÏºÃÀí½â¡£ÄÜÈÃÈË¿´¶®¾ÍÊǺÃÎÄÕ¡£
¸úÎÒÒ»Æðд Makefile
³Âð© (CSDN)
¸ÅÊö
——
ʲôÊÇmakefile£¿»òÐíºÜ¶àWinodwsµÄ³ÌÐòÔ±¶¼²»ÖªµÀÕâ¸ö¶«Î÷£¬ÒòΪÄÇЩWindowsµÄIDE¶¼ÎªÄã×öÁËÕâ¸ö¹¤×÷£¬µ«ÎÒ¾õµÃÒª×÷Ò»¸öºÃµÄºÍprofessionalµÄ³ÌÐòÔ±£¬makefile»¹ÊÇÒª¶®¡£Õâ¾ÍºÃÏñÏÖÔÚÓÐÕâô¶àµÄHTMLµÄ±à¼Æ÷£¬µ«Èç¹ûÄãÏë³ÉΪһ¸öרҵÈËÊ¿£¬Ä㻹ÊÇÒªÁ˽âHTMLµÄ±êʶµÄº¬Òå¡£ÌØ±ðÔÚUnixϵÄÈí¼þ±àÒ룬Äã¾Í²»Äܲ»×Ô¼ºÐ´makefileÁË£¬»á²»»áдmakefile£¬´ÓÒ»¸ö²àÃæËµÃ÷ÁËÒ»¸öÈËÊÇ·ñ¾ ......
LinuxÏÂCHM²é¿´¹¤¾ß»ã×Ü
http://www.ossw.com.cn/bbs/bencandy.php?id=2252&l_page=1
1. chmsee
homepage: http://211.92.88.40/~zhong/
requires: gtkhtml, libgnomevfs
env: µ÷ÓÃgtkhtmlÏÔʾHTML£¬ÊʺÏGNOME»·¾³ÏÂʹÓÃ
ChmSeeÊÇÒ»¸öä¯ÀÀCHMÎļþµÄ³ÌÐò,Ö§³Ö¼òÌåºÍÓ¢ÎıàÂëµÄCHMÎļþ,ÆäËü±àÂëÔݲ»Ö§³Ö.
ÓÉÓÚChmSeeµÄ¹¤×÷·½Ê½,ËùÒÔ¶ÔÌ«´óµÄCHMÎļþ´¦ÀíÆðÀ´±È½Ï³ÔÁ¦ (ÌåÑéÔڽϴóCHMÎļþµÄ´ò¿ªºÍÍ˳ö).
2. xchm
homepage: http://xchm.sourceforge.net
requires: chmlib, wxGTK
chmÎļþ½âÎö»ùÓÚchmlib(¼ûÏÂ), ½çÃæ²¿·ÖÐèÒªwxGTK
(Debian testing/unstableÒѾÊÕ¼¸Ã¹¤¾ß)
3. chm_viewer
......
PostgreSQL Linux
°²×°¼°Ê¹Ó㬼òÒ×ÊÖ²á
Ò»£¬ÅäÖ÷½·¨£º
1
£¬Ê×ÏÈÏÂÔØÈÎÒâ°æ±¾µÄPostgreSQL For Linux X86_64
wget http://downloads.enterprisedb.com/postgresql/postgresql-8.4.1-1-linux-x64.bin
2
£¬Îı¾Ä£Ê½°²×°
[root@imdba.cn ~]# ./postgresql-8.4.1-1-linux-x64.bin –mode text
—————————————————————————-
Welcome to the PostgreSQL Setup Wizard.
—————————————————————————-
Please specify the directory where PostgreSQL will be installed.
Installation Directory [/opt/PostgreSQL/8.4]: /home/PostgreSQL/8.4
————————————————————&md ......
.tar
½â°ü£º tar xvf FileName.tar
´ò°ü£ºtar cvf FileName.tar DirName
£¨×¢£ºtarÊÇ´ò°ü£¬²»ÊÇѹËõ£¡£©
---------------------------------------------
.gz
½âѹ1£ºgunzip FileName.gz
½âѹ2£ºgzip -d FileName.gz
ѹËõ£ºgzip FileName
.tar.gz
½âѹ£ºtar zxvf FileName.tar.gz
ѹËõ£ºtar zcvf FileName.tar.gz DirName
---------------------------------------------
.bz2
½âѹ1£ºbzip2 -d FileName.bz2
½âѹ2£ºbunzip2 FileName.bz2
ѹËõ£º bzip2 -z FileName
.tar.bz2
½âѹ£ºtar jxvf FileName.tar.bz2
ѹËõ£ºtar jcvf FileName.tar.bz2 DirName
---------------------------------------------
.bz
½âѹ1£ºbzip2 -d FileName.bz
½âѹ2£ºbunzip2 FileName.bz
ѹËõ£ºÎ´Öª
.tar.bz
½âѹ£ºtar jxvf FileName.tar.bz
ѹËõ£ºÎ´Öª
---------------------------------------------
.Z
½âѹ£ºuncompress FileName.Z
ѹËõ£ºcompress FileName
.tar.Z
½âѹ£ºtar Zxvf FileName.tar.Z
ѹËõ£ºtar Zcvf FileName.tar.Z DirName
---------------------------------------------
.tgz
½âѹ£ºtar zxvf FileName.tgz
ѹËõ£ºÎ´Öª
.tar.tgz
......