Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
RICHUNCLEPENNYBAGS
Dec 21, 2010

crashdome posted:

I'm interested in improving performance of some CPU bound functions. The functions are already async and my UI is responsive. it's just the tasks can take several minutes. Its a procedure which optimizes order and placement of materials. Running all possible combinations is complicated as is the scoring to determine best fit. Would using F# in any way improve performance on procedures that rely heavily on loops and lists as containers?

This sounds like a problem for a better algorithm, not switching programming languages (and also sounds vaguely similar to some Hard Problems like the Knapsack Problem but I don't know).

RICHUNCLEPENNYBAGS fucked around with this message at 21:56 on Apr 17, 2015

Adbot
ADBOT LOVES YOU

crashdome
Jun 28, 2011
I think you're right about checking with a profiler first. I'm going to write my changes very deliberately in C# first with very verbose code and after running the profiler I will whittle it down to less verbose linq and/or extension methods to ensure I'm not doing like you said and dumping out too many lists. I have linq sprinkled around inconsistently and that's probably my problem.

RICHUNCLEPENNYBAGS
Dec 21, 2010

crashdome posted:

I think you're right about checking with a profiler first. I'm going to write my changes very deliberately in C# first with very verbose code and after running the profiler I will whittle it down to less verbose linq and/or extension methods to ensure I'm not doing like you said and dumping out too many lists. I have linq sprinkled around inconsistently and that's probably my problem.

Although it does not usually matter, if you have really performance-critical code, you probably want to avoid Linq altogether. Any list or array allocation is obviously linear-time too so avoiding that would help. Another one I see all the time: if you're creating a collection just to check if it contains things, use a HashSet and not a List or array.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug
A read through the Roslyn Contribution Guide might help some. A lot of this stuff will make your code harder to read. There's also LinqOptimizer which will compile your LINQ queries down to IL. I have not used LinqOptimizer but I think someone on SA had

ljw1004
Jan 18, 2005

rum

crashdome posted:

I think you're right about checking with a profiler first. I'm going to write my changes very deliberately in C# first with very verbose code and after running the profiler I will whittle it down to less verbose linq and/or extension methods to ensure I'm not doing like you said and dumping out too many lists. I have linq sprinkled around inconsistently and that's probably my problem.

I wouldn't even bother with that. You might run the profiler on your code as-is and discover that 99% of CPU-time is spent in just one tiny five-line chunk of code. No point rewriting the rest of your code if this is the only problem area.

RICHUNCLEPENNYBAGS
Dec 21, 2010

ljw1004 posted:

I wouldn't even bother with that. You might run the profiler on your code as-is and discover that 99% of CPU-time is spent in just one tiny five-line chunk of code. No point rewriting the rest of your code if this is the only problem area.

While that's possible, he described it as a brute-force solution to a combinatorial optimization problem, which suggests to me that the asymptotic complexity is probably super-high.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
Why does TabControl rebuild the visual tree for its items if you use ItemsSource? Who thought this would be a good idea? :wtc:

I'm using MVVM with AvalonDock and because of this there is a noticeable delay when switching tabs.

I don't know how to solve this in a way that isn't really loving hacky.

SirViver
Oct 22, 2008
Persist the Visual Tree when switching tabs in the WPF TabControl?
Not sure if you'd count this as hacky, but I guess that's WPF for ya v:v:v

Inverness
Feb 4, 2009

Fully configurable personal assistant.

SirViver posted:

Persist the Visual Tree when switching tabs in the WPF TabControl?
Not sure if you'd count this as hacky, but I guess that's WPF for ya v:v:v
The problem is that I'm using AvalonDock, with MVVM, and the tab control is created by it at some point. I guess I'll have to find it with a visual tree search and manipulate it manually somehow.

Perhaps by disabling the document tab binding and doing that with some code behind.

I'm more irritated that I have to do this in the first place than anything really.

Inverness fucked around with this message at 12:50 on Apr 20, 2015

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Weird issue. This

code:
private void OutputPhotos(PhotoList photolist)
        {
            LogMessage("saving photos " + photolist.photos.Count.ToString());
            Task.Run(() => filewriter.Write(photolist) );
        }
Produces the output
"saving photos 89" and 89 photos most of the time...

I just caught it outputting the 89 photos, plus 2 other batches of previously output photos from a couple days ago... over and over. The correct new batch, plus 2 'stuck' batches. Each time... but always saying that photolist.photos.count was 89.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

bobua posted:

Weird issue. This

code:
private void OutputPhotos(PhotoList photolist)
        {
            LogMessage("saving photos " + photolist.photos.Count.ToString());
            Task.Run(() => filewriter.Write(photolist) );
        }
Produces the output
"saving photos 89" and 89 photos most of the time...

I just caught it outputting the 89 photos, plus 2 other batches of previously output photos from a couple days ago... over and over. The correct new batch, plus 2 'stuck' batches. Each time... but always saying that photolist.photos.count was 89.

What is the Write method you're calling doing?

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Super simple foreach photo in photolist photo.save();


I would normally write that task.run line as Task.Run(() => { filewriter.Write(photolist); }); Instead of how it is... does that make any difference? Could the .write task me crashing silently and hanging around in memory or something? This is bizarre.

crashdome
Jun 28, 2011
Your filewriter... is it being shared across photolists? Is the IO operation being disposed of properly?

crashdome
Jun 28, 2011

ljw1004 posted:

I wouldn't even bother with that. You might run the profiler on your code as-is and discover that 99% of CPU-time is spent in just one tiny five-line chunk of code. No point rewriting the rest of your code if this is the only problem area.

RICHUNCLEPENNYBAGS posted:

While that's possible, he described it as a brute-force solution to a combinatorial optimization problem, which suggests to me that the asymptotic complexity is probably super-high.

Yes, I should mention most of the rewriting is required because of a big change in the algorithm. I just plan on rewriting very verbosely to make it easier to find that 4-5 line chunk of code of why it takes so long and go from there.

bobua
Mar 23, 2003
I'd trade it all for just a little more.

crashdome posted:

Your filewriter... is it being shared across photolists? Is the IO operation being disposed of properly?

I think it is, depending on what exactly that means... there is one filewriter object and I give it photolists. The photolist also has a string property that holdes the filename stub, so while one photolist object could be holding more files than it should(say 2 or 3 sets of 89 photos) it couldn't manage to output them under a different name...

The best way I can describe how this is acting, is that filewriter is a multicast delegate holding 2 old filewriter's and the one current one. Then everytime I call it it spits out the 2 old ones and the new current one. I'm not using delegates or even events at all though. I only use the word FileWriter twice in my project, once in the constructor with a standard FileWriter filewriter = new FileWriter(); and once more when I call it in the previously posted code.

The only think wacky that I do is use some copy\pasted code to try and force a higher quality jpeg save. Here's the whole filewriter class.

code:
	public void Write(PhotoList photolist)
        {
            string videofilenamestub = Properties.Settings.Default.ImagePath + "\\video\\";
            int videoSequenceNumber = 0;
            foreach (var image in photolist.photos)
            {             
                try
                {                    
                    //image.Save(videofilenamestub + photolist.Time.ToString("yyyyMMddHHmmss") + "-" + videoSequenceNumber.ToString().PadLeft(3, '0') + "-" + photolist.rider.tag.ToString() + ".jpg"); //old low quality save
                    saveJpeg(videofilenamestub + photolist.Time.ToString("yyyyMMddHHmmss") + "-" + videoSequenceNumber.ToString().PadLeft(3, '0') + "-" + ".jpg", image.Bitmap, 100);
                }
                catch(Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.Message);
                }
                finally{ videoSequenceNumber++; }
            }
        }

        public void saveJpeg(string path, Bitmap img, long quality)
        {
            // Encoder parameter for image quality

            EncoderParameter qualityParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality);

            // Jpeg image codec
            ImageCodecInfo jpegCodec = this.getEncoderInfo("image/jpeg");

            if (jpegCodec == null)
                return;

            EncoderParameters encoderParams = new EncoderParameters(1);
            encoderParams.Param[0] = qualityParam;
            img.Save(path, jpegCodec, encoderParams);
        }

        public ImageCodecInfo getEncoderInfo(string mimeType)
        {
            // Get image codecs for all image formats
            ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();

            // Find the correct image codec
            for (int i = 0; i < codecs.Length; i++)
                if (codecs[i].MimeType == mimeType)
                    return codecs[i];
            return null;
        }

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

