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
<launch> | |
<!-- | |
To distinguish between the cases where the rgb image is | |
1280x1024 versus 640x480. This affects the pipeline. | |
--> | |
<arg name="high_res_rgb" default="true"/> | |
<arg name="cloud_input_ns" value="camera/rgb_downsampled" | |
if="$(arg high_res_rgb)"/> | |
<arg name="cloud_input_ns" value="camera/rgb" unless="$(arg high_res_rgb)"/> |
/* | |
g++ main.cpp -lboost_system -lboost_thread -lpthread -o main | |
*/ | |
#include <boost/asio.hpp> | |
#include <boost/array.hpp> | |
#include <iostream> | |
void send_something(std::string host, int port, std::string message) |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
float atan2_approximation1(float y, float x); | |
float atan2_approximation2(float y, float x); | |
int main() | |
{ | |
float x = 1; |
/////////////////////////////////////////////////////////////////////////////// | |
#ifndef _SKIPLIST_H_ | |
#define _SKIPLIST_H_ | |
#include <iostream> | |
#include <sstream> | |
/////////////////////////////////////////////////////////////////////////////// |
%{ | |
Problem 7 (i): modexp function | |
Returns x ^ y mod n for x, y, and n > 1. | |
%} | |
function result = modexp (x, y, n) | |
%anything raised to 0th power = 1 so return 1 | |
if (y == 0) | |
result = 1; | |
return; | |
end |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
vector<vector<int> > cart_product (const vector<vector<int>>& v) { | |
vector<vector<int>> s = {{}}; | |
for (auto& u : v) { | |
vector<vector<int>> r; |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
#include "ceres/ceres.h" | |
#include "glog/logging.h" | |
using ceres::CostFunction; | |
using ceres::AutoDiffCostFunction; | |
using ceres::Problem; | |
using ceres::Solver; | |
using ceres::Solve; | |
struct CostFunctor { |