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 org.apache.poi.ss.usermodel.Row; | |
import org.apache.poi.xssf.streaming.SXSSFSheet; | |
import org.apache.poi.xssf.streaming.SXSSFWorkbook; | |
import org.apache.poi.xssf.usermodel.XSSFRow; | |
import org.apache.poi.xssf.usermodel.XSSFSheet; | |
import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
import java.io.BufferedReader; | |
import java.io.FileOutputStream; | |
import java.io.FileReader; |
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 cv2 | |
from redis import ConnectionPool, Redis | |
import numpy as np | |
import json, time | |
from threading import Thread, Event | |
redis_config = {"server": "localhost", | |
"passwd": '', | |
"port": '6379', | |
"db": 0} |
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
interface Robot { | |
// very common features, every client must implement are below. | |
void run(); | |
void walk(); | |
} | |
interface ShootingRobot extends Robot { void shoot(); } | |
interface SwimmingRobot extends Robot { void swim(); } | |
interface FightingRobot extends Robot { void fight(); } |
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 interface Robot { | |
void run(); | |
void shoot(); | |
void swim(); | |
void fight(); | |
void walk(); | |
} | |
// company A wants to extend the Robot to add Speaking feature |
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 interface Everything { run() } | |
// similar to Object class(root class, it has most generalized methods) in Java | |
public class HumanoidRobot extends Everything { | |
public void run() { | |
// code to run using batteries. | |
} | |
} | |
public class Human extends Everything { | |
public void run() { |
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 interface Human { | |
publi void eat(); | |
} | |
public class HumanoidRobot extends Human { | |
// Humanoid Robot - A humanoid is something that has an appearance | |
// resembling a human without actually being one. | |
// can robot eat ? No | |
@override | |
publi void eat() { | |
// do nothing |
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 interface Human { | |
publi void eat(); | |
} | |
public class HumanoidRobot extends Human { | |
// can robot eat ? | |
} | |
Human obj1 = new Human() | |
Human obj2 = new HumanoidRobot() |
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 MSWord2030 { | |
void display() { ... } | |
void feature1() { ... } | |
void feature2() { ... } | |
void feature3() { ... } | |
} |
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
interface doc_feature2 { void feature2(String content); } | |
class MSWord2030 extends MSWord2020 implements doc_feature2 { | |
public void feature2(String content) { ... } | |
} |
NewerOlder