Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lugnut

Pages: 1 ... 171 172 173 174 175 [176] 177 178 179 180 181 ... 879
2626
I don't see why you ignored my second post. You wanted code to list every possible combination of coins (limited by the values provided) that totals  a certain value. I gave you code that does that.
oops
I'll test this
Give us a few examples of what you want this function to calculate. Like actual input/output. Every time I think I get what you're talking about, you say something that confuses me again.
and post this if trinick's doesn't do what I want- I can use it as an example maybe

2627
Off Topic / Re: General Programming Megathread - New OP
« on: November 29, 2012, 10:40:54 PM »
Kill it with fire

2628
Modification Help / Re: Aggregating webserver improvements
« on: November 28, 2012, 11:29:23 PM »
boy this code is stupid. i wrote it a long time ago.
i prefixed comments from today with "11-28-12" but you probably would've figured that out on your own

i noted a useful feature i forgot to mention in these posts: getBL_ID/NameFromIP(%ip), does just as it says on the tin. requires some form of logging of ip's and stuff
sucks for people with dynamic ips

http://pastebin.com/bv2G53FW
expires in a month
i dunno why i put that in there

2629
Modification Help / Re: Aggregating webserver improvements
« on: November 28, 2012, 11:16:36 PM »
It's 1000 by default, do you mean you changed it to 10000?
oopsies :( EDIT: saw the file, turns out I turned it to 10k, then down to 500. still made a big difference, apparently the browser sends two queries or something, and the webserver can't handle it.
I was trying to think of a good way to do this. I could make it so when the webserver needs to open up an image file, it opens the file at the path (which the developer would either manually make or create via script) that simply contains a url to where to find it on the web. So, basically a text file with a .png/.gif/etc extension.
sounds okay

edit finally found it
checking for SUPER SECRET MISSLE LAUNCH CODES (there probably isn't any) then uploading

2630
Modification Help / Re: Aggregating webserver improvements
« on: November 28, 2012, 10:21:15 PM »
Do you know what they were at least? If you can remember but can't find them I can throw them in.
After that I'll put out the test version - just did a live chat with 3 people and it worked with them all.
I mainly did some things that intercepted a request for an image and redirected it to a image hosted on dropbox, allowing me to log ip's

my best change was making the timeout time 1000ms instead of 10000ms

it boosted webserver performance by, well, 1000%
(I do hope I did that math right)

2631
Drama / Re: List of banned users who have returned for the $5 a key sale
« on: November 28, 2012, 09:54:41 PM »
Nonnel == Nomel == Devo?

2632
Okay what if I take a target change and find all the possible combinations using all the available resources, then brute-force-style calculate the possible ways said combos will fit (still making sure to not use too many coins!) Then order in the amount of total coins/money used

2633
Yes but that gives me only one possible solution, right?

2634
No.. I have X quarters, X dimes, X nickels, and X pennies

I have a target amount. I want to break the coins into groups that equal that amount, as many groups as possible.

2635
So I am way too lazy to type it again, so have some reading.
Quote
Never tell your password to anyone.
Tuesday, November 27, 2012
10:56 PM - Lugnut: I have X dollars and Y cents in change
10:58 PM - Lugnut: I wish to make a script that will take the coins I have, and break them down into all the possible sets of combinations that makes Z$ and uses the most coins
10:58 PM - Lugnut: Sooo, loop through all the coins to divide them up or what
10:59 PM - Lugnut: How would I do that algorithmically
11:00 PM - Jetz: Uses the most coins...? Convert it all to pennies?
11:00 PM - Jetz: I'm not sure I understand the problem
11:04 PM - Lugnut: Say I have 1.25
11:05 PM - Lugnut: And that's 25¢, 4 nickels, 15 pennies, 4 dimes
11:06 PM - Lugnut: Um
11:06 PM - Lugnut: That's only 1$
11:06 PM - Lugnut: Ok yeah its 1$
11:06 PM - Lugnut: Broken down as stated
11:07 PM - Lugnut: I want to calculate how many possible combonations breaks it into 25¢ groups
11:07 PM - Lugnut: 15 pennies + 1 dime
11:07 PM - Lugnut: 5 pennies, 2 dimes
11:07 PM - Lugnut: Etc etc
11:08 PM - Lugnut: With the goal being to break it into the most optimal group for utilizing most of the coins
11:08 PM - Lugnut: ... without turning it into 100 pennies
11:09 PM - Jetz: Wait, break it into groups all using the same set of coins, like you can't use 15 pennies in 1 and 5 in another?
11:09 PM - Lugnut: Create a set of groups, where each group == 25¢
11:09 PM - Lugnut: Where the total is as close to 1$ as possible
11:11 PM - Jetz: And reuse is not aloud between groups? Sheesh that's a difficult problem. Would be annoying to even find a way to brute force that one.
11:11 PM - Lugnut: Correct
11:12 PM - Lugnut: It is allowed between sets

I realized after this line that it would be easier on every party involved's (did I just say involved's?) brain if I asked the whole of coding help instead.

A good way to think of this is that you have a stuffload of pocket change, and you want to figure out all the ways you want to create bus far.
This is a good comparison cause that's actually what I'm trying to do, lol.
If you have questions or suggestions, please post. You don't need actual code, we're talking algorithms here, not neccesarily code.

2636
Then just loop through everybody?

Okay, that'll work

Thanks!

2637
Oh and it needs to be efficient and stuff
Cause I'll be looping through all buildings on a regular basis

2638
Drama / Re: List of banned users who have returned for the $5 a key sale
« on: November 27, 2012, 07:33:19 PM »
using == for the list, huh?
i think the programming is getting to you.
it's accurate :/

2639
Modification Help / Re: Aggregating webserver improvements
« on: November 27, 2012, 07:30:56 PM »
Woo hoo
Yeah um I'm still looking for my modifications, but don't hold your breath - they aren't amazing

2640
Yeah, basically that.
CityRPG lots are the kind of zone definition I'm thinking of.

Pages: 1 ... 171 172 173 174 175 [176] 177 178 179 180 181 ... 879