coding

Kichik Shahzoda(C#) solution.

Kichik Shahzoda(C#) solution.

Muammoning Qo'ylishi: Shahzoda va malika bir-birlari bilan uchrashishni rejalashtirganlar, ammo ular orasidagi yo'lda bir nechta planetalar joylashgan. Ular uchrashish uchun planetalardan o'tishlari kerak. Har bir planetaning radiusi va markazi mavjud bo'lib, shahzoda va malikaning oldiga borishi uchun kamida nechta sayyorani kesib o'tishi kerakligini aniqlashimiz kerak. Bizning maqsadimiz: Shahzoda va malikaning joylashuvlari berilgan. Sayyoralar to'g'risida ma'lumotlar berilgan. Har bir planetani tekshirish kerak: agar shahzoda va malika faqat bitta sayyoradan o'tayotgan bo'lsa, ya'ni biri ichida va ikkinchisi tashqarisida bo'lsa,shahzoda o'sha planetani kesib o'tishga majbur bo'ladi. Input: Birinchi qator: testCases — testlar soni. Keyingi qatorlar har bir test uchun: Shahzoda va malikaning koordinatalari:…
Read More
Enable Configuration APIs of WAS in Windows 11

Enable Configuration APIs of WAS in Windows 11

Configuration APIs in general are tools that allow developers to programmatically manage and modify the settings. In Windows Process Activation Service shortly called WAS, configuration APIs allow developers to create and manage Application Pools , Configure Sites and Applications , Set Protocols , and adjust security settings. This article will walk you through the steps of How to Enable Configuration APIs of WAS in Windows 11 using simple steps. Let’s get started. Key Steps: To enable Configuration APIs of WAS , we will have to access Windows Features. There are several ways to access Windows Features in Windows 11. We…
Read More
Update the SDK from 2.xx to 3.xx for ESP8266 development for Simple Script programmable Controller.

Update the SDK from 2.xx to 3.xx for ESP8266 development for Simple Script programmable Controller.

In order to ensure the performance (and especially the reliability) of the Simple script programmable Controller, it took me a while to upgrade the ESP8266 sdk used by the controller from version 2.xx to version 3.xx; The ESP8266 RTOS SDK V3.0 updates the system architecture and adjusts it to be consistent with the ESP-IDF. This means that the same set of application code has the opportunity to be applied to products with different chips (ESP8266, ESP32, ESP32-S2 chips). The updates are mainly:1, using eso-idf code framework2、 Refactor some and core libraries, including WiFi libraries and libmain.3、 Update third-party libraries, such…
Read More
Understanding SOLID Principles in C#

Understanding SOLID Principles in C#

As developers, we often come across the term "SOLID" principles, which are a set of five design principles that help us write maintainable, scalable, and efficient code. However, understanding and applying these concepts in real-life projects can sometimes be tricky. To make it simpler, let's break down each principle with practical, relatable examples and code snippets that any developer can understand. 1. Single Responsibility Principle (SRP) Real-Life Example: Imagine you’re organizing a community event, and Alex, your friend, tries to handle everything—from setting up the venue, to promoting the event, to managing food. With so many responsibilities, things often slip…
Read More
Filter a CSV file and re-arrange it by category #eg60

Filter a CSV file and re-arrange it by category #eg60

The CSV file below has 4 columns: idSale (id), Movie (movie name), Genre and Director: Use Java to implement a task: filter the file using Director as the argument, group it by Genre, and print data in the order of genre and then movie names. For example, when argument is set as Christopher Nolan, we have the following result: Here is SPL script: A1: Open the CSV file and filter it by director. A2: Group the file by Genre and loop to compute one group each time. Read How to Call a SPL Script in Java to find how to…
Read More
问题记录

问题记录

Question 1 web 版本 1.0.1 不可以,1.0.2 就可以访问 Question 2 1/18 日用户模块用户添加和登陆出现问题,手机号没有查询到,导致重复添加的失败:「数据库主从同步出现问题」 Question 3 Nacos 2.2.3 服务注册不上的问题,最后通过查看 nacos 的源码,发现配置中的 namespace 已经不是旧版本的命名空间了,需要是命名空间的 ID。在 nacos 的控制台显示中,把 namespace 归为 Namespace ID, namespace showname 归为 namespaces。所以配置文件中的 namespace 要和 nacos 命名中对应的 Namespace ID 一致 Question 4 发现一个问题, 当方法添加 @Cacheable 和@TimeToLive。缓存注解的时候, 如果方法抛出 businessexception,之前的切面无法捕获并正常返回异常信息。 异常触发点:WarmReplayCacheInterceptorPostProcessor.class -> in.getMethod().invoke(advice, in.getArguments()); 异常被捕获,此时的异常为 InvocationTargetException,包裹着 BusinessException。 异常中间流转的过程还没看,最后一次流转在 CglibAopProxy.class ->throw new UndeclaredThrowableException(ex); 到达项目中的异常统一处理方法 handleException,进入方法的异常为 UndeclaredThrowableException,在目前的方法处理中,是没有对 UndeclaredThrowableException 进行处理的,对此异常进行处理就行。 UndeclaredThrowableExceptione.getCause()这是 InvocationTargetException UndeclaredThrowableExceptione.getCause().getCause()取出 BusinessException 然后按照 BusinessException 正常处理就行了 目前的问题是:1 没有加 else,返回 500;2:Throwable cause = e.getCause().getCause(); 这个 cause 的值会随机出现两种样态 1:class com.qis.base.exception.BusinessException 2:class com.qis.base.exception.BusinessException message: 报错信息 在最新的测试中,不使用 instanceof 判断异常的类型,使用 cause.getClass().equals(BusinessException.class)进行判断,判断为 BusinessException 更加准确 Question 5 live_room_online_user 表,非查询操作非常频繁。执行清除直播间过期用户数据时,容易出现死锁问题。具体的操作是删除最后更新时间在 3 分钟前的数据。 解决办法 1:…
Read More
Caching Dependencies on GitHub Actions

Caching Dependencies on GitHub Actions

Introduction GitHub Actions provide two ways of storing files: caching for things like dependencies and artifacts for the results of a job, such as logs or binaries. Although they sound similar, they are used for different purposes. So, we will use caching to speed up our workflow runs. Another thing to know is that cache access will be restricted to only a few branches: the current branch, the base branch for pull requests, and the default branch. Caches created in unrelated branches won't be available, but that's not something that will affect us in most cases, since we usually operate…
Read More
A privacy focused online PDF Editor

A privacy focused online PDF Editor

Photo from Markus Spiske privpdf.com is an open-source project by Neural Nirvana aimed to prioritize privacy and safety of PDF documents.Almost every one of us has used the online PDF editor services to merge, split, edit, watermak PDF files. But doing it online comes with a risk of your document data being shared with third party servers, even stored without consent.That's why we created privpdf.com - a privacy focused in-browser PDF editor capable in doing everything current online providers are offering - all inside the browser with no data ever uploaded anywhere!The client-side processing enables the user to be assured…
Read More
Mint Blockchain became the first Superchain to participate in Optimism governance and was successfully approved for 750,000 OP!

Mint Blockchain became the first Superchain to participate in Optimism governance and was successfully approved for 750,000 OP!

Recently, Mint Blockchain achieved a significant milestone in the Web3 and NFT sectors. In the latest Cycle 28 review of the Optimism Grant, Mint Blockchain became the only Superchain approved by the OP Grant Committee, successfully securing 750,000 OP in funding to support the expansion of its NFT ecosystem. This achievement marks a further deepening of Mint Blockchain’s involvement in OP governance and highlights its crucial role in advancing blockchain technology and the NFT ecosystem. The First Superchain to Participate in OP Governance Mint Blockchain has consistently been dedicated to driving ecosystem development through innovation and collaboration. Previously, Mint Blockchain…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.