crashdome posted:

Your filewriter... is it being shared across photolists? Is the IO operation being disposed of properly?

Let's go back a step:

Why is he using Task.Run to save a file?

[edit]

Also, this is a bug just waiting to happen:
code:
            for (int i = 0; i < codecs.Length; i++)
                if (codecs[i].MimeType == mimeType)
                    return codecs[i];
            return null;
Also also, System.IO.Path.Combine is your friend:
string videofilenamestub = Properties.Settings.Default.ImagePath + "\\video\\";

New Yorp New Yorp fucked around with this message at 03:42 on Apr 21, 2015

ljw1004
Jan 18, 2005

rum

bobua posted:

Weird issue. This
code:
private void OutputPhotos(PhotoList photolist)
        {
            LogMessage("saving photos " + photolist.photos.Count.ToString());
            Task.Run(() => filewriter.Write(photolist) );
        }
Produces the output
"saving photos 89" and 89 photos most of the time...
I just caught it outputting the 89 photos, plus 2 other batches of previously output photos from a couple days ago... over and over. The correct new batch, plus 2 'stuck' batches. Each time... but always saying that photolist.photos.count was 89.

I think the message you write to the log is misleading. How about this one...

code:
LogMessage($"started to save {photolist.photos.Count} photos on a background
thread, but I have no way of knowing how long it will take to save,
nor when it's done, and if there are any exceptions raised then
they'll be silently swallowed, and woe betide me if the saving is
still going on at the same time as someone else decides to
modify the 'photolist' object");
:) That's my facetious way of recommending that you write something different:

