Profilo di Rosaline

Nome Rosaline
Indirizzo email n/a
Messaggi5
  • Problem with Longest Common Substring
    Forum >> Programmazione Python >> Web e Reti
    I'm having difficulty understanding the code for the Longest Common Substring problem on my regular resource. I'm not getting the desired output when I try to run the code. Here is the code I'm trying to use:

    // Function to find Longest Common Substring
    
    // of two given strings
    
    string LCS(string X, string Y)
    
    {
    
    // Find lengths of given strings
    
    intm = X.length ();
    
    int n = Y.length();
    
    
    
    
    // Declare the 2D array
    
    int L[m+1][n+1];
    
    
    
    
    //Fill values ​​​​in the array
    
    for (int i = 0; i <= m; i++)
    
    {
    
    for (int j = 0; j <= n; j++)
    
    {
    
    if (i == 0 || j == 0)
    
    Lj = 0;
    
    else if (X[i - 1] == Y[j - 1])
    
    L j = L[i - 1][j - 1] + 1;
    
    else
    
    L j = max(L[i - 1]j, L [j - 1]);
    
    }
    
    }
    
    
    
    
    // Backtrack to find the substring
    
    int index = Lmn;
    
    
    
    
    // Create a string length index+1
    
    string lcs(index+1, ' ');
    
    
    
    
    // Start from the right-most-bottom-most corner
    
    // and one by one store characters in lcs[]
    
    int i = m, j = n;
    
    while (i > 0 && j > 0)
    
    {
    
    // If current character in X[] and Y are same
    
    if (X[i - 1] == Y[j - 1])
    
    {
    
    // Put current character into result
    
    lcs [index - 1] = X[i - 1];
    
    
    
    
    // reduce values ​​of i, j and index
    
    the--;
    
    j--;
    
    index--;
    
    }
    
    
    
    
    // If not same, then find the larger of two and
    
    // go in the direction of larger values
    
    ​​else if (L[i - 1]j > L [j - 1])
    
    the--;
    
    else
    
    j--;
    
    }
    
    
    
    
    // Return the result
    
    return lcs;
    
    }
    I'm hoping someone can help me figure out what's wrong with the code and help me get the desired output. Thanks in advance!


    --- Ultima modifica di Rosaline in data 2023-04-19 14:08:33 ---
  • Re: Python / Flask
    Forum >> Programmazione Python >> Web e Reti
    RESPONSES:




    Yes, you are correct. To make this service available on other PCs, you will need to deploy it on a server and make it accessible through a common endpoint. The easiest way to do this is to use a cloud hosting provider like AWS or Azure. With a cloud hosting provider, you can easily spin up a virtual server, deploy your application on it, and make it accessible to the world. You will also need to register a domain name, create an SSL certificate, and point the domain to your server so that the service is accessible through a secure connection. Once these steps are completed, you should be able to access the service from any computer in the world. I hope this helps!
  • Re: Creazione Programma Python
    Forum >> Programmazione Python >> Web e Reti
    You can refer to this resource as well.

    --- Ultima modifica di Rosaline in data 2023-02-02 06:48:16 ---
  • What kind of Python application project structure is ideal?
    Forum >> Programmazione Python >> Web e Reti
    Consider that you wish to use Python to create a complex desktop (not web) application for end users. What folder hierarchy for the project would be the best?




    Maintenance simplicity, IDE friendliness, suitability for source control branching/merging, and simplicity in creating install packages are all desired attributes.




    more specifically




    Where should the source be placed?

    Scripts used to launch applications should go where?

    Where should I store my IDE project clutter?

    Where do you place the acceptance and unit tests?

    Where should non-Python data, such configuration files, go?

    Where should non-Python sources for pyd/so binary extension modules be placed, such as C++?
  • Re: Piccolo database condiviso online
    Forum >> Programmazione Python >> Database
    For the database, you can use a lightweight database such as SQLite, which is free and open-source, and can be used with Python. To move the database between the PCs, you can use a cloud storage solution such as Dropbox, Google Drive, or Microsoft OneDrive. You can also use FTP and SFTP to transfer the database between computers.




    To access the database, you can use a database management system such as SQLiteStudio, or use a Python library such as SQLAlchemy or SQLite3 to access the database directly from Python code.