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 com.pig3; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class MultiExecutor { | |
| // Add any necessary member variables here | |
| List<Thread> threads =new ArrayList<>(); | |
| /* |
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 java.util.List; | |
| public class MultiExecutor { | |
| // Add any necessary member variables here | |
| /* | |
| * @param tasks to executed concurrently | |
| */ | |
| public MultiExecutor(List<Runnable> tasks) { |
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 com.pig2; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Random; | |
| public class Main { | |
| public static final int MAX_PASSWORD = 9999; | |
| public static void main(String[] args) { |
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
| print 'Hello Pig' #Python 3.x doesn't support | |
| print('Hello Hog') |
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 com.pig.simplesteph.kafka.tutorial1; | |
| import java.util.Properties; | |
| import org.apache.kafka.clients.producer.KafkaProducer; | |
| import org.apache.kafka.clients.producer.ProducerConfig; | |
| import org.apache.kafka.clients.producer.ProducerRecord; | |
| import org.apache.kafka.common.serialization.StringSerializer; | |
| public class ProducerDemo { |
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 com.pig.simplesteph.kafka.tutorial1; | |
| import java.util.Properties; | |
| import org.apache.kafka.clients.producer.KafkaProducer; | |
| import org.apache.kafka.clients.producer.ProducerConfig; | |
| import org.apache.kafka.clients.producer.ProducerRecord; | |
| import org.apache.kafka.common.serialization.StringSerializer; | |
| public class ProducerDemo { |
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 wadete; | |
| public enum CvTypeEnum { | |
| TYPE_0("0", "零"), | |
| TYPE_1("1", "一"), | |
| TYPE_2("2", "二"), | |
| TYPE_3("3", "三"), | |
| TYPE_4("4", "四"), | |
| TYPE_5("5", "五"), | |
| TYPE_6("6", "六"), |
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 DIP; | |
| import java.util.List; | |
| import org.javatuples.Triplet; | |
| public class Research { // high-level:有low level當參數的建構子,且功能上更接近使用者端,使用者端不在意data storage,而更在意功能服務Research | |
| // public Research(Relationships relationships) |
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 DIP; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Objects; | |
| import java.util.stream.Collectors; | |
| import org.javatuples.Triplet; | |
| public class Relationships implements RelationshipBrowser { // low-level:與資料儲存(data storage)有直接關係,並且可直接取用其中的資料 |
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 DIP; | |
| import java.util.List; | |
| public interface RelationshipBrowser { | |
| List<Person> findAllChildrenOf(String name); | |
| } |