суббота, 28 декабря 2013 г.

★ ШКОЛЬНЫЙ ПОРТАЛ, Антон Гудман оставил для вас сообщение

Антон Гудман оставил для вас сообщение
 
 
Вы можете прочитать сообщение и ответить на него через наш чат.


До скорого!
Команда Badoo

четверг, 3 октября 2013 г.

Ruby :: Class Variables and Methods

Class methods do not have access to instance methods or instance variables. However instance methods can access both class methods and class variables.

Recall that an instance variable always has an @ symbol prefixed before its name. Similarly, class variables are prefixed with @@.

One of the places where class variables do find proper use is to store application configuration - things like application name, version, database and other settings. The next exercise is to build one such class ApplicationConfiguration. You have to define two class-level methods: set and get. The set method takes two parameters: property_name and value. The get method takes one parameter: property_name, and should return the value that corresponds to the property.

class instance variables

class Item
  def self.show
    puts "Class method show invoked"
  end 
end


class Item
 
  class << self
    def show
      puts "Class method show invoked"
    end
  end
 
end


Ruby :: Instance Variables and Accessors

class Item
 
  def initialize(description, color)
    @description = description
    @color = color
  end
 
  def description=(new_description)
    @description = new_description
  end
   
  def color=(new_color)
    @color = new_color
  end
   
end



rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/45-more-classes/lessons/110-instance-variables#solution4434

Ruby :: Instance Variables and Accessors :: getter and setter methods

So far we talked about accessing the contents of an instance variable through getter methods. Now, how do you change the value of the instance variables from outside? That is where setter methods come into play. 

Ruby :: Redefining, overriding, and super

class Item
    attr_reader :item_name, :qty
   
    def initialize(item_name, qty)
        @item_name = item_name
        @qty = qty
    end
    def to_s
        "Item (#{@item_name}, #{@qty})"
    end

    def ==(other_item)
      puts "Method == called on #{self} with parameter #{other_item}"
      return self.to_s == other_item.to_s
    end
end


p Item.new("abcd",1)  == Item.new("abcd",1)
p Item.new("abcd",2)  == Item.new("abcd",1)
 


class Fixnum
  def +(other)
    42
  end
end



Most object oriented languages offer a mechanism by which an overridden method can be called by the overriding method. Ruby uses the super keyword to make this happen. Using super will call the same method, but as defined in the superclass and give you the result.

class Animal
  def move
    "I can move"
  end
end

class Bird < Animal
  def move
    super + " by flying"
  end
end
 

Ruby :: Understanding Inheritance

puts Float.instance_methods.count #201

puts (Float.instance_methods - Object.instance_methods).count #87

Ruby :: Classification

As you've probably guessed, Object#is_a? accepts a single parameter - a class. Object#is_a? has an alias, Object#kind_of?.

They're identical in every respect so you're free to pick whichever reads better in a given context.

quick summary

  • Classes act as templates for the creation of objects, specifying their state and behaviour
  • An object created by a class is called an instance of that class
  • A class is itself an object, and an instance of the class Class

Ruby :: Blocks, Procs, and Lambdas

The -> literal form is a shorter version of Kernel#lambda.

Kernel#proc factory method is identical to Proc.new. Note that proc is a method and not a literal form like -> nor a keyword like yield.

воскресенье, 10 февраля 2013 г.

ZHo @ ReggaeJungle 2011 by Samshe

ZHo @ ReggaeJungle 2011 by Samshe

