Hdu6000 wash (priority queue + greed)

Problem Description Mr.Panda is about to engage in his favourite activity doing laundry! He's brought L indistinguishable loads of laundry to his local laundromat, which has N washing machines and M dryers.The ith washing machine takes Wi minutes to wash one load of laundry, and the ith dryer takes Di minutes to ...

Posted on Tue, 31 Mar 2020 16:27:11 -0700 by kazil

Using pymongo to operate the database

Using pymongo to connect to the database Connect mongodb #!/usr/bin/env python # -*- coding:utf-8 -*- from pymongo import MongoClient conn = MongoClient('192.168.0.113', 27017) db = conn.mydb #Connect to mydb database, if not, it will be created automatically my_set = db.test_set  #Use the test set collection, otherwis ...

Posted on Tue, 31 Mar 2020 12:32:13 -0700 by m@ndio

Knowledge arrangement of LESS (CSS preprocessing)

variable blend nesting pattern matching Guide expression operation function Type detection type Color color Math operation LESS belongs to CSS preprocessing language, which cannot be directly recognized by browsers like CSS, so it needs to be compiled The compiler only compiles. The generated. css file is ...

Posted on Mon, 30 Mar 2020 22:18:25 -0700 by DonnieDarko

POJ 3190 stall reservations (greedy interval problem + priority queue maintenance)

Question meaning: a group of individual cows only produce milk at a fixed time. Each cow needs to use a milking machine. Ask how many milking machines are needed at least to meet the needs of all cows, and output the number of the milking machine according to the order given by the cows. First, the cows are sorted from small t ...

Posted on Mon, 30 Mar 2020 12:10:07 -0700 by saleemshehzad

Distributed deployment of clickhouse in Docker

Startup service docker run --add-host=ck2:172.17.0.3 --add-host=ck3:172.17.0.4 -d --name ck1 -h ck1 --ip 172.17.0.2 --ulimit nofile=262144:262144 -p 8124:8123 -p 9001:9000 yandex/clickhouse-server docker run --add-host=ck1:172.17.0.2 --add-host=ck3:172.17.0.4 -d --name ck2 -h ck2 --ip 172.17.0.3 --ulimit nofile=262144:262144 -p 8125:8123 -p 900 ...

Posted on Mon, 30 Mar 2020 09:34:52 -0700 by The Wise One

Memory pool module of nginx

Structural drawing Use Allocate the size of NGX pool t directly, and then allocate a certain amount of memory from it. large memory allocation steps: Allocate memory block of size size, and check whether there is free large in pool to link memory. If not, allocate a large structure and mount its large header pointer to NGX? Pool? Data? T. ...

Posted on Mon, 30 Mar 2020 08:30:41 -0700 by AjithTV

Unsupervised learning and sklearn Library

1, Unsupervised learning Fundamentals Using unlabeled data to learn the distribution of data or the relationship between data and data is called unsupervised learning The biggest difference between supervised learning and unsupervised learning is whether the data is labeled The most commonly used scenarios of unsupervised learning are Clusterin ...

Posted on Mon, 30 Mar 2020 05:45:56 -0700 by Bou

Machine learning Chapter 5 support vector machine

Reference: author's Jupyter NotebookChapter 5 – Support Vector Machines Support vector machine (SVM) is a powerful and comprehensive machine learning model, which can perform linear or nonlinear classification, regression, and even outlier detection tasks. It is one of the most popular models in machine learning. Anyone who is interested in mac ...

Posted on Sat, 28 Mar 2020 08:16:10 -0700 by accu

[PHP open source class library] simple excel - a reading and writing tool for Excel and CSV files with elegance and performance

This extension package allows you to easily read and write simple Excel and CSV files. Use generators in the background to ensure low memory usage, even when working with large files. This is an example of how to read Excel or CSV. SimpleExcelReader::create($pathToFile)->getRows() ->each(function(array $rowProperties) { // pr ...

Posted on Sat, 28 Mar 2020 05:03:36 -0700 by Thresher

Art of concurrent programming 06 compound & hierarchical spin lock

  Compound lock Consider the following conclusion based on observation: in a queue lock, only the thread in front of the queue needs to switch locks. A balance scheme of queue lock and back lock is to allow only a small number of waiting threads in the queue during the process of entering the critical area (making the queue shorter, the qu ...

Posted on Wed, 25 Mar 2020 01:56:00 -0700 by bengaltgrs