Skip to content

Instantly share code, notes, and snippets.

View nixsiow's full-sized avatar

Nix Siow nixsiow

View GitHub Profile
## This is a testing site for Markdown
Hello !

#Question Question Question

  1. 'RubyMonk Is Pretty Brilliant'.match(/ ./) Question's Link

  2. 'RubyMonk Is Pretty Brilliant'.match(/ ./, 9)

  3. 'Beat me up Scotty' Section

##RECAP
#Arrays ['literal', 'notation', 555]
#While loops
#If statements
#Functions
#The interpreter reads from top down;
#Compare a sequence of values put them into an array and then can check if it is included in an array;
##HOMEWORK SUBMISSION
#FLOW CONTROL
- Conditionals;
- Loops;
#PATH
- echo $PATH - shows all the paths the computer searches through (the paths are separated by a colon);
- which - will tell you which programme was run (if two files have the same name, it will run the first one found in the path);
- The ruby language will allow you to get hold of the process.id
- If you type irb into terminal, you can then type Process.pid to get the process id;
99 Bottles of Beer
Write a program which prints out the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.
Requirements
Your file should be called beer.rb
The program should be called with Beer.song
The program should output to STDOUT using puts
Each verse should be separated by a single blank line.
Extensions

Current as at 25-Feb-2014

#Ruby Notes ###Terminology Literals = values e.g. 1 or "Simon"
Variables = a place to store values
Operator = + - * / % = Parameter = inputs for variables
Fix_num = an integer

TERNARY OPERATOR
n.abs == 1 ? 'bottle' : 'bottles'
#This is saying if the number of bottles is 1 return bottle, if not return bottles;
# In Ruby we have open classes;
#You can take any class at any point and add extra data into it;
#MONKEY MATCHING adding something later to something that exists already;
##Dependencies
#If you want to require library c when you install it it requires library d;
#Things you are depending on depend on other things;
##PACKAGE MANAGER SOLVES ALL OF THIS!
gem install package name #Will work out where to store it on your system, it will work out all the dependencies and go and download them;
#Some gems are very complicated such as ImageMagick, it depends on software that is written on your computer and not in ruby;
require 'sinatra' #only works if we have installed sinatra on our machine;

Point Mutations

A mutation is simply a mistake that occurs during the creation or copying of a nucleic acid, in particular DNA. Because nucleic acids are vital to cellular functions, mutations tend to cause a ripple effect throughout the cell. Although mutations are technically mistakes, a very rare mutation may equip the cell with a beneficial attribute. In fact, the macro effects of evolution are attributable by the accumulated result of beneficial microscopic mutations over many generations.

The simplest and most common type of nucleic acid mutation is a point mutation, which replaces one base with another at a single nucleotide.

By counting the number of differences between two homologous DNA strands taken from different genomes with a common ancestor, we get a measure of the minimum number of point mutations that could have occurred on the evolutionary path between the two strands.

This is called the 'Hamming distance'

Current as at 18-MAR-2014

###HTTP Requests###

Contains… GET

  • domain
  • path

###Controller