<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ivaneeo's blog

    自由的力量,自由的生活。

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

    #

    1.ruby
    ??? http://www.ruby-doc.org/core/
    ??? 代理訪問:http://anonymouse.org/cgi-bin/anon-www.cgi/http://www.ruby-doc.org/core/

    ??? http://www.ruby-doc.org/stdlib/
    2.rmagick
    ??? http://studio.imagemagick.org/RMagick/doc/index.html

    3.gemjack.com集合的大多數rdoc(推薦!)
    ??? http://gemjack.com/
    posted @ 2006-11-20 17:44 ivaneeo 閱讀(488) | 評論 (0)編輯 收藏

    mysql和oracle存儲圖片文件都是用blob類型,但是ruby怎么處理的呢?
    ruby還是把它當作字符串,但是要經過加工.

    我們完全可以使用rmagick這個圖形庫來進行.


    代碼:
    ??? require 'rubygems'
    ??? require_gem 'rmagick'
    ??? include Magick

    ??? DBI.connect('DBI:Mysql:test_dbo:192.168.0.164', 'mysql', '') { |dbh|
    ???? dbh.execute 'SET NAMES utf8'
    ?????? 1.upto(13) { |i|
    ??? ? str = "insert into users(name, pwd, img) values(?,?,?)"
    ???? dbh.prepare(str) { |st|
    ?jpg = Image.read('1.jpg').first
    ? st.execute('a', 'b', jpg.to_blob)
    ? }
    ?}
    }

    如果從數據庫反響出來,也類似(from_blob方法)

    posted @ 2006-11-20 17:38 ivaneeo 閱讀(499) | 評論 (0)編輯 收藏

    首先創建表,我們這里默認編碼utf8:

    create table samples (
    ????id int not null auto_increment,
    ????foo varchar(100) not null,
    ????bar text not null,
    ????primary key (id)
    ) Type=MyISAM CHARACTER SET utf8;


    這里創建表類型時要使用MyISAM類型,因為只有MyISAM類型才支持完整的utf8.最后設置編碼utf8.

    1.dbi操作數據庫
    如果你本地編碼時gbk的話,首先要默認類Iconv進行轉換.
    require 'iconv'
    def gb2u str
    conv = Iconv.new("UTF-8", "GBK")
    str = conv.iconv(str)
    str << conv.iconv(nil)
    conv.close

    str
    end

    插入代碼:
    DBI.connect('DBI:Mysql:test:localhost', 'mysql', '') { |dbh|
    dbh.execute 'SET NAMES utf8' #這里要指明代碼
    1.upto(13) { |i|
    st.execute("insert into samples(foo, bar) values('#{gb2u('一')}#{i}', '#{gb2u('二')}')")
    }
    }



    2.activerecord
    activerecord是對dbi的包裝.(也更神,呵呵!)
    代碼:
    require 'rubygems'
    require_gem 'activerecord' #因為我是gem的安裝

    ActiveRecord::Base.establish_connection(
    :adapter => "mysql",
    :host => "localhost",
    :database => "test",
    :username => "mysql",
    :password => "",
    :encoding => "utf8") #編碼只需這里指明

    #指明表
    class Mytab < ActiveRecord::Base
    set_table_name 'samples'
    end

    #插入數據
    tab = Mytab.new
    tab.foo= gb2u('一')
    tab.bar = gb2u('二')
    tab.save

    #查詢數據
    data = Mytab.find(:all)
    data.each { |line|
    puts "['#{line[:id]}', '#{line[:foo]}, '#{line[:bar]}]"
    }




    posted @ 2006-11-20 14:28 ivaneeo 閱讀(646) | 評論 (0)編輯 收藏

    看rrobots的一個簡單的例子:

    ----------------------- code -----------------------
    require 'robot'

    class NervousDuck
    ?? include Robot

    ? def tick events
    ??? turn_radar 1 if time == 0
    ??? turn_gun 30 if time < 3
    ??? accelerate 1
    ??? turn 2
    ??? fire 3 unless events['robot_scanned'].empty?
    ? end
    end

    ----------------------- code -----------------------

    這里至少要實現tick方法.

    下面是控制robot的一些方法和屬性:

    ? battlefield_height? #the height of the battlefield
    ? battlefield_width?? #the width of the battlefield
    ? energy????????????? #your remaining energy (if this drops below 0 you are dead)
    ? gun_heading???????? #the heading of your gun, 0 pointing east, 90 pointing
    ????????????????????? #north, 180 pointing west, 270 pointing south
    ? gun_heat??????????? #your gun heat, if this is above 0 you can't shoot
    ? heading???????????? #your robots heading, 0 pointing east, 90 pointing north,
    ????????????????????? #180 pointing west, 270 pointing south
    ? size??????????????? #your robots radius, if x <= size you hit the left wall
    ? radar_heading?????? #the heading of your radar, 0 pointing east,
    ????????????????????? #90 pointing north, 180 pointing west, 270 pointing south
    ? time??????????????? #ticks since match start
    ? speed?????????????? #your speed (-8/8)
    ? x?????????????????? #your x coordinate, 0...battlefield_width
    ? y?????????????????? #your y coordinate, 0...battlefield_height
    ? accelerate(param)?? #accelerate (max speed is 8, max accelerate is 1/-1,
    ????????????????????? #negativ speed means moving backwards)
    ? stop??????????????? #accelerates negativ if moving forward (and vice versa),
    ????????????????????? #may take 8 ticks to stop (and you have to call it every tick)
    ? fire(power)???????? #fires a bullet in the direction of your gun,
    ????????????????????? #power is 0.1 - 3, this power will heat your gun
    ? turn(degrees)?????? #turns the robot (and the gun and the radar),
    ????????????????????? #max 10 degrees per tick
    ? turn_gun(degrees)?? #turns the gun (and the radar), max 30 degrees per tick
    ? turn_radar(degrees) #turns the radar, max 60 degrees per tick
    ? dead??????????????? #true if you are dead
    ? say(msg)??????????? #shows msg above the robot on screen
    ? broadcast(msg)????? #broadcasts msg to all bots (they recieve 'broadcasts'
    ????????????????????? #events with the msg and rough direction)

    posted @ 2006-11-18 00:33 ivaneeo 閱讀(463) | 評論 (0)編輯 收藏

    首先要設置返回頭jsp頁面:response.setContentType("text/xml");

    var node=xmlHttpReq.responseXML.documentElement.childNodes;
    document.write("當前在線人數" +node.item(0).textContent+"人");

    for(obj_key in node.item(0)){
    alert(obj_key);
    }這個方法知道的textContent這個方法的

    posted @ 2006-11-16 19:55 ivaneeo 閱讀(522) | 評論 (0)編輯 收藏

    兼容微軟Office的辦公軟件OpenOffice,可用于文檔處理,電子表格和幻燈片制作;類似于Outlook,集成郵件、聯系人、日程和任務管理等強大功能的 Evolution;GGV和XCHM分別用于查看PDF和CHM文檔;Smart-Storage讓U盤、移動硬 盤、讀卡器、 MP3、MP4、數碼相機及刻錄機的使用變得異常簡單;英漢詞典 Stardict;壓縮與歸檔工具File-Roller;Planner和Dia分別用于項目管理和流程 圖制作。

    以安全輕便著稱的Firefox瀏覽器,支持多頁面瀏覽、屏蔽彈出式窗口和網頁字體放大;類似于Foxmail,可用于收發郵件、新聞組及RSS的 Thunderbird;支持 ICQ、Yahoo、MSN、IRC、Jabber等協議的即時通訊軟件Gaim;用于視頻對話的 Gnomemeeting;支持斷點續傳的D4X;用于BT下載的Gnome-BT;可實現網絡IP電話的Linphone;用于遠程桌面控制和診斷的 Tsclient。


    類似于Photoshop的強大圖像處理工具Gimp;類似于Coreldraw或Illustrator的矢量處理軟件Inkscape;類似于 Pagemaker的排版軟件Scribus;類似于3D Max的三維設計軟件Blender;類似于Acdsee的圖片管理軟件Gthumb、F-Spot;Xsane掃描軟 件簡單易用。

    超能媒體播放器Totem,支持目前流行的大多數影音格式和在線播放;用于抓取CD 音軌的Sound-Juicer;用于組織和管理大量數碼音樂的 Rhythmbox;類似于Winamp 的MP3播放軟件bmp;簡潔的電視播放器Tvtime;高品質的錄音軟件;各種趣味盎然 的游戲軟件。
    posted @ 2006-11-16 14:23 ivaneeo 閱讀(545) | 評論 (0)編輯 收藏

    				1。gem query --remote        # shortcut: gem q -R
    #列出所有包
    2。gem query --remote --name-matches doom # shortcut: gem q -R -n doom
    #列出所有名字匹配的包
    3。gem install --remote progressbar # shortcut: gem i -r progressbar
    #安裝指定名字的包。
    gem ins -r progressbar --version '> 0.0.1' #這里可以匹配版本
    4。gem specification progressbar # shortcut: gem spec progressbar
    #查看安裝過的指定包詳細信息
    5。gem uninstall progressbar
    #卸載包
    6。gem query --local # shortcut: 'gem q -L'
    #列出所有本地安裝過的包
    7。gem ins rake
    #在本地安裝,如果沒有遠程安裝
    8。gem list -b ^C
    #列出所有以C開頭的包
    9。gem_server
    開啟rdoc服務。可以查看安裝包的rdoc
    posted @ 2006-11-07 21:12 ivaneeo 閱讀(525) | 評論 (0)編輯 收藏

    小弟發現的不錯的東東: ubuntu設置
    posted @ 2006-11-07 13:56 ivaneeo 閱讀(377) | 評論 (0)編輯 收藏

    這里現在xunleibho_v14.dll

    命令行輸入:regsvr32 xunleibho_v14.dll

    posted @ 2006-11-06 21:59 ivaneeo 閱讀(2758) | 評論 (0)編輯 收藏

    #mdconfig -a -t vnode -f abc.iso -u 1
    #mount_cd9660 /dev/md0 /mnt
    posted @ 2006-11-02 18:49 ivaneeo 閱讀(517) | 評論 (0)編輯 收藏

    僅列出標題
    共67頁: First 上一頁 20 21 22 23 24 25 26 27 28 下一頁 Last 
    主站蜘蛛池模板: 免费看美女被靠到爽| 国产美女精品久久久久久久免费| 中文字幕一区二区免费| 精品无码国产污污污免费网站国产| 免费看男人j放进女人j免费看| 亚洲一区二区三区免费观看| 99久久综合国产精品免费| 免费永久国产在线视频| 久久精品国产亚洲AV无码娇色| 亚洲男人天堂2018av| 国产视频精品免费视频| 亚洲精品卡2卡3卡4卡5卡区| 亚洲日韩看片无码电影| 青青操免费在线观看| 亚洲AV无码专区在线播放中文| 亚洲中文字幕无码中文| 99精品视频免费在线观看| 免费看国产精品麻豆| 中文字幕免费播放| 午夜亚洲av永久无码精品| 亚洲国产精品网站久久| 国产大片免费天天看| 永久免费毛片手机版在线看| 日韩免费码中文在线观看| 黄色片在线免费观看| 久久亚洲春色中文字幕久久久| 久久天天躁狠狠躁夜夜免费观看| 久久亚洲欧美国产精品| 在线免费观看国产| 亚洲国产精华液网站w| 一级做a爰片久久毛片免费陪| 国产成人亚洲精品青草天美| 69式国产真人免费视频| 亚洲蜜芽在线精品一区| 高清一区二区三区免费视频 | 人成午夜免费视频在线观看| 亚洲s码欧洲m码吹潮| 女性自慰aⅴ片高清免费| 亚洲美女免费视频| 免费人成视频x8x8入口| 免费看美女午夜大片|