(Note: this post is in draft mode and is to be updated... JC)


Throughout 2017 I will be supporting Clare on becoming a beekeeper. I've never done beekeeping myself before and thought this would be a good opportunity to learn together. Being an Intel Software Innvoator myself I am also keen to potentially build a tech project aligning to beekeeping. No idea as to the problems and solutions just yet. This post serves as a draft scribble notepad for ease of quick references. Will probably put something together to the Intel Developer Mash at some point.

Hybrid Bee-Tech related posts

View cpadTDDMochaChaiBasics.js
const Mocha = require ('mocha')
const assert = require('chai').assert
const mocha = new Mocha ({ui: 'bdd'})
mocha.suite.emit('pre-require', this, 'solution', mocha)
describe('Test suite', () => {
it('should work', () => {

Composition over Inheritance

"Inheritance encourages you to build this taxonomy of objects very early on in the project. And you are most likely going to make big design mistakes while doing that. Because humans cannot predict the future."

"I think it's just better to use composition from the start. It's more flexible, it's more powerful, and it's really easy to do."

-- Mattias P Johansson, @mpjme

FunFunFunction - Composition over Inheritance

View coderpad_tdd_test_suites.js
// ***** Requirements
// Implement function sequence, which returns new n-size Array filled according to pattern.
// pattern may be:
// - a function that takes two: (element, index), one: (element) or any arguments (similar to map function), then filled running this function, in other words: function describes sequence,
// - number, string or any other object, then filled by copying, this object n-times.
// ****** Solution

Say you have a dataset. You wish to find out the number of character columns, numerical columns, and total columns.

One way to do this is to use the SAS array in conjunction with dim() function.

I've created the following code demo to illustrate this - inspired by this SAS blog forum.

data all_chars;
    var1 = "hello";
    var2 = "world";
data hello_world;
put "hello world";

This is a SAS Code:

data junk;
  put "hello world";

Any syntax highlighting?


Say I have 5 files: (file1, file2, ... file5).

All have been commited.

Say now all 5 files have been changed.

When you issue git status, all 5 files should be shown as (red) unstaged status.

Say I am happy with the changes in file1 to file4, but not file5 (i.e. I'd like to revert file5 to the last committed stage).


Say we have two models like this:

class Supplier < ActiveRecord::Base
  has_one :account

class Account < ActiveRecord::Base
  belongs_to :supplier