code:
private async Task OutputPhotosAsync(PhotoList photolist)
        {
            LogMessage("saving photos " + photolist.photos.Count.ToString());
            await Task.Run(() => filewriter.Write(photolist) );
        }

crashdome
Jun 28, 2011
What he said ^^^ I think his exceptions are not being caught because he's not looking for them. So yes, removing Task.Run might bring the real problem to focus.

raminasi
Jan 25, 2005

a last drink with no ice
I thought that defining "async" methods that were just thin wrappers around Task.Run was considered bad practice?

NiceAaron
Oct 19, 2003

Devote your hearts to the cause~

GrumpyDoctor posted:

I thought that defining "async" methods that were just thin wrappers around Task.Run was considered bad practice?

Indeed, though moreso for public methods since it's better to let the caller choose whether or not to use Task.Run. If it's just a private helper method then it might not be so bad (depending on context).

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Ithaqua posted:

Let's go back a step:

Why is he using Task.Run to save a file?



Saving the files takes 3 to 5 seconds and locks up the other thread which is receiving images from hardware that I need to receive and discard(or they get queued up in a buffer on the hardware). I've read io bound tasks shouldn't be handled with threads but everytime I try some other solution I tend to create a problem elsewhere. I really do want to fire and forget this task, even if it fails. I don't really understand async, but it always seems like they just let the calling method keep processing while waiting, and my calling method is a callback from a driver api. I need it to finish running before the write process finishes.

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Ithaqua posted:


Also, this is a bug just waiting to happen:
code:
            for (int i = 0; i < codecs.Length; i++)
                if (codecs[i].MimeType == mimeType)
                    return codecs[i];
            return null;

This isn't my code and I don't like having to use it but it was all google turned up on saving emgu's images to higher quality jpegs than default. Can you give me any help on why it's bad?

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug
Can you post more code? I'm still not sure what is going on. You saying "multicast delegate holding 2 old filewriter's and the one current one" has me worried. A Bitmap is not very threadsafe (SO) and it's possible you are getting into a dead lock.

