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
package flying; | |
public class Coordinate { | |
public double xCoord; | |
public double yCoord; | |
public Coordinate(double x, double y){ | |
xCoord = x; | |
yCoord = y; | |
} |
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
package flying; | |
import flying.Coordinate; | |
public interface Flying { | |
public boolean isFlyingRightNow = false; | |
public void fly(Coordinate c); | |
} |
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
package flying; | |
import flying.Flying; | |
import flying.Coordinate; | |
public class Pigeon implements Flying { | |
public String name; | |
public int age; | |
public int weight; | |
public boolean isFlyingRightNow = false; //INTERFACE |
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
package flying; | |
import flying.Flying; | |
import flying.Coordinate; | |
public class Boeing implements Flying { | |
public static int serial = 1; | |
public int number; | |
public int passengerCount; | |
public double fuelAmount; |
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 flying.Boeing; | |
import flying.Pigeon; | |
import flying.Coordinate; | |
import flying.Flying; | |
public class Main { | |
public static void main(String[] args) { | |
Boeing boeing1 = new Boeing(112); | |
Boeing boeing2 = new Boeing(108); | |
Pigeon joe = new Pigeon("joe"); |
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 CoreData | |
let projectName: String = "<Your project's name here>" | |
// AppDelegate stuff here | |
func applicationWillTerminate(_ application: UIApplication) { | |
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | |
self.saveContext() | |
} |
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 cv2 | |
import numpy as np | |
cap = cv2.VideoCapture(0) | |
while True: | |
_, frame = cap.read() | |
# interesting stuff here | |
cv2.imshow('CAMERA', frame) | |
key = cv2.waitKey(1) & 0xFF |
NewerOlder