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 <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| typedef union | |
| { | |
| unsigned int ui; | |
| unsigned char c[4]; | |
| float f; |
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
| # Compiles a CUDA application to report the attributes of a kernel | |
| # | |
| # usage: cuda_kernel_query.py <file> <entry name> [<define list>] | |
| # | |
| # file - name of the CUDA source file contain the kernel of interest | |
| # entry name - name of the kernel to examine | |
| # define list - comma delimited list of proprocessor defines for compilation | |
| # | |
| # If BLOCK_SIZE is defined in the file, this value is used in the occupancy | |
| # calculation, otherwise the blockSize returned by |
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
| # Script for running an application multiple times | |
| # | |
| # usage run_handler.py "<app + args>" <times> [output.csv] | |
| # | |
| # This script runs the a process multiple times and reports the | |
| # average running time. Optionally, a file name can be provided, | |
| # and the script will append the execution of each completed time | |
| # into a file of that name. | |
| # | |
| # The script further estimates its total running time after the |
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 os,time | |
| from slackclient import SlackClient | |
| from twitch import TwitchClient | |
| client = TwitchClient(client_id=os.environ.get('TWITCH_TOKEN')) | |
| # Dictionary of twitch accounts | |
| twitchAccounts = {'NAME' : {'username' : 'TWITCH_USERNAME'}} | |
| wait_time = 60 |
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
| from random import shuffle | |
| from sys import argv | |
| from pathlib import Path | |
| names = [] | |
| if len(argv) == 2: | |
| file_path = Path(argv[1]) | |
| if not file_path.exists(): | |
| print(f'File not found: {argv[1]:s}') |
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
| num_disks = 15 | |
| num_pegs = 3 | |
| disks = ['disk%d' % (i+1) for i in range(num_disks)] | |
| pegs = ['peg%d' % (i+1) for i in range(num_pegs)] | |
| filename = 'hanoi-problem.pddl' | |
| init = ['(clear disk1)'] | |
| goals = ['(clear disk1)'] |
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 discord | |
| import asyncio | |
| import RPi.GPIO as GPIO | |
| import traceback | |
| from discord.ext import commands | |
| TOKEN = 'BOT_TOKEN_HERE' | |
| description = '''A bot that reports changes to a pin on the GPIO''' |
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
| // Renders a single screen-aligned triangle that fills the screen without a vertex buffer | |
| // Creates texture coordinates with (0,0) in the top left and (1,1) in the bottom right | |
| // | |
| // DX11 API calls: | |
| // m_pD3D11Device->IASetInputLayout(NULL); | |
| // m_pD3D11Device->IASetPrimitiveTopology( D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST ); | |
| // m_pD3D11Device->Draw(3, 0); | |
| struct VSOut | |
| { |
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
| # Python 3 script that reads the latest tweets that | |
| # match the search term (line 21) and appends the url to | |
| # the first video associated with each tweet to file | |
| # See line 47 for the file name | |
| # tested with Python 3.6.4 | |
| import tweepy | |
| import signal | |
| import sys |
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
| <!-- Streams a list of videos from a text file --> | |
| <!-- Text file format: integer,url --> | |
| <!-- Tested with Google Chrome Version 66.0.3359.139 (Official Build) (64-bit) --> | |
| <!-- To run a simple local web server --> | |
| <!-- type "python -m http.server 8000" at the command line --> | |
| <!-- then direct your browser to localhost:8000 --> | |
| <html> |