ryanwold.net

A civic-minded citizen seeking the singularity

Back to Entries

programming notes/ideas

draft
Date: 2012-02-06
Tags: ruby

sunday 3:02pm

I just lost about an hour due to the lack of an Mongo index on the Earthquake.time field.

NOTE: use 2d mongod spatial index, rather than 2dsphere

3 examples of everything: 3 classes: Car, Person, Animal 3 methods 3 args 3 returns 3 variables

3 workflows 3 departments 3 3 problems solved

We speculate that because the designs are so much more concrete, and the logical relationship between objects explicit, it is easier to understand, evaluate, and modify a design.

http://c2.com/doc/oopsla89/paper.html

Declarative Imperative Programming Worfklow Charts Dimensions of Data


  1. create a feature branch for a coherent, autonomous diff of code
  2. write code locally, with tests
  3. push the code to github, which will get it to spin on Bamboo
  4. if bamboo is green pull request for the feature/branch else :revert => 2 end

a callback is basically: passing a function to another function as an argument, and having that passed-in function modify something within the function that it is passed into


Ruby variables

  • global variables
  • class variables
  • instance variables
  • method variables

hard-coded code dynamically generated code

--

Data Structures:

string "words" "some words together" "a whole long paragraphs..." integer 1 7 190889 float 1.0 9.0184759 298575.0393938281 boolean true 1 false 0

array [] hash { :key => 'value1', :key2 => ['array val1', 'array val 2', @var ] }

Examples:

[ {}, {}, {} ]

or

{ "an array" => [], "string", => "words man" }


0..* - must have 0 or more (may have 1 or more)

1..* - must have 1 or more

1 - must have 1


when delegating the delegatee inherit behavior and rules/legislation from the delator.

idea: anatomy of Ruby anatomy of a Rails project

Class instance of a class

variable

method/function sometimes implemented as an attribute

class


By Ryan Wold · © 2012–2026 Ryan Wold

Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.

Tip: $afomi on HandCash · afomi@handcash.io

Ideas 5
OpenHouse