python – top-down or bottom-up recursion errors

I worked at and wrote a top-down and bottom-up recursion. Spent a lot of time trying to figure out why the top-down version did not work. But I could not find any ideas?

# recursion: top-down    
class Solution:
    def coinChange(self, coins: List(int), amount: int) -> int:
        def compute_num_coins(amount, num_coins_so_far):
            if amount == 0:
                return num_coins_so_far
            if amount not in dp:
                min_coins = float('inf')
                for coin in coins:
                    if amount - coin >= 0:
                        num_coins = compute_num_coins(amount - coin, num_coins_so_far + 1)
                        min_coins = min(min_coins, num_coins)
                dp(amount) = min_coins
            return dp(amount)

        dp = {}
        min_coins = compute_num_coins(amount, 0)
        return min_coins if min_coins != float('inf') else - 1

The bottom-up version I wrote works fine. I can not see the difference between the brands that do not work earlier.

# recursion: bottom-up
class Solution:
    def coinChange(self, coins: List(int), amount: int) -> int:
        def compute_num_coins(amount):
            if amount == 0:
                return 0
            if amount not in dp:
                min_coins = float('inf')
                for coin in coins:
                    if amount - coin >= 0:
                        num_coins = compute_num_coins(amount - coin) + 1  
                        min_coins = min(min_coins, num_coins)
                dp(amount) = min_coins
            return dp(amount)

        dp = {} 
        min_coins = compute_num_coins(amount)
        return min_coins if min_coins != float('inf') else - 1

lo.logic – Can Removing Extensionality Avoid Kardianity Errors in Layered Theories?

To let $ SF $ be the schema of stratified understanding.

Take the theory $ SF + Infinity + Choice + text {Extensionality fails everywhere} $

Do the following statements agree with this theory?

  1. $ forall X (| X | leq | P_1 (X) |) $

  2. $ forall X (Infinite (X) to | X | = | P_1 (X) |) $

It is known that these two statements fail in NFU, as NFU proves this $ | P_1 (X) | <| X | $ for some amounts, it guilty of committing cardinality mistakes of the first kind

The known proof of this error in NFU, however, depends on the extensionality, hence the question. It may happen that removing the extensionality leads to the avoidance of cardinality errors of the first kind.

It is known that this theory can interpret $ NFU + Infinity + Choice $ because SF can interpret the NFU as evidence for Marcel Crabbe. Equivalent evidence that NFU is interpretable by SF is found here between 15 and 17.

mysql 5.7 – InnoDB errors and crashes with MyISAM database?

I have a server with a MySQL database containing only MyISAM tables. There are no other databases on the server (except, of course, system databases). Since moving to mysql 5.7.27, there are InnoDB-related bugs and even crashes. The configuration is mostly the default that is included in the Ubuntu 18.04 package. I only have some myisam buffers and adapted the cache. (Now I have also enlarged the Innodb pool, hoping that these errors will disappear)

What can these mistakes cause and how can I get rid of them?

Examples of errors:

2019-09-19T04: 39: 34.464347Z 5169718 (Warning) InnoDB: Free blocks in the buffer pool are hard to find (21 search iterations)! 21 failed attempts to empty a page! If necessary, increase the size of the buffer pool. It is also possible that fsync in your Unix version is very slow or completely frozen in the kernel. Then upgrading to a newer version of your operating system might be helpful. Check the number of fsyncs in the following diagnostic information. Pending deletion log (fsync): 0; Buffer Pool: 0. 22967494 OS file reads, 55308825 OS file writes, 1252 OS fsyncs. Start InnoDB Monitor to print more diagnostics to standard output.

2019-09-20T08: 27: 30.209263Z 0 (ERROR) (FATAL) InnoDB: Page (Page ID: space = 45, page number = 4551) still fixed or faulty

2019-09-20 10:27:30 0x7f9350594740 innoDB: assertion error in thread 140270684948288 in file, line 910

Networking – Ubuntu 18.04 sudo apt update gives a long list of connection timeout errors

I just installed Lubuntu 18.04.3 LTS and it works fine. I can connect to my wifi and surf the internet. In fact, I post here with it. However, if I try that sudo apt update it gives me some connection errors with timed out. Here is something of it.

