Back 2 wordpress

Finally I can access this website using the network connection at workplace. The UI is very cool in wordpress.com now :) . I hope I will come up with more cool ideas and post them here in the future.

Posted in Uncategorized | Leave a comment

From MSN Live Space to WordPress

I’ve followed msn live space’s instructions to migrate my blog to WordPress today.

It was a little slow at first on the website :( But after I installed ecto on my mac, the connection speed is ok.

Looking forward to having an excited journey in wp :D

Posted in Uncategorized | Leave a comment

安装Bugzilla 3.4.4

由于公司需要升级Bugzilla,这几天专门安装了Bugzilla 3.4.4 + Perl 5.10.1 + MySql 5.1.42 + Apache2.2,安装过程虽然根据官方文档的流程走下来,不过中途还是遇到了一些小麻烦,在此记录下来,希望给自己的工作作一下总结,同时希望后来者少走弯路。

——————————安装步骤———————————-

1. 首先去官网下载最新版的Bugzilla 3.4.4 http://www.bugzilla.org/download/

将Bugzilla解压到C:

2. 用Bugzilla网站内置的搜索工具搜索Windows,找到win32的安装方法,网址如下:http://www.bugzilla.org/docs/win32install.html

3. 该网址会让你转到wiki上:https://wiki.mozilla.org/Bugzilla:Win32Install

4. 找到install bugzilla from tarball,因为我下载的是tar.gz格式的文件

5. 下载MySQL,文档里说5.x版本已经十分稳定,因此我下了mysql-essential-5.1.42-win32.msi(39M),http://dev.mysql.com/downloads/mysql/4.1.html

安装到C:Program FilesMySQLMySQL 5.1下,用户名密码都用root

6. 去command line utility里,输入密码root,给bugs数据库赋权限、设密码sockmoney

GRANT ALL PRIVILEGES ON bugs.* TO ‘bugs’@’localhost’ IDENTIFIED BY ‘sockmonkey';

quit

7. 下载ActiveState Perl 5.10.1http://activestate.com/Products/Download/Download.plex?id=ActivePerl

将perl安装到C:Perl。安装后除了perl以外,附带有ppm工具(Perl Package Manager)可以方便地查看perl组件。

这里说明一下:默认已经将C:Perlbin的环境变量配置好,但需要cmd重启才生效。

8. 安装一系列perl模块,https://wiki.mozilla.org/Bugzilla:Win32Install#Install_Modules

9. 下载Apache2.2https://wiki.mozilla.org/Bugzilla:Win32Install#Download_Apache_2.x

安装到C:Programe FilesApache Group

修改Apache的配置文件需要设置端口、指向C:/Bugzilla、让index.cgi文件能够生成html,修改完成后重启Apache2.2

net stop Apache2.2

net start Apache2.2

10. 在Bugzilla目录下,检查perl组件是否完整

C:bugzilla>perl checksetup.pl

我这里发现缺少DateTime等三个perl组件,运行ppm install DateTime后显示:ppm install failed: Cant determine best",解决方法如下:

ppm repo list (第一个是ActiveState Package Repository)

ppm repo off 1

ppm install DateTime

安装所有必须组件

ppm repo on 1

由于第一个组件包仓库似乎有问题,先关闭ActiveState Package Repository仓库,安装完后再打开

11. checksetup后发现还有个问题, MySQL的max_allowed_packet至少需要3276750字节。You need to set the max_allowed_packet parameter in your MySQL configuration to at least 3276750.You can set this parameter in the [mysqld] section of your MySQL

找到mysql的my.ini文件,添加一项

#max SQL allowed packet
max_allowed_packet=4M

重启mysql:

net stop mysql

net start mysql

我一开始设成正好3276750系统只认成了3275776,因此后来设了4M。

12. 打开http://localhost,我这里无法打开,于是只好用http://192.168.1.xx:8080本机的IP以及Apache中设置的端口),进入Bugzilla页面。wooo~看到这个页面那叫一个喜悦啊。。。

13. 事情还没完,需要用checksetup时设置的用户名和密码登陆后,去parameters页面设置url_base,设成http://本机IP:Apache端口/,别忘了结尾的/符号。

14. 为了可以发送email,还要设置smtp服务器,用户名,密码。

设完后报错:

Error requiring
Authen::SASL: ‘Can’t locate Authen/SASL.pm in @INC

上网查了下,还是缺少组件,网上说用ppm搜索email和Authen-SASL相关组件

我装了Unicode-Stringprep, Authen-SASL,其他如果报错,看相关的装。

我用ppm搜到后直接安装,发现默认是装在一个不存在的目录,因此安装报错。

于是我用命令行ppm install 组件名,ok了。添加另一个用户后,可以收到admin发出的邮件了。

—————————————————————————–

总结一下:

需要安装的软件:Bugzilla 3.4.4 + Perl 5.10.1 + MySql 5.1.42 + Apache2.2

实际遇到的问题及解决方法:

// 关闭ActiveState Package Repository,以便安装所需perl组件

ppm repo off 1

安装所有必须组件
ppm repo on 1

// 重设mysql max_allowed_packet

max_allowed_packet=4M

// 发送email缺少组件

用ppm搜索email和Authen-SASL相关组件

ppm install xx

—————————————————————————-

参考资料:

安装步骤:https://wiki.mozilla.org/Bugzilla:Win32Install

解决perl组件缺失却无法安装:http://old.nabble.com/install-DateTime—Can’t-determine-best—after-upgrade-td26202799.html

解决无法发送email:http://old.nabble.com/Bugzilla-mail-send-is-not-working-td25026436.html

—————————————————————————-

漫长的安装过程完毕!

Cheers!

Chilly

Posted in Uncategorized | Leave a comment

iTypeFast Support Blog

Hello Visitor!
This blog is intended to be used as the support blog for the app “iTypeFast” on the App Store.

What’s iTypeFast?
iTypeFast is created to train your typing speed on the iPhone. If you can type a given sentence in the given time, you’ll be able to advance to the next level. The speed limitation will advance a little along with the level. This is an ever-lasting game and you can always challenge faster typing speed. If you play this game for some time, you’ll realize that you’ve almost become a professional typist on the iPhone.

Features:
1. Customizable Game Speed and Screen Orientation
2. Real Typing Sound and Error Vibration
3. Best and Last Speed Recorded
4. Progressbar for Time and Numbers of Characters

Special Tips:
1. Recite the sentence before typing
2. A soft and quick tap is better than a heavy one
3. Focus on the keyboard but keep an eye on the progressbar
4. It is recommended that you replay each level and make a little progress before advance to the next level

If you have any questions, please leave your comments here. I will reply as soon as possible.

Hope you enjoy it and type faster and faster!
Chilly Zhong

Posted in iPhone | Leave a comment

iPlan support blog

     Hallo! visitor

     By the time you see this blog, you should have seen the iPlan app on the App Store. This blog is intended to be used as the support url for iPlan.

icon

primary detail color move add

     I have just started to create something big. Well, actually it’s small. But it is also pretty big. How do you quantify the size of an idea?

     iPlan provides you an exciting way to manage your things better. You will soon notice that iPlan is your own app. You are the person who decide its function. You may use it to manage daily plan, work list, notes, to do list, events or all of these.

     What’s iPlan
     The iPlan is created to help people manage things better with classified lists. First you need to create a catalog and sub-lists (see the slide show above, “Home” is a sub-list of “Catalog”). Then you can add, rename, reorder and search items by tapping the “Edit” button. You can also move items from one list to another (the 4th screenshots) or send your list via Email.

     1. Well-Organized Screens
     Always feel annoyed to handle lists of things, get one thing done and forget another? iPlan uses only 2 primary screens, the Catalog screen and the sub-list screen, to give you quick access to whatever you’ve input in it. You can access to add, rename, reorder, delete, move, color and email functions also in these two screens. You don’t have to go through lots of screens to get things done.

     2. Easy Save and Quickly Relaunch
     When you quit the app, iPlan will save all the lists you modified. You won’t lose anything when you come back. You can quickly relaunch to Catalog screen if you’ve already input something in iPlan. The Welcome screen won’t disturb you every time you relaunch the app.

     3. Send List via Email
     Does your boss ask you to send the work report of the week? If you’ve input it in iPlan, you can quickly send it out via email. Give your boss a big surprise!

     4. Horizontal View Supported
     To help you type easier, this app supports all the other orientations except upside down. You can enjoy typing in landscape mode keyboard. 

     5. Customize Color by Yourself
     Do you feel boring to see all the navigation bars and tool bars in the same color? In iPlan, you can select a customized color for navigationbars and toolbars. Why not choose a color that fits your mood?

     If you meet with any problems, please leave your comments here or you may contact me by email. I’ll reply to you as soon as possible.

     Hope you enjoy it!
     Chilly Zhong

Posted in iPhone | Leave a comment

Send JPG Image via Socket on iPhone

- (void) stream: (NSStream *) stream handleEvent: (NSStreamEvent) eventCode
{
@try {
switch(eventCode)
{
case NSStreamEventOpenCompleted: //open completed
{
NSData *data = UIImageJPEGRepresentation(drawImage.image, 90);
// Convert from native to host endianness
byteData = (Byte *)[data bytes];
len = [data length];
break;
}
case NSStreamEventHasSpaceAvailable: //has space available
{
if(stream == oStream)
{
uint8_t *length = (uint8_t *)(len);
// Don’t forget to check the return value of ‘write’
[oStream write:length maxLength:4];
NSInteger intReturn = [oStream write:byteData maxLength:len];
len -= intReturn;
byteData += intReturn;
}
break;
}
case NSStreamEventEndEncountered: //end encountered
{
[activityIndicator stopAnimating];
[oStream close]; //close output stream
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Successful”
message:nil
delegate:self
cancelButtonTitle:@”OK”
otherButtonTitles:nil];
[alert show];
[alert release];
break;
}
case NSStreamEventErrorOccurred: //error occurred
{
[activityIndicator stopAnimating];
[oStream close];
break;
}
}
}
@catch (NSException * e) {
[activityIndicator stopAnimating];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[e reason]
message:nil
delegate:nil
cancelButtonTitle:@”OK”
otherButtonTitles:nil];
[alert show];
[alert release];
}
}

