Time of Update: 2018-12-04
#include <imaging.h>#include <initguid.h>#include <imgguids.h> unsigned char* LoadBMP(char* file){ FILE *fp = fopen(file,"rb"); if(!fp) { MessageBox(g_hWnd, _T("Open file error"), _T("error"), MB_OK); } BITMAPFILEHEADER hdr; fread(
Time of Update: 2018-12-04
原始連結:http://dev.gameres.com/Program/Visual/2D/對2D遊戲引擎設計的一些思考.htm
Time of Update: 2018-12-04
遊戲編程可不僅僅是圖形程式的開發工作,實際上包含了許多方面,本文所要講述的就是關於如何使用 DirectInput 來對鍵盤編程的問題。 在 DOS 時代,我們一般都習慣於接管鍵盤中斷來加入自己的處理代碼。但這一套生存方式在萬惡的 Windows 社會下是行不通的,我們只能靠領 API 或者 DirectInput 的救濟金過活。 在 Windows 的 API 中,有一個 GetAsyncKeyState()
Time of Update: 2018-12-04
使用EditText進行文本輸入時,若不進行特殊的設定,使用Android內建的軟鍵盤,該軟鍵盤會佔用整個介面,那麼,如何讓鍵盤只佔用螢幕的一部分呢? Xml代碼 <EditText android:id="@+id/text1" android:layout_width="150dip" android:layout_height="wrap_content" android:imeOptions="flagNoExtractUi"/>
Time of Update: 2018-12-04
以下是常用到的Intent的URI及其樣本,包含了大部分應用中用到的共用Intent。 一、開啟一個網頁,類別是Intent.ACTION_VIEW Uri uri = Uri.parse(“http://blog.3gstdy.com/”); Intent intent = new Intent(Intent.ACTION_VIEW, uri); 二、開啟地圖並定位到一個點 Uri uri = Uri.parse(“geo:52.76,-79.0342″); Intent
Time of Update: 2018-12-04
恢復出廠預設值流程概括 一. 設定模組中進行恢復出廠預設值操縱,系同一共做了兩件事: 1. 往 /cache/recovery/command 檔案中寫進命令欄位: 2. 重啟系統 二. 重啟系統會必須進進 recovery 模式 進進 recovery 模式的幾種方式 1. 通過讀取 /cache 分區中檔案 /cache/recovery/command 內容進進 2. 通過按鍵操縱進進 (G1 通過同時按 HOME 和 掛斷鍵) 以上兩種方式進進都需要
Time of Update: 2018-12-04
製作Android ROM有兩種方法:編譯Android原始碼的方法,這個比較複雜,以後再介紹;在已有的ROM基礎上製作或者叫定製自己的ROM。本文介紹的是在已有ROM基礎上的定製步驟。我這裡使用的機器是Nexus One,於是下載了第三方的ROM,這裡以安卓農夫ROM 2.4為基礎。當然也可以用CyanogenMod提供的ROM,實際上安卓農夫的ROM就是在該ROM基礎上做的定製。解壓縮ROM,比如安卓農夫ROM 2.4檔案名稱為:n1_2.4_signed
Time of Update: 2018-12-04
String[] projection = { MediaStore.Images.Media.SIZE, MediaStore.Images.Media.DISPLAY_NAME }; Uri uri = MediaStore.Images.Thumbnails.getContentUri("external"); Cursor c = Thumbnails.queryMiniThumbnails(getContentResolver(),
Time of Update: 2018-12-04
掃描全部 我猜測其在效率方面可能有點副作用 Java代碼 public void systemScan(){ sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()))); } - 掃描某個檔案 參數:填入該檔案的路徑 Java代碼
Time of Update: 2018-12-04
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int cmp(const int &a , const int &b){ return a >= b;}int cmp1(const int &a , const int &b){ if(a%10 == b%10
Time of Update: 2018-12-04
常量字串為什麼位於靜態儲存區?char *c="zhaobei";書上說: "zhaobei"這個字串被當作常量而且被放置在此程式的記憶體靜態區。那一般的int i=1;1也是常量,為什麼1就不被放置在此程式的記憶體靜態區了呢?請高手指點!所有的字元竄常量都被放在靜態記憶體區因為字串常量很少需要修改,放在靜態記憶體區會提高效率例:char str1[] = "abc";char str2[] = "abc";const char str3[] = "abc";const char str4[]
Time of Update: 2018-12-04
iphone5的螢幕解析度:1136 x 640 也即是高度變成了568,程式啟動時我們需要一張retina圖片命名為Default-568h@2x.png。在我們建立工程時xcode會預設為我們建立一個純黑色的圖片替換即可。xcode 4.5 已經支援iphone5的模擬器了。開啟模擬器,選擇裝置,選擇iphone(Retina 4-inch),即為iphone5的模擬器。1、設定autosizing,為上下自動適應大小,只需點擊即可。2、勾選Autoresize
Time of Update: 2018-12-04
下面這幾個簡單例子,涉及記憶體對齊#include<iostream>#include <cstdio>class test{};int main(){ int i = sizeof(test); printf("%d",i); getchar();}列印結果::::::竟然為1#include<iostream>#include <cstdio>class test{ int a; char c;};int
Time of Update: 2018-12-04
#include <iostream>using namespace std;class A{public : A (int i) { a = i; } int fun(int b) { return a*c+b; } int c;private : int a;};int main(){ A x(18); int A::*pc; pc = &A::c; x.*pc = 5;
Time of Update: 2018-12-04
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 跟蹤網路電話、手機網站和手機應用程式。用這個教程你能夠學到怎樣在你的app中用Google解析器。- - - - - - - - - - - - - - - - - - - - - - - - - -
Time of Update: 2018-12-04
armv 是指令集的意思,偏硬體。目前iphone5支援armv7s。The iPhone 5 will ship with and only run iOS 6.0. To coincide with the launch of iOS 6.0, Apple has seeded developers with a newer version of its development tools. Xcode 4.5 makes two major changes: it drops
Time of Update: 2018-12-04
當你寫一個catch子句時,必須確定讓異常通過何種方式傳遞到catch子句裡。你可以有三個選擇:與你給函數傳遞參數一樣,通過指標(by pointer),通過傳值(by value)或通過引用(by reference)。 我們首先討論通過指標方式捕獲異常(catch by pointer)。從throw處傳遞一個異常到catch子句是一個緩慢的過程,在理論上這種方法的實現對於這個過程來說是效率最高的。因為在傳遞異常資訊時,只有採用通過指標拋出異常的方法才能夠做到不拷貝對象,例如:class
Time of Update: 2018-12-04
1、 目前時間 NSDate *nowDate = [NSDate date]; NSLog(@"nowDate = %@",nowDate); 2、從現在開始的24小時 NSTimeInterval secondsPerDay = 24*60*60; NSDate *tomorrow = [NSDate dateWithTimeIntervalSinceNow:secondsPerDay];
Time of Update: 2018-12-04
1 me@ubuntu:~$ su 2 密碼:<--- 輸入安裝時root使用者的密碼3 su:認證失敗 很簡單,重新設定下密碼就好了(雖然我輸入的還是舊的密碼)1 me@ubuntu:~$ sudo passwd 2 密碼:<--- 輸入安裝時那個使用者的密碼3 輸入新的 UNIX 密碼:<--- 新的Root使用者密碼4 重新輸入新的 UNIX 密碼:<--- 重複新的Root使用者密碼5 passwd:已成功更新密碼 6 me@ubuntu:~$ su 7 密碼:&
Time of Update: 2018-12-04
這三個概念都是與OO中的多態有關係的。如果單是區別重載與覆蓋這兩個概念是比較容易的,但是隱藏這一概念卻使問題變得有點複雜了,下面說說它們的區別吧。重載是指不同的函數使用相同的函數名,但是函數的參數個數或類型不同。調用的時候根據函數的參數來區別不同的函數。覆蓋(也叫重寫)是指在衍生類別中重新對基類中的虛函數(注意是虛函數)重新實現。即函數名和參數都一樣,只是函數的實現體不一樣。隱藏是指衍生類別中的函數把基類中相同名字的函數屏蔽掉了。隱藏與另外兩個概念表面上看來很像,很難區分,其實他們的關鍵區別就是