<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[a568283992的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/a568283992</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; a568283992]]></copyright><item><title><![CDATA[go.泛型+管道 简单的阻塞队列]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/123438301</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/123438301</guid><author>a568283992</author><pubDate>Sat, 12 Mar 2022 09:14:35 +0800</pubDate><description><![CDATA[go在1.18迎来了一次大的改版，引进了相关泛型。这使得在开发过程有了更多的扩展性，可以有效解决功能相同但是代码重复的部分。

这次使用泛型+管道的方式实现了一个简单的阻塞队列。


对于管道而言就是go提供给我们天然的阻塞队列，我们在此基础上再根据泛型的特性可以完成对于任何类型的队列方式，此队列对于高并发的情况下依旧有效，类似于生产者消费者的应用。


直接上code:



import (
   "context"
   "time"
)

/**
 @author: nizhenxian
...]]></description><category></category></item><item><title><![CDATA[goland大数计算(java转go福音)]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/119698329</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/119698329</guid><author>a568283992</author><pubDate>Sat, 14 Aug 2021 11:14:25 +0800</pubDate><description><![CDATA[在go语言中我们知道整形只有byte、int32以及int64等而浮点数只有float32和float64基本数据类型。有时候根据需求需要使用大数操作，go中的big包中带了NewInt以及NewFloat，但是提供的api较少，可供初始化的只能使用基本数据类型。不能使用字符串进行初始化。于是本人参考java的大数类进行开发go-bigger并且提供丰富的API调用。github：

github：https://github.com/SineyCoder/go-bigger


内置BigIntege..]]></description><category></category></item><item><title><![CDATA[goLang简单聊天室]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/117199968</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/117199968</guid><author>a568283992</author><pubDate>Sun, 23 May 2021 20:47:35 +0800</pubDate><description><![CDATA[有一段时间没写博客了，现在因为工作需要学习了go，做一个小Demo，简单的聊天室。


首先服务端开启监听8889端口，监听每一个客户端。
	客户端需要先登录，登录成功后，服务端会发送给每一个客户端一个消息，XXX用户登陆成功，目前程序还没写完全，后续会不断更新~~
message.go:
首先需要一个消息传送的protocol，因为是基于TCP协议，传输过程中会有粘包和拆包问题，因此定义一个协议来保证数据完整性。


package message

const (
	LoginMesType    =.]]></description><category></category></item><item><title><![CDATA[模拟ThreadLocal内存泄漏过程]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/108571541</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/108571541</guid><author>a568283992</author><pubDate>Mon, 14 Sep 2020 07:43:41 +0800</pubDate><description><![CDATA[我们知道，在java的ThraedLocal中可能存在内存泄漏的问题。原因在于其内部维护了一个弱引用Map，其对于key是一个弱引用，当我们线程的强引用不再指向其对象时，就会进行回收。但是map中只回收了key而没有回收value，这务必造成内存的泄漏。因此，这里通过模拟这一过程，更加好的理解ThreadLocal内存泄漏。






import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java..]]></description><category></category></item><item><title><![CDATA[记录一致性hash的java实现]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/106869028</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/106869028</guid><author>a568283992</author><pubDate>Sat, 20 Jun 2020 10:50:15 +0800</pubDate><description><![CDATA[一致性hash通常用在客户端的负载均衡策略，目的就是在变更服务器数量时，能尽量保证命中率。这样就不会造成缓存雪崩的问题。下列代码就是通过模拟正常hash和一致性hash的比对进行。

对于正常的hash而言，当我们存入K,V键值对时，我们只需要hash(K) % size，然后把结果映射到对应服务器即可。这种方式对于服务器负载均衡而言是很好的，经过测试每台服务器的压力都会平均。但是在扩展服务器后，可能就会出现问题，造成大量K不命中，从而重新往数据库查数据，增加了数据库压力。
对于一致性hash，需要有足够.]]></description><category></category></item><item><title><![CDATA[模拟synchronized锁升级过程（详细代码）]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/105615708</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/105615708</guid><author>a568283992</author><pubDate>Sun, 19 Apr 2020 15:18:31 +0800</pubDate><description><![CDATA[synchronized在1.6之后发生了很大改动，做了很多优化。因为Doug Lea大师的ReentrantLock类设计的很完美，jdk源码作者不服，所以对synchronized做了很大的改动。



此博客针对已对synchronized锁有所了解的。


首先我们需要知道synchronized具有4种锁的状态（细分5种）：

无锁无偏向
	无锁可偏向
	有锁已偏向
	轻量锁
	重量锁...]]></description><category></category></item><item><title><![CDATA[去除异常值，使用python编写matlab的hampel(X)函数]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/103639227</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/103639227</guid><author>a568283992</author><pubDate>Fri, 20 Dec 2019 21:58:49 +0800</pubDate><description><![CDATA[matlab中默认生成一个2 * k + 1大小的窗口，不足的部分使用目前的数据填充。

使用正态分布标准偏差估计值（值为1.4826） * 绝对中位差，得到一个估计标准差。

matlab中默认为3个估计标准差以外的就判定为离群点。


代码如下：




def hampel(X):
    length = X.shape[0] - 1
    k = 3
    nsigma = 3
...]]></description><category></category></item><item><title><![CDATA[利用Javascript检测开发者工具Devtools是否打开]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/103022334</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/103022334</guid><author>a568283992</author><pubDate>Tue, 12 Nov 2019 09:24:36 +0800</pubDate><description><![CDATA[转载自此处


function checkDevTools(options) {
       const isFF = ~navigator.userAgent.indexOf("Firefox");
       let toTest = '';
       if (isFF) {
          toTest = /./;
          toTest.toString = fu...]]></description><category></category></item><item><title><![CDATA[用python解析csi数据，使用csi tools工具获取wifi的.dat文件]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/100048722</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/100048722</guid><author>a568283992</author><pubDate>Sat, 24 Aug 2019 08:59:16 +0800</pubDate><description><![CDATA[我只做大自然的搬运工


原先的csi tools得到的.dat文件需要使用matlab进行解析，由于某些需要，使用python进行解析，但是网络上没有，因此和csi3群里的某位小伙伴合作完成（大部分工作都是他在做）。


具体请转☞他的博客以及github
...]]></description><category></category></item><item><title><![CDATA[android仿探探图片拖拽功能]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/94192662</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/94192662</guid><author>a568283992</author><pubDate>Sat, 29 Jun 2019 19:12:39 +0800</pubDate><description><![CDATA[废话不多说，先给效果图



使用


allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}


dependencies {
	        implementation 'com.github.SineyCoder:DragPhoto:1.0'
	}




&lt;com.si...]]></description><category></category></item><item><title><![CDATA[android图片加载完成后涟漪特效]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/87859135</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/87859135</guid><author>a568283992</author><pubDate>Thu, 21 Feb 2019 13:23:59 +0800</pubDate><description><![CDATA[先上效果图



 思路：就是重写了View布局，然后通过drawArc来实现

具体代码如下


/**
 * author: siney
 * Date: 2019/2/21
 * description:
 */
public class RippleImage extends AppCompatImageView {

    public RippleImage(Context cont...]]></description><category></category></item><item><title><![CDATA[Android一种自定义下拉刷新和上拉加载更多（使用外部拦截法解决冲突）]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/86531431</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/86531431</guid><author>a568283992</author><pubDate>Thu, 17 Jan 2019 21:30:02 +0800</pubDate><description><![CDATA[首先上效果图



有2种刷新方式

1.list滚动时无法触发刷新，必须置顶或置底才能触发刷新。



2.list滚动时也可以触发刷新，即刷新与滚动可以兼容（不包括fling）。




开始之前，请在gradle加入RecyclerView组件


implementation 'com.android.support:design:28.0.0'




    因为之前参...]]></description><category></category></item><item><title><![CDATA[一种自定义的滚轮滑动控件]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/85016106</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/85016106</guid><author>a568283992</author><pubDate>Sat, 15 Dec 2018 17:34:57 +0800</pubDate><description><![CDATA[
首先感谢这位博主， 我是在他的基础上添加了一些小样式。所以详细请看这位博主的描述。

我将他的样式详细描述了下github


使用 


allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}


dependencies {
	        implementation 'com....]]></description><category></category></item><item><title><![CDATA[仿QQ左滑删除【基于RecyclerView】]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/84927713</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/84927713</guid><author>a568283992</author><pubDate>Sun, 09 Dec 2018 14:30:25 +0800</pubDate><description><![CDATA[这是我github开源项目，目前测试阶段，欢迎大家使用提意见！

 


https://github.com/SineyCoder/LeftSlideView


 

使用步骤 

 添加仓库


allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

 添加依赖包


depend...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1116]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82494549</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82494549</guid><author>a568283992</author><pubDate>Fri, 07 Sep 2018 11:59:06 +0800</pubDate><description><![CDATA[1116 Come on! Let's C（20 分）

&quot;Let's C&quot; is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun,...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1117]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82494394</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82494394</guid><author>a568283992</author><pubDate>Fri, 07 Sep 2018 11:55:48 +0800</pubDate><description><![CDATA[1117 Eddington Number（25 分）

British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an &quot;Eddington number&quot;,E -- that is, the maximum inte...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1067]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82353997</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82353997</guid><author>a568283992</author><pubDate>Mon, 03 Sep 2018 20:08:37 +0800</pubDate><description><![CDATA[1067 Sort with Swap(0, i)（25 分）

Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to u...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1064]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82347443</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82347443</guid><author>a568283992</author><pubDate>Mon, 03 Sep 2018 13:36:40 +0800</pubDate><description><![CDATA[1064 Complete Binary Search Tree（30 分）

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:

The left subtree of a node contains only nodes with keys...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1032]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82313843</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82313843</guid><author>a568283992</author><pubDate>Sun, 02 Sep 2018 11:12:50 +0800</pubDate><description><![CDATA[1032 Sharing（25 分）

To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same ...]]></description><category></category></item><item><title><![CDATA[PAT (Advanced Level) Practice 1085]]></title><link>https://blog.youkuaiyun.com/a568283992/article/details/82284872</link><guid>https://blog.youkuaiyun.com/a568283992/article/details/82284872</guid><author>a568283992</author><pubDate>Sat, 01 Sep 2018 10:27:31 +0800</pubDate><description><![CDATA[1085 Perfect Sequence（25 分）

Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×pwhere M and m are the maximum and minimum numbe...]]></description><category></category></item></channel></rss>