Posted in iPhone | Leave a comment

VOIP Research——东进D161A语音处理卡应用

什么是VOIP   

      VoIP是Voice over Internet Protocol的缩写,指的是将模拟的声音讯号经过压缩与封包之后,以数据封包的形式在IP 网络的环境进行语音讯号的传输,通俗来说也就是互联网电话、网络电话或者简称IP电话的意思。VoIP技术是目前互联网应用领域的一个热门话题,成为全球互联网与电子商务十大趋势之一(eMarketer)。

VOIP的原理

      VoIP的基本原理是:通过语音的压缩算法对语音数据编码进行压缩处理,然后把这些语音数据按 TCP/IP 标准进行打包,经过 IP 网络把数据包送至接收地,再把这些语音数据包串起来,经过解压处理后,恢复成原来的语音信号,从而达到由互联网传送语音的目的。 IP 电话的核心与关键设备是 IP 网关,它把各地区电话区号映射为相应的地区网关 IP 地址。这些信息存放在一个数据库中,数据接续处理软件将完成呼叫处理、数字语音打包、路由管理等功能。

如何实现长途电话

  在用户拨打长途电话时,网关根据电话区号数据库资料,确定相应网关的 IP 地址,并将此 IP 地址加入 IP 数据包中,同时选择最佳路由,以减少传输时延, IP 数据包经 Internet 到达目的地的网关。在一些 Internet 尚未延伸到或暂时未设立网关的地区,可设置路由,由最近的网关通过长途电话网转接,实现通信业务。