For the code Ithaqua mentioned having unbraced loops and if statements can be a "bad" thing (see goto fail SSL exploit). I would at least change it to a LINQ statement so that it's more declarative. Really, I would have the constructor find the ImageCodecInfo and cache it or wrap it in a Lazy<T>. Just to reduce the amount of work needed when saving a JPEG and it's one less call within saveJpeg plus null checking. I would also want to throw an exception if no ImageCodecInfo is found instead of silently giving up or at least log it.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

bobua posted:

This isn't my code and I don't like having to use it but it was all google turned up on saving emgu's images to higher quality jpegs than default. Can you give me any help on why it's bad?

If I had to guess, it's the lack of braces around not just just the for loop, but also the if statement. It makes it really easy to unintentionally break things when modifying the code since just adding a line changes the semantics of the loop.

EDIT: A clearer and less error-prone way of writing it is to just use LINQ's FirstOrDefault:

C# code:
return codecs.FirstOrDefault(c => c.MimeType == mimeType);
EDIT2: Beaten by a mile.

Bognar fucked around with this message at 19:30 on Apr 21, 2015

bobua
Mar 23, 2003
I'd trade it all for just a little more.

gariig posted:

Can you post more code? I'm still not sure what is going on. You saying "multicast delegate holding 2 old filewriter's and the one current one" has me worried. A Bitmap is not very threadsafe (SO) and it's possible you are getting into a dead lock.

For the code Ithaqua mentioned having unbraced loops and if statements can be a "bad" thing (see goto fail SSL exploit). I would at least change it to a LINQ statement so that it's more declarative. Really, I would have the constructor find the ImageCodecInfo and cache it or wrap it in a Lazy<T>. Just to reduce the amount of work needed when saving a JPEG and it's one less call within saveJpeg plus null checking. I would also want to throw an exception if no ImageCodecInfo is found instead of silently giving up or at least log it.

Thanks.

I think I just figured it out the whole problem. I'm registering a callback with the camera's api but never removing it at close. I thought the api shutdown command would kill all that, but it must not because it makes perfect sense with the symptoms I'm getting.

Gildiss
Aug 24, 2010

Grimey Drawer
We are trying to get more information on replication during our software’s installation that sets up such things.
I am trying to get it to log the replication information to a file, and to log all errors and progress.

We use the Transpublication.CreateSnapshotAgent method to create the agent.

I am trying to get to the Replication Snapshot Agent's parameters, specifically, [-Output output_path_and_file_name] and [-OutputVerboseLevel [0|1|2] ].

So is there a way to access the parameters through C# in the installer code?
Or will I have to use a T-SQL script with the PreSnapshotScript and PostSnapshotScript properties to alter the Snapshot Agent and then set it back to default?

Inverness
Feb 4, 2009

Fully configurable personal assistant.
After tremendous amounts of suffering, I fixed my problem with AvalonDock tabs and the visual tree binding.

I did it by creating a ContentControl subclass that creates and caches content presenters, and then replacing the control template for the document pane so it uses that.

Edit: So I realized on the way home this wasn't such a great idea. Binding to the source items for the tabs is the only reliable way of keeping track of things instead of the whole weak reference thing I was trying. Instead I want to use an ItemsControl, specifically, the Selector subclass. Only problem is that I can't figure out how to get scroll views to work inside of each item. I want the scroll view inside each item, not an item presenter inside a scroll view.

Inverness fucked around with this message at 00:21 on Apr 23, 2015

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Trying to relearn WPF and MVVM, and binding is still confusing me a bit. I have an enum called Status in my view model, with possible values of READY and OPENING (and more later). Instead of those, I want to display pretty values in my application's status bar, like "Ready." and "Opening (45%)", for example. Is the way forward to bind a label to the enum normally, write a StatusValueConverter with the strings coded in, and set the label's converter to it? Or is there a better way?

Ideally, that 45% would come from the OpenProgress property in my view model.

