Code Monkey home page Code Monkey logo

subset_sum's Issues

Importing the rust crate doesn't work

I would like to use your rust crate in my project but I ran into a problem when I add it to my Cargo.toml file.
Running cargo build ends up in an error:

error[E0433]: failed to resolve: use of undeclared crate or module `mem`
   --> /home/max/.cargo/registry/src/index.crates.io-6f17d22bba15001f/subset_sum-0.22.1/src/dp_module.rs:503:21
    |
503 |                     mem::swap(&mut y.0, &mut y.1);
    |                     ^^^ use of undeclared crate or module `mem`

This what I add to my Cargo.toml:

[dependencies]
dpss = {version = "0.22.1", package = "subset_sum"}

Unsigned version for find_subset

Does this crate offer an unsigned version of the find_subset function?

For example a function with a signature like:

fn find_subset(Vec<usize>, usize, usize) -> Vec<Vec<usize>>;

I would need that in my project.

Python - Failing to build ModuleNotFoundError: No module named 'cffi'

Python version: 3.12
Platform: Win64

Full logs:

PS C:\Users\tavio\Downloads> pip install dpss
Collecting dpss
  Using cached dpss-0.22.0.tar.gz (150 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: dpss
  Building wheel for dpss (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for dpss (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      Running `maturin pep517 build-wheel -i C:\Users\tavio\AppData\Local\Programs\Python\Python312\python.exe --compatibility off`
         Compiling autocfg v1.1.0
         Compiling crossbeam-utils v0.8.8
         Compiling cfg-if v1.0.0
         Compiling lazy_static v1.4.0
         Compiling scopeguard v1.1.0
         Compiling rayon-core v1.9.1
         Compiling num_cpus v1.13.1
         Compiling either v1.6.1
         Compiling itertools v0.10.3
         Compiling memoffset v0.6.5
         Compiling crossbeam-epoch v0.9.8
         Compiling rayon v1.5.1
         Compiling crossbeam-channel v0.5.4
         Compiling crossbeam-deque v0.8.1
         Compiling subset_sum v0.22.0 (C:\Users\tavio\AppData\Local\Temp\pip-install-vt8ik074\dpss_84d1f0c3ac4c4da8b3452018dafd92c1)
          Finished release [optimized] target(s) in 7.60s
      💥 maturin failed
        Caused by: Failed to generate cffi declarations using C:\Users\tavio\AppData\Local\Programs\Python\Python312\python.exe: exit code: 1
      --- Stdout:

      --- Stderr:
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
      ModuleNotFoundError: No module named 'cffi'

      📦 Including license file "LICENSE"
      🔗 Found cffi bindings
      ðŸ\x90\x8d Using CPython 3.12 at C:\Users\tavio\AppData\Local\Programs\Python\Python312\python.exe to generate the cffi bindings
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', 'C:\\Users\\tavio\\AppData\\Local\\Programs\\Python\\Python312\\python.exe', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dpss
Failed to build dpss
ERROR: Could not build wheels for dpss, which is required to install pyproject.toml-based projects

What I tried:

  • Installing and reinstalling Rust
  • Manually installing cffi (despite it already having been installed prior to installing dpss)
  • Installing package maturin from PyPI

Bank Reconciliation

Hi,

Thanks for this great pkg. I am testing the wasm package (wasm_find_subset) to do reconciliations. But I have some questions:

  1. My subset array and target may include some values with 2 decimal places,
    example: subset [-40000, 25305.55, 25305.55, 30000, 54123.78] target: 79429.33.
    Could I just multiply the subset and the target by 100 to remove the decimals and make it work? By doing this will it take longer get a result?

  2. Using the same subset example as above, sometimes I can have repeated numbers in the subset array. Is it possible to get wasm_find_subset to return the result as positions in the array? example:
    subset [-40000, 25305.55, 25305.55, 30000, 54123.78] target: 79429.33
    result: [[1, 4], [2,4]]

  3. Currently the wasm_find_subset function returns a string. Could it return an array of arrays? Or is there an easy way to convert that string to an array of arrays.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.