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
/** | |
* Based on code by Caroline Dunn: https://github.com/carolinedunn/pico-weather-station | |
**/ | |
#include <stdio.h> | |
#include <math.h> | |
#include "pico/stdlib.h" | |
#include "hardware/gpio.h" | |
#include <string.h> | |
const uint LED_PIN = PICO_DEFAULT_LED_PIN; |
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
class Show { | |
private String name; | |
private String airTime; | |
public Show(String name, int hour, int minute) { | |
if (hour < 0 || hour > 24) { | |
System.out.println("warning: invalid hour: " + hour); | |
} | |
if (minute < 0 || minute > 59) { | |
System.out.println("warning: invalid minute: " + minute); |
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 java.lang.reflect.Array; | |
import java.util.ArrayList; | |
import java.util.Comparator; | |
import java.util.PriorityQueue; | |
class WaitTimeComparator implements Comparator<Customer> { | |
@Override | |
public int compare(Customer c1, Customer c2) { | |
// if (c1.waitTime > c2.waitTime) { | |
// return -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
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.util.Scanner; | |
class TooFewColumnsException extends Exception { | |
public TooFewColumnsException(int row) { | |
super("Error reading CSV file at row " + row + ": too few columns"); | |
} | |
} |
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
int size = 0; | |
for (Food f : food) { | |
size += f.getTools().length; | |
} | |
Tool[] tools = new Tool[size]; | |
int i = 0; | |
for (Food f : food) { | |
for (Tool t : f.getTools()) { | |
tools[i++] = t; |
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
public class Program { | |
public static void main(String[] args) { | |
Shape[] shapes = new Shape[3]; | |
sgihapes[0] = new Circle(0, 0, 1); | |
shapes[1] = new Rectangle(0, 0, 2, 1); | |
shapes[2] = new Circle(1, 1, 1); | |
for (Shape shape : shapes) { | |
System.out.println(shape.getArea()); | |
} |
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
public class Program { | |
public static void main(String[] args) { | |
Shape[] shapes = new Shape[3]; | |
sgihapes[0] = new Circle(0, 0, 1); | |
shapes[1] = new Rectangle(0, 0, 2, 1); | |
shapes[2] = new Circle(1, 1, 1); | |
for (Shape shape : shapes) { | |
System.out.println(shape.getArea()); | |
} |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyWQXiYiP0Pg/IyMTn/9yvtmZw8aIde9RufiuInnn8wp1PYb8tHo8ocTA2ycd/Orv+zKLsjq4VRFsFQJ+4heIvist56wwKmhs6XUU5nVMZvFm2P0RTwY9N8AeuQYK8xHAjrdchS34lQlxi7nQcZx/RhH8vseuhyrVX80sI96TPirYXTjQusuNIKLcHk3+SqTUQqp2q3yy4x5UNJe69rcWUNUdboZSV7726VZZze8gwnEPUYGJrfOsUTomeTTFI8Qe3OTH7NZCRJ6NkIQr+6UrRYcq8vlMIlAGERGCzRG0/qq07dCnU2a6biwJX5Tzr1gNDEW/R9Ah3NdcxPHFybRvX eleanor@Athena |
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 java.util.ArrayList; | |
import java.util.PriorityQueue; | |
import java.util.Comparator; | |
class Customer { | |
private int timeOnHold; | |
public Customer(int timeOnHold) { | |
this.timeOnHold = timeOnHold; | |
} |
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 java.util.Arrays; | |
import java.util.HashMap; | |
class Ingredient { | |
public final String name; | |
public Ingredient(String name) { | |
this.name = name; | |
} |
NewerOlder