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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
!LButton:: | |
MouseClick, Left,X,Y,20,1, | |
return | |
mega_click = y |
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
.data | |
names: .space 16 | |
ryan: .asciiz "Ryan\n" | |
tammi: .asciiz "Tammi\n" | |
josh: .asciiz "Josh\n" | |
robert: .asciiz "Robert\n" | |
.text |
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> | |
static long num_steps = 100000; | |
double step; | |
void main() { | |
int i; | |
double x=0.0,pi=0.0,sum=0.0; | |
step = 1.0/(double)num_steps; | |
for (i=0;i<num_steps;i++) { |
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
// be sure you have ncurses installed | |
// compile with 'g++ ncurses_hello_world.cpp.cc -lcurses' | |
#include <ncurses.h> | |
int main() | |
{ | |
initscr(); /* Start curses mode */ | |
printw("Hello World !!!"); /* Print Hello World */ | |
refresh(); /* Print it on to the real screen */ |
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 <string> | |
#include <iostream> | |
// made to help with my printer and printing both sides | |
int main () { | |
std::cout << "This program prints numbers in sequence with comma seperated values as either even or odd\n"; | |
int choice; | |
while (choice == 0 && choice != 1 && choice != 2) { | |
std::cout << "1 for odd, 2 for even: "; |
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
(define (remove-nth n l) | |
(cond ((= n 0) l ) | |
((null? l) l) | |
(else (cons (car l) (remove-nth (- n 1) (cdr l)))) | |
) | |
) |
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
(*find i within the lst*) | |
let rec member i lst = | |
match lst with | |
[] -> false | |
| hd::tl -> hd = i || member i tl;; | |
(*with if else instead*) |
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
#pragma once | |
#include <string> | |
//because other langauges have these and the c++ does not | |
//Trims whitespace - from http://stackoverflow.com/questions/1798112/removing-leading-and-trailing-spaces-from-a-string | |
std::string trim(const std::string& str, | |
const std::string& whitespace = " \t") | |
{ | |
const auto strBegin = str.find_first_not_of(whitespace); |
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
#pragma once | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <iterator> | |
// split function for c++ -- from http://stackoverflow.com/questions/236129/split-a-string-in-c | |
template<typename Out> |
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 <string> | |
#include <cctype> | |
bool findStringIC(const std::string & strHaystack, const std::string & strNeedle) { | |
auto it = std::search( | |
strHaystack.begin(), strHaystack.end(), | |
strNeedle.begin(), strNeedle.end(), | |
[](char ch1, char ch2) { return std::tolower(ch1) == std::tolower(ch2); } | |
); | |
return (it != strHaystack.end() ); |
OlderNewer