Tag:A key

  • Talk about auto commit of Kafka client


    order This article mainly talks about the implementation of auto commit of Kafka client maven <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version></version> </dependency> poll kafka-clients-!/org/apache/kafka/clients/consumer/KafkaConsumer.java public ConsumerRecords<K, V> poll(long timeout) { acquire(); try { if (timeout < 0) throw new IllegalArgumentException(“Timeout must not be negative”); if (this.subscriptions.hasNoSubscriptionOrUserAssignment()) throw new IllegalStateException(“Consumer is not subscribed to any topics or assigned […]

  • Self study series of golang (2)


    Defer keyword First of all, let’s look at the definition of the official website A “defer” statement invokes a function whose execution is deferred to the moment the surrounding function returns, either because the surrounding function executed a return statement, reached the end of its function body, or because the corresponding goroutine is panicking. That […]

  • Vue tab switch sliding transition effect, APP sideslip effect


    Let’s see the effect firsthttps://yhq.leizhenxd.com/Say nothing, love to see and hear the code App.vue` <template> <div id=”app”> <transition :name=”transitionName” mode=”in-out”> <keep-alive> <router-view/> </keep-alive> </transition> <div id=”nav”> <router-link to=”/index.html”>…</router-link> <router-link to=”/optimus.html”>…</router-link> <router-link to=”/gao.html”>…</router-link> </div> </div> </template> <script> export default{ data(){ return{ transitionName:’left’ } }, watch:{ ‘$route’ (to, from) { if(toIdx < 10 && fromIdx < 10){ […]

  • Minute lets you solve, the asynchronous load causes the abnormal data


    async-demo On some methods of handling asynchronous requests 1. Common JavaScript scenarios 1.setInterval setTimeoutThis timer function. 2. HTTP requestvue-resource、fetch、axios. And so on. 2. Common phenomena 1. Can’t get the results as required 2. To get the result, we need to use the traditional callback function, which is very cumbersome. function A(){ setTimeout(B(),200); C(); } A() […]

  • JavaScript learning notes Interview Part 1 CSS


    1、 HTML interview questions 1. How to understand semantics? My answer:Semantic is to achieve the same function, try to use HTML section, main, these conventional structures to write DOM structure. It’s easy to understand. Answer after optimization:Write the main structure using main, section, footer, title, H2, H3, list using UL, Li, text using P tag. […]

  • JS advanced – new content course introduction


    Focus: prototype chain Focus: different inheritance Another role of Archetype Point: this points to know who it is   Review prototype Prototype chain Can the orientation of prototypes be changed inherit How to realize inheritance The way of prototype inheritance Borrow constructor inheritance Combinatorial inheritance Copy inheritance   Different representations of functions Different ways to […]

  • Go redis parser


    Go redis parser, project address: https://github.com/8090Lamber… A simple and secure redis parser. It is learned that most of the existing parsers are unified output after the parsing of a single process, which prolongs the overall execution time and decides to rewrite one by itself. Its characteristics are as follows:Offline ready to useIt does not need […]

  • Viewpager calls notifydatasetchanged() to refresh the solution


    1、 The cause of the problem Viewpager control to a large extent meets the developer’s development page left and right mobile switching function, very convenient to use. However, in use, it is found that when data is deleted or modified, pageradapter can’t just notify to refresh view through notifydatasetchanged method like baseadapter. A solution has […]

  • PHP chain operation realizes four chain operations


    The point is to return the $this pointer, which makes it easy to call the latter function. Operation.php <?php namespace IMooc; class Operation { protected $number = 0; public function __construct($number) { $this->number = $number; } public function add($number) { $this->number += $number; return $this; } public function decrease($number) { $this->number -= $number; return $this; […]