(edit) Sorry I can't post any code, separate computers for 'net access here. :(

Ciaphas fucked around with this message at 00:11 on Apr 23, 2015

GoodCleanFun
Jan 28, 2004

Ciaphas posted:

Trying to relearn WPF and MVVM, and binding is still confusing me a bit. I have an enum called Status in my view model, with possible values of READY and OPENING (and more later). Instead of those, I want to display pretty values in my application's status bar, like "Ready." and "Opening (45%)", for example. Is the way forward to bind a label to the enum normally, write a StatusValueConverter with the strings coded in, and set the label's converter to it? Or is there a better way?

Ideally, that 45% would come from the OpenProgress property in my view model.

(edit) Sorry I can't post any code, separate computers for 'net access here. :(

Use a property, maybe StatusLabel, that returns a string based on the value of the Status property in a case statement and your OpenProgress property. In the setter for Status, make a call to OnPropertyChanged for StatusLabel.

GoodCleanFun fucked around with this message at 00:21 on Apr 23, 2015

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


GoodCleanFun posted:

Use a property, maybe StatusLabel, that returns a string based on the value of the Status property in a case statement and your OpenProgress property. In the setter for Status, make a call to OnPropertyChanged for StatusLabel.

Bah, that's a lot easier :doh:. Here's me always bloody overthinking it. Thanks lots.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost
A Prerelease of Sqlite for Windows 10 UAP apps is now out

:woop:

Now I can actually use all the nice database stuff I wrote in my Windows 10 apps without massive hacks.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
Looking at the visual tree showed me the ItemsPresenter was creating a StackPanel, which explained why the visible item was not being constrained so it would scroll properly.

Setting ItemsPanelTemplate to use a Grid did the trick. Now I have the tab control still using MVVM with hundreds of visual elements per tab that preserves states between tab changes. :yotj:

Drastic Actions posted:

A Prerelease of Sqlite for Windows 10 UAP apps is now out

:woop:

Now I can actually use all the nice database stuff I wrote in my Windows 10 apps without massive hacks.
So what is the whole universal app thing and what is different about it compared to what we have now?

Inverness fucked around with this message at 01:39 on Apr 23, 2015

ljw1004
Jan 18, 2005

rum

Inverness posted:

So what is the whole universal app thing and what is different about it compared to what we have now?

Summary: You can now write a single project and have it run on multiple devices (before you had to have a different project for each device.) It's now easier to do form-factor-adaptive UIs too.

I've been overseeing the technical side of things for .NET apps. I can't wait to say more about it all, but for that I have to wait until next Wednesday when things will be announced at Microsoft's Build conference. (We released a kind of intermediate "point-in-time" version of the tools last month, but I'd get too confused if I tried to describe that as well as the final way things work...)

Gul Banana
Nov 28, 2003

i'm looking forward to finding out the final details on 'plibs' or whatever they end up called, the replacement for pcls that work with .net core..

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

ljw1004 posted:

Summary: You can now write a single project and have it run on multiple devices (before you had to have a different project for each device.) It's now easier to do form-factor-adaptive UIs too.

I've been overseeing the technical side of things for .NET apps. I can't wait to say more about it all, but for that I have to wait until next Wednesday when things will be announced at Microsoft's Build conference. (We released a kind of intermediate "point-in-time" version of the tools last month, but I'd get too confused if I tried to describe that as well as the final way things work...)

Unfortunately no one actually cares about windows phone or tablet so idk why they kept pushing universal apps so hard

The cross platform stuff is way more useful

amotea
Mar 23, 2008
Grimey Drawer
I wish they'd just fix and improve WPF, and not reinvent the wheel over and over again. There is no viable alternative for desktop applications right now.

WPF is powerful enough for any UI stuff you can think of, it just needs some overhauling in some places.

Also, an updated cross-browser Silverlight would beat the hell out of the dumb Javascript hell everyone's using right now.

RICHUNCLEPENNYBAGS
Dec 21, 2010

amotea posted:

I wish they'd just fix and improve WPF, and not reinvent the wheel over and over again. There is no viable alternative for desktop applications right now.

WPF is powerful enough for any UI stuff you can think of, it just needs some overhauling in some places.

Also, an updated cross-browser Silverlight would beat the hell out of the dumb Javascript hell everyone's using right now.

