Dahua's profile笑对人生,傲立寰宇PhotosBlogLists Tools Help
    August 26

    minesweeper

    有好些时间没有更新blog,因为这段时间有很多别的事情:所做的research最近在进行implementation,观看奥运,接待朋友,搬家 。。。。。。现在生活开始转回学期的状态了。

    这一年来在Csail一直使用Linux工作站,它的性能非常出色。前两天工作到晚上的时候,有点疲惫,想干点别的——终于发现这台机子的系统缺了一点东西——没有游戏。于是,自己动手,丰衣足食,用MATLAB写了一个扫雷,呵呵。我不是艺术青年,也就谈不上有多少美工设计了,不过玩起来的感觉,和在windows下的扫雷也没有太大差别。

    程序放到Matlab Exchange上面了,有兴趣就去瞧瞧吧,呵呵

    http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=21211&objectType=file

    后来才发现,KDE下面还是有扫雷的,叫KMines。不过,还是自己写的东西比较亲切了。

    现在越来越多的科学计算以外的东西开始在matlab下面被实现了——虽然不如在windows下面的counterpart pp,不过功能都挺齐全。Emacs的Fans们可以一天到晚只用Emacs一个程序不出来完成几乎全部的工作和娱乐。matlab离这种“操作系统化”的境界也不远了。

    matlab自己的浏览器,你可以试试: web('www.google.com');  还有自己的ftp,文件下载命令urlread,音乐播放命令play,和电影播放命令movie。(在低版本matlab,上面的部分命令可能还没提供)

    像email, painter这样的功能虽然暂时还没有内建,不过,实现起来也不是特别困难了。也许在不远的将来,我们真的可以长时间在matlab下面完成各种工作不用出来。

    ----------------------------------------------------------------------------------------------------

    既然说到这里,就继续说点MATLAB的GUI编程吧。以前,在香港的时候,当算法要移植到系统的时候,都是用C#来完成外围的UI。现在,已经长时间在Linux下面工作了。坦白的说,可以选择的UI结构其实是更多了,主要有GTK, Qt,还有Java里面的Swing, Swt。但是,它们现在还处在战国时代,百家争鸣,却没有主流。现在自己写一些UI也主要是为了自己方便,也就不想折腾太多架构了,还是回到Matlab去吧。

    比起其它高级语言下面的常用UI体系,Matlab的UI还是比较“土”的——但是,非常实用。它提供了一种普通语言一般没有内建的控件:axes,你可以直接在里面绘制各种图表。另外一个优势,就是和matlab代码的无缝套接,原来写好的算法,不需要任何移植或者重新封装,就能在这个UI上面直接调用。虽然长得很朴素,但是,对于科学方面的应用,它的开发效率无疑是最高的。

    它提供了两种编写GUI应用程序的方式:使用Guide(一个类似于窗口设计器的东西,能直接往里面拉控件和调节参数),或者是直接手工写代码。我个人比较偏向于使用后者,一来自己写的东西代码比较简洁,二来自己能够自由选择合适的程序结构(取决于应用的逻辑),而不受限于自动生成的程序结构。

    但是,写matlab对GUI应用有一个根本性的缺陷,那就是这种语言的核心不支持多线程编程(它的新版支持多核运算,但是和multithread不是一个概念),任何长时间的程序一旦跑起来,就会把其它东西的运行block掉。因此,它适合用于单步运算时间不太长的交互式算法,而长时间运行的陈程序,比如大规模的training,一般情况还是不要用UI来控制了。

    Comments (17)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    No namewrote:
    <a href="http://wakayama.galsnetwork.com/mobile/">和歌山 デリヘル</a>
    <a href="http://hyogo.galsnetwork.com/mobile/">神戸 デリヘル</a>
    <a href="http://himeji.galsnetwork.com/mobile/">姫路 デリヘル</a>
    <a href="http://osaka.galsnetwork.com/mobile/">大阪 デリヘル</a>
    <a href="http://kyoto.galsnetwork.com/mobile/">京都 デリヘル</a>
    <a href="http://nara.galsnetwork.com/mobile/">奈良 デリヘル</a>
    <a href="http://osaka.club-valentine.com/m/">大阪 デリヘル</a>
    <a href="http://hyogo.club-valentine.com/m/">神戸 デリヘル</a>
    <a href="http://wakayama.club-valentine.com/m/">和歌山 デリヘル</a>
    <a href="http://nara.club-valentine.com/m/">奈良 デリヘル</a>
    <a href="http://www.valentine-kyoto.com/m/">京都 デリヘル</a>
    <a href="http://hyogo.pro-file.jp/m/">神戸 デリヘル</a>
    <a href="http://himeji.pro-file.jp/m/">姫路 デリヘル</a>
    <a href="http://wakayama.pro-file.jp/m/">和歌山 デリヘル</a>
    <a href="http://nara.pro-file.jp/m/">奈良 デリヘル</a>
    <a href="http://kyoto.pro-file.jp/m/">京都 デリヘル</a>
    <a href="http://osaka.pro-file.jp/m/">大阪 デリヘル</a>
    <a href="http://minamiosaka.pro-file.jp/m/">南大阪 デリヘル</a>
    <a href="http://ichigo-m.com/m/">大阪 デリヘル</a>

    Sept. 4
    No namewrote:

    <a href="http://wakayama.galsnetwork.com/">和歌山 デリヘル</a>
    <a href="http://hyogo.galsnetwork.com/">神戸 デリヘル</a>
    <a href="http://himeji.galsnetwork.com/">姫路 デリヘル</a>
    <a href="http://osaka.galsnetwork.com/">大阪 デリヘル</a>
    <a href="http://kyoto.galsnetwork.com/">京都 デリヘル</a>
    <a href="http://nara.galsnetwork.com/">奈良 デリヘル</a>
    <a href="http://osaka.club-valentine.com/">大阪 デリヘル</a>
    <a href="http://hyogo.club-valentine.com/">神戸 デリヘル</a>
    <a href="http://wakayama.club-valentine.com/">和歌山 デリヘル</a>
    <a href="http://nara.club-valentine.com/">奈良 デリヘル</a>
    <a href="http://www.valentine-kyoto.com/">京都 デリヘル</a>
    <a href="http://hyogo.pro-file.jp/">神戸 デリヘル</a>
    <a href="http://himeji.pro-file.jp/">姫路 デリヘル</a>
    <a href="http://wakayama.pro-file.jp/">和歌山 デリヘル</a>
    <a href="http://nara.pro-file.jp/">奈良 デリヘル</a>
    <a href="http://kyoto.pro-file.jp/">京都 デリヘル</a>
    <a href="http://osaka.pro-file.jp/">大阪 デリヘル</a>
    <a href="http://minamiosaka.pro-file.jp/">南大阪 デリヘル</a>
    <a href="http://ichigo-m.com/">大阪 デリヘル</a>

    Sept. 4
    No namewrote:
    <a href="http://hr-soft.co.jp/">サイト制作</a>
    <a href="http://www.dress-me.jp/">ドレス レンタル</a>
    <a href="http://www.salon-antiage.com/">アートメイク</a>
    <a href="http://www.a-onemp.co.jp/">アパレル</a>
    <a href="http://www.hanana.jp/">アロマセラピー</a>
    <a href="http://www.salonr.jp/">恵比寿 メンズエステ</a>
    <a href="http://www.ravenna-p-s.jp/">恵比寿 エステ</a>
    <a href="http://www.ibs-hrc.jp/">ダイエット クエン酸</a>
    <a href="http://www.shihantei.com/wedding/">レストラン ウェディング</a>
    <a href="http://maquiaonline.com/CGI/fanclub/index.cgi?fanclubseq=0000006"> ランコム</a>
    <a href="http://maquiaonline.com/CGI/fanclub/index.cgi?fanclubseq=0000004"> エスティローダー</a>
    <a href="http://maquiaonline.com/CGI/fanclub/index.cgi?fanclubseq=0000009"> ルナソル</a>
    <a href="http://jinjajin.jp/">神社</a>
    <a href="http://www.toko-web.co.jp/">建設機械レンタル</a>
    <a href="http://winefun.jp/">ワイン</a>
    <a href="http://winefun.jp/">シャンパン</a>
    <a href="http://www.fit-comp.jp/">ダイエット 方法</a>
    Sept. 4
    No namewrote:

    <a href="http://www.aaa-ch.net/">風俗</a>
    <a href="http://www.aaa-ch.net/">デリヘル</a>
    <a href="http://www.aaa-ch.net/m/">風俗</a>
    <a href="http://www.aaa-ch.net/area.php?category=2000">デリヘル 風俗</a>
    <a href="http://www.akibain.com/">エロゲー</a>
    <a href="http://www.pure-soapland.com/i/">ソープランド</a>
    <a href="http://www.pure-soapland.com/i/">吉原 ソープランド</a>
    <a href="http://chuh.jp/">出会い</a>
    <a href="http://pc.chuh.jp/">出会い</a>
    <a href="http://www.erogle.net/m/">デリヘル</a>
    <a href="http://www.pure-soapland.com/chiiki/susukino/">すすきの ソープランド</a>
    <a href="http://www.pure-soapland.com/chiiki/sonota/">新宿 ソープランド</a>
    <a href="http://www.pure-soapland.com/chiiki/chiba/">千葉 ソープランド</a>
    <a href="http://www.pure-soapland.com/chiiki/saitama/">埼玉 ソープランド</a>
    <a href="http://www.pure-soapland.com/chiiki/kanagawa/">神奈川 ソープランド</a>
    <a href="http://www.pure-soapland.com/index2.html">吉原 ソープランド</a>
    <a href="http://avshop.jp/">sod</a>
    <a href="http://dreamynightshop.jp/">バイブ</a>
    <a href="http://onstyle.co.jp/">風俗求人 高収入</a>
    <a href="http://onstyle.co.jp/">都内 キャバクラ 全額日払い</a>
    <a href="http://ecsta.tv/">無料動画</a>
    <a href="http://kansai.bigdesire.co.jp/">大阪 風俗</a>
    <a href="http://kansai.bigdesire.co.jp/mobile/">大阪 風俗</a>
    <a href="http://kansai.yorutomo.net/i/">神戸 風俗</a>
    <a href="http://www.eroshima.com/">裏DVD</a>
    <a href="http://www.eroshima.com/mobile/">裏DVD</a>
    <a href="http://valentine-works.com/">風俗 求人</a>
    <a href="http://valentine-works.com/m/">風俗 求人</a>
    <a href="http://no1-shinjuku.jp/">デリヘル 新宿</a>
    <a href="http://no1-shinjuku.jp/">デリヘル 東京</a>
    <a href="http://www.55group.jp/">千代田区 デリヘル</a>
    <a href="http://www.55group.jp/">台東区 デリヘル</a>
    <a href="http://www.55group.jp/">墨田区 デリヘル</a>
    <a href="http://www.55group.jp/">中央区 デリヘル</a>



    Sept. 4
    Feb. 15
    caowrote:
    hi, Dahua,
    新年快乐!
    上个星期又去波士顿开会,结果自己病倒了,没法出来,也没通知你和小刚。(呜呜,感冒了坐飞机耳朵都嗡嗡作响,好惨)
    波士顿好冷冷冷啊~多多保重, healthy 2009!
    Jan. 28
    xin yewrote:
    看了你好多篇文章 都是学术方面的 觉得写的不枯燥反而很吸引人:)我的msn是 xinxincrystal@live.cn 记得加我:)
    Jan. 4
    Nov. 10
    Nov. 5
    Oct. 23
    matlab的功能确实超乎我们的想象的,特别是还有很多优美的现在还远没有被发掘。
    这就像游戏一样,有人找出的东西可以让设计者都称奇
    Sept. 24
    Picture of Anonymous
    Zane wrote:
    了不起呀!
    Sept. 13
    Sept. 4
    YiMin Zhongwrote:
    用Linux操作系统上面游戏好象很多,KDE的要比用GNOME多一些,最近自己刻了一张Ubuntu准备试一下,以前的Debian搞的DEB太多就乱了,蛮怀念Red Hat时代的。
    Aug. 27
    Dahua Linwrote:
    由于丢失了原来的帐号,我不得不开设了新的空间。就让这里从此成为一个永恒的留念吧。
     
    请大家以后转到我的新空间:
     
     
    谢谢。
     
    Dahua
    Aug. 27
    Yao Xiewrote:
    matlab也时髦了
    Aug. 27
    nan yiwrote:
    收发email, 短信,在matlab已经可以实现了
    Aug. 26

    Trackbacks

    The trackback URL for this entry is:
    http://dahua.spaces.live.com/blog/cns!28AF4251DF30CA42!2661.trak
    Weblogs that reference this entry
    • None