繁體中文
琪派听译培训网为客户提供专业的听译培训服务,还提供各类文档,视频的翻译服务

[学员试译作品] Rubby编程进阶

   本站不出售任何教学视频,仅提供翻译服务
翻译成本:¥0元
零售价: ¥0元(支持花呗/信用卡)
教学类别 中文字幕/听译培训学员试译作品/
教学名 [学员试译作品] Rubby编程进阶
信息编号 ST-27
软件版本 (加入CG听译培训课程,免费查看教学产品)
教学时间
如果您有教学或者文档需要翻译,请联系我们的工作人员。
 
[双语人士炼成之路] 听译精讲课 培训教材 15(含教师讲解)
[双语人士炼成之路] 听译精讲课 培训教材 14(含教师讲解)
[双语人士炼成之路] 听译精讲课 培训教材 13(含教师讲解)
[双语人士炼成之路] 听译精讲课 培训教材 12(含教师讲解)
[双语人士炼成之路] 听译/听力/翻译培训教材 与翼同行 分解讲解
   查看更多字幕请按此  
 
    
字幕详细信息介绍
 

CG教学翻译网听译培训学员 张军 的听译作品。(指导老师:严红)

张军 2016年4月加入听译培训 本作品是 张军 第一部试译作品

 
 

Ruby,一种简单快捷的面向对象(面向对象程序设计)脚本语言,在20世纪90年代由日本人松本行弘(Yukihiro Matsumoto)开发,遵守GPL协议和Ruby License。它的灵感与特性来自于 Perl、Smalltalk、Eiffel、Ada以及 Lisp 语言。由 Ruby 语言本身还发展出了JRuby(Java平台)、IronRuby(.NET平台)等其他平台的 Ruby 语言替代品。Ruby的作者于1993年2月24日开始编写Ruby,直至1995年12月才正式公开发布于fj(新闻组)。因为Perl发音与6月诞生石pearl(珍珠)相同,因此Ruby以7月诞生石ruby(红宝石)命名。

下载地址:链接:http://pan.baidu.com/s/1dF2AqDr 密码:2eew

 

 
张军 听译文字

All right, welcome to your fitz Rubby tutorial.
好了,欢迎大家看fitz的Rubby教学视频

and in this lesson I am going to show you guys how to create an object from the class.
在这个教学中,我将要让你们看到怎么从一个类创建出一个对象的。

so remember, in last lesson we create a class, an animal class.
记得在上一个教学中我们创建了一个类,一个动物类

now class is pretty much a blue print for creating objects
现在类很大程度上是创建对象的蓝图

so anytime we want to create an animal
任何时候你想创建一个动物

it can have a name, an age and a trait
它都会有名字,年龄,特征

so now let's go ahead and create an animal object.
我们继续来创建一个动物对象

anytime we want to create a new animal object
任何时候我们想创建一个新的动物对象

we go ahead and we first give it a name or a variable.
我们都会先给它一个名字或一个变量

so first_animal, and variables can have underscore.
因此写上first_animal,参数名字里面可以有下划线

as you can see, equals Animal.new
你可以看到,它等于Animal.new

this is how you create an animal object.
这就是创建动物对象

basiclly we are saying, ok, we are going to create an animal object.
基本上我们要说的就是,好吧,我们要来创建动物对象

name first_animal, and this is going to be a new object from the Animal class.
起名为first_animal, 这是从动物类生成的一个新对象

now go ahead and hit enter,
继续按下回车键

and this is just where it stored in memory.
这是它在内存中的位置

it looks confusing, you really never need to memorize the address or anything like that.
它看起来更让人迷惑,你实际上是不需要记得地址或则是像它的东西

but that is what it means, that's where it is stored on your memory, on your computer.
但这就是它的意思,是保存在内存,保存在电脑上的位置

so this will be different on your screen than mine.
这个在你屏幕上显示的跟我屏幕上的不一样

so now that we gave it a variable nickname
现在我们为它设置一个变量别名

any time we want to refer to this object
任何时候当我们引用这个对象的时候

we refer to it as first_animal.
用first_animal来引用它

then rubby knows that we are talking about this animal.
这样rubby就知道我们说的是这个动物类

so remember, I want to have this variable first_animal
记住,我要让这个变量first_animal

