Skip to content

Instantly share code, notes, and snippets.

View c650's full-sized avatar
🛰️

c650

🛰️
View GitHub Profile
@c650
c650 / combo.cpp
Created June 26, 2016 17:52
makes combinations of vector elements
#include <iostream>
#include <vector>
#include <cstdio>
template <typename T>
void combination(std::vector<T>& vec, std::vector<T>& tmp, int start, int end, int idx, int r);
int main() {
std::vector<unsigned int> vec = {1,2,3,4,5};
std::vector<unsigned int> tmp(vec.size());
@c650
c650 / Quadratic.java
Created August 26, 2016 17:07
CLI Quadratic Formula Calculator
public class Quadratic {
public static void main(String[] args) {
double a,b,c;
if (args.length != 3) {
System.out.println("Wrong number of Args.\nUsage: [a] [b] [c]");
System.exit(1);
}
a = Double.parseDouble(args[0]);
b = Double.parseDouble(args[1]);
c = Double.parseDouble(args[2]);
@c650
c650 / eclipsifier.rb
Last active September 20, 2016 23:37
converts directory of java files into an eclipse project
#! /usr/bin/ruby
# by charles bailey (@c650)
# under MIT License
# 9.20.16
require 'fileutils'
if ARGV.length != 4
puts "Usage: ./program [code dir] [new project dir] [example dir] [project name]"
=begin
count-all-code.rb
@author Charles Bailey
@version 1.0.0 11/7/16
Ever wanted to know how much code you've written?
This nifty little script will download ALL of your
public repositories so you can find out!
=end
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
def f(x,y)
(((-0.0447 * x ** 6 + 0.2731 * x ** 5 - 0.7935 * x ** 4 + 1.7751 * x ** 3 - 2.561 * x ** 2 + 0.9885 * x + 1.0821) ** 2) - (y ** 2)) ** 0.5
end
startx = 0
endx = 2
starty = -1.2
endy = 1.2
/*
Ways to Represent Graphs
Charles (@c650)
Showing how to represent _unweighted_ graphs
in C++.
*/
#include <iostream>
#include <vector>
@c650
c650 / template for code formatting discord
Created February 16, 2018 04:35
template for code formatting discord
```c
// code here
```
/*
Mercer 2018 Problem 10: Nth Derivative.
Charles Bailey. 03/01/2018
*/
#include <bits/stdc++.h>
#include <regex>
typedef long long ll;
/*
Problem 6: Drizzle
from the Mercer 2018 Spr Programming contest
Charles Bailey
03 02 2018
*/
#include <bits/stdc++.h>
typedef long long ll;