In school training [group]

meaning of the title Divide n numbers into several groups. The minimum number in each group cannot be more than the total number of elements in this group. Find the number of schemes. N<=2000.   Reflection If we get a partition of n numbers, we can simply find out the number of schemes. After sorting it from large to small, let larger I ...

Posted by mananx on Thu, 31 Oct 2019 16:08:28 -0700

Python 3 basic multiplication table

       Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3       Conda : 4.7.5    typesetting : Markdown   code_1 """ @Author : Xing Xin @Date : 2019/7/2 @Blog : www.cnblogs.com/xingchuxin @Gitee : gitee.com/zhichengjiu """ def main(): # The final value is 9 end_num = 9 # Row cou ...

Posted by grga on Thu, 31 Oct 2019 15:56:11 -0700

[LOJ Chen 2162] [POI2011] Garbage (Euler circuit)

Problem surface LOJ Title Solution First of all, there is an obvious conclusion that the edges that do not need to be modified can be deleted directly, and the edges that need to be modified can be reserved. The white dot is that the number of times each edge is to be visited can be directly modeled as two. If an edge is proved to be connected ...

Posted by tsinka on Thu, 31 Oct 2019 15:04:54 -0700

Centos7 installs Redis5.0.5 and joins Systemd service

1. Install gcc-c++, tcl yum install gcc-c++ tcl 2. Decompress, compile and test tar zxvf redis-5.0.5.tar.gz make make test 3. Install to / opt make PREFIX=/opt/redis/redis-5.0.5 install # Create a soft chain ln -s redis-5.0.5 latest 4. Configuration file. There is an example redis.conf in the source file directory. T ...

Posted by khovorka on Thu, 31 Oct 2019 13:54:46 -0700

__Detail of dict attribute

1. Attribute of class and attribute of class object class Parent(object): a = 'a' b = 1 def __init__(self): self.a = 'A' self.b = 1.1 def print_info(self): print('a = %s , b = %s' % (self.a, self.b)) @staticmethod def static_test(self): print 'a static func.' ...

Posted by ThunderAI on Thu, 31 Oct 2019 12:33:17 -0700

binlog based configuration master and slave of mysql master cluster

I. environmental preparation Main: 192.168.132.121 From: 192.168.132.122 There is data on the main database, and it is still being written. mysql> select * from darren.test; +------+ | id | +------+ | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | +------+ mysql> grant replication slave on *.* to 'replication'@'192 ...

Posted by DarkArchon on Thu, 31 Oct 2019 12:24:59 -0700

[FreeRTOS]. FreeRTOS cortex m3 M4 interrupt priority setting summary

Change from: https://blog.csdn.net/xukai871105/article/details/53516857 PrefaceThis article will show how to set the interrupt priority of STM32 Cortex M3 and M4 Series MCU in FreeRTOS embedded operating system.summary [1] STM32L1 series, STM32F1 series and STM32F4 series. NVIC? Prioritygroup? 4 is required when setting NVIC. [2] the priori ...

Posted by rocksolidsr on Thu, 31 Oct 2019 12:10:55 -0700

Sorting algorithm -- bubble sorting

Bubble sorting is one of the simple sorting algorithms. By comparing two adjacent elements, when the first element is larger than the second element, the first element is moved back (ascending, similarly, descending). After each sorting, there must be a maximum or minimum value at the end. First bubble sort 1 static void BubbleSort ...

Posted by bradjinc on Thu, 31 Oct 2019 10:56:41 -0700

Multithreaded learning

Simple multithreaded applet code implementation: 1. Write a program to print out "I am a programmer" letter by letter by multithreading cooperation. The string has array storage of char type.   import static jodd.util.ThreadUtil.sleep; public class CharNum { static String str = "i am a programmer"; String[] str1 = ...

Posted by ConcreteDJ on Thu, 31 Oct 2019 09:05:07 -0700

Object array custom sort -- System.Collections.ArrayList.Sort()

Use the System.Collections.ArrayList.Sort() object array to customize sorting   Its core is the implementation of comparator, which is a class. It inherits the IComparer interface and implements the int IComparer.Compare(Object x, Object y) method. This method implements the comparison method of custom sorting. It can sort the object array di ...

Posted by poison on Thu, 31 Oct 2019 05:28:54 -0700