TOROBASS – BASSIA
2:32
×
Dave Brubeck – Koto Song
10:52
Alice SpaceDoll – 08. SpaceDoll
5:01
Dave Brubeck – Koto Song
10:52
Yuki Kajiura – Grandpa's Violin (OST "Hack Liminality")
2:27
3:50
Dave Brubeck – Koto Song
10:52
Земфира – Какая красота
3:11
4:57
Сердце Дурака – Раздражает
4:30
Kibaki – Keep on coming for more
2:00
5:15
Cause and Effect – Happy? { #HappyLAND
5:15
#CaravanStyle } Cause and Effect – Stay { #ToronaroRadio
5:02
Gary Moore – Parisienne Walkways
6:47
Обе Две – Милый
3:23
Обе Две – Гонщики
2:18
Обе Две – Пачка
3:32
Обе Две – Моряки
7:07
Обе Две – Сэлинджер
3:33
Poni Hoax – I Shall Take It Anyway
4:45
★Poni Hoax – We Are The Bankers
3:43
Poni Hoax – Faces in the water
5:46
Poni Hoax – She Sells Anger
7:48
Poni Hoax – L.A. Murder Motel
5:29
Poni Hoax – She's On The Radio
3:27
Guru's Jazzmatazz – Lifesaver
4:17
Flunk – Personal Stereo
4:35
Vibrasphere – Breathing Place
7:16
Yuki Kajiura – Grandpa's Violin (OST "Hack Liminality")
2:27
Toronaro Project – EndLesss BirthDay ( downtempo chicane style four accordes demo draft )
6:38
Dave Brubeck – Koto Song
10:52
Flunk – Personal Stereo
4:35
Guru's Jazzmatazz – Lifesaver
4:17
Choongum – Humanity
3:36
The Fatback Band – Got To Learn How To Dance (Karim Extended Dance)
7:06
Soundgarden – Rowing
5:08
㋛ Goldie – Angel (Ragga jungle)
5:08
Static Movement Feat. Impact – The Lost Tribe
7:17
Маркшейдер Кунст – Деньги - это придуманный способ обмана
5:27
Noize Mc – Вселенная бесконечна?
4:23
Mic – Vers Luisant
8:42
Isaak Hypnotizer – Levitation
7:29
Mic – Vers Luisant
8:42
Camouflage – Accordion
5:02
Ciquid Vision – Vivid Dream (mix cut)
16:37
#JUNGLE #DnB #ATMO Source Direct – Secret Liaison
8:32
Way Out West – Killa (Orkidea Mix)
9:20
#DeepLAB } Hammock – We Will Say Goodbye To Everyone
7:42
Janette Moon – Calling
2:50
Isaak Hypnotizer – Levitation
7:29
Девид Окай Aнно – Лучше уповать на господа
5:48
Девид Окай Анно – Славь господа душа моя
4:34
Сердце Дурака – Раздражает
4:30
Blue Lunar Monkey – Dissolution (Original Mix)
7:03
---------------------------Muzik---------------------------- – ------------------------Tuzik-----------------------------
0:24
Hobotek – Kosmit (for my friend)
7:11
Пробуждение – Самореализация. Раскрытие последней чакры - Сахасрары. Просветление. Пробуждение Кундалини от сна. Очищение. Стремительный прорыв в духовном восхождении. Свет. Любовь.
4:34
Isaak Hypnotizer – Levitation
7:29
Zero Cult – Heartwork
8:17
Ott – Adrift In Hilbert Space
8:10
Choongum – Humanity
3:36
#DeepLAB } Hammock – We Will Say Goodbye To Everyone
7:42
Toronaro Project – EndLesss BirthDay ( downtempo chicane style four accordes demo draft )
6:38
Спирали – Система
4:28
Gus Gus – Purple (Sasha Vs The Light Mix) breaks
5:52
Toronaro Project – EndLesss BirthDay ( downtempo chicane style four accordes demo draft )
6:38
Choongum – Humanity
3:36
Пробуждение – Самореализация. Раскрытие последней чакры - Сахасрары. Просветление. Пробуждение Кундалини от сна. Очищение. Стремительный прорыв в духовном восхождении. Свет. Любовь.
4:34
Isaak Hypnotizer – Levitation
7:29
Toronaro Project – EndLesss BirthDay ( downtempo chicane style four accordes demo draft )
6:38
#DeepLAB } Hammock – We Will Say Goodbye To Everyone
7:42
Toronaro Project – EndLesss BirthDay ( downtempo chicane style four accordes demo draft )
6:38
Toronaro Project – Enterna Step II (#Ambient)
3:48
kazaa – kazaa11 - superhit-one 14sec (ringtone) edition
0:14
Isaak Hypnotizer – Levitation
7:29