Time of Update: 2018-12-05
SqlConnection myCon = new SqlConnection(); string connectionString = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]; myCon.ConnectionString = connectionString; try {
Time of Update: 2018-12-05
#include <stdio.h>#include <sys/socket.h>#include <netdb.h>#include <netinet/in.h>#include <arpa/inet.h>#include <string.h>int main(){ struct hostent *host; char hostname1[] = "www.baidu.com"; char
Time of Update: 2018-12-05
#include <gtk/gtk.h>int main(int argc,char *argv[]){ GtkWidget *window;//定義一個指向視窗的指標 char title[] = "Hello World";//設定表單的標題 gtk_set_locale(); gtk_init(&argc,&argv);//建立視窗 window =
Time of Update: 2018-12-05
來自:http://hi.baidu.com/dbzhang800/item/14d738cf9a24513d45941642本人 20130511親測有用,感謝原創者。20110815更新:有網友提到直接添加一個環境變數 LANG=en 即可。見qtcn.org自從安裝了QtCreator內建的Mingw4.4後,編譯C++程式時,老出現亂碼:E:\cpp_t>c++ -Wall b.cpp b.cpp: In function 鈥榠nt main()鈥? b.cpp:22:
Time of Update: 2018-12-05
一些應用程式啟動很慢時,一般會在啟動時顯示一個畫面,利用這種方法可以讓程式啟動時間不那麼長。給Qt應用程式加一個啟動畫面很簡單,需要使用的類是QSplashScreen,在視窗沒有顯示之前,QSplashScreen顯示一個圖片,他還可以在圖片上顯示文字資訊提示使用者當前程式初始化的進度。一般情況下,啟動畫面代碼在main()函數中,加在調用QApplication::exec()之前 //main.cpp #include <QtGui/QApplication>
Time of Update: 2018-12-05
看書的看到了聲明和定義,自己試著答了下,雖然相差不遠,但還是不夠完美,於是查了下資料,如下:什麼是定義:所謂的定義就是(編譯器)建立一個對象,為這個對象分配一塊記憶體並給它取上一個名字,這個名字就是我們經常所說的變數名或對象名。但注意,這個名字一旦和這塊記憶體匹配起來(可以想象是這個名字嫁給了這塊空間,沒有要彩禮啊。^_^),它們就同生共死,終生不離不棄。並且這塊記憶體的位置也不能被改變。一個變數或對象在一定的地區內(比如函數內,全域等)只能被定義一次,如果定義多次,編譯器會提示你重複定義同一個
Time of Update: 2018-12-05
步驟如下:1. 下載SDL_draw(SDL_draw-1.2.13.tar.gz)開源包(http://sdl-draw.sourceforge.net/)2. 編譯,安裝開源包sudo ./configureloading cache ./config.cachechecking for a BSD compatible install... (cached) /usr/bin/install -cchecking whether build environment is sane...
Time of Update: 2018-12-05
這周抽空學以致用,參考LDD3及嵌入式系統介面設計與Linux驅動程式開發這兩本書,結合自己的開發板,做了LED驅動的程式,自己寫程式和看書感覺真的是不一樣啊,過程中犯了不少錯誤,但最終還是完成了程式,很高興!硬體平台:tq2440核心版本:2.6.30.41. 硬體介紹下面首先介紹一下我的開發板的接線,我的開發板是天嵌公司的tq2440,它的LED接線: 其中,nLED_1接S3C2440的GPB5引腳,其他依次接GPB6,GPB7,GPB8,低電平時LED點亮。這些條件就夠我們寫驅動使用了。
Time of Update: 2018-12-05
英文字型的1磅,相當於1/72 英寸,約等於1/2.8mm。12PT的字列印出來約為4.2mm。網頁中12px的字才相當於12像素。 雖然 四號=(14/72)*96=18.6px 更接近 19px,但是因為 18px 是點陣,所以系統還是優先顯示點陣字型大小的。換句話說:四號=18px中文字型大小VS英文字型大小(磅)VS像素值的對應關係:八號=5磅(5pt) ==(5/72)*96=6.67 =6px七號=5.5磅 ==(5.5/72)*96=7.3 =7px小六=6.5磅 ==(6.5/7
Time of Update: 2018-12-05
http://www.dzsc.com/data/html/2011-9-4/97838.html 現在我們經常會用busybox產生根檔案系統,可是根檔案系統起來以後命令列提示符只有一個“#”號,沒有像linux發行版那樣是[user@hostname currentpath]
Time of Update: 2018-12-05
轉自 http://blog.csdn.net/yinwei520/article/details/6263185,轉載請註明出處!通過Platform機制開發發底層驅動的大致流程為: 定義 platform_device---註冊 platform_device ---定義 platform_driver-----註冊 platform_driver。 1. Platform_device 定義於 kernel/include/linux/platform_device.h中,struct
Time of Update: 2018-12-05
轉載出處 http://blog.chinaunix.net/space.php?uid=8116903&do=blog&id=334708tty是Teletype的縮寫(轉)
Time of Update: 2018-12-05
"mount_devfs_fs(): unable to mount devfs, err: -2"一個困擾了我很久的問題,主要是ecc的問題。在此我把我的理解說一下好了: 搞清楚你在driver/mtd/nand/s3c2410.c檔案中有沒有把NAND_ECC_SOFT改成NAND_ECC_NONE,這個網上不少的人都會做(聽說會與yaffs檔案系統有衝突,但我發現反而和cramfs檔案系統有衝突)。這個地方我那時候沒有交代清楚,不好意思^_^
Time of Update: 2018-12-05
基於之前移植的的核心,把驅動分別進行移植,這篇主要進行USB驅動移植,並闡明與熱插拔相關的mdev,在2.6.30核心中,USB驅動已經比較完善了,移植是只要簡單對配置單進行修改即可,添加的內容如下:Device Drivers ---> SCSI device support ---> SCSI device support SCSI disk support
Time of Update: 2018-12-05
main.cpp#include "mainwindow.h"#include <QApplication>#include <QDeclarativeView>#include <QDeclarativeContext>int main(int argc, char *argv[]){ QApplication app(argc, argv); QDeclarativeView view; QDeclarativeContext
Time of Update: 2018-12-05
URL:http://www.eit.name/blog/read.php?426Overview:Using in-memory fs you can allocate part of physical memory to be used as a harddisk partition. You can mount this partition and start writing and reading files like a harddisk partition, it will be
Time of Update: 2018-12-05
#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <fcntl.h>#include <string.h>int mydup2(int filedes, int filedes2);char * getpathname(char * abpathname, char * compathname);int main(void){ int fd;
Time of Update: 2018-12-05
我們經常看到 read 的時候沒有資料可讀,而有時卻是 write 的時候緩衝區已 滿寫不進去。而應用程式不關心這個,只關心我要的資料何時能讀取出來,或者我 寫的資料何時才能寫進去。因此這樣應該要阻塞進程,直到有資料可讀或者有記憶體 可寫。那我們就來看看幾個概念和問題: 1)何為進程睡眠? 2)是否什麼情況下都可以睡眠?
Time of Update: 2018-12-05
1)const int *pp是一個指向整型常量的指標,可以修改指標的值,但不能修改指標所指向的值#include <stdio.h>int main(){ int b = 5; int c = 3; const int *p = &b; printf("*p is %d\n",*p); *p = 6;//錯誤,向唯讀位置 *p賦值 p = &c;//可以修改指標的值 printf("*p is %d\n",*p);
Time of Update: 2018-12-05
建立有空洞的檔案程式如下,建立的檔案大小為10位元組,開頭字元為a,最後一個字元為b。#include "apue.h"#include <fcntl.h>int creatHoleFile(const char *filename, mode_t mode);int main(int argc, char* argv[]){int i;if (argc < 2){printf("Usage: chf filename\n");exit(1);}for (i = 1; i