Err: 1 bionic-security InRelease
Failed to connect to (2001: 67c: 1360: 8001 :: 21).
– connect (101: Network is unreachable) Could not connect to (2001: 67c: 1562 :: 19). – connect (101: network is
unreachable) Could not connect to
(2001: 67c: 1562 :: 16). – connect (101: network is unreachable) could not
Connect to (2001: 67c: 1560: 8001 :: 11). – connect
(101: Network is unreachable) Unable to connect (2001: 67c: 1360: 8001 :: 17). – connect (101:
Network is unreachable) Could not connect to
(2001: 67c: 1560: 8001 :: 14). – connect (101: network is not available)
Could not connect to 80 (

I'm trying to ping some of the IP, but it seems to work well. Here is the result


PING ( 56 (84) Data bytes. 64 bytes
from 91,189,88,174: icmp_seq = 1 ttl = 54 time = 264 ms
— ping statistics — 3 packets sent, 3 received, 0% packet loss, time 2002ms rtt min / avg / max / mdev =
264,493 / 264,750 / 265,008 / 0,210 ms

I am not sure where the problem lies. I hope I can get some help. Thank you for reading this long explanation

Python – linear combination of images gives me errors

Consider the following code

import  numpy as np

import cv2 as cv

imag1 =cv.imread('logos.jpg')
imag1 =cv.cvtColor(imag1,cv.COLOR_BGR2GRAY)
shape1 =imag1.shape
imag2 =cv.imread('arduino.jpg')
imag2 =cv.cvtColor(imag2,cv.COLOR_BGR2GRAY)
shape2 =imag2.shape

imag2 =cv.resize(imag2,(shape1(1),shape1(0)))


result1 =cv.addWeighted(imag1,0.2,imag2,0.8,0)
alpha =0.5
result =alpha *imag1 + (1-alpha)*imag2

The built-in function of python-cv.addWeighted works fine, but when I try to implement the second, I get the following error message

Traceback (most recent call last):
  File "C:/Users/Dato/Downloads/python_environment/", line 23, in 
cv2.error: OpenCV(4.0.0) c:projectsopencv-pythonopencvmodulesimgprocsrccolor.hpp:261: error: (-2:Unspecified error) in function '__cdecl cv::CvtHelper,struct cv::Set<3,4,-1>,struct cv::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
> Unsupported depth of input image:
>     'VDepth::contains(depth)'
> where
>     'depth' is 6 (CV_64F)

The size of the pictures are (223, 400), (223, 403), so I used the Resize function to make the pictures the same, but I can not understand what the reason for the error is? thank you in advance

sql – Update Table Errors: A column associated with a non-key-preserved table can not be modified

I have a question like this:

    WHERE a.TAHUN = '2018' AND b.KET_KD_GAS = 'BSI') t1 
SET t1.STATUS = '1', t1.T_ID = '5d81a2b1d36a1'

I would like to set the update status and ID_code to 1 and 5d81a2b1d36a1, but this error code will always be displayed

ORA-01779: A column associated with a non-key-preserved table can not be modified

I worked with:

update finance.rkap_rencana set status = '1', t_id = '5d81a2b1d36a1'

But that's not what I want.

Does anyone know how to do that?

Thank you very much

google search console – The following errors are displayed Text too small to read, clickable elements too close together, content wider than the screen

I'm getting the following bugs in the GSC in Mobile Usability.
1. To read too small text
2. Clickable elements too close together
3. Content wider than screen

I received the same error last month (for another page) and it was fixed automatically. Was there a similar problem before?

Development Process – How do I avoid errors in business-level configurations with similar discipline as in source code?

We have a system that allows our customers to co-ordinate people (buyers) to deliver food within 45 minutes of order creation.

Each customer has a number of stores in which the orders are processed by the buyers
and each buyer has a schedule that indicates in which business and at what times he / she will work.

However, we also have a feature that only allows them to create orders when the store is already configured in our systems and when there are enough buyers at the expected time.

As you can see, checking whether a particular order is accepted in our system depends on the current time, shop configuration, and buyer's schedule.

We managed our source code pretty well, we do code reviews, unit tests, and integration tests. However, we have not found a satisfactory way to manage the configurations of the stores and the schedules and these are as sensitive as the source code If there is an incorrect configuration, it is almost as if the client had a bug in our source code because we do not allow them to create jobs, and revenue goes down.

Therefore, we would like to find a way to manage the configuration of the stores and the schedules with a similar discipline as we do with our source code. We want to test if the configuration is correct. At the moment we do this configuration via SQL scripts, which are testable inputs may not be accurate and we have no way to manage it or test its correctness.

Did you have a similar problem? Do you know any tools, languages, or processes that prevent us from making mistakes in client configuration and have a central way of knowing the current configuration, other than displaying database tables?

By the way, we get these configurations as tables of business people talking to the customer.