2018년 5월 27일 일요일

[Python] matplotlib rain simulation modification

https://matplotlib.org/gallery/animation/rain.html#sphx-glr-gallery-animation-rain-py

1)
scat=facecolors=rain_drops['color'],

2)
rain_drops['color'] = np.random.uniform(0, 1, (n_drops, 4))

<<result>>



* gtk install
pip install PyGTK

2018년 4월 27일 금요일

(4. 27.) 채팅 프로그램 만들기-Server

1. 서버 측 프로그램 구성


2. 소스 분석


  1) 멤버변수
---------ArrayList<DataOutputStream> list = new ArrayList<DataOutputStream>();

  2) 생성자
---------Socket s = socket.accept();
ServerThread serverThread = new ServerThread(s);

serverThread.start();
   3) Broadcast
---------synchronized (list) {
for(DataOutputStream tmp:list) {
                        tmp.writeUTF(msg);
   4) 메인

   5) ServerThread
---------생성자(메서드 파라미터: 소켓)
dis = new DataInputStream(s.getInputStream());
dos = new DataOutputStream(s.getOutputStream());
list.add(dos);
   

---------run(@Override)while(true) {
String msg = dis.readUTF();
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
//dos.writeUTF(msg);
broadCast(msg);
}

3. 사용 클래스
   - IO: DataOutputStream, DataInputStream
   - NET: ServerSocket, Socket
   - etc.: ArrayList, String, Exception
   3-1) 소켓 접속방법
Socket ss = new Socket("111.222.333.55", 1111);
Socket s1 = new Socket(new InetSocketAddress("www.naver.com", 1111), null, daemon);
Socket s21 = new Socket();

s21.connect(new InetSocketAddress("www.naver.com", 1111));


2018년 4월 26일 목요일

(4. 26.) JAVA Collections, File IO interface, Generic Type

1. JAVA Collections
  - List, Map..
  - 상속 관계도
      |_ 출처: https://www.programcreek.com/2009/02/the-interface-and-class-hierarchy-for-collections/



 2. 채팅 프로그램
      - 자주 사용하는 단어 분석하기 예제







2018년 4월 25일 수요일

(4. 25.) JAVA IO pkg

1. InputStream, OutputStream Class



2. Reader, Writer


3. BufferedReader, BufferedInputStream
    BufferedWriter, BufferedOutputStream




[Android Studio] Installation and Make a Layer for Mac OS(High Sierra)

1. download android studio https://developer.android.com/studio/#downloads 2. Make a Shared Resource(String in this case) 3...