This file contains hidden or 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 <string> | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
vector<string> dogPeople = { "James", "Mary", "Tim", "Jane", "Greg" }; |
This file contains hidden or 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
# USAGE INSTRUCTIONS | |
# It's an interactive shell, where you have the following options... | |
# - Just type in an assembly instruction in Intel syntax, and it'll spit out the bytecode | |
# - Change the syntax to AT&T with the att command | |
# - Change the syntax back to Intel with the intel command | |
# - Quit with the q command | |
import os | |
import sys | |
import tempfile | |
import subprocess |
This file contains hidden or 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
public static boolean isPowerOf2(int num) | |
{ | |
return Math.log(num) / Math.log(2) == (double)(31 - Integer.numberOfLeadingZeros(num)); | |
} |
This file contains hidden or 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
// | |
// Student.cpp | |
// StudentInformationAnalyzer | |
// | |
// Created by Adam Spindler on 1/4/14. | |
// Copyright (c) 2014 Adam Spindler. All rights reserved. | |
// | |
#include "Student.h" |
This file contains hidden or 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
#import <UIKit/UIKit.h> | |
@interface MAAppDelegate | |
@property (nonatomic,retain) UIWindow * window; | |
-(void)applicationDidFinishLaunching:(id)arg1; | |
@end | |
%hook MAAppDelegate |
This file contains hidden or 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
template <typename T> | |
void remove_elements(vector<T> &vect, function<bool(T)> comparator) | |
{ | |
auto newEnd = remove_if(vect.begin(), vect.end(), comparator); | |
vect.erase(newEnd, vect.end()); | |
} |
This file contains hidden or 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
import java.util.*; | |
import java.awt.*; | |
import javax.swing.*; | |
public class Main | |
{ | |
public static void main(String[] args) | |
{ | |
JFileChooser fileDialog = new JFileChooser(); | |
if (fileDialog.showOpenDialog(null) != JFileChooser.APPROVE_OPTION) |
This file contains hidden or 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> | |
#include <functional> | |
#include <algorithm> | |
using namespace std; | |
double GetFunctionLength(double start, double end, function<double(double)> mathFunc, int precision) | |
{ | |
if (precision < 1) | |
return 0; |
This file contains hidden or 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
import sys | |
def PrintDiaboloLine(centerLen, totalLen): | |
endLen = (totalLen - centerLen) / 2 | |
print endLen * '.' + (centerLen * '@') + endLen * '.' | |
def PrintDiabolo(width, height, iteration): | |
if (iteration * 2) + 1 >= height: | |
PrintDiaboloLine(2, width) | |
return |
This file contains hidden or 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 <stdio.h> | |
void PrintStarLine(int len) | |
{ | |
for (int i = 0; i < len; i++) | |
printf("*"); | |
printf("\n"); | |
} | |
void PrintBodyLine(int len) |