Skip to content

Instantly share code, notes, and snippets.

//
// main.c
// Standard Deviation
//
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
from math import *
#get the input numbers and returns them as a list
def inputget():
#get a string of input, and separate it into numbers
inputs = input("Enter numbers separated by spaces: ").split(' ')
#create an empty list
output_int = []
@geekskick
geekskick / gist:8ae2328a4e252ae8535b
Created May 22, 2015 22:45
Daily Programmer Easy 215
//
// main.c
// Sad Cycle
//
// http://www.reddit.com/r/dailyprogrammer/comments/36cyxf/20150518_challenge_215_easy_sad_cycles/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
//
// main.c
// Threading
//
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
@geekskick
geekskick / secret_message.c
Created January 5, 2016 22:58
Started making a present to my girlfriend
#include <stdio.h>
union test {
unsigned char a;
unsigned short b;
unsigned int c;
unsigned int d;
unsigned long e;
};
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include <math.h>
/// Uses luminosity to convert colour to greyscale
#define LUM_R 0.21F
#define LUM_G 0.72F
#define LUM_B 0.07F
@geekskick
geekskick / main.cpp
Created December 16, 2016 12:42
Apprentice Lab
/*
* Use the numbers 1-9 in that order to find all the ways of getting 100.
* You can't miss any of the numbers out and only use + and - operations
* No functions or classes allowed either!
*
* eg
* 1+2+3+4+5+6+7+8+9 = 100? Then show
* 123+456-789 = 100? Then Show
*
*/
@geekskick
geekskick / dailyProgrammerXmasLights.swift
Last active December 16, 2016 13:28
Daily Programmer X Mas Lights, using as many computed properties as possible
import Foundation
///the led information
struct LED{
let voltageDrop :Float!
let currentDrawn :Float!
let image :String = "-|>|-"
init(voltageDrop: Float, currentDrawn: Float){
self.voltageDrop = voltageDrop
@geekskick
geekskick / main.cpp
Created March 1, 2017 18:34
Lab Exerise 2
#include <iostream>
#include <vector>
#include "carbon_footprint.h"
#include "car.h"
#include "building.h"
#include "bicycle.h"
int main ()
{
{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
enum{TITLE_MAX = 1024};
typedef struct Story
{