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
// Here's the hacky way. I'm looping 8 times, because I know I have 80 students and therefore need at least 8 pages of ten. | |
function getSubmissions(course, courseWork) { | |
var optionalArgs = { | |
pageSize: 10 | |
} | |
var submissionObjs = []; | |
for (var i=0; i<8; i++) { | |
var response = Classroom.Courses.CourseWork.StudentSubmissions.list(course, courseWork, optionalArgs); // API call with necessary parameter | |
optionalArgs.pageToken = response.nextPageToken; //set next page token for a new page of results on next request |
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
var React = require('react'); | |
var OpenResponse = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
Open Response | |
</div> | |
) | |
} |
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 <cs50.h> | |
void quit(); | |
void show_menu(); | |
void print_list(); | |
void insert_at_tail(); | |
int search(); |
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
// Is there a difference between the two ways shown below of declaring a member variable in a class? | |
// If not, would there be a preference of one over the other? | |
class Foo { | |
public $bar = "baz"; | |
} | |
class Foo2 { | |
public function __construct() { |
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
function validatePythagorean(a, b, c) { | |
var rightSide = Math.sqrt(a*a + b*b); | |
if(Math.abs(rightSide - c) < 0.05) { | |
return true; | |
} else { | |
return false; | |
} | |
} |
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
def convert(num, base): | |
highest_power = 0 | |
while base**highest_power < num: | |
highest_power += 1 | |
result = "" |
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
/********* | |
Rui Santos | |
Complete project details at https://RandomNerdTutorials.com/esp8266-relay-module-ac-web-server/ | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
*********/ | |
// Import required libraries | |
#include "ESP8266WiFi.h" |
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 sys | |
from machine import Pin, ADC | |
pot = ADC(Pin(0)) | |
pot.atten(ADC.ATTN_11DB) | |
t = 0 | |
# ruff: noqa: E402 | |
sys.path.append("") | |
from micropython import const | |
import uasyncio as asyncio | |
import aioble |
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 <Adafruit_ADS1X15.h> | |
#include <SoftwareSerial.h> | |
Adafruit_ADS1115 ads; /* Use this for the 16-bit version */ | |
//Adafruit_ADS1015 ads; /* Use this for the 12-bit version */ | |
SoftwareSerial mySerial(2, 3); // RX, TX | |
bool selfTestEn = false; |