VOIP的优点

      VoIP网络电话会成为将来的主流,技术的可控性、灵活性和经济性优势使网络电话可应用于许多场所。

实例说明

      随着科学技术的不断发展,语音卡被广泛地应用于商业软件中。本例实现了利用语音卡实现电话呼叫的功能。实例运行结果如图13.12所示。

image
图13.12 语音卡电话呼叫系统

技术要点

      本例采用东进公司开发的8路模拟语音卡,该卡采用灵活的模式化设计,可按需配置外线、内线两种模块。该语音卡可实现坐席、会议、FSK数据收发、语音合成等多种功能,并提供SDK开发工具包。
在安装完驱动程序后,相应的动态链接库(NewSig.dllTc08a32.dll文件)会复制到Windows的系统目录下。在语音卡的开发过程中,主要通过调用NewSig.dll和Tc08a32.dll来实现相应的功能。下面介绍这两个动态库中主要使用的函数
(1)LoadDRV函数
该函数用于加载动态链接库。
(2)FreeDRV函数
该函数用于关闭驱动程序。
(3)EnableCard函数
该函数用于初始化语音卡硬件,并为每个通道分配语音缓冲区。
(4)CheckValidCh函数
该函数检测在当前机器内可用的通道总数。
(5)CheckChType函数
该函数用于测试某个通道的类型。
(6)PUSH_PLAY函数
该函数用于维持文件录放音的持续进行,需在处理函数的大循环中调用。
(7)SetBusyPara函数
该函数用于设置要检测的挂机忙音的参数。
(8)RingDetect函数
该函数用于测试外线是否振铃或内线是否提机。
(9)OffHook函数
该函数用于外线提机。
(10)HangUp函数
该函数用于外线挂机。
(11)Sig_Init函数
该函数用于完成信号音检测的初始化工作。
(12)Sig_CheckBusy函数
清空忙音检测的缓冲区以及内部计数。
(13)Sig_ResetCheck函数
该函数用于清空忙音检测的缓冲区以及内部计数。
(14)Sig_StartDial函数
该函数用于拨打电话号码。开始某通道的呼出过程。该函数只是设置通道的呼出缓冲区,真正的呼出过程需要循环调用Sig_CheckDial函数来逐步完成。
(15)Sig_CheckDial函数
该函数用于检测呼出结果。

