1.站群服务器用SS5 SOCKS5 配置多IP/多端口高性能代理服务器(16G内存主机支持超过100万并发S5代理)
2.java源代码 求大神 明天就要上机
3.跪求C语言进行哈夫曼编码、分源算术编码和LZW编码,分源要求源程序要有注释。分源
站群服务器用SS5 SOCKS5 配置多IP/多端口高性能代理服务器(16G内存主机支持超过100万并发S5代理)
配置高性能多IP SOCKS5代理服务器,分源以下步骤可实现目标:
1. 在CentOS 6.x上安装必要的分源源码类型划分编译组件。
2. 下载并编译最新SS5源码,分源红警源码试读完成安装。分源
3. 为服务器配置多个IP地址。分源
4. 按IP地址创建对应数量的分源用户。
5. 配置iptables的分源mangle链及POSTROUTING链,关联用户、分源UID和IP。分源
6. 设置socket5代理认证方式及密码。分源源码解释大全
7. 启动/重启SS5代理,分源指定端口为,分源关联IP和用户。
8. 放开防火墙的63源码网端口,并确保开机自动运行。
9. 调整内核参数,优化性能,支持大量连接。点菜管理源码
. 完成配置后,服务器即可提供高性能的多IP SOCKS5代理服务。
配置过程中如遇问题,请查阅相关资料。如有租用多IP站群服务器需求,可联系我。
java源代码 求大神 明天就要上机
package com.uisftec;
import java.io.Serializable;
public class TestScores implements Serializable {
private double[] testScores;
public TestScores(double[] testScores) {
this.testScores = testScores;
}
public double getAverageScore() {
double sum = 0.0d;
for (int i = 0; i < testScores.length; i++) {
sum += testScores[i];
}
return sum / testScores.length;
}
}
package com.uisftec;
public class InvalidTestScore {
public InvalidTestScore(double[] testScores) {
if (testScores == null) {
throw new IllegalArgumentException("数组为空");
}
for (int i = 0; i < testScores.length; i++) {
if (testScores[i] < 0 || testScores[i] > ) {
throw new IllegalArgumentException("数组中包含的test Score不在0~这个范围内");
}
}
}
}
package com.uisftec;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
public class TestScoresSerialize {
public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
// 创建5个对象
TestScores testScores1 = new TestScores(new double[] { 1.0, 2.0 });
TestScores testScores2 = new TestScores(new double[] { 5.0, 2.0 });
TestScores testScores3 = new TestScores(new double[] { .0, .0 });
TestScores testScores4 = new TestScores(new double[] { .0, .0 });
TestScores testScores5 = new TestScores(new double[] { .0, .0 });
// 创建数组
TestScores[] testScores = new TestScores[] { testScores1, testScores2, testScores3, testScores4, testScores5 };
// 写入到D盘testScores.dat
ObjectOutput out = new ObjectOutputStream(new FileOutputStream("d:\\testscores.dat"));
for (TestScores testScores6 : testScores) {
out.writeObject(testScores6);
}
// D盘STOUT
File file = new File("D:\\STDOUT");
// 创建输出留
DataOutputStream outputStream = new DataOutputStream(new FileOutputStream(file));
// 创建读取d盘序列化对象
ObjectInputStream in = new ObjectInputStream(new FileInputStream("d:\\testscores.dat"));
// 打印平均分并写入到D盘STDOUT
TestScores testScores8 = (TestScores) in.readObject();
System.out.println(testScores8.getAverageScore());
outputStream.writeDouble(testScores8.getAverageScore());
TestScores testScores9 = (TestScores) in.readObject();
outputStream.writeDouble(testScores9.getAverageScore());
System.out.println(testScores9.getAverageScore());
TestScores testScores = (TestScores) in.readObject();
System.out.println(testScores.getAverageScore());
outputStream.writeDouble(testScores.getAverageScore());
TestScores testScores = (TestScores) in.readObject();
System.out.println(testScores.getAverageScore());
outputStream.writeDouble(testScores.getAverageScore());
TestScores testScores = (TestScores) in.readObject();
System.out.println(testScores.getAverageScore());
outputStream.writeDouble(testScores.getAverageScore());
// 关闭流
out.close();
in.close();
outputStream.close();
}
}
跪求C语言进行哈夫曼编码、算术编码和LZW编码,要求源程序要有注释。
以下是哈夫曼编码
#include<iostream>
#include<math.h>
#include<string>
#include<iomanip>
using namespace std;
int n;
int isin(string str,char a)
{
int temp=0;
for(int i=0;i<str.length();i++)
{
if(str[i]==a) temp=1;
}
return temp;
}
void bubble(double p[],string sign[])//排序
{
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(p[i]<p[j])
{
double temp=p[i];
p[i]=p[j];
p[j]=temp;
string m=sign[i];
sign[i]=sign[j];
sign[j]=m;
}
}
}
}
void huff(double tempp[],string tempstr[])
{
double p[][];
string sign[][];
sign[0][i]=tempstr[i]; //符号放在sign数组中
for(int i=0;i<n;i++)
{
p[0][i]=tempp[i]; //p数组放对应的概率(第1列中)
}
for(i=0;i<n-1;i++)
{
bubble(p[i],sign[i]); //第一次排序
for(int j=0;j<n-2-i;j++)
{
p[i+1][j]=p[i][j]; //前n-2-i个概率重新放在p数组中(是数组的第2列中)
sign[i+1][j]=sign[i][j];
}
p[i+1][j]=p[i][j]+p[i][j+1];//第一次两个最小概率求和
sign[i+1][j]=sign[i][j]+sign[i][j+1];//符号跟随
for(j=n-1-i;j<n;j++)
{
p[i+1][j]=0;
}
}
string final[];
for(i=n-2;i>=0;i--)
{
for(int k=0;k<n;k++)
{
if(isin(sign[i][n-2-i],sign[0][k][0])) final[k]+="0";
if(isin(sign[i][n-1-i],sign[0][k][0])) final[k]+="1";
}
}
cout<<setw(9)<<"哈弗曼编码如下:"<<endl;
for(i=0;i<n;i++)
{
cout<<setw(7)<<sign[0][i]<<setw(7)<<p[0][i]<<setw()<<final[i]<<
setw(7)<<final[i].length()<<endl;
}
}
void main()
{
char a[];
cout<<"该字符串符号为:";
cin>>a;
string s=a;
n=s.length();
char b[][2];
for(int i=0;i<n;i++)
{
b[i][0]=a[i];
b[i][1]='\0';
}
string str[];
for(i=0;i<n;i++)
{
str[i]=b[i];
}
double tempp[];
cout<<"字符概率依次为:";
for(i=0;i<n;i++)
{
cin>>tempp[i];
}
huff(tempp,str);
}