A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| import java.util.Random; | |
| public class Arrays { | |
| public static void main(String[] args) { | |
| // Declaration style. | |
| int arrayTwo[] = new int[3]; | |
| int[] arrayOne = new int[3]; // This is better! []'s are part of the type!! | |
| // Indexing: We always refer to the first element of an array [0]. | |
| // ex. subway example |
| package org.insidion.test.jsoupexperiment; | |
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.Iterator; |
#MongoDB - Setting up a Replica Set
cd \mongodbdir\
mkdir db1
mkdir db2
mkdir db3
###Primary mongod --dbpath ./db1 --port 30000 --replSet "demo"
Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.
Terminology:
This gist assumes:
www-data (may be apache on other systems)| #!/usr/bin/python | |
| # | |
| # (originally entered at https://gist.github.com/1035399) | |
| # | |
| # License: GPLv3 | |
| # | |
| # To download the AFINN word list do: | |
| # wget http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6010/zip/imm6010.zip | |
| # unzip imm6010.zip | |
| # |
| #!/bin/sh | |
| sudo groupadd mysql | |
| sudo mkdir -p /var/mysqld | |
| sudo useradd -r -g mysql -M -d /var/mysqld mysql | |
| sudo chown mysql:mysql /var/mysqld | |
| sudo yum -y install cmake bison gcc-c++ | |
| curl -sL http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz | tar zx | |
| cd mysql-5.5.28/ | |
| cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/5.5.28 -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_bin |
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
Afterwards, we'll see how easy it is to package our newly provisioned VM
| # following Python packages needs to be installed | |
| # xlrd, xlsxrd, unidecode, MySQLdb | |
| import xlrd | |
| import xlsxrd | |
| import MySQLdb as mdb | |
| import re | |
| import unidecode |