首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

通过写Java代码来对MyEclipse进行注册

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MyEclipseGen { private static final String LL = "Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself."; public String getSerial(String userId, String licenseNum) {    java.util.Calendar cal = java.util.Calendar.getInstance();    cal.add(1, 3);    cal.add(6, -1);    java.text.NumberFormat nf = new java.text.DecimalFormat("000");    licenseNum = nf.format(Integer.valueOf(licenseNum));    String verTime = new StringBuilder("-").append(      new java.text.SimpleDateFormat("yyMMdd").format(cal.getTime()))      .append("0").toString();    String type = "YE3MP-";    String need = new StringBuilder(userId.substring(0, 1)).append(type)      .append("300").append(licenseNum).append(verTime).toString();    String dx = new StringBuilder(need).append(LL).append(userId)      .toString();    int suf = this.decode(dx);    String code = new StringBuilder(need).append(String.valueOf(suf))      .toString();    return this.change(code); } private int decode(String s) {    int i;    char[] ac;    int j;    int k;    i = 0;    ac = s.toCharArray();    j = 0;    k = ac.length;    while (j < k) {     i = (31 * i) + ac[j];     j++;    }    return Math.abs(i); } private String change(String s) {    byte[] abyte0;    char[] ac;    int i;    int k;    int j;    abyte0 = s.getBytes();    ac = new char[s.length()];    i = 0;    k = abyte0.length;    while (i < k) {     j = abyte0[i];     if ((j >= 48) &&

04

面试必备TCP三次握手

在进入本篇文章正题之前,需要先了解一下关于TCP连接过程中使用的关键字含义。 序列号seq:标记数据段的顺序。 TCP把连接中发送的所有数据字节都编上一个序号,第一个字节的编号由本地随机产生; 给字节编上序号后,就给每一个报文段指派一个序号;序列号seq就是这个报文段中的第一个字节的数据编号。 确认号ack:期待收到对方下一个报文段的第一个数据字节的序号; 序列号表示报文段携带数据的第一个字节的编号;而确认号指的是期望接收到下一个字节的编号;因此当前报文段最后一个字节的编号+1即为确认号。 同步SYN:连接建立时用于同步序号。 当SYN=1,ACK=0时表示:这是一个连接请求报文段。若同意连接,则在响应报文段中使得SYN=1,ACK=1。 SYN=1表示这是一个连接请求,或连接接受报文。 SYN这个标志位只有在TCP建产连接时才会被置1,握手完成后SYN标志位被置0。 确认ACK:仅当ACK=1时,确认号字段才有效。ACK=0时,确认号无效。 终止FIN:表示释放一个连接。FIN=1,则表示发送方的报文段数据已经发送完毕,并请求断开连接。

05

基于Redisson的RAtomicLong实现全局唯一工单号生成器

最近几年,我一直从事的是运营平台业务开发。每天,我们都需要处理大量的工单配置工作。为了生成工单号,我们建立了一张专用的数据库表,用于记录和生成工单号。每次创建工单时,我们会查询这张表,根据年份字段、月份字段和模块编码找到最大的自增序列号。随后,我们将自增序列号加一,与模块编码、年月序列号拼接以生成工单号,并将相关信息写入表中。这种方法一直使用得很顺利,因为工单配置的量并不是特别大,一直都没有出现问题。然而,最近我们为第三方提供了一个工单推送的接口,他们一次性推送了大量的工单,这导致不仅生成了许多重复工单号,而且还引起了接口性能方面的问题。因此,我们决定对工单号生成方式进行改进,本文我们将介绍下我们新的生成方法。

01
领券