I want this object to represent the dog next door to me.
我要让这个对象代表隔壁那条狗

the one named Floyd
这只狗的名字叫弗洛伊德

that barks all the time, and keep me up when I ----
它总是在叫,让我睡不着

so remember, every animal can have a name, age and trait.
记住,每个动物都有名字,年纪与特征

so let's go ahead and set his name right here.
把它的名字设置到这里

so first_animal.name, now in order to access an object's attribute
也就是first_animal.name,为了访问对象的属性

and remember the attributes of our objects are basiclly these things
要记得对象的属性基本上就是这些东西

a name, age and a trait
名字,年纪,特征

in order to access those, we need to go ahead and write the object name
要访问它们的话,我们需要写出对象名

which is first_animal, dot attributes, in this case is .name
它是first_animal加上点,后面是属性,这里是.name

so now we are pretty much saying ok, we want to access this object's name.
现在基本上就可以了,我们可以访问对象的名字

and we want to set it equal to, you can name it anything you want
我们要把它设置为等于,你可以把它命名为任何你想要的东西

I am gonna name my "Floyd"
我要将它命名为Floyd

so now go ahead and hit enter
现在按下回车

and now our object first_animal.name is Floyd
现在我们的对象first_animal的名字就是Floyd了

simple enough, so now what we want to do is we want to set the first_animal's age
很简单,现在我们要做的就是设置first_animal的年龄

basically Floyd's age, and a trait about Floyd.
基本上就是佛洛伊德的年纪,还有它的特性

so first_animal.age equals, how old is Floyd,
first_animal.age等于,佛洛伊德有多大了

this is a really old dog, probably 93
这是条很老的狗,大约93岁了

hit enter, now before I go on, I want to mention this.
按下enter,在我继续之前,我想先提下这个

in Rubby programming, anytime you are woking with text like Floyd or
在Rubby编程中,任何时候当你处理像Floyd这样的文字的时候

maybe you want to set the gender to male or femal.
或者你希望将性别设置为男性或者是女性

you need to surround text in double quotation marks.
你要把文字放到双引号中

and anytime you want to work with numbers
任何时候当你要使用数字的时候

you don't use quotation marks.
不要使用双引号

so numbers don't get surrounded, and text get surrounded with quotes.
数字是不需要用引号围起来的,文字是需要用引号围起来的

so for example whenever I want to set the trait of this object
无论什么时候你要设置对象的特性

so first_animal, and what's this ,the trait.
first_animal,这是什么,是trait.

I'll just say that this one is annoying
我是说这个是annoying

that's why I surround it with quotation marks.
这是我要用引号把它围起来的原因了

because remember, anytime when have text, get it surrounded in quotation marks
但是记住,有文字的话,就用引号把它围起来

so go ahead and hit enter, and now it says ok, annoying.
按下回车,现在就可以了,是annoying.

校对后

All right, welcome to your fifth Rubby tutorial. (CG教学翻译网听译培训学员 张军 听译作品 www.gbstuff.com)
好,现在我们来学习Rubby教学的第五部分。

and in this lesson I am going to show you guys how to create an object from the class.
在本教学中我要教大家用类创建一个对象

so remember, in the last lesson we create a class, an animal class.
记得我们上个教学创建了一个叫做animal的类

now a class is pretty much a blue print for creating objects
类基本上来说就是一个创建对象的蓝图

so any time we want to create an animal
任何时候如果我们希望创建一个对象

it can have a name, an age and a trait
它都可以有name, age与trait

so now let's go ahead and create an animal object.
现在我们来创建一个animal对象

anytime we want to create a new animal object
任何时候当我们希望创建一个新的animal对象的时候

we go ahead and we first need to give it a name or a variable.
需要先给它设置一个名字或者是一个变量

so first_animal, and variables can have underscores, obviously.
也就是first_animal,很明显变量是可以有下划线的

as you can see, equals Animal.new
就是这样的,它等于Animal.new

this is how you create an animal object.
这就是你创建animal对象的方法了

basiclly we are saying, ok, we are going to create an animal object.
基本上来说就是,我们要创建一个animal对象

name first_animal, and this is going to be a new object from the Animal class.
起名为first_animal, 它是Animal类的一个新对象

