Slitting paper rolls into small rolls with minimum waste - excel

I have a big paper roll with different widths (length not important).
I would like to find the best combination of small rolls that can be slit out from the main roll with minimum waste, it can be any combination. Can anyone help me to find out an automated solution for this in excel or in any other program?
Thanks.
Edit:
I have tried this manually but there are a lot more combinations possible but out of these 3 trials the highlighted one is the minimum waste. Screenshot attached. I am thinking of an automated way for this.

Related

I need advice on aggregating data in a spreadsheet to be analyzed with Python

I want to input the past couple of years of my high school soccer team's stat books into a spreadsheet so I can run my own analysis on it using Python in Google Colab or a Jupyter Notebook. The problem I have right now is that I don't know what the best way of aggregating it in Excel is. I have a record of basic stats such as lineups, shots, saves, goals, assists, etc. for each individual game (standard box score stuff you'd expect from a high school team who uses a JV player to keep stats). But what would be the best way to input all of this in a way that will make it easy for me to analyze? Obviously I can't make a separate Excel tab for each individual game (there are hundreds of games), and I don't think logging them all into the same tab would be the best thing to do either, but I don't what I should do in order to solve this problem. This seems like a simple problem, and I'm probably missing a really obvious solution, but if anyone could give me some advice, I'd be very grateful. Does anyone have any experience doing anything similar? Thanks for taking the time to help.
I haven't tried anything yet because I wanted to figure out a good method before I put a bunch of time into this.

How to determine sample size given few parameters

How to determine sample size given there is 20% point reduction [ before change – after change =20% ] with 95% confidence level and 90% power ? Any pointer on how to solve this
A good first step is always to think about, what kind of test you plan to use. From the very little information you give a paired t-test (or a single measurement t-test comparing the difference to zero) is a likely candidate.
You can now google for "statistical power of t test" to which you can add the name of any computer language or statistics software you plan to use. Except maybe for educational purposes I'd advise to compute statics not by hand but via software.
Kind of an obvious option for statistic software on stackoverflow might be R. In Ryou'll find solutions to many sample size or power calculations in the package pwr. Here is the link to a getting started text: https://cran.r-project.org/web/packages/pwr/vignettes/pwr-vignette.html
The pwr.t.test function is good for your problem. Google will readily help you to alternatives for Python and Julia and SPSS I assume for C++, Java and Javascript as well.
However you will have to make assumptions about the variance or the effect size. Will each value be reduced by almost exactly 20% or will some be reduced a lot and some increase? That is of utmost importance to the question. You will need only one observation if there is no variance, a small amount of observations if there is little variance and a large amount of observations if there is lots of variance.

printing a very large number in python takes forever

I wanted to calculate a very large number and since python supports arbitraryly large numbers I thought that's perfect.
So, here it is:
import math
x=2**24
y=3840*2160
z=x**y
print("z is calculated")
print(z)
Well, the last I see is "z is calculated", so it is not the calculation itself that is the problem.
But even after an hour I do not see any other output.
So can someone explain what is going on here?
PS: z has about 60 Million digits...
So, this is expected behaviour and "won't fix".
The algorithm converting an integer to a string has quadratic complexity and an improvement is too much effort since it happens so rarely.
As a workaround it was recommended that I use a package like GMP, which seems to be better suited.
I just hope that this does not open a door to DOS attacks to servers where the attackers can provide such a number as input. it is enough if the server wants to log that number to freeze up.

How can I synchronize two audio recordings *without* timestamps?

Let's say I have two separate recordings of the same concert (created on a user's phone and then uploaded to our server). These recordings are then aligned according to their creation timestamp. However, when these recordings are played together or quickly toggled between, it is revealed that their creation timestamps must be off because there is a perceptible delay.
Since the time stamp is not a reliable way to align these recordings, what is an alternative? I would really prefer not to have to learn about audio signal processing to solve this problem, but recognize this may be the only way. So, I guess my question is:
Can I get away with doing some kind of clock synchronization? Is that even possible if the internal device clocks are clearly off by an unknown amount? If yes, a general outline of how this would work and key words would be appreciated.
If #1 is not an option, I guess I need to learn about audio signal processing? Again, a general outline of how to tackle the problem from that angle and some key words would be appreciated.
There are 2 separate issues you need to deal with. Issue 1 is the alignment of the start time of the recordings. I doubt you can expect that both user's pressed record at the exact same moment. Even if they did they may be located different distances from the speaker and it takes time for sound to travel. Aligning the start times by hand is pretty trivial. The human brain is good at comparing the similarities of sound. Programmatically it's a different story. You might try using something like cross correlation or looking over on dsp.stackexchange.com. There is no exact method though.
Issue 2 is that the clocks driving the A/D converters on the two devices are not going to be running at the same exact rate. So even if you synchronize the start time, eventually the two are going to drift apart. The time it takes to noticeably drift is a function of the difference of the two clock frequencies. If they are relatively close you may not notice in a short recording. To counter act this you need to stretch the time of one of the recordings. This increases or decreases the duration of the recording without affecting the pitch. There are plenty of audio recording apps that allow you to time stretch but they don't give you any help in figuring out by how much. Start be googling "time stretching" or again have a look at dsp.stackexchange.com.
I realize neither of these are direct answers - rather suggestions.
Take a look at this document, describes how you can align recordings using Sonic Visualizer(GPL) and a plugin.
I've not used it before, but found the document (and this question) when I was faced with a similar problem.

How to circumvent the maximum number of timeouts in a workflow?

When I'm designing a workflow using the built-in GUI, I noticed that after the fifth depth of timeout(timeout until x minutes, then do...) I can no longer add more steps. Vertically, I can enter many lines but depth-wise (i.e. to the right) it seems to give me a no-no and I can't add a sixth wait until, then do... clause.
Is it possible and I'm experiencing some other problem without realizing it or is it a limitation by design? Can it be worked around? I'm targeting both on-premise and on-line installations.
You could put the steps on the same depth (assuming that you're doing something besides the delays) - so they are aligned sideways. That way, you can enter arbitrary many waiting statements (i.e. 12, because that's what I've tested).
As for the five levels of depth, I've never run into a situation when I needed it. I suggest that you post a bounty if you'd like to learn more. But you might want to do that after the new years eve. Right now people are busy with that life thingy, not attending the only purpose in life (e.g. logging in onto Stack Overflow).

Resources