Skip to content

Instantly share code, notes, and snippets.

@peterneorr
peterneorr / Program.cs
Created October 26, 2022 15:57
test program for BNC 575
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace Client
{
/// <summary>
/// Simplest possible socket client to connect and send a SCPI command to
/// an ethernet device
/// </summary>
@peterneorr
peterneorr / Program.cs
Created December 4, 2021 22:47
Family Gift Exchange Program
//everybody to give/recieve a gift
List<string> players = new List<string> { "Peter", "Emma", "John", "Chris", "Patty", "Karen", "Jenny", "Sloane" };
players.Sort();
Dictionary<string,List<string>> restrictions = new Dictionary<string,List<string>>();
// Rule: players can't give to themselves
players.ForEach(p => restrictions.Add(p, new List<string> { p }));
@peterneorr
peterneorr / stepper_and_servor.ino
Created June 24, 2021 15:21
Arduino concurrency
/*
Adapted from https://create.arduino.cc/projecthub/debanshudas23/getting-started-with-stepper-motor-28byj-48-3de8c9
and the arduino "sweep" example
*/
#include <Servo.h>
#define A 2
#define B 3
#define C 4
#define D 5
@peterneorr
peterneorr / activemq
Created October 24, 2017 00:03
ActiveMQ /etc/init.d/ script
#!/bin/bash
#
# start/stop Active MQ
#
# chkconfig: 2345 90 10
#
# Description: ActiveMQ init script
# Source function library.
. /etc/init.d/functions
@peterneorr
peterneorr / apollo
Last active October 18, 2017 18:00
Apollo 1.7.1 /etc/init.d script
#!/bin/bash
#
# apollo start/stop Apollo MQ
#
# chkconfig: 2345 90 10
#
# Description: ApolloMQ init script
# Source function library.
. /etc/init.d/functions
@peterneorr
peterneorr / Tron_.idea_.name
Created October 3, 2014 15:06
Tron game to Demonstrate Pygame for Delta High programming club
PyGameDemo