Skip to content

Instantly share code, notes, and snippets.

View shikharbhardwaj's full-sized avatar

Shikhar Bhardwaj shikharbhardwaj

View GitHub Profile
E:\Learning\node\prj\nudge>jitsu deploy
info: Welcome to Nodejitsu bluefog
info: jitsu v0.14.0, node v0.10.33
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node app.js
info: Creating snapshot 0.0.1-1
info: Uploading: [=============================] 100%
error: Error running command deploy
error: Error building snapshot
#include <cstdio>
int path[100][100]; //The inputs, with the states of the paths
int nums[100][100]; //The number of possible paths
//Count the number of ways to go from the topmost corner
//to the lowermost
void countWays(int i, int j, int n){
if(i >= n){
return;
}
if(j >= n){
#include <iostream>
#include <algorithm>
namespace quick{
inline void swap(int *a, int *b){
int t = *a;
*a = *b;
*b = t;
}
void insertion_sort(int ar[], int lo, int hi){
for(int i = lo+1;i<=hi;i++){
#include <iostream>
#include <algorithm>
#include <vector>
typedef std::vector<int> vi;
int max_revenue(unsigned i, const vi &price, vi &states){
//Takes in the length of the rod and outputs the optimal
//revenue obtainable from it
//Inputs are the length of the rod, price table and "states", ie.
//a std::vector of same length as price and all elements init to -1.
//Top-down, memoized
%% gauss_seidel: Use the Gauss Seidel method to solve the given system of linear
% equations
% Input : A -> Augmented matrix of the system, arranged in diagonally
% dominant fashion
% iters -> Number of iterations to perform
% Output : x -> solved values of the unknowns
function [x] = gauss_seidel(A, iters)
num_unknowns = size(A, 2) - 1;
% Slice the augmented matrix to extract the RHS
#include <algorithm>
#include <iostream>
#include <list>
#include <set>
#include <unordered_map>
class DirectedGraph {
public:
DirectedGraph() = default;
DirectedGraph(int v) : V(v) {
for (int i = 1; i <= V; i++) {
// Dynamic programming - Unbounded knapsack problem for coin change
#include <algorithm>
#include <iterator>
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
const int MAX_S = 1e3;
//#include <benchmark/benchmark.h>
#include <chrono>
#include <ctime>
#include <iostream>
#include <omp.h>
#include <thread>
#include <vector>
namespace mlpack {
namespace parallel {
λ spike/parallel ∴ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
λ spike/parallel ∴ g++ test_bench.cpp -std=c++11 -O3 -Wall -Werror -lbenchmark -lpthread
λ spike/parallel ∴ ./a.out
Run on (4 X 3700 MHz CPU s)
2017-05-16 21:42:29
// Maxim's Config (aka BananaGaming)
// When you type "//" the game ignores whatever is written after
con_enable "1" //Enables Console
cl_clanid 7238336 //Use Steam Group Tag "Go Bananas"
echo Config Loaded! (1/2) //This confirms that the config has been loaded
viewmodel_presetpos 3
viewmodel_offset_x 2.5
viewmodel_offset_y 0