显示下一条  |  关闭

周行天下

舟者,行遍天下

 
 
 
 
 
 
模块内容加载中...
 
 
 
 
 

日历

 
 
模块内容加载中...
 
 
 
 
 
 我要留言
 
 
 
留言列表加载中...
 
 
 
 
 
 
 
 

ruby 基础知识

2008-3-12 10:38:06 阅读125 评论10 122008/03 Mar12

一、基本入门知识

1.ruby -cw c2f.rb 检查代码语法错误

2.puts 输入换行,print输出不换行,gets等待键盘输入

3.to_i将字符串转化为整数

4.File.read()从文件读取,例:File.read("temp.dat")

5.File.new() 输出至文件,例:fh = File.new("temp.out", "w") w为打开模式

6.require请求加载文件,例:require 'requiree.rb'

7.load,同require,区别:可以加载多次

二、解释器知识

1.ruby命令行开关

作者  | 2008-3-12 10:38:06 | 阅读(125) |评论(10) | 阅读全文>>

Netbeans 英文启动

2008-3-6 12:46:38 阅读42 评论0 62008/03 Mar6

在 IDE-HOME/etc/netbeans.conf 文件中设置启动参数
为 netbeans_default_options 添加启动参数:--locale en_US

类似这样:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true --locale en_US"

参考Netbeans帮助中“IDE启动参数”一节

作者  | 2008-3-6 12:46:38 | 阅读(42) |评论(0) | 阅读全文>>

A Ruby on Rails plugin from the makers of AjaxScaffold

2008-3-5 10:05:23 阅读21 评论0 52008/03 Mar5

ActiveScaffold

A Ruby on Rails plugin from the makers of AjaxScaffold

Latest release is 1.1.1:

作者  | 2008-3-5 10:05:23 | 阅读(21) |评论(0) | 阅读全文>>

rails插件

2008-2-29 9:11:38 阅读18 评论0 292008/02 Feb29

分页插件:ruby script/plugin install svn://errtheblog.com/svn/plugins/will_paginate  

spec插件:

作者  | 2008-2-29 9:11:38 | 阅读(18) |评论(0) | 阅读全文>>

ruby使用gzip获取网页内容

2008-2-19 15:45:10 阅读40 评论0 192008/02 Feb19

require 'net/http'
require 'uri'
module Net
  class HTTP
    def HTTP.get_with_headers(uri,headers=nil)
      uri=URI.parse(uri) if uri.respond_to? :to_str
      start(uri.host,uri.port) do |http|
        return http.get(uri.path,headers)
      end

作者  | 2008-2-19 15:45:10 | 阅读(40) |评论(0) | 阅读全文>>

ruby版本的ftp批量下载

2008-2-13 13:51:57 阅读81 评论0 132008/02 Feb13

#
# To change this template, choose Tools | Templates
# and open the template in the editor.
 
require 'net/ftp'


#include Tests

def upload_file(host,user,password,local_folder,remote_folder,size)
  ftp_client=Net::FTP.new(host)
  ftp_client.login(user,password)
  get_folder("*",remote_folder,ftp_client,create_folder(local_folder),size)

作者  | 2008-2-13 13:51:57 | 阅读(81) |评论(0) | 阅读全文>>

觉得能触动的的,请顶一顶

2008-2-13 13:03:06 阅读12 评论1 132008/02 Feb13

1.   他——是一位西藏运输兵,   军功章代表着他为祖国立的汗马功劳,   可他连自己的妻子难产死亡都没来的及看上一眼。下跪,   在妻儿的墓前下跪……男儿一跪仍英雄!!!!


2.相信大家都有过类似的情况,你会怎么做呢?想她们吗?无动于衷?



3.他手里的吃的你吃过吗?你会吃吗?



4.看着这张照片你怎么想的?



5.为了几块钱的生活费

作者  | 2008-2-13 13:03:06 | 阅读(12) |评论(1) | 阅读全文>>

人的一生像坐一辆公交车

2008-2-3 13:24:08 阅读13 评论0 32008/02 Feb3

人的一生,像乘坐一台公交车。



我们知道它有起点和终点,却无法预知沿途的经历。



有的人行程长,有的人行程短。



有的人很从容,可以欣赏窗外的景色



有的人很窘迫,总处于推搡和拥挤之中。



然而与悬挂在车门上、随时可能掉下去的人相比,似乎又感欣慰.

作者  | 2008-2-3 13:24:08 | 阅读(13) |评论(0) | 阅读全文>>

ftp客户端代码

2008-1-29 9:28:54 阅读200 评论0 292008/01 Jan29

using System;
using System.Net;
using System.IO;
using System.Text;
using System.Net.Sockets;

namespace ftpGet
{
    /// <summary>
    /// FTP Client
    /// </summary>
    public class FTPClient
    {
        #region 构造函数
        /// <summary>
        /// 缺省构造函数
        /// </summary>
        public FTPClient()

作者  | 2008-1-29 9:28:54 | 阅读(200) |评论(0) | 阅读全文>>

FTP命令&FTP响应码

2008-1-29 9:26:48 阅读254 评论0 292008/01 Jan29

最近在用C#写一个FTP客户端类,贴个资料备用。

FTP命令

命令  描述 
ABOR 中断数据连接程序
ACCT <account> 系统特权帐号
ALLO <bytes>  为服务器上的文件存储器分配字节
APPE <filename> 添加文件到服务器同名文件
CDUP <dir path> 改变服务器上的父目录
CWD <dir path> 改变服务器上的工作目录
DELE <filename> 删除服务器上的指定文件
HELP <command> 返回指定命令信息
LIST <name>

作者  | 2008-1-29 9:26:48 | 阅读(254) |评论(0) | 阅读全文>>

查看所有日志>>

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2012

   
创建博客 登录  
 关注