Skip to content

Instantly share code, notes, and snippets.

View HotelCalifornia's full-sized avatar
🏩
🏳️‍🌈🏳️‍⚧️

Hannah Brooke HotelCalifornia

🏩
🏳️‍🌈🏳️‍⚧️
View GitHub Profile
# -*- coding: utf-8 -*-
import os
import fnmatch as fn
FILTER = '*.log'
PATH = '//fs_02/2016$/618616/PLTW Sftw Engineering/Python'
def run():
log = '"' + get_last_log(PATH) + '"'
command = u'%logstart -ort ' + log + ' append'
@HotelCalifornia
HotelCalifornia / monsieur_robot.c
Last active August 29, 2015 14:11
Simple ROBOTC program for a robot with two TETRIX DC motors, one NXT motors, and an NXT ultrasonic sensor
#pragma config( Hubs, S1, HTMotor, none, none, none )
#pragma config(Sensor, S1, hubby, sensorI2CMuxController )
#pragma config(Sensor, S2, sonar, sensorSONAR )
#pragma config( Motor, motorA, motorA, tmotorNXT, openLoop )
#pragma config( Motor, motorC, , tmotorNXT, openLoop )
#pragma config( Motor, mtr_S1_C1_1, motorD, tmotorTetrix, openLoop, driveRight)
#pragma config( Motor, mtr_S1_C1_2, motorE, tmotorTetrix, openLoop, driveLeft )
/************************************************************\
* This robot will move around autonomously, and decide *
# instead of testing for the user existing, test if the user doesn't exist
function user_not_exists($username)
{
$connection = $this->get_connection();
$stmt = $connection->prepare("SELECT `username` FROM users WHERE username = ?;");
$stmt->bindValue(1, $username, PDO::PARAM_STR);
$stmt->execute();
return empty($stmt->fetchAll(PDO::FETCH_ASSOC));
# PDOStatement::fetchAll returns an array, so it's easiest to test if the array is empty (no results found)
# if you want to keep the function as user_exists(...), try returning $stmt->fetchAll(PDO::FETCH_ASSOC)[0]
:loop
echo 
ping 192.0.2.2 -n 1 -w 100 > nul
goto loop
from turtle import *
import random as r
RADIUS = 50
# visual of the circle
c = Turtle()
c.penup()
c.setpos(c.pos()[0], c.pos()[1]-RADIUS)
c.pendown()
import matplotlib.pyplot as plt
primes = []
for i in range(2, 10000):
for j in range(2, i):
if i % j == 0:
break
else:
primes.append(i)
from scipy.special import lpmv as p
from numpy.core.umath import sin, cos
import csv
import urllib2
url = 'https://drive.google.com/open?id=0B6ZzcxI-pS7DWC1NaGo0YU5yMGc'
resp = urllib2.urlopen(url)
data = csv.reader(resp)
ggm02c = []
/root/.rakudobrew/moar-nom/install/bin/moar: error while loading shared libraries: libmoar.so: cannot enable executable stack as shared object requires: Invalid argument
Cleaning up ...
/usr/bin/perl -MExtUtils::Command -e mkpath gen/moar/stage1/gen
/usr/bin/perl tools/build/gen-cat.pl moar src/how/Archetypes.nqp src/how/RoleToRoleApplier.nqp src/how/NQPConcreteRoleHOW.nqp src/how/RoleToClassApplier.nqp src/how/NQPCurriedRoleHOW.nqp src/how/NQPParametricRoleHOW.nqp src/how/NQPClassHOW.nqp src/how/NQPNativeHOW.nqp src/how/NQPAttribute.nqp src/how/NQPModuleHOW.nqp src/how/EXPORTHOW.nqp > gen/moar/stage1/nqpmo.nqp
/root/.rakudobrew/moar-nom/install/bin/moar --libpath=src/vm/moar/stage0 src/vm/moar/stage0/nqp.moarvm --bootstrap --setting=NULL --no-regex-lib --target=mbc \
--output=gen/moar/stage1/nqpmo.moarvm gen/moar/stage1/nqpmo.nqp
/root/.rakudobrew/moar-nom/install/bin/moar: error while loading shared libraries: libmoar.so: cannot enable executable stack as shared object requires: Invalid argumen
[14:32:26] root@localhost:~ **]#> rakudobrew build panda
Already on 'master'
Your branch is up-to-date with 'origin/master'.
error: pathspec 'nom' did not match any file(s) known to git.
panda for nom not found
Installing latest panda instead.
rakudobrew: perl6: command not found
./perl6-m tools/build/install-core-dist.pl /root/.rakudobrew/moar-nom/install/share/perl6
Unhandled exception: Failed to write string to stream: bad file descriptor
at <unknown>:1 (././CORE.setting.moarvm:print_exception)
from gen/moar/m-CORE.setting:21425 (././CORE.setting.moarvm:<anon>)
from gen/moar/stage2/NQPHLL.nqp:1628 (/root/.rakudobrew/moar-nom/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from src/Perl6/Compiler.nqp:29 (./blib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:1568 (/root/.rakudobrew/moar-nom/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/m-main.nqp:37 (/root/.rakudobrew/moar-nom/perl6.moarvm:MAIN)
from gen/moar/m-main.nqp:33 (/root/.rakudobrew/moar-nom/perl6.moarvm:<mainline>)
from <unknown>:1 (/root/.rakudobrew/moar-nom/perl6.moarvm:<main>)