注意:在进行呼出结果检测之前必须调用函数StartSigCheck启动信号音采集过程,并且在进行呼出结果检测时,要循环调用FeedSigFunc函数维持信号音采集过程。

实现过程
(1)新建一个项目。
(2)在Form1窗体中,主要添加两个Button控件,用于执行电话拨号和电话挂机,添加一个DataGridView控件,显示语音卡各通道及通道状态,添加Timer组件实现电话的呼出过程,添加一个TextBox控件,用于输入呼出电话号码
(3)主要程序代码
      在窗体装载事件中,主要进行初始化语音卡驱动程序,并且检测通道总数及状态,为每一条通道分配语音缓冲区。代码如下:
        private void Form1_Load(object sender, EventArgs e)
        {
            //初始化驱动程序
            long load = DJ160API.LoadDRV();
            //检测通道总数,并为每个通道分配语音缓冲区
            short wuseCh = DJ160API.CheckValidCh();
            short wFileBufLen = 16 * 1024;
            long card = DJ160API.EnableCard(wuseCh, wFileBufLen);
            //设置表格通道的行数
            dataGridView1.RowCount = wuseCh;
            //检测每个通道类型
            short chanelTpye = 0; //定义通道类型变量
            string strType = "";
            for (short i = 0; i < wuseCh; i++)
            {
                chanelTpye = DJ160API.CheckChType(i);
                dataGridView1[0, i].Value = i;
                switch (chanelTpye)
                {
                    case 0:
                        strType = "内线";
                        break;
                    case 1:
                        strType = "外线";
                        break;
                    case 2:
                        strType = "悬空";
                        break;
                }
                dataGridView1[1, i].Value = strType;
                dataGridView1[2, i].Value = "空闲";
            }
        }
      在DataGridView控件中选择一个外线空闲通道,单击【拨号】按钮,进行电话拨号,并且将拨号过程中的状态显示在相应的DataGirdView表格中。代码如下:
        private void button1_Click(object sender, EventArgs e)
        {
            short wuseCh = DJ160API.CheckValidCh();
            short wFileBufLen = 16 * 1024;
            long card = DJ160API.EnableCard(wuseCh, wFileBufLen);
            DJ160API.Sig_Init(chanel);
            //检查(外线)是否有振铃信号或(内线)是否有提机
            bool ring = DJ160API.RingDetect(chanel);
            //外线提机
            DJ160API.OffHook(chanel);
            byte[] ss =new byte[textBox1.Text.Length];
            byte[] s ={ 0 };
            for (int i = 0; i < textBox1.Text.Length; i++)
            {
                ss[i] = Convert.ToByte(textBox1.Text.Substring(i, 1));
            }
            DJ160API.Sig_StartDial(chanel, ss, s, 0);
            timer1.Enabled = true;
            dataGridView1[2, chanel].Value = "拨号中…";
            dataGridView1[3, chanel].Value = textBox1.Text;
        }
      单击【挂机】按钮,实现电话挂机功能。代码如下:
        private void button2_Click(object sender, EventArgs e)
        {
            DJ160API.HangUp(chanel);
            DJ160API.Sig_ResetCheck(chanel);
            DJ160API.StartSigCheck(chanel);
            timer1.Enabled = false;
            dataGridView1[2, chanel].Value = "空闲";
            dataGridView1[3, chanel].Value = "";
        }
      Sig_StartDial函数用于拨打电话号码。开始某通道的呼出过程。该函数只是设置通道的呼出缓冲区,真正的呼出过程需循环调用Sig_CheckDial函数来逐步完成。代码如下:
        private void timer1_Tick(object sender, EventArgs e)
        {
            DJ160API.Sig_CheckDial(chanel);
        }
      单击DataGridView控件的相应行记录相应的通道号,代码如下:
   private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            chanel = (short)e.RowIndex;
        }

参考资料:

http://blog.csdn.net/long102/archive/2007/10/31/1859287.aspx

完整的东进D161A板卡API函数类:

http://www.dj.com.cn/donjinbbs/ShowPost.asp?action=Previous&id=2789

Posted in Uncategorized | Leave a comment