Skip to content

Instantly share code, notes, and snippets.

View jaronoff97's full-sized avatar
:bowtie:
opentelemetry-ing

Jacob Aronoff jaronoff97

:bowtie:
opentelemetry-ing
View GitHub Profile
---------------------------------- <-- a BorderLayout with a North and Center
| Type a URL | GO | <-- a (1,2) Gridlayout
|--------------------------------|
| |
| |
| |
| |
| HTML DATA | <-- a (1,1) Gridlayout
| |
| |
----------------------------------
| Type a URL | GO |
|--------------------------------|
| |
| |
| |
| |
| HTML DATA |
| |
| |
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.net.*;
import java.io.*;
public class FrameLayoutURLReader extends JFrame implements ActionListener {
protocol MailingAddress {
var address: String { get }
}
protocol TextRepresentable {
func represent() -> String
}
extension Int: TextRepresentable {
func represent()->String{
return "\(self)"
}
enum SortMethod {
case AscendingPriority
case DescendingPriority
case AscendingDueDate
case DescendingDueDate
func sort_function()->(Homework, Homework)->Bool{
switch self {
case AscendingPriority:
return { (h1, h2) in
enum Subject {
case English
case Programming
case Language
case Science
case History
}
struct Homework {
var subject: Subject
var due_date: String
var x: Int = 10 //statically typed variable
var y = 30.0 //dynamicly typed variable
var z: Double = Double(x)+y //Because x is an integer, we have to tell swift to add these numbers as doubles
var 國 = "美國"//We can use characters and emojis as variable names
let name="Jacob Aronoff"//let means the variable is immutable or final
print("My name is \(name)")//Print is just like in python
let students = ["Jacob","Sam","Corey","Michael"]//Swift array
todos = []
def main():
print("Welcome to your todolist!")
add_todo()
print_todos()
while(True):
choice = raw_input(
"If you want to add to your list say 'add', if you want to remove things say 'remove', if you want to see your todos say 'print', say anything else to exit ")
students = ["Jacob", "Sam", "Corey", "Michael"]
num = 0
while num < len(students):
print(students[num])
num += 1
for student in students:
print(student)
secret_number = 27
lower_bound = 0
upper_bound = 100
their_number = -100
def guessing_game(number):
if number <= lower_bound or number >= upper_bound:
print("Out of bounds!")
return # stops the method, we could also just say return, but break is a really useful control flow statement