This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
bool isMultiple(int n,int divisor) { | |
return n % divisor == 0; | |
} | |
int main() { | |
for (int i = 1; i <= 10000000; i++) { | |
if (isMultiple(i, 3) && isMultiple(i, 5)) { | |
std::cout<<"FizzBuzz"<<"\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
bool isMultiple(int n,int divisor) { | |
return n % divisor == 0; | |
} | |
int main() { | |
for (int i = 1; i <= 10000000; i++) { | |
std::string text = std::string(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
// Normalized pixel coordinates (from 0 to 1) | |
fragCoord = fragCoord / iResolution.xy; | |
vec2 start = vec2(0.2, 0.2); | |
vec2 end = iMouse.xy / iResolution.xy; | |
vec2 direction = normalize(end - start); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// dijkstra | |
// | |
// Created by Owen Morgan on 28/09/2018. | |
// Copyright © 2018 Owen Morgan. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <unordered_map> | |
#include <vector> | |
template <typename T> | |
struct Edge; | |
template <typename T> | |
struct Node; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::hash::{Hash, Hasher}; | |
struct Node | |
{ | |
value : i32, | |
connections : Vec<Edge> | |
} | |
impl Hash for Node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compile with: | |
// c++ range_for.cpp -std=c++11 -m[sse4.2|avx2|avx|arch=native] | |
// run with ./a.out array_size | |
#include <vector> | |
#include <thread> | |
#include <cstdio> | |
#include <numeric> | |
#include <emmintrin.h> | |
#include <smmintrin.h> |