2008年6月30日星期一

Hotspot Shield真好用

前一段时间发现用firefox无法在这里创建新文章了,用IE可以~再后来用IE也不可以了~
今天看到介绍Hotspot Shield,装上以后好像就可以了,哈哈
同时看到它是用VPN穿越的网络,不由想到能不能用来创建我自己的主机,让校园网外能访问呢?这个问题很诱人,要琢磨琢磨~

2008年6月22日星期日

面对而不是逃避

面对而不是逃避,这是我唯一的选择!
面对困难,有足够的力量,有足够的支持,有必胜的信念,选择面对而不是逃避,没什么好说的了,Keep going!

2008年6月21日星期六

这个月结尾的任务

这个月很快就要过去了,我的JTSS却还没有完成!
效率太低了!!
剩下的时间全力干这个,排除一切干扰!

奇怪

最近发现用Firefox不能在这里写博客了~用IE登录却可以!
不知道出了什么问题??

2008年6月18日星期三

HOWTO: Send and Receive Hotmail through Evolution

HOWTO: Send and Receive Hotmail through Evolution

Okay everyone, after digging around in these forums and googling like I've never googled before, I figured out how to send and receive e-mail through hotmail using Evolution. I'm throwing together a rough HOWTO for others. If things need more clarification, let me know and I'll update it.

First, make sure your system is up to date. Open up a terminal and type:

Code:
sudo apt-get update
Now, install the inet daemon

Code:
sudo apt-get install inetutils-inetd
This takes care of all of our dependencies. Now on to the good stuff...

Code:
sudo apt-get install hotway hotsmtp
This will install hotway, which allows you to read hotmail e-mails by simulating a POP3 server, and hotsmtpd, which allows you to send e-mail through hotmail using SMTP. By default, however, only hotway gets installed properly to your inet daemon, so let's fix this.

Code:
sudo gedit /etc/inetd.conf
Look for a line like this:

Code:
pop3  stream tcp nowait nobody /usr/sbin/tcpd /usr/bin/hotwayd
By default, hotway leaves a copy of each message it downloads on the server. I prefer it this way, so I can read my e-mail at other locations, but if you don't feel like filling up your hotmail box, change the line to add "-r" to the end, like this:

Code:
pop3  stream tcp nowait nobody /usr/sbin/tcpd /usr/bin/hotwayd -r
And we also need to add a line to get hotsmtpd working, just paste this at the bottom:

Code:
2500  stream tcp nowait nobody /usr/sbin/tcpd /usr/bin/hotsmtpd
This will set the inet daemon to listen to incoming calls on port 2500, and forward the connection to the hotsmtp daemon. Now, save your file, exit gedit, and restart your inetd server:

Code:
sudo /etc/init.d/inetutils-inetd restart
If everything is working properly, you'll see this pop up on your screen:

Code:
* Restarting internet superserver inetd                            [ ok ]
Now, close out of your terminal and start up Evolution. It may pop up the first-time use wizard, you can use that if you like. Or, you may have to go to Edit->Preferences and hit the Mail Accounts button on the left. However you choose to do it, here's your information:

Email Address: xxx@hotmail.com (fill in your normal e-mail address that you use to login to hotmail)

Receive Server type: POP
Server: 127.0.0.1
Username: xxx@hotmail.com (same as above)
Security: No encryption
Authentication type: Password
(Remember password checkbox is up to you)

Send Server type: SMTP
Server: 127.0.0.1:2500
[X] Server requires authentication (check this box)
Use Secure Connection: No encryption
Authentication Type: PLAIN
Username: xxx@hotmail.com (same as above)
(Optional Remember password checkbox)

2008年6月12日星期四

初尝QtJambi

今天好不容易下载了qt4.4linux版,编译了半天,终于装好了。qtjambi就简单多了,解压缩后拷贝到/usr/local/Trolltech4.4.0/,直接就可以用了~
在Eclipse里设置好qtjambi的目录,新建了一个项目试了一下,和在C++里感觉差不多,不过好多功能还没用,以后就先用jambi来构建二维显示模块。

2008年6月9日星期一

关于将仿真底层与显示分离的想法

由于师弟的代码使用C#写的,我要将我的仿真系统(Java写的)的数据传送到他的程序,就是一个进程间通讯(IPC)的问题,当然,这里只是单向的通讯,控制中心无需向仿真系统发送数据。
上网搜了一下如何实现IPC,发现网络方式是最不依赖于底层操作系统的,因为Java和C#都能很好的支持网络操作。进一步的考察选择TCP还是UDP方式,感觉UDP的组播方式最适合我的需求。因为仿真系统本身就有底层MAS与显示系统之间接口的问题,通过UDP组播方式,将底层MAS单独实现为一个系统,通过一个接口Agent向固定的组播IP发送数据,显示系统和控制中心这样的数据接收者则加入上述组播组,接收组播消息。
由于底层系统是不依赖于显示和其他系统模块的,这样就可以在实现底层系统时不用关心其他模块的实现,做到最大程度的解耦~显示和其他模块也不用关心底层系统的实现,只需接收组播消息即可,然后进行解析,完成自身功能。这样可以分别实现2D和3D显示模块,且这两个模块可以共享组播数据解析模块的代码~
另一个显而易见的好处是,可以在不同的计算机上运行不同的模块,充分利用计算机网络中多台计算机的处理能力,使得以后扩展更容易。比如,路网规模扩大后,可以在多台计算机上运行不同区域的底层仿真系统,向不同的组播地址发送消息,显示模块可以通过选择加入不同的组播组还切换接收不同区域的仿真结果来显示,或者用多台计算机同时显示不同区域的仿真结果。
以上的网络操作都是在本地局域网内实现的,因此网络速度不是问题,UDP的效率优势得到充分发挥的同时,其劣势也可以忽略,这是我目前能想到的最佳方案了~

2008年6月1日星期日

初步搞定win32下使用Win32 API和Qt库进行串口编程

经过几天的努力,终于基本上搞定Win32下的串口编程了,使用的是Qt的界面,用了Qt的多线程,串口操作没有用控件,直接对Win32 API进行调用,大部分串口操作都封装在一个类中,在辅助线程中进行串口事件的设置和等待,根据我的需要,设置等待特定字符的到达,暂时设为‘\n’,在NMEA语句中这是一条语句的结束符。等到特定字符到达后,辅助线程emit一个信号给GUI主线程,在主线程中调用串口操作类进行非重叠读操作,读取的字节长度=此时输入缓冲区内字符串的长度,通过动态分配内存来满足需要。在主线程中将读取的字符串显示出来,然后释放动态分配的内存。
现在多线程部分没有问题了,今天大部分时间都是在调试多线程,开始时eclipse中好像不能用gdb在Windows下调试多线程,总是出错。后来不知怎么搞的又可以了,抓紧调了一下,发现主要问题出在等待500ms超时后,想让辅助线程休眠100ms,使用了sleep(100),嘿嘿,应该是msleep(100)。
由于手头没有串口输入信号,串口读操作的代码还没有测试,明天去学校测一下,半天内全部搞定!然后发给其他人,这个东西要开源~~:)