now go ahead and hit enter,
接着点击enter键

and this is just where it stored in memory.
这是它在内存中的地址

it looks more confusing, you really never need to memorize the address or anything like that.
看起来让人很困惑, 你是不需要记住这个地址或者是像这样的东西的

but that is what it means, that's where it is stored on your memory, on your computer.
但这就是它所表示的,是在你的内存,电脑中保存的位置

so this will be different on your screen than mine.
这在你的屏幕上显示的与我这里的不同

so now that we gave it a variable nickname,
现在我们为它设置了变量别名

any time we want to refer to this object,
任何时候我们希望引用这个对象

we refer to it as first_animal.
就是用first_animal来引用它。

then rubby knows that we are talking about this animal.
这样rubby就知道我们是在谈这个animal了。

so remember, I want to have this variable first_animal
记住我要将这个变量first_animal

I want this object to represent the dog next door to me.
我要让这个对象代表我隔壁的那只狗

the one named Floyd
它的名字叫做Floyd

that barks all the time, and keep me up when I try to watch my date night movies.
它总是不停的叫,在我晚上约会看电影的时候让我睡不着

so remember, every animal can have a name, age and trait.
记住,任何animal都会有name, age与trait.

so let's go ahead and set his name right here.
我们在这里设置它的名字

so first_animal.name, now in order to access an object's attribute
first_animal.name,为了访问对象的属性

and remember the attributes of our objects are basiclly these things
记住对象的属性基本上来说就是这些东西

a name, age and a trait
name, age还有trait

in order to access those, we need to go ahead and write the object name,
为了访问呢它们,我们需要写出对象名

which is first_animal, dot attributes, in this case is .name
也就是first_animal, 然后点加属性,这里也就是.name了。

so now we are pretty much saying ok, we want to access this object's name.
现在基本上就可以了,我希望访问这个对象的名字

and we want to set it equal to, you can name it anything you want
我们要将它设置为等于,你可以将它设置为任何希望的名字。

I am gonna name my "Floyd"
我要将它命名为Floyd

so now go ahead and hit enter,
按下回车键

and now our object first_animal.name is Floyd
first_animal.name就是Floyd了

simple enough, so now what we want to do is we want to set the first_animal's age
非常简单,接着我们要做的就是设置first_animal的年龄。

basically Floyd's age, and a trait about Floyd.
基本上就是Floyd的年龄,还有trait.

so first_animal.age equals.... , how old is Floyd,
首先first_animal.age等于,Floyd有多大年纪了呢?

this is a really old dog, probably 93
这是一条很老的狗了,或许93岁了

hit enter, now before I go on, I want to mention this.
按下回车,在我继续设置之前,要提一下这个

in Rubby programming, anytime you are woking with text like Floyd or
在Rubby编程中,任何时候当你处理像Floyd这样的名字

maybe you want to set the gender to male or femal.
或者是你希望设置它的性别为公或者是母

you need to surround text in double quotation marks.
需要用双引号将文字括起来

and anytime you want to work with numbers,
当你使用数字的时候

you don't use quotation marks.
是不需要使用双引号的

so numbers don't get surrounded, and text gets surrounded with quotes.
也就是数字不会括起来,文字会被括起来

so for example whenever I want to set the trait of this object
例如任何时候当我希望设置这个对象的trait

so first_animal, and what's this, the trait.
first_animal, 这个是什么,trait

I'll just say that this one is annoying,
将它设置为annoying

that's why I surround it with quotation marks.
这就是我要用双引号将它括起来的原因了

because remember, anytime when have text, get it surrounded in quotation marks,
记住,任何时候当你有文字的时候,将它用双引号括起来

so go ahead and hit enter, and now it says ok, annoying.
按下回车,现在它就可以了,annoying


 
 
 


 
友情链接 : |CG艺术共和国 |空行动画
 
Gnomon字幕
112211
地址: 广东省广州市番禺市广路祈福新村   邮编:511495
客服电话:86-20-34771565  客服QQ:1355398  客服微信(请扫右方二维码)
copyright © 2009-2018 琪派听译培训网
法律声明:本站提供笔译,听译,口译等翻译服务,提供笔译/听译等培训服务
本站对出售的培训教学产品拥有自主知识版权