It'd be nice if they were actually improving WPF, yes. As far as Silverlight, no one is going to install plugins to use your Web site (especially with mobile) and JavaScript has gotten a lot nicer to work with, IMO.

amotea
Mar 23, 2008
Grimey Drawer

RICHUNCLEPENNYBAGS posted:

It'd be nice if they were actually improving WPF, yes. As far as Silverlight, no one is going to install plugins to use your Web site (especially with mobile) and JavaScript has gotten a lot nicer to work with, IMO.

We have a large enterprise .NET/WPF application that resellers/customers would love to run in the browser (instead of continuously installing and updating clients all over the world). Installing a plug-in doesn't bother them.

For regular websites with mass trafic I agree a plug-in doesn't really work. There are several 3rd party efforts to convert WPF into javascript though, so maybe if MSFT really wanted to they could make something like that work.

some kinda jackal
Feb 25, 2003

 
 
Man, is it typical for the VS 2013 Community "web" installer to take like 4 hours to install the product?

I was installing on 2012R2 VM with 4 gigs ram so resources shouldn't be an issue, and I've got a 50/50 pipe so it shouldn't have taken like 4 hours to download :|

Adbot
ADBOT LOVES YOU

crashdome
Jun 28, 2011
I've seen downloads take that long simply because it's throttled on the senders side. Possibly what happened. The bane of my existence are those installers that are like 500Kb when the actual product is 6GB and you have to just sit there staring at an install screen in the center of the screen for 6 hours.


UPDATE ON MY PERFORMANCE PROBLEM:
Just wanted to drop this in here to mention you guys helped me out again. I used a profiler and found out almost 80% of my workload was in the properties of the object models. For example, one of my models is a wrapper around a List<T> and also a model with something like an Index field so, I had things like these:
code:
public decimal TotalLength
{
	get { return this.Sum(o => o.Length); }
}

public string CombinationStrategyKey
{
	get { return String.Concate(prop1,prop2,prop3); }
}
I was looking at properties such as this as part of my algorithm and the overhead in calling them like this was most of my problem. I guess it was just conditionally easier to write the above without thinking. The items I optimize don't change it's Length/Key during this process so as a test I hooked up an in-object PropertyChanged delegate that in the event an item changes only those properties, it would set a private field instead. For the List, I just put in a private field and override the Add/Remove methods to change the field I need. Basically, I cache the values within the object itself and BAM, huge reduction in time. Now that I know it's successful, I'm going to look into locking those properties/fields for thread safety just in case.

It has reduced it from potentially taking an hour down to about 1-2 minutes for 300 items. I still have the potential that larger iterations can increase the time factorially(?is that a word?). I'm looking into parallelizing now the master items and also breaking item counts larger than say 150 items into groups as part of the optimization process to reduce the chances of an extreme situation.

So... thanks everyone again.

quick edit: My algorithm has to account for scoring every possible combination so 300 items means:
306,057,512,216,440,636,035,370,461,297,268,629,388,588,804,173,576,999,416,776,741,259,476,533,176,716,867,465,515,291,422,477,573,349,939,147,8
88,701,726,368,864,263,907,759,003,154,226,842,927,906,974,559,841,225,476,930,271,954,604,008,012,215,776,252,176,854,255,965,356,903,506,788,72
5,264,321,896,264,299,365,204,576,448,830,388,909,753,943,489,625,436,053,225,980,776,521,270,822,437,639,449,120,128,678,675,368,305,712,293,681
,943,649,956,460,498,166,450,227,716,500,185,176,546,469,340,112,226,034,729,724,066,333,258,583,506,870,150,169,794,168,850,353,752,137,554,910,
289,126,407,157,154,830,282,284,937,952,636,580,145,235,233,156,936,482,233,436,799,254,594,095,276,820,608,062,232,812,387,383,880,817,049,600,0
00,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000

possible scores.

I cut that down drastically by breaking the recursive function if the combinations are more than 12 items and also by skipping items similar to the previous item checked. That should make the possibilities a lot less :D

crashdome fucked around with this message at 17:22 on Apr 23, 2015

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply