lixinso@lixinso-desktop:~$ adb shell
# mount
# mount
# mount -o remount /dev/block/mtdblock0 /system
# mount
# mount
mount完就可以任意修改删除拉~~~~
另一個更簡單的方法是直接
:~$adb remount
即可
另一個更簡單的方法是直接
:~$adb remount
即可
from google.appengine.ext import db
from google.appengine.ext.db import BadValueError
import datetime, time
from google.appengine.api import users
SIMPLE_TYPES = (int, long, float, bool, dict, basestring, list)
def to_dict(model):
output = {}
if isinstance(model, db.Query):
output = []
for v in model:
output.append(to_dict(v))
return output
elif isinstance(model, list):
output = []
for v in model:
output.append(to_dict(v))
return output
for key, prop in model.properties().iteritems():
value = getattr(model, key)
if value is None or isinstance(value, SIMPLE_TYPES):
output[key] = value
elif isinstance(value, datetime.date):
output[key] = value.strftime("%Y/%m/%d %H:%M")
elif isinstance(value, db.GeoPt):
output[key] = {'lat': value.lat, 'lon': value.lon}
elif isinstance(value, db.Model):
output[key] = to_dict(value)
elif isinstance(value, users.User):
output = {}
methods = ['nickname', 'email', 'auth_domain']
for method in methods:
output[method] = getattr(value, method)()
return output
else:
raise ValueError('cannot encode ' + repr(prop))
return output
import model
rooms= model.Room.all()
self.response.out.write(model.to_dict(rooms))
typedef struce _MYSTRUCT
{
char szChar[255];
int iInt;
}MyStruct;
在傳送端的部份
void Send()
{
AnsiString app_name = "要收到訊息的視窗";
AnsiString msg = "要傳送的訊息";
int type = 1; //要傳送的數字
HWND hWnd = FindWindow(NULL, app_name.c_str()); //找到視窗
if(hWnd)
{
MyStruct ms;
istrcpy(ms.szChar, msg.c_str());
ms.iInt=type;
COPYDATASTRUCT CopyData;
CopyData.dwData=0;
CopyData.cbData=sizeof(MyStruct);
CopyData.lpData=&ms;
SendMessage( hWnd, WM_COPYDATA, NULL, (LPARM)&CopyData);
}
}
void __fastcall WMCopyData( TMessage &Message );
BEGIN_MESSGE_MAP
MESSAGE_HANDLER(WM_COPYDATA, TMessage, WMCopyData)
END_MESSAGE_MAP(TForm)
void __fastcall TMainForm::WMCopyData(TMessage &Message)
{
COPYDATASTRUCT *CopyData = (COPYDATASTRUCT*) (Message.LParam);
if(CopyData->cbData == sizeof(MyStruct) )
{
MyStruct ms;
CopyMemory(&ms, CopyData->lpData, CopyData->cbData);
//ms.Int 即是接收到的數字
//ms.szChar即是要接收到的訊息
}
}
#include < QtNetwork/QTcpSocket >
//宣告一個QTcpSocket方便在整個程式中使用
QTcpSocket *m_socket;
//產生QTcpSocket物件
m_socket = new QTcpSocket(this);
//Connect事件觸發的Function
//在收到Server的訊息時會觸發readRead()
connect(m_socket,SIGNAL(readyRead()),this,SLOT(slotReadyRead()));
//連線成功的事件
connect(m_socket,SIGNAL(connected()),this,SLOT(slotConnected()));
//斷線的事件
connect(m_socket,SIGNAL(disconnected()),this,SLOT(slotDisConnected()));
//連線到Server
QString ip_address="127.0.0.1";
int port = 2266
m_socket->connectToHost(ip_address,port );
//傳送訊息
QTextStream stream(m_socket);
stream << "Server: Hi, I am client";
//接收訊息
m_socket->readAll();
public static PendingIntent serviceIntent = null;
public static void registerService(Context context) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
//如果serviceIntent不為null(已註冊過)
if (serviceIntent != null)
alarmManager.cancel(serviceIntent); //清除
final int updateInterval = 60 * 60000;//間隔時間單位為ms
//間隔時間不為0
if (updateInterval != 0) {
//如果serviceIntent為null
if (serviceIntent == null) {
//建立intent
Intent intent = new Intent(context, 要更新的Service.class);
//建立serviceIntent
serviceIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
//在AlarmManager設定重覆執行的Server的intent
alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime() + updateInterval,
updateInterval, serviceIntent);
}
}
public static void removeService(Context context) {
if (serviceIntent != null) {
((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).cancel(serviceIntent);
serviceIntent = null;
}
}
@Override
public void onDisabled(Context context) {
// TODO Auto-generated method stub
UpdateService.removeService(context);
super.onDisabled(context);
}
@Override
public void onEnabled(Context context) {
// TODO Auto-generated method stub
UpdateService.registerService(context);
super.onEnabled(context);
}