Skip to content

Instantly share code, notes, and snippets.

[
{
"Brand": "EVGA",
"ProductName": "GeForce GTX 1060",
"GraphicName": "GeForce GTX 1060",
"CostPrice": 200.00,
"MSRP": 309.99,
"QtyOnHand": 20,
"QtyOnBackOrder": 10,
"Description": "The EVGA GeForce GTX 1060 is loaded with innovative new gaming technologies, making it the perfect choice for the latest high definition games. Powered by NVIDIA Pascal the most advanced GPU architecture ever created the GeForce GTX 1060 delivers brilliant performance that opens the door to virtual reality and beyond.Max Monitors Supported: 4"
#include "Gregorian.hpp"
#include <array>
bool is_leap_year( unsigned y) {
return ((y % 4 == 0) && (y % 100 !=0)) || (y%400 == 0);
}
@h3llborn
h3llborn / tuples_demo_main.cpp
Created September 21, 2017 12:32
tuples demo
#include <tuple> // ordered container , elements don't have to be the same type; C++ 11 standard, comes from boost - pre c++11
#include <iostream>
#include <string>
#include <type_traits>
using namespace std;
#include "tupleio.hpp"
int main() {
@h3llborn
h3llborn / BoostTestDemo.cpp
Created September 11, 2017 14:53
unit testing demo
// dont complain about old c functions I didn't write
#define _CRT_SECURE_NO_WARNINGS
#define BOOST_TEST_MODULE MyTestDemo
#include <boost/test/unit_test.hpp>
int square(int n) { return n*n; }
BOOST_AUTO_TEST_CASE(square_ok) {
BOOST_CHECK(square(2) == 4);
BOOST_CHECK(square(3) == 4); // continues despite failure
--Q1
SELECT c.CompanyName AS "Customer", REPLACE(PostalCode,' ','-') AS "Postal Code", ord.OrderID as "Order #"
FROM Customers c
LEFT OUTER JOIN Orders ord
ON c.CustomerID = ord.CustomerID
WHERE c.Country = 'France' OR c.Country = 'Canada'
ORDER BY OrderID DESC;
--Q2
SELECT RPAD(SUBSTR(s.CompanyName,1,20),20,'.') AS "Company", RPAD(SUBSTR(p.ProductName,1,15),15,'.') AS "Product",
@h3llborn
h3llborn / cipher.cpp
Last active March 15, 2017 23:17
updated findoffset , output works too, random number works, encryption works
//BcEncode.cpp
//Chris Niesel
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <map>
#include <random>
#include <ctime>
#include <vector>
@h3llborn
h3llborn / barcodegen.html
Created August 8, 2016 04:04
airline barcode gen v0.1
<!DOCTYPE html>
<html>
<head>
<title>barcode gen</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
// author chris niesel
// class compsci 2211
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
void initrandom(){
srand((float) time(NULL));
}
// author chris niesel
// class compsci 2211
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
/*
Method: initrandom
input: nothin
// author chris niesel
// class compsci 2211
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void initrandom(){
srand((float) time(NULL));
}
float genRandom(){