Skip to content

Instantly share code, notes, and snippets.

View supr's full-sized avatar

supr

  • C|^_^|Ɔ
  • GU HQ, 21 Faro System.
View GitHub Profile
#include <iostream>
#include <cstdlib>
int num_bits2(long n) {
int i = 0;
for(i = 0; n; i++)
n &= n - 1;
return i;
}
.encoding = "UTF-8"
displayname = "MapR-Sandbox-For-Hadoop-3.0.3"
guestos = "rhel6-64"
virtualhw.version = "8"
config.version = "8"
numvcpus = "2"
cpuid.coresPerSocket = "1"
memsize = "6144"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
@supr
supr / gist:ef4c4377c24e57508cd7
Created May 9, 2014 02:09
C++11 Algorithm example
/*
C++11 Algorithm example
Compile: clang++ -std=c++11 -static this.cc
*/
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
int numbers[] = {1, 2, 42, 7, 0};
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:
1. You have an upgrade for libselinux which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libselinux of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
@supr
supr / test.json
Created June 23, 2014 17:50
test.json
{
"variables": {
"mapr_version": "3.1.1"
},
"builders": [
{
"name" : "sandbox-partner",
"vm_name" : "MapR-Sandbox-For-Hadoop-Partner-{{ user `mapr_version` }}",
"type" : "virtualbox-ovf",
"source_path" : "output-sandbox/MapR-Sandbox-Base-For-Hadoop-{{ user `mapr_version` }}.ova",
[root@ip-10-196-18-178 ~]# yum install mapr-hive-0.12
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: mirror.hmc.edu
* epel: linux.mirrors.es.net
* extras: mirror.hmc.edu
* updates: mirrors.centarra.com
Setting up Install Process
No package mapr-hive-0.12 available.
Error: Nothing to do
FROM centos:centos6
MAINTAINER foo@bar.com
ADD ./file1 /opt/example/
ADD ./file2 /opt/example/
ADD ./dir1 /opt/example/
ADD ./dir2 /opt/example/
RUN ls -l /opt/example
docker build -t 'deleteme' .
Sending build context to Docker daemon 9.728 kB
#include <iostream>
#include <string>
using namespace std;
template<typename T>
struct Node {
T item;
struct Node<T> *next;
};
#include<iostream>
template<typename T>
class Node {
public:
T data;
Node<T>* next;
};
template<typename T> class List;
@supr
supr / main.rs
Created September 19, 2014 05:22
Simple Thread Implementations in Rust
use std::os;
fn main() {
let (tx, rx) = channel();
let args = os::args();
let mut max_messages: uint = 10u;
println!("Command line args len: {}", args.len());