<p>I need to disable specific keys (Ctrl and Backspace) in Internet Explorer 6.  Is there a registry hack to do this.  It has to be IE6.  Thanks.</p>

<p>Long Edit: </p>

<p>@apandit: Whoops.  I need to more specific about the backspace thing.  When I say disable backspace, I mean disable the ability for Backspace to mimic the Back browser button.  In IE, pressing Backspace when the focus is not in a text entry field is equivalent to pressing Back (browsing to the previous page).</p>

<p>As for the Ctrl key.  There are some pages which have links which create new IE windows.  I have the popup blocker turned on, which block this.  But, Ctrl clicking result in the new window being launched.</p>

<p>This is for a kiosk application, which is currently a web based application.  Clients do not have the funds at this time to make their site kiosk friendly.  Things like URL filtering and disabling the URL entry field is already done.</p>

<p>Thanks.</p>

[{'answer_id': 59748, 'author': 'Rob Walker', 'author_id': 3631, 'author_profile': 'https://Stackoverflow.com/users/3631', 'pm_score': 0, 'selected': False, 'text': '<p>If they are a real numbers then infinite ... otherwise it is a bit trickier.</p>\n\n<p>(OK, for any computer representation of a real number there would be a finite count ... but it would be big!)</p>\n'}, {'answer_id': 59783, 'author': 'Torlack', 'author_id': 5243, 'author_profile': 'https://Stackoverflow.com/users/5243', 'pm_score': 1, 'selected': False, 'text': '<p>One way of looking at the problem is as follows:</p>\n\n<p>First, a can be any value from 0 to 500.  Then if follows that b+c+d+e = 500-a.  This reduces the problem by one variable.  Recurse until done. </p>\n\n<p>For example, if a is 500, then b+c+d+e=0 which means that for the case of a = 500, there is only one combination of values for b,c,d and e.</p>\n\n<p>If a is 300, then b+c+d+e=200, which is in fact the same problem as the original problem, just reduced by one variable.</p>\n\n<p>Note: As Chris points out, this is a horrible way of actually trying to solve the problem.</p>\n\n<p><a href="https://stackoverflow.com/questions/59743/number-of-possible-combinations#59833" title="See his reply">link text</a></p>\n'}, {'answer_id': 59792, 'author': 'Leahn Novash', 'author_id': 5954, 'author_profile': 'https://Stackoverflow.com/users/5954', 'pm_score': -1, 'selected': False, 'text': '<p>Including negatives? Infinite.</p>\n\n<p>Including only positives? In this case they wouldn\'t be called "integers", but "naturals", instead. In this case... I can\'t really solve this, I wish I could, but my math is too rusty. There is probably some crazy integral way to solve this. I can give some pointers for the math skilled around.</p>\n\n<p>being x the end result,\nthe range of a would be from 0 to x,\nthe range of b would be from 0 to (x - a),\nthe range of c would be from 0 to (x - a - b),\nand so forth until the e.</p>\n\n<p>The answer is the sum of all those possibilities.</p>\n\n<p>I am trying to find some more direct formula on Google, but I am really low on my Google-Fu today...</p>\n'}, {'answer_id': 59824, 'author': 'Jason Cohen', 'author_id': 4926, 'author_profile': 'https://Stackoverflow.com/users/4926', 'pm_score': 3, 'selected': False, 'text': "<p><strong>The answer to your question is 2656615626</strong>.</p>\n\n<p>Here's the code that generates the answer:</p>\n\n<pre><code>public static long getNumCombinations( int summands, int sum )\n{\n    if ( summands &lt;= 1 )\n        return 1;\n    long combos = 0;\n    for ( int a = 0 ; a &lt;= sum ; a++ )\n        combos += getNumCombinations( summands-1, sum-a );\n    return combos;\n}\n</code></pre>\n\n<p>In your case, <code>summands</code> is 5 and <code>sum</code> is 500.</p>\n\n<p><strong>Note that this code is slow</strong>.  If you need speed, cache the results from <code>summand,sum</code> pairs.</p>\n\n<p>I'm assuming you want numbers <code>&gt;=0</code>.  If you want <code>&gt;0</code>, replace the loop initialization with <code>a = 1</code> and the loop condition with <code>a &lt; sum</code>.  I'm also assuming you want permutations (e.g. <code>1+2+3+4+5</code> plus <code>2+1+3+4+5</code> etc).  You could change the for-loop if you wanted <code>a &gt;= b &gt;= c &gt;= d &gt;= e</code>.</p>\n"}, {'answer_id': 59831, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': "<p>I solved this problem for my dad a couple months ago...extend for your use.  These tend to be one time problems so I didn't go for the most reusable...</p>\n\n<p>a+b+c+d = sum</p>\n\n<p>i = number of combinations</p>\n\n<pre><code>        for (a=0;a&lt;=sum;a++)\n        {\n            for (b = 0; b &lt;= (sum - a); b++)\n            {\n                for (c = 0; c &lt;= (sum - a - b); c++)\n                {\n                    //d = sum - a - b - c;\n                    i++\n                }\n            }\n        }\n</code></pre>\n"}, {'answer_id': 59833, 'author': 'Chris Conway', 'author_id': 1412, 'author_profile': 'https://Stackoverflow.com/users/1412', 'pm_score': 5, 'selected': True, 'text': '<p>@Torlack, @Jason Cohen: Recursion is a bad idea here, because there are "overlapping subproblems." I.e., If you choose <code>a</code> as <code>1</code> and <code>b</code> as <code>2</code>, then you have 3 variables left that should add up to 497; you arrive at the same subproblem by choosing <code>a</code> as <code>2</code> and <code>b</code> as <code>1</code>. (The number of such coincidences explodes as the numbers grow.)</p>\n\n<p>The traditional way to attack such a problem is <a href="http://en.wikipedia.org/wiki/Dynamic_programming" rel="nofollow noreferrer">dynamic programming</a>: build a table bottom-up of the solutions to the sub-problems (starting with "how many combinations of 1 variable add up to 0?") then building up through iteration (the solution to "how many combinations of <em>n</em> variables add up to <em>k</em>?" is the sum of the solutions to "how many combinations of <em>n-1</em> variables add up to <em>j</em>?" with 0 &lt;= <em>j</em> &lt;= <em>k</em>). </p>\n\n<pre><code>public static long getCombos( int n, int sum ) {\n  // tab[i][j] is how many combinations of (i+1) vars add up to j\n  long[][] tab = new long[n][sum+1];\n  // # of combos of 1 var for any sum is 1\n  for( int j=0; j &lt; tab[0].length; ++j ) {\n    tab[0][j] = 1;\n  }\n  for( int i=1; i &lt; tab.length; ++i ) {\n    for( int j=0; j &lt; tab[i].length; ++j ) {\n      // # combos of (i+1) vars adding up to j is the sum of the #\n      // of combos of i vars adding up to k, for all 0 &lt;= k &lt;= j\n      // (choosing i vars forces the choice of the (i+1)st).\n      tab[i][j] = 0;\n      for( int k=0; k &lt;= j; ++k ) {\n        tab[i][j] += tab[i-1][k];\n      }\n    }\n  }\n  return tab[n-1][sum];\n}\n</code></pre>\n\n<pre>\n$ time java Combos\n2656615626\n\nreal    0m0.151s\nuser    0m0.120s\nsys 0m0.012s\n</pre>\n'}, {'answer_id': 60107, 'author': 'rjzii', 'author_id': 1185, 'author_profile': 'https://Stackoverflow.com/users/1185', 'pm_score': 2, 'selected': False, 'text': "<p>This would actually be a good question to ask on an interview as it is simple enough that you could write up on a white board, but complex enough that it might trip someone up if they don't think carefully enough about it. Also, you can also for two different answers which cause the implementation to be quite different.</p>\n\n<p><strong>Order Matters</strong><br />\nIf the order matters then any solution needs to allow for zero to appear for any of the variables; thus, the most straight forward solution would be as follows:</p>\n\n<pre><code>public class Combos {\n    public static void main() {\n        long counter = 0;\n\n        for (int a = 0; a &lt;= 500; a++) {\n            for (int b = 0; b &lt;= (500 - a); b++) {\n                for (int c = 0; c &lt;= (500 - a - b); c++) {\n                    for (int d = 0; d &lt;= (500 - a - b - c); d++) {\n                        counter++;\n                    }\n                }\n            }\n        }\n        System.out.println(counter);\n    }\n}\n</code></pre>\n\n<p>Which returns 2656615626.</p>\n\n<p><strong>Order Does Not Matter</strong><br />\nIf the order does not matter then the solution is not that much harder as you just need to make sure that zero isn't possible unless sum has already been found.</p>\n\n<pre><code>public class Combos {\n    public static void main() {\n        long counter = 0;\n\n        for (int a = 1; a &lt;= 500; a++) {\n            for (int b = (a != 500) ? 1 : 0; b &lt;= (500 - a); b++) {\n                for (int c = (a + b != 500) ? 1 : 0; c &lt;= (500 - a - b); c++) {\n                    for (int d = (a + b + c != 500) ? 1 : 0; d &lt;= (500 - a - b - c); d++) {\n                        counter++;\n                    }\n                }\n            }\n        }\n        System.out.println(counter);\n    }\n}\n</code></pre>\n\n<p>Which returns 2573155876.</p>\n"}, {'answer_id': 13333456, 'author': 'neel', 'author_id': 1215889, 'author_profile': 'https://Stackoverflow.com/users/1215889', 'pm_score': 0, 'selected': False, 'text': '<p>It has general formulae, if<br>\na + b + c + d = N<br>\nThen number of non-negative integral solution will be <code>C(N + number_of_variable - 1, N)</code></p>\n'}, {'answer_id': 19784359, 'author': 'user2955441', 'author_id': 2955441, 'author_profile': 'https://Stackoverflow.com/users/2955441', 'pm_score': 0, 'selected': False, 'text': '<p>@Chris Conway answer is correct. I have tested with a simple code that is suitable for smaller sums.</p>\n\n<pre><code>                    long counter = 0;\n            int sum=25;\n\n            for (int a = 0; a &lt;= sum; a++) {\n                for (int b = 0; b &lt;= sum ; b++) {\n                    for (int c = 0; c &lt;= sum; c++) {\n                        for (int d = 0; d &lt;= sum; d++) {\n                             for (int e = 0; e &lt;= sum; e++) {\n                           if ((a+b+c+d+e)==sum) counter=counter+1L;\n\n                             }\n                       }\n                    }\n                }\n            }\n            System.out.println("counter e "+counter);\n</code></pre>\n'}, {'answer_id': 44703816, 'author': 'Neil  Wang', 'author_id': 8128469, 'author_profile': 'https://Stackoverflow.com/users/8128469', 'pm_score': 0, 'selected': False, 'text': '<p>The answer in math is 504!/(500! * 4!).</p>\n\n<p>Formally, for x1+x2+...xk=n, the number of combination of nonnegative number x1,...xk is the binomial coefficient: (k-1)-combination out of a set containing (n+k-1) elements.</p>\n\n<p>The intuition is to choose (k-1) points from (n+k-1) points and use the number of points between two chosen points to represent a number in x1,..xk.</p>\n\n<p>Sorry about the poor math edition for my fist time answering Stack Overflow.</p>\n\n<p><code>Just a test for code block</code></p>\n\n<pre><code>Just a test for code block\n\n    Just a test for code block\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/59761', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/78/']