摘要:
过了n多天后,当再次使用原先博客上写的那篇:Android 压缩解压zip文件去做zip包的解压的时候,出现了原来没有发现的很多问题。首先是中文汉字问题,使用java的zip包不能很好的解决解压问题;其次还有getRealFileName()内的那个判断:由之前的"if(dirs.length >1)" 如果是 >1 的话,对于一些文件不能够解压,修改为:if(dirs.length>0)对于zip压缩包内包含中文目录或者中文文件的话,参考网上的资源:“使用apache的zip工具包(所在包为ant.jar )代替JDK的zip工具包,因为java类型自带
阅读全文
posted @ 2013-07-17 16:58
帕拉美
阅读(18320)
推荐(0)
摘要:
在软件实现更新模块的时候,有可能会判断一下服务器上的版本的版本号和本地版本的版本号。下面有类似这样形式的版本号:string str = "0.0.0.1";分析一下可以看出,该版本号可以分为4个部分,下面就实现一个提取这4部分的功能函数: 1 //通过string 参数获取版本号到version数组内 2 //该函数是通过"."来分别获取4个整形值的 3 //所以允许出现类似: "1000.20.3.5" 4 5 void GetVersion(string str,int *version) 6 { 7 string st1(&q
阅读全文
posted @ 2013-07-03 17:52
帕拉美
阅读(4065)
推荐(0)
摘要:
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef string::size_type (string::*find_t)(const string& delim, string::size_type offset) const;vector Split(const string& ...
阅读全文
posted @ 2013-06-21 18:42
帕拉美
阅读(5463)
推荐(0)
摘要:
在 windows下头文件中包含 #include就可以使用_beginthread进行线程创建。个人感觉挺方便的。在linux下类似于_beginthread 和 _endthread 的 是pthread_create和pthread_exitlinux下包含头文件 #include=================================pthread_create 启动线程属性讲解:http://blog.csdn.net/hudashi/article/details/7709413===================================下面是转载的一个例子:原
阅读全文
posted @ 2013-06-21 11:49
帕拉美
阅读(4127)
推荐(0)
摘要:
CDlgTestDlg::CDlgTestDlg CDlgTestDlg::DoModal CDialog::DoModal CDlgTestDlg::PreSubclassWindow CDlgTestDlg::OnCreate CDlgTestDlg::OnSize CDialog::OnInitDialog CWndUpdateData(FALSE) CDlgTestDlg::DoDataExchange CDlgTestDlg::OnInitDialog CDlgTestDlg::OnShowWindow CDlgTestDlg::OnPaint CDlgTes...
阅读全文
posted @ 2013-06-20 10:39
帕拉美
阅读(1705)
推荐(0)
摘要:
int转stringint n = 0;std::stringstream ss;std::string str;ss<<n;ss>>str;string转intstd::string str = "123";int n = atoi(str.c_str());#include"stdafx.h"#include<string>#include<sstream>usingnamespacestd;voidmain(){//int转stringstringstreamss;intn=123;stringstr
阅读全文
posted @ 2013-05-29 10:59
帕拉美
阅读(271)
推荐(0)
摘要:
熟悉xact的都知道一个cue可以对应多个sound。在播放某个cue的时候xact会按照每个sound播放概率进行选择某个sound然后进行下面的播放。在这里简单的使用rand进行一个模拟通过概率选择某一项的实现。假设有四个sound对应的概率分别为:A——%20B——%40C——%10D——%30假设100%概率的话,可以简单的指定0-100对应上面的每项的概率。A————对应100内的(0-19)20%B————对应100内的(20-59)40%C————对应100内的(60-69)10%D————对应100内的(70-99)30%这里使用rand()所求得出的概率尽管不能绝对的和上面类
阅读全文
posted @ 2013-05-28 12:19
帕拉美
阅读(1260)
推荐(0)
摘要:
@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {AudioManager mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);int currentVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); switch (keyCode) {case KeyEvent.KEYCODE_VOLUME_UP:// 音量增大mAudioManager.s..
阅读全文
posted @ 2013-05-27 16:12
帕拉美
阅读(9225)
推荐(0)
摘要:
http://www.cppblog.com/gohan/archive/2008/05/11/49488.html
阅读全文
posted @ 2013-05-22 16:35
帕拉美
阅读(583)
推荐(0)
摘要:
-------------------------------------------------------------------------------------Linux------------------------------------------------------------...
阅读全文
posted @ 2013-05-22 14:21
帕拉美
阅读(49192)
推荐(4)