1. Introduction OverScroller in Android is responsible for calculating the real-time sliding position for ListView, RecyclerView, ScrollView and other scrolling controls, and these position algorithms directly affect the experience of each scroll. As we all know, Android’s animation experience is ~far~ inferior to iOS, and even now that Android generally supports 120Hz high swipe, the experience is not very comfortable. The reason for this is no longer hardware performance limitations,
Netty startup process analysis
Typical Netty server side startup code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 public class MyServer { public static void main(String[] args) throws Exception{ EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { ServerBootstrap serverBootstrap = new ServerBootstrap();
How to properly open Linux gui programs in SSH terminal
Windows systems use mostly GUI programs, with a few command line programs (such as netstat). Linux, on the other hand, uses mostly command-line programs, but also has gui programs (such as jvisualvm). But sometimes opening a gui program in Linux will report an error, and sometimes there is no problem. This article explores what the X Window System is and how to properly open Linux gui programs in ssh terminal.
Apple's new operating system "realityOS" revealed
Software developers have found multiple references to “realityOS” in the App Store’s upload log and in the GitHub repository used by Apple. From the information revealed, realityOS is most likely Apple’s new AR/VR operating system, which will be installed on Apple’s rumored mixed reality devices.
An obvious reference to a new Apple operating system called “realityOS”.
It’s no secret that Apple is working on a mixed reality platform. According to job listings on its website, numerous reliable reports, and other sources, Apple’s mixed reality platform has been in development for years, with a team of thousands of people.
Go1.18 New feature: TryLock that has been tossed many times
Proposing new features definitely involves user scenarios. When the time comes to 2018, @deanveloper mentions a classic loading scenario: several very large files need to be loaded and I want a progress bar to show how close I am to completion.
He considered that this progress bar could be well implemented using TryLock, and the following is his sample code:
1 2 3 4 5 6 7 8 9 10 11 12 13 func (b *ProgressBar) Add(n int) { atomic.
Google bug bounty sets new record, Chrome fixes industry-leading speed
oogle recently posted official blog that their Vulnerability Rewards Program (VRP) continued to grow in 2021, with a total of $8.7 million in vulnerability awards. A total of $8.7 million in vulnerability awards were made, with researchers who found vulnerabilities also donating $300,000 of their awards to charity.
Android For Android vulnerability rewards, researchers are being paid twice as much in 2021 compared to 2020. In concrete terms, researchers received nearly $3 million in 2021, and Google also awarded the largest single Android vulnerability bounty ever – $157,000!
Detailed breakdown of the Kafka architecture
Basic Concepts Kafka Architecture The Kafka architecture consists of a number of Producers, a number of Brokers, a number of Consumers, and a ZooKeeper cluster. There are two other concepts that are particularly important in Kafka - Topic and Partition. Messages in Kafka are grouped by topic, producers are responsible for sending messages to a specific topic (each message sent to a Kafka cluster is assigned a topic), and consumers
Raft protocol implementation details from JRaft
Distributed Systems and the Consistency Problem The consistency problem is a core problem that needs to be solved in distributed systems. Distributed systems are generally composed of multiple nodes of equal status, and the interaction between the nodes is like several people getting together to discuss a problem. Let’s imagine a more specific scenario, such as three people discussing where to eat at noon, the first person said that a hot pot restaurant has just opened nearby, and I heard that the taste is very good; but the second person said, no, it takes too long to eat hot pot, or just drink some porridge; and the third person said, I just went to that porridge restaurant yesterday, it’s too bad, it’s better to go to McDonalds.
Linux file system and file caching knowledge collation
File system of Linux Characteristics of the file system The file system has to be strictly organized so that files can be stored in blocks. The file system should also have indexed areas to make it easy to find out where the multiple blocks of a file are stored. the file system should have a cache layer if there are files that are hot files and have been read and written to frequently in the recent past.
Kubernetes Scheduling Framework and Extender Comparison and Details
Kubernetes started out by providing only Extender. The Extender scheduler plugin, which enables non-intrusive extensions by deploying a web service, has several problems.
The number of Extender extensions is limited: only “Filter” and “Prioritize” extensions are available during scheduling. The “Preempt” extension is called after running the default preemption mechanism. “Extender cannot be called at other points, e.g. not before running the predicate function. Performance issues: Each call to an extender involves JSON coding and decoding.
Does the original TCP connection still exist after disconnecting the network cable?
Today, let’s talk about an interesting question: Unplug the cable for a few seconds, then plug it back in, does the original TCP connection still exist?
Some people may say that if the cable is unplugged, it means the physical layer is disconnected, so the upper transport layer should also be disconnected, so the original TCP connection will not exist. Just like when we make a wired phone call, if one party’s phone line is unplugged, the call is completely disconnected.
C++ implementation for friendly handling of Json data
Background C/C++ client needs to receive and send JSON format data to the backend to achieve communication and data interaction, but there is no ready-made interface for handling JSON format data in C++, so we can’t avoid splitting and splicing by directly referring to third-party libraries. Considering that there will be a lot of JSON data to be processed in this project, we can’t avoid the repetitive splitting and splicing.
Buffer mapping mechanism in WebGPU
1. What is buffer mapping Without giving a definition, simply put, after mapping (Mapping) a certain piece of video memory, it can be accessed by the CPU. After the Buffer (meaning video memory) of the three graphics APIs (D3D12, Vulkan, Metal) is mapped, the CPU will be able to access it, and at this point, note that the GPU can still access this piece of video memory. This leads to
Implementing a thread pool using Rust
How to implement a thread pool Thread pooling: a thread usage pattern. Too many threads introduce scheduling overhead, which in turn affects cache locality and overall performance. Instead, a thread pool maintains multiple threads waiting for a supervising manager to assign tasks that can be executed concurrently. This avoids the cost of creating and destroying threads while processing short time tasks. Thread pools not only ensure full utilization of the
Mad about the upgrade, Etsy drops React
There is a long-standing debate about whether to use Preact or React, the MIT-licensed open source software that has over 26k stars on GitHub and 1/4 million downloads per week on NPM. And React, an internal project from Facebook, has become one of the mainstream front-end frameworks after being open-sourced in 2013.
Baidu has asked to stop using React / React Native internally for a long time, and Ali has started to pilot Preact in some of its businesses.
WordPress plugin has a high-risk RCE vulnerability, only 50% of sites fixed
PHP Everywhere is an open source WordPress plugin, which was recently disclosed to have three serious security vulnerabilities, the plugin has been used by more than 30,000 websites worldwide, attackers can The vulnerability can be exploited to execute arbitrary code on the affected site.
PHP Everywhere enables PHP code on WordPress from anywhere, enabling users to insert and execute PHP-based code on pages, posts, and sidebars in the content management system.
After three years, Elastic 8 is officially released
Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multi-tenant-enabled, full-text search engine with an HTTP Web interface and schemaless JSON documents.Elasticsearch is developed in Java and distributed as open source software under the Apache license. The official client is available in Java, .NET (C#), PHP, Python, Apache Groovy, Ruby, and many other languages.
After nearly three years, Elasticsearch 8 has been released with the following new features.
Linux Thread Local Storage
In C/C++ programs, global variables are shared by all threads by default, and developers need to deal with multi-threaded competition. There are cases where we need to make sure that one thread has an exclusive share of the data and that other threads cannot access it. A typical case is the errno global variable, which always stores the error code of the last call of the current thread, without thread
How Java beans abstract and simplify
Today in the packaging of third-party applications open interface, write a lot of return value class, many of these classes are similar in structure only individual field names are not the same. In order to separate the fields to copy a change is not to win, and the name is the most headache. Like the following two.
1 2 3 4 5 6 7 8 9 10 11 @EqualsAndHashCode(callSuper = true) @Data public class SimpleUserResponse extends WeComResponse { private List<SimpleUser> userlist; } @EqualsAndHashCode(callSuper = true) @Data public class UserDetailResponse extends WeComResponse { private List<UserDetail> userlist; } Is it similar?
Functional programming class library vavr
Whenever a new version of the JDK is released, some people say “I won’t upgrade, I’ll keep using Java 8”, but many people at work are still not very good at using the new features of Java8, and these features often make Java less “bloated”. However, I personally think that the most representative of all the new features of Java8 must be functional programming. Some may say that this style