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
    
  
  
    
  | <!DOCTYPE html> | |
| <html lang="ko"> | |
| <head> | |
| <script> | |
| </script> | |
| <style> | |
| #msg { | |
| width: 800px; | |
| height: 400px; | |
| background-color: lightgray; | 
  
    
      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.*; | |
| import java.util.function.Consumer; | |
| /* | |
| GenericExample | |
| 제네릭(GenericExample)은 jdk1.5 부터 사용할 수 있다. | |
| 객체의 타입을 컴파일러에 미리 알려줘 컴파일러가 형변환 코드를 추가해준다. | |
| 이상한 객체를 형변환하는 것을 미리 알려줘 안전하고 명확한 프로그래밍을 가능하게 해준다. | 
  
    
      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 example.echo; | |
| import io.netty.bootstrap.Bootstrap; | |
| import io.netty.buffer.ByteBuf; | |
| import io.netty.buffer.ByteBufUtil; | |
| import io.netty.buffer.Unpooled; | |
| import io.netty.channel.*; | |
| import io.netty.channel.nio.NioEventLoopGroup; | |
| import io.netty.channel.socket.DatagramChannel; | |
| import io.netty.channel.socket.DatagramPacket; | 
  
    
      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 akka.actor.AbstractActor; | |
| import akka.actor.ActorSystem; | |
| import akka.actor.Props; | |
| import akka.event.Logging; | |
| import akka.event.LoggingAdapter; | |
| import com.typesafe.config.Config; | |
| import com.typesafe.config.ConfigFactory; | |
| /** | |
| * 5150 포트로 메시지를 기다렸다. 메시지를 대문자로 변환해서 응답한다. | 
  
    
      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 akka.actor.AbstractActor; | |
| import akka.actor.ActorSelection; | |
| import akka.actor.ActorSystem; | |
| import akka.actor.Props; | |
| import akka.event.Logging; | |
| import akka.event.LoggingAdapter; | |
| import com.typesafe.config.Config; | |
| import com.typesafe.config.ConfigFactory; | |
| /** | 
  
    
      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.io.IOException; | |
| import java.net.DatagramPacket; | |
| import java.net.DatagramSocket; | |
| public class UdpServer { | |
| public static void main(String[] args) throws IOException { | |
| int port = 2020; | |
| byte[] buf = new byte[11]; | |
| DatagramPacket packet = new DatagramPacket(buf, buf.length); | 
  
    
      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.io.IOException; | |
| import java.net.DatagramPacket; | |
| import java.net.DatagramSocket; | |
| import java.net.InetAddress; | |
| import java.util.concurrent.TimeUnit; | |
| public class UdpClient { | |
| public static void main(String[] args) throws IOException, InterruptedException { | |
| InetAddress address = InetAddress.getByName("127.0.0.1"); | |
| int port = 2020; | 
  
    
      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.text.SimpleDateFormat; | |
| import java.time.LocalDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| import java.util.Date; | |
| public class DateTimeFormatSample { | |
| public static void main(String[] args) { | |
| // Old style | |
| SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); | 
  
    
      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
    
  
  
    
  | # ref: https://github.com/rehassachdeva/UDP-Pinger | |
| import random | |
| import sys | |
| from socket import * | |
| # Check command line arguments | |
| if len(sys.argv) != 2: | |
| print "Usage: python UDPPingerServer <server port no>" | |
| sys.exit() | 
  
    
      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
    
  
  
    
  | #-*-coding: utf-8 -*- | |
| # ref: https://github.com/rehassachdeva/UDP-Pinger | |
| import time | |
| import sys | |
| import math | |
| from socket import * | |
| # standard deviation (표준편차) | |
| def standardDeviation(values, avg, option): | 
NewerOlder