Please visit new wiki for more info and tasks!
- ruby style => OOP everywhere, e.g.
2 + 2
is a callFixnum(2).+(Fixnum(2))
[1,2,3].each {|n| puts n}
- Simple classes (
Fixnum
,String
,Float
) - Kernel (puts, gets, p)
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <stdio.h> | |
#define BATCH_SIZE 10 | |
void calc_stat_for(char *batch, int sz, int *stat){ | |
int i; | |
print_batch(batch,sz); |
2 + 2
is a call Fixnum(2).+(Fixnum(2))
[1,2,3].each {|n| puts n}
Fixnum
, String
, Float
)Ok, so Inheritance
its not just for young white dudes waiting for their grandparents to fucking keel over at 82.
In ruby, Inheritance allows one class to inherit from another class attributes and behaviors (methods) that it didnt have before. The inheriter, much like a young white male, is the child class. The class that it inherits from, rather than being his old money grandparents, is the Parent Class. The lesson says Inheritance is designated with a < symbol, for example:
class Daughter < Father
end
$VERBOSE = nil | |
require File.expand_path('../rooby', __FILE__) | |
Person = Rooby::Class.new 'Person' do | |
define :initialize do |name| | |
@name = name | |
end | |
define :name do |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
int main() | |
{ | |
int a,d,m,o,c,f,x; | |
printf("A D M O C | F\n"); | |
for(x=0; x<32; x++){ | |
a = x & 16; |
#!/usr/bin/ruby | |
require 'date' | |
require 'pp' | |
COMPANY_NAME="<#company_name#>" | |
if ARGV.count != 1 | |
puts "Usage: update_strings.rb /path/to/source/dir" | |
puts "Path and project_name are case sensitive." |
- (void)viewDidAppear:(BOOL)animated | |
{ | |
[super viewDidAppear:animated]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillChangeFrameNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) |
// | |
// VIOSXibLoader.h | |
// Created by Aziz Latypov on 8/21/15. | |
// | |
// If your TableViewCells are in Xib files and you name them in some convencion | |
// described with regular expression, you can load them into a table like this: | |
// In your viewDidLoad method call | |
// [[VIOSXibLoader defaultLoader] loadXibsForTableView:self.tableView | |
// withPattern:@"^MyModelClassName(\\w*)TableViewCell$"]; | |
// |
See original in Ray Wenderlich code style guide
Put bracket on next line for functions.