Magic words:
psql -U postgres
If run with -E
flag, it will describe the underlaying queries of the \
commands (cool for learning!).
Most \d
commands support additional param of __schema__.name__
and accept wildcards like *.*
/// insert a key value pair possibly splitting nodes along the way. | |
pub fn insert(&mut self, kv: KeyValuePair) -> Result<(), Error> { | |
let root_offset = self.wal.get_root()?; | |
let root_page = self.pager.get_page(&root_offset)?; | |
let new_root_offset: Offset; | |
let mut new_root: Node; | |
let mut root = Node::try_from(root_page)?; | |
if self.is_node_full(&root)? { | |
// split the root creating a new root and child nodes along the way. | |
new_root = Node::new(NodeType::Internal(vec![], vec![]), true, None); |
/// Implement TryFrom<Page> for Node allowing for easier | |
/// deserialization of data from a Page. | |
impl TryFrom<Page> for Node { | |
type Error = Error; | |
fn try_from(page: Page) -> Result<Node, Error> { | |
let raw = page.get_data(); | |
let node_type = NodeType::from(raw[NODE_TYPE_OFFSET]); | |
let is_root = raw[IS_ROOT_OFFSET].from_byte(); | |
let parent_offset: Option<Offset>; |
Simple script that plots rarefaction curve from a givenn data set using the following: http://en.wikipedia.org/wiki/Rarefaction_(ecology) |
''' | |
@param string: input file name with '.xlsx' ending | |
@author: Nimrod Shneor | |
''' | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import xlrd | |
import matplotlib.cm as cm |