2012年12月16日 星期日

test

#include <iostream>
#include <string>
using namespace std;

string GetName()
{
string FirstName, LastName, FN;

cout << "Employee's First Name: ";
cin >> FirstName;
cout << "Employee's Last Name: ";
cin >> LastName;

FN = FirstName + " " + LastName;

return FN;
}

int main()
{
string FullName;
double Hours;

double GetHours(string FullName);

FullName = GetName();

Hours = GetHours(FullName);

cout << "\nEmployee's Name: " << FullName;
cout << "\nWeekly Hours: " << Hours << " hours\n\n";

return 0;
}

double GetHours(string FullName)
{
double Mon, Tue, Wed, Thu, Fri, TotalHours;

cout << endl << FullName << "'s Weekly Hours\n";
cout << "Monday: ";
cin >> Mon;
cout << "Tuesday: ";
cin >> Tue;
cout << "Wednesday: ";
cin >> Wed;
cout << "Thursday: ";
cin >> Thu;
cout << "Friday: ";
cin >> Fri;

TotalHours = Mon + Tue + Wed + Thu + Fri;

return TotalHours;
}

png 最佳化

Most Effective Method to Reduce and Optimize PNG Images

PNGOutWin

http://www.cocos2d-iphone.org/forum/topic/39715

2012年12月13日 星期四

Adobe AIR Native Extension (iOS)

Requirements

 

Reference (TODO)

 

Samples

 

Step By Step(TODO)

Step By Step
01. 建立Cocoa Touch Static Library
02. 移除自動建立的.h檔
03. 將FlashRuntimeExtensions.h拷貝至.m檔相同目錄
04. 在.m檔中加入 #import "FlashRuntimeExtensions.h"
05. 根據FREFunction          函式定義, 實作FREFunction          
06. 根據FREContextInitializer函式定義, 實作FREContextInitializer (mapping FREFunction)
07. 根據FREContextFinalizer  函式定義, 實作FREContextFinalizer
08. 根據FREInitializer       函式定義, 實作FREInitializer        (mapping FREContextInitializer & FREContextFinalizer)
09. 根據FREFinalizer         函式定義, 實作FREFinalizer
10. Generating the compiled library(http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt3.html)

 

Debug(TODO)

Adobe AIR Native Extension (Android)

 

Requirements

 

Reference

 

Samples

 

Step By Step

1. 建立Android Library Project

1

2

3

4

2. 加入FlashRuntimeExtensions.jar

1

2

3

3. 建立對應Package

1

2

3

4. 實作FREFunction介面

1

2

5. 繼承FREContext類別

1

6. 將所有實作FREFunction介面的類別在 step 5 建立的類別中的 getFunctions 建立對應的Dictionary

2

7. 實作FREExtension介面, 並在createContext中回傳step5建立的類別

1

8. 打包成JAR

1

2

3 

 

Debug

Adobe AIR native extension

Developing Native Extensions

 

API Reference

API 分析

java

Develop Native Extension for Android

1. create android library Project

1

2

3

4

2. add FlashRuntimeExtensions.jar into this project

5

6

3. create corresponding package

8

9

4. implementing the FREExtension interface

 

  1. extending the FREContext class
  2. implementing the FREFunction interface which you want to control

Resources