-
psopt-SourceCode
PSOpt is a program to demonstrate the optimization process of particle
swarm optimization. A two-dimensional objective function is visualized
by levels of grey: the lighter the color, the higher the function value.
The particles are shown as red circles, their trajectory as red lines.
The global memory (best point found up to now by the whole swarm) is shown
as a blue cross-hair, the local memory (best points found by each of the
particles) as small blue crosses. To run the program, first choose one of
the example functions, then create a particle swarm, and finally start the
optimization.
- 2015-03-23 14:06:17下载
- 积分:1
-
基于Web整合验证
主要可以用于在Web开发中引入,帮助开发者在验证这块操作,在开发过程中方便快捷丰富网页验证过滤从而更好理解JS验证带来的巨大效率!!!
- 2023-07-24 19:30:03下载
- 积分:1
-
android 手机拍照上传到服务器
android 手机拍照上传到服务器
- 2013-06-26下载
- 积分:1
-
Android tcp通讯学习用
核心代码:package com.Test;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.app.Activity;import android.view.Menu;import android.widget.Button;import android.view.View;import android.view.View.OnClickListener;import java.io.BufferedInputStream;import java.io.InputStream;import java.io.OutputStream;import java.io.IOException;import java.io.UnsupportedEncodingException;import java.io.InputStreamReader;import java.io.BufferedReader;import java.io.PrintWriter;import java.io.Reader;import java.net.Socket;import java.net.ServerSocket;import java.net.UnknownHostException;import android.view.TextureView;import android.widget.EditText;import java.lang.String;import java.lang.Thread;public class MainActivity extends Activity implements OnClickListener{ private Button m_btn; private Button m_sendbtn; private ServerSocket mySerSocket; private Socket clientSocket; private EditText m_edit; private String line; boolean conn = true; private Socket accSocket; private static final String Host = "10.0.2.2"; private static final int Port = 12000; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); m_btn = (Button)findViewById(R.id.button1); m_sendbtn = (Button)findViewById(R.id.button2); m_edit = (EditText)findViewById(R.id.editText1); //m_btn.setOnClickListener(this); m_btn.setOnClickListener(new ReceiverListener()); m_sendbtn.setOnClickListener(this); //Socket clientSocket = new Socket(Host, Port); } class ReceiverListener implements OnClickListener { private ReceiveThread mReceiveThread = null; private boolean stop = true; private Handler mHandler = null; public void onClick(View v) { try { if(clientSocket == null) { clientSocket = new Socket(Host, Port); } // InputStream myInputStream = clientSocket.getInputStream();// // //BufferedReader in = new BufferedReader(new InputStreamReader(myInputStream));//// byte [] buffer = new byte[myInputStream.available()]; //int temp = 0; //String strMsg = in.readLine(); // myInputStream.read(buffer);// // // String strMsg = new String(buffer);// // m_edit.setText(strMsg);// while ((temp = myInputStream.read(buffer)) != -1)// {// m_edit.setText(new String(buffer, 0, temp));//// } mReceiveThread = new ReceiveThread(clientSocket); stop = false; mReceiveThread.start(); } catch (IOException e) { e.printStackTrace(); } //消息处理 mHandler = new Handler() { public void handleMessage(Message msg) { m_edit.setText((msg.obj).toString()); } }; } private class ReceiveThread extends Thread { private InputStream inStream = null; private byte[] buf; private String str = null; ReceiveThread(Socket s) { try { this.inStream = s.getInputStream(); } catch(IOException e) { e.printStackTrace(); } } public void run() { while(!stop) { this.buf = new byte[512]; try { this.inStream.read(this.buf); } catch(IOException e) { e.printStackTrace(); } try { this.str = new String(this.buf, "GB2312").trim(); } catch(UnsupportedEncodingException e) { e.printStackTrace(); } Message msg = new Message(); msg.obj = this.str; mHandler.sendMessage(msg); } } } } public void onClick(View v) {// if (v.getId() == R.id.button1)// {// new Thread()// {// public void run()// {// try // {// if(clientSocket == null)// {// clientSocket = new Socket(Host, Port);// } // InputStream myInputStream = clientSocket.getInputStream();// // BufferedReader in = new BufferedReader(new InputStreamReader(myInputStream));//// byte [] buffer = new byte[1024 * 4];//// int temp = 0;// // String strMsg = in.readLine();// // //myInputStream.read(buffer);// // //String strMsg = new String(buffer);// // m_edit.setText(strMsg);////// while ((temp = myInputStream.read(buffer)) != -1)//// {//// m_edit.setText(new String(buffer, 0, temp));//////// }// // }// catch (IOException e)// {// e.printStackTrace();// }// }// }.start();// // } if(v.getId() == R.id.button2) { new Thread() { public void run() { try { if(clientSocket == null) { clientSocket = new Socket(Host, Port); } //inputStream clientInputStream = clientSocket. String msg = "RESET-SHOW"; //InputStream clientInputStream = clientSocket.getInputStream(); //BufferedReader br = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); //BufferedReader br = new BufferedReader(); //line = br.readLine(); OutputStream clientOutputStream = clientSocket.getOutputStream(); byte buffer[]=msg.getBytes(); clientOutputStream.write(buffer); clientOutputStream.flush(); //int temp = 0; // PrintWriter out = new PrintWriter(clientOutputStream);// // out.println("Serer Message: " msg); } catch(IOException e) { e.printStackTrace(); } } }.start(); } }private Reader InputStreamReader() { // TODO Auto-generated method stub return null; }// private Handler handler = new Handler()// {// public void handleMessage(Message msg)// {// super.handleMessage(msg);// //处理UI// m_edit.setText("Finish");// Log.i("PDA", "Finish");// // }// }; @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; }}
- 2014-08-18下载
- 积分:1
-
The-Android-100-problem-sets
Android&架構&敏捷_高煥堂100問題集_Part_A_ok
进程,线程,JNI,IPC基础(The Android& Architecture & agile _ Gao Huantang 100 problem sets _Part_A_ok)
- 2014-07-02 16:22:23下载
- 积分:1
-
rEGISTRANT
notify Registrant Source Code for Andriod.
- 2013-12-30 19:26:28下载
- 积分:1
-
电源功率
&功率功率功率功率功率功率功率功率功率功率功率功率功率功率功率
- 2023-03-20 13:50:04下载
- 积分:1
-
Apress-Pro-Android-Apps-Performance-Optimization-
I thank the team at Apress who made this book possible: Steve Anglin, Corbin Collins, Jim
Markham, and Jill Steinberg. Working with all of them was a real pleasure and I can with
confidence recommend them to any author.
I also want to thank the tech reviewers: Charles Cruz, Shane Kirk, and Eric Neff. They
provided invaluable feedback, often catching mistakes I would not have seen even after dozens of
readings.
To all my friends whom I did not get to see as often as I would have liked while I was working
on this book, I give my thanks too: Marcely, Mathieu, Marilen, Maurice, Katie, Maggie, Jean-René,
Ruby, Greg, Aline, Amy, and Gilles, I promise I will make up for the lost time. Last but not least, I
owe a lot to three people: Eddy Derick, Fabrice Bernard, and Jean-Louis Gassée. Sometimes all it
takes is an injured toe and a broken suitcase.
- 2012-11-26 00:27:29下载
- 积分:1
-
非常好用简单的井字棋
资源描述
用Java做的井字棋,好用非常好用
用Java做的井字棋,好用非常好用
用Java做的井字棋,好用非常好用
用Java做的井字棋,好用非常好用
用Java做的井字棋,好用非常好用
用Java做的井字棋,好用非常好用
- 2023-06-26 09:15:03下载
- 积分:1
-
Akka集群
基于akka的集群例子,实用性很强,非常适合于分布式应用开发。可以自动发现新加入节点,自动负载均衡,自动消去down下去的节点。
- 2022-07-03 20:40:34下载
- 积分:1