Merge Sort Algorithm-归并排序

Merge Sort belongs to the category of Divide and Conquer algorithms.These algorithms operate by breaking down large problems into smaller,more easily solvable problems.  归并排序属于分治算法分类,这些算法通过把大的问题拆
阅读全文

Insertion Sort Algorithm-插入排序算法

Insertion Sort is a simple sorting algorithm that works the waywe sort playing cards in our hands.We sort the first two cards and thenplace the third card in the appropriate position within the first
阅读全文

Selection Sort Algorithm-选择排序算法

    Selection Sort is a simple sorting algorithm that find the smallestelement in the array and swaps it with the element in the first position,then find the second smallest elemen
阅读全文

Bubble Sort Algorithm-冒泡排序

    Bubble sort is an algorithm that is used to sort a list of elements,for exampleelements in an array. This algorithm compares two adjacent elements and then swapsthem if they ar
阅读全文

阿里云老用户续费优惠,一年6.5折扣

  • Adamin90
  • 2021-12-14 21:20:03
  • VPS
    今天朋友跟我说服务器要续费了,发给我一张截图比去年贵了好几千,但是服务器上部署的网站和内容太多不好迁移。    然后我找了找,阿里云有针对老用户的续费活动,能省下不少钱 。直达链接:阿里云老用户续费活动 这个优惠还是不错的,一年老用户享受6.5折扣,3年6.3折,5年6折详细步骤:点击活动链接&nbs
阅读全文

Xshell通过跳板机连接只有ipv6的vps

    最近折腾了一台欧洲小鸡只有ipv6地址,由于我本地宽带不支持ipv6,所以没有通过xshell或者putty直连。    解决方式可以通过跳板机的方式连,意思就是通过支持ipv6的跳板机代理连接我们只有ipv4的vps。    如果跳板机只支持ipv4是不可行的,我们可以
阅读全文

使用warp解决vir,rn等谷歌验证码问题

使用cloudflare warp脚本解决virmach,RN等vps谷歌验证码问题
阅读全文

Android Handler 原理-Handler

  • Adamin90
  • 2021-09-25 12:11:55
  • Android
Handler机制是安卓消息循环机制的基石,Handler是Handler机制的指挥者 Handler发送消息方式有两个版本,post和send,post版本发送一个runnable对象,send直接发送Message对象,post和send最终都调用了MessageQueue的enqueueMessage方法。 Handler处理消息的方法是dispatchMessge方法,优先处理msg.callback,其次是Handler的mCallback对象,最后才是handleMessage方法。 Handler移除消息的方法最终都是调用MessageQueue的移除方法。 HandlerThread继承自Thread,简化了在子线程创建Handler的过程,run方法自动调用Looper.prepare和Looper.loop。
阅读全文

Android Handler 原理-Looper

  • Adamin90
  • 2021-09-21 13:08:26
  • Android
Looper主要通过loop方法从MessageQueue中循环获取消息,然后交给Handler处理。 在线程中要先使用Looper.prepare方法创建Looper,再调用Looper.loop方法获取和处理消息。 Android主线程的Looper实在ActivitiyThread的main方法中通过Looper.prepareMainLooper初始化的。
阅读全文

Android Handler原理-MessageQueue

  • Adamin90
  • 2021-09-19 21:59:28
  • Android
MessageQueue负责消息的入队(enQueueMessage)和出队(next),通过Handler间接操作入队,Looper.loop调用next方法循环出队,MessageQueue的初始化在Looper的prepare或prepareMainLooper方法中,mainLooper定义消息队列不可退出。MessageQueue内大部分操作是native层操作,基于epoll机制。同步屏障可以使异步消息优先执行。 MessageQueue内的IdleHandler可以注册为闲时执行,闲的意思使消息队列无消息,或者消息未达到执行时间。
阅读全文
  • Powered by bjyblog modified by Adam © 2014-2023 www.lixiaopeng.com 版权所有 ICP证:鲁ICP备15039297号
  • 联系邮箱:14846869@qq.com