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
using System; | |
namespace ConsoleAppTest01 | |
{ | |
class Program | |
{ | |
static readonly Random RNG = new Random(); | |
enum Choice | |
{ |
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
import random | |
print("Let's play some Rock, Paper, Scissors!") | |
options = ['rock', 'paper', 'scissors'] | |
trumps = {'rock': ['scissors'], 'paper': ['rock'], 'scissors': ['paper']} | |
wins = 0 | |
losses = 0 | |
running = True |
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
const int pulsePin = 13; | |
const int pulseLength = 10; // Pulse time in milliseconds | |
const int pulseDelay = 10; // Delay between pulses | |
void setup() { | |
pinMode(pulsePin, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(pulsePin, 1); |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int stroccurs (const char* src, const char delim) { | |
int occurances = 0; | |
char c; | |
while ((c = *src++)) { | |
if (c == delim) |
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
// / temp.ino | |
// ? Simple temperature reader. Reads temperature via LM335Z sensor and outputs to SMC1602A compliant LCD | |
// @ Justin Eittreim <eittreim.justin@live.com> | |
#include <LiquidCrystal.h> | |
// Provide the appropriate pins to the LCD library | |
// 12=RS, 11=E, 5=D4, 4=D5, 3=D6, 2=D7 | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); |
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 <stdio.h> | |
#include <stdlib.h> | |
typedef unsigned char byte; | |
typedef char* string; | |
string dec2bin(byte x) | |
{ | |
int i; | |
string bin = (string)malloc(sizeof(char)*9); |
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
<?php | |
// MangaPanda.com Scraper | |
// Downloads manga to be read locally, and organizes the files. | |
/// !!! It goes without saying, but if you don't own a physical copy of the manga, downloading it is illegal! | |
/// @ Justin Eittreim <eittreim.justin@live.com> | |
$name = "ao-haru-ride"; // Name portion of the URL. | |
$prettyname = "Ao Haru Ride"; // Proper name, for the folder. | |
$first_chapter = 16; // First chapter to scrape. |
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 <stdio.h> | |
#include <stdlib.h> | |
int main (int argc, char** argv) { | |
int num = 0; | |
char buf[12]; | |
puts("Enter a number: "); | |
fgets(buf, 12, stdin); | |
num = atoi(buf); | |
printf("The number you entered was: %i\n", num); |
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
package network | |
import ( | |
"net" | |
"io" | |
"time" | |
"bufio" | |
) | |
// It's simpler to use a bufio.Reader, instead of dealing with |
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
package network | |
import ( | |
"strings" | |
) | |
type Packet struct { | |
Command, Parameter, Body string | |
Arguments map[string]string | |
SubPacket *Packet |
NewerOlder