Search Results

Search found 216 results on 9 pages for 'remainder'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Make DIV fill remainder of page vertically?

    - by mazin k.
    I have a Google Maps app that takes up most of the page. However, I need to reserve the top-most strip of space for a menu bar. How can make the map div automatically fill its vertical space? height: 100% does not work because the top bar will then push the map past the bottom of the page. +--------------------------------+ | top bar (x% tall) | |================================| | ^ | | | | | div | | (100%-x% tall) | | | | | v | +--------------------------------+

    Read the article

  • Division, Remainders and only Real Numbers Allowed

    - by Senica Gonzalez
    Trying to figure out this pseudo code. The following is assumed.... I can only use unsigned and signed integers (or long). Division returns a real number with no remainder. MOD returns a real number. Fractions and decimals are not handled. INT I = 41828; INT C = 15; INT D = 0; D = (I / 65535) * C; How would you handle a fraction (or decimal value) in this situation? Is there a way to use negative value to represent the remainder? In this example I/65535 should be 0.638, however, with the limitations, I get 0 with a MOD of 638. How can I then multiply by C to get the correct answer? Hope that makes sense.

    Read the article

  • Fastest way to calculate a 128-bit integer modulo a 64-bit integer

    - by Paul Baker
    I have a 128-bit unsigned integer A and a 64-bit unsigned integer B. What's the fastest way to calculate A % B - that is the (64-bit) remainder from dividing A by B? I'm looking to do this in either C or assembly language, but I need to target the 32-bit x86 platform. This unfortunately means that I cannot take advantage of compiler support for 128-bit integers, nor of the x64 architecture's ability to perform the required operation in a single instruction.

    Read the article

  • Java: confirm method Binary division and find remainder is correct?

    - by cadwag
    I am parsing binary files and have to implement a CRC algorithm to ensure the file is not corrupted. Problem is that I can't seem to get the binary math working when using larger numbers. The example I'm trying to get working: BigInteger G = new BigInteger("11001", 2); BigInteger M = new BigInteger("1110010000", 2); BigInteger R = M.remainder(G); I am expecting: R = "0101" But I am getting: R = "1100" I am assuming the remainder of 0101 is correct since it is given to me in this book I am using as a reference for the CRC algorithm (it's not based in Java), but I can't seem to get it working. I can get small binary calculations to work that I have solved by hand, but not the larger ones. I'll admit that I haven't worked the larger ones by hand yet, that is my next step, but I wanted to see if someone could point out a glaring flaw I have in my code. Can anyone confirm or deny that my methodology is correct? Thanks

    Read the article

  • C# - Converting a float to an int... and changing the int depending on the remainder

    - by Django Reinhardt
    Hi, this is probably the really newbie question (well, I'm pretty sure it is), but I have a float that's being returned and I need a quick and efficient way of turning it into an int. Pretty simple, but I have an exception. If the remainder of the float is anything other than .0 then I want to increment the int. Some quick examples: Float = 98.0, Int = 98 Float = 98.1, Int = 99 Float = 6.6, Int = 7 etc. Thanks for any help!

    Read the article

  • How to find the remainder of large number division in C++?

    - by Beelzeboul
    Hello, I have a question regarding modulus in C++. What I was trying to do was divide a very large number, lets say for example, M % 2, where M = 54,302,495,302,423. However, when I go to compile it says that the number is to 'long' for int. Then when I switch it to a double it repeats the same error message. Is there a way I can do this in which I will get the remainder of this very large number or possibly an even larger number? Thanks for your help, much appreciated.

    Read the article

  • Help in C with integers

    - by inferno2991
    You need to use division and remainder by 10. Consider this example: 163 divided by 10 is 16 remainder 3 16 divided by 10 is 1 remainder 6 1 divided by 10 is 0 remainder 1 You'll notice the remainder is always the last digit of the number that's being divided. Now figure out a way to do this in C... How do i do it in c Help :(

    Read the article

  • Help in C with intergers

    - by inferno2991
    You need to use division and remainder by 10. Consider this example: 163 divided by 10 is 16 remainder 3 16 divided by 10 is 1 remainder 6 1 divided by 10 is 0 remainder 1 You'll notice the remainder is always the last digit of the number that's being divided. Now figure out a way to do this in C... How do i do it in c Help :(

    Read the article

  • how to interleaving lists

    - by user2829177
    I have two lists that could be not equal in lengths and I want to be able to interleave them. I want to be able to append the extra values in the longer list at the end of my interleaved list.I have this: a=xs b=ys minlength=[len(a),len(b)] extralist= list() interleave= list() for i in range((minval(minlength))): pair=a[i],b[i] interleave.append(pair) flat=flatten(interleave) c=a+b if len(b)>len(a): remainder=len(c)-len(a) for j in range(-remainder): extra=remainder[j] extralist.append(extra) if len(a)>len(b): remainder=len(c)-len(b) for j in range(-remainder): extra=remainder[j] final=flat+extralist return final but if I test it: >>> interleave([1,2,3], ["hi", "bye",True, False, 33]) [1, 'hi', 2, 'bye', 3, True] >>> The False and 33 don't appear. What is it that Im doing wrong?

    Read the article

  • In OpenRasta, how do I configure a URI where I get "the remainder of the path" as a single string?

    - by Daniel Earwicker
    Normally in OpenRasta there is some configuration like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/customers/region/{region}") ... // and so on ... where the {region} part of the path is automatically mapped to a string parameter in the handling method. So if the user hits: http://server/customers/region/emea Then the handler method is passed the string "emea". As well as doing this, I'd like to register a handler with something like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/someotherthing/*") ... // and so on In this imaginary syntax, the asterisk would mean "take the rest of the path, including slashes, to be a single string parameter to pass to the handling method". And so if the user hits: http://server/someotherthing/how/about/this?that=other Then my handler method receives a string parameter: how/about/this?that=other Is such a thing possible in OpenRasta? In Sinatra (Ruby) I'd use a regular expression to do exactly this.

    Read the article

  • How do you make a CSS-defined table-cell scroll?

    - by Giffyguy
    I want to be able to set the height of the table, and force the cells to scroll individually if they are larger than the table. Consider the following code: (see it in action here) <div style="display: table; position: absolute; width: 25%; height: 80%; min-height: 80%; max-height: 80%; left: 0%; top: 10%; right: 75%; bottom: 10%; border: solid 1px black;"> <div style="display: table-row;"> <div style="display: table-cell; border: solid 1px blue;"> {Some dynamic text content}<br/> This cell should shrink to fit it's contents. </div> </div> <div style="display: table-row;"> <div style="display: table-cell; border: solid 1px red; overflow: scroll;"> This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. </div> </div> </div> If you open this code (in IE8, in my case) you'll notice that the second cell fits in the table nicely when the browser is maximized. In theory, when you shrink the browser (forcing the table to shrink as well), a vertical scrollbar should appear INSIDE the second cell when the table becomes too small to fit all of the content. But in reality, the table just grows vertically, beyond the bounds set by the CSS height attribute(s). Hopefully I've explained this scenario adequately... Does anyone know how I can get this to work?

    Read the article

  • How do you make a CSS-defined table-cell scroll?

    - by Giffyguy
    I want to be able to set the height of the table, and force the cells to scroll individually if they are larger than the table. Consider the following code: (see it in action here) <div style="display: table; position: absolute; width: 25%; height: 80%; min-height: 80%; max-height: 80%; left: 0%; top: 10%; right: 75%; bottom: 10%; border: solid 1px black;"> <div style="display: table-row;"> <div style="display: table-cell; border: solid 1px blue;"> {Some dynamic text content}<br/> This cell should shrink to fit it's contents. </div> </div> <div style="display: table-row;"> <div style="display: table-cell; border: solid 1px red; overflow: scroll;"> This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. This should only take up the remainder of the table's vertical space. </div> </div> </div> If you open this code (in IE8, in my case) you'll notice that the second cell fits in the table nicely when the browser is maximized. In theory, when you shrink the browser (forcing the table to shrink as well), a vertical scrollbar should appear INSIDE the second cell when the table becomes too small to fit all of the content. But in reality, the table just grows vertically, beyond the bounds set by the CSS height attribute(s). Hopefully I've explained this scenario adequately... Does anyone know how I can get this to work?

    Read the article

  • Why is DivMod Limited to Words (<=65535)?

    - by Andreas Rejbrand
    In Delphi, the declaration of the DivMod function is procedure DivMod(Dividend: Cardinal; Divisor: Word; var Result, Remainder: Word); Thus, the divisor, result, and remainder cannot be grater than 65535, a rather severe limitation. Why is this? Why couldn't the delcaration be procedure DivMod(Dividend: Cardinal; Divisor: Cardinal; var Result, Remainder: Cardinal); The procedure is implemented using assembly, and is therefore probably extremely fast. Would it not be possible for the code PUSH EBX MOV EBX,EDX MOV EDX,EAX SHR EDX,16 DIV BX MOV EBX,Remainder MOV [ECX],AX MOV [EBX],DX POP EBX to be adapted to cardinals? How much slower is the naïve attempt procedure DivModInt(const Dividend: integer; const Divisor: integer; out result: integer; out remainder: integer); begin result := Dividend div Divisor; remainder := Dividend mod Divisor; end; that is not (?) limited to 16-bit integers?

    Read the article

  • Pi help with Php (mass looping)

    - by Pieman
    My primary question is: Is this alot of loops? while ($decimals < 50000 and $remainder != "0") { $number = floor($remainder/$currentdivider); //Always round down! 10/3 =3, 10/7 = 1 $remainder = $remainder%$currentdivider; // 10%3 =1, 10%1 $thisnumber = $thisnumber . $number; $remainder = $remainder . 0; //10 $decimals += 1; } Or could I fit more into it? -without the server crashing/lagging. I'm just wondering, Also is there a more effiecent way of doing the above? (e.g. finidng out that 1/3 = 0.3 to 50,000 decimals.) Finally: I'm doing this for a pi formulae the (1 - 1/3 + 1/5 - 1/7 etc.) one, And i'm wondering if there is a better one. (In php) I have found one that finds pi to 2000 in 4 seconds. But thats not what I want. I want an infinite series that converges closer to Pi so every refresh, users can view it getting closer... see: http://zombiewrath.com/pi.php (Old one) and 'zombiewrath.com/superpi.php' (Newer one) But obv. converging using the above formulae takes ALONG time. Is there any other 'loop' like Pi formulaes (workable in php) that converge faster? Thanks alot...

    Read the article

  • What does the ".align" x86 Assembler directive do exactly? [migrated]

    - by Sinister Clock
    I will list exactly what I do not understand, and show you the parts I can not understand as well. First off, The .Align Directive .align integer, pad. The .align directive causes the next data generated to be aligned modulo integer bytes 1.~ ? : What is implied with "causes the next data generated to be aligned modulo integer bytes?" I can surmise that the next data generated is a memory-to-register transfer, no? Modulo would imply the remainder of a division. I do not understand "to be aligned modulo integer bytes"....... What would be a remainder of a simple data declaration, and how would the next data generated being aligned by a remainder be useful? If the next data is aligned modulo, that is saying the next generated data, whatever that means exactly, is the remainder of an integer? That makes absolutely no sense. What specifically would the .align, say, .align 8 directive issued in x86 for a data byte compiled from a C char, i.e., char CHARACTER = 0; be for? Or specifically coded directly with that directive, not preliminary Assembly code after compiling C? I have debugged in Assembly and noticed that any C/C++ data declarations, like chars, ints, floats, etc. will insert the directive .align 8 to each of them, and add other directives like .bss, .zero, .globl, .text, .Letext0, .Ltext0. What are all of these directives for, or at least my main asking? I have learned a lot of the main x86 Assembly instructions, but never was introduced or pointed at all of these strange directives. How do they affect the opcodes, and are all of them necessary?

    Read the article

  • Given an integer, determine if it is a Palindrome in less than O(n) [on hold]

    - by user134235
    There is an O(n) solution to the problem of determining if an integer is a palindrome below. Is it possible to solve this problem in O(log n) or better? static void IsPalindrome(int Number) { int OrignalNum = Number; int Reverse = 0; int Remainder = 0; if (Number > 0) { while (Number > 0) { Remainder = Number % 10; Reverse = Reverse * 10 + Remainder; Number = Number / 10; } if (OrignalNum == Reverse) Console.WriteLine("It is a Palindrome"); else Console.WriteLine("It is not a Palindrome"); } else Console.WriteLine("Enter Number Again"); }

    Read the article

  • True / false evaluation doesn't work as expected in Scheme

    - by ron
    I'm trying to compare two booleans : (if (equal? #f (string->number "123b")) "not a number" "indeed a number") When I run this in the command line of DrRacket I get "not a number" , however , when I put that piece of code in my larger code , the function doesn't return that string ("not a number") , here's the code : (define (testing x y z) (define badInput "ERROR") (if (equal? #f (string->number "123b")) "not a number" "indeed a number") (display x)) And from command line : (testing "123" 1 2) displays : 123 Why ? Furthermore , how can I return a value , whenever I choose ? Here is my "real" problem : I want to do some input check to the input of the user , but the thing is , that I want to return the error message if I need , before the code is executed , because if won't - then I would run the algorithm of my code for some incorrect input : (define (convert originalNumber s_oldBase s_newBase) (define badInput "ERROR") ; Input check - if one of the inputs is not a number then return ERROR (if (equal? #f (string->number originalNumber)) badInput) (if (equal? #f (string->number s_oldBase)) badInput) (if (equal? #f (string->number s_newBase)) badInput) (define oldBase (string->number s_oldBase)) (define newBase (string->number s_newBase)) (define outDecimal (convertIntoDecimal originalNumber oldBase)) (define result "") ; holds the new number (define remainder 0) ; remainder for each iteration (define whole 0) ; the whole number after dividing (define temp 0) (do() ((= outDecimal 0)) ; stop when the decimal value reaches 0 (set! whole (quotient outDecimal newBase)) ; calc the whole number (set! temp (* whole newBase)) (set! remainder (- outDecimal temp)) ; calc the remainder (set! result (appending result remainder)) ; append the result (set! outDecimal (+ whole 0)) ; set outDecimal = whole ) ; end of do (if (> 1 0) (string->number (list->string(reverse (string->list result))))) ) ;end of method This code won't work since it uses another method that I didn't attach to the post (but it's irrelevant to the problem . Please take a look at those three IF-s ... I want to return "ERROR" if the user put some incorrect value , for example (convert "23asb4" "b5" "9") Thanks

    Read the article

  • Sorting arrays in java

    - by user360706
    Write a static method in Java : public static void sortByFour (int[] arr) That receives as a paramater an array full of non-negative numbers (zero or positive) and sorts the array in the following way : In the beginning of the array all the numbers that devide by four without a remainder will appear. After them all the numbers in the array that devide by 4 with a remainder of 1 will appear. After them all the numbers in the array that devide by 4 with a remainder of 2 will appear. In the end of the array all the rest numbers (those who divide by 4 with the remainder 3) will appear. (The order of the numbers in each group doesn't matter) The method must be the most efficient it can. This is what I wrote but unfortunately it doesn't work well... :( public static void swap( int[] arr, int left, int right ) { int temp = arr[left]; arr[left] = arr[right]; arr[right] = temp; } public static void sortByFour( int[] arr ) { int left = 0; int right = ( arr.length - 1 ); int mid = ( arr.length / 2 ); while ( left < right ) { if ( ( arr[left] % 4 ) > ( arr[right] % 4 ) ) { swap( arr, left, right ); right--; } if ( ( arr[left] % 4 ) == ( arr[right] % 4 ) ) left++; else left++; } } Can someone please help me by fixing my code so that it will work well or rewriting it?

    Read the article

  • how to solve error processing /usr/lib/python2.7/dist-packages/pygst.pth:?

    - by ChitKo
    Error processing line 1 of /usr/lib/python2.7/dist-packages/pygst.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Error processing line 1 of /usr/lib/python2.7/dist-packages/pygtk.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 161, in addpackage if not dircase in known_paths and os.path.exists(dir): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) TypeError: must be encoded string without NULL bytes, not str Remainder of file ignored Traceback (most recent call last): File "/usr/share/apport/apport-gtk", line 16, in <module> from gi.repository import GObject File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module dynamic_module._load() File "/usr/lib/python2.7/dist-packages/gi/module.py", line 222, in _load version) File "/usr/lib/python2.7/dist-packages/gi/module.py", line 90, in __init__ repository.require(namespace, version) gi.RepositoryError: Failed to load typelib file '/usr/lib/girepository-1.0/GLib-2.0.typelib' for namespace 'GLib': Invalid magic header

    Read the article

  • How should an object that uses composition set its composed components?

    - by Casey
    After struggling with various problems and reading up on component-based systems and reading Bob Nystrom's excellent book "Game Programming Patterns" and in particular the chapter on Components I determined that this is a horrible idea: //Class intended to be inherited by all objects. Engine uses Objects exclusively. class Object : public IUpdatable, public IDrawable { public: Object(); Object(const Object& other); Object& operator=(const Object& rhs); virtual ~Object() =0; virtual void SetBody(const RigidBodyDef& body); virtual const RigidBody* GetBody() const; virtual RigidBody* GetBody(); //Inherited from IUpdatable virtual void Update(double deltaTime); //Inherited from IDrawable virtual void Draw(BITMAP* dest); protected: private: }; I'm attempting to refactor it into a more manageable system. Mr. Nystrom uses the constructor to set the individual components; CHANGING these components at run-time is impossible. It's intended to be derived and be used in derivative classes or factory methods where their constructors do not change at run-time. i.e. his Bjorne object is just a call to a factory method with a specific call to the GameObject constructor. Is this a good idea? Should the object have a default constructor and setters to facilitate run-time changes or no default constructor without setters and instead use a factory method? Given: class Object { public: //...See below for constructor implementation concerns. Object(const Object& other); Object& operator=(const Object& rhs); virtual ~Object() =0; //See below for Setter concerns IUpdatable* GetUpdater(); IDrawable* GetRenderer(); protected: IUpdatable* _updater; IDrawable* _renderer; private: }; Should the components be read-only and passed in to the constructor via: class Object { public: //No default constructor. Object(IUpdatable* updater, IDrawable* renderer); //...remainder is same as above... }; or Should a default constructor be provided and then the components can be set at run-time? class Object { public: Object(); //... SetUpdater(IUpdater* updater); SetRenderer(IDrawable* renderer); //...remainder is same as above... }; or both? class Object { public: Object(); Object(IUpdater* updater, IDrawable* renderer); //... SetUpdater(IUpdater* updater); SetRenderer(IDrawable* renderer); //...remainder is same as above... };

    Read the article

  • Anyone got a nifty credit expiry algorithm?

    - by garethkeenan
    Our website uses a credit system to allow users to purchase inexpensive digital goods (eg. photos). We use credits, rather than asking the user to pay for items individually, because the items are cheap and we are trying to keep our credit-card/PayPal overhead low. Because we aren't a bank, we have to expire credits after a certain amount of time. We expire deposit credits after a year, but other types of credits (bonuses, prizes, refunds) may have a different shelf-life. When a buyer buys an item, we spend the credit that is going to expire first. Our current system keeps track of every deposit by storing the original value and the remainder to be spent. We keep a list of all purchases as well, of course. I am currently moving to a system which is much more like a traditional double-entry accounting system. A deposit will create a ledger item, increasing the user's 'spending' account balance. Every purchase will also create a ledger item, decreasing the user's 'spending' account balance. The new system has running balances, while the old system does not, which greatly improves our ability to find problems and do reconciliations. We do not want to use the old system of keeping a 'remainder' value attached to each deposit record because it is inefficient to replay a user's activities to calculate what the remainder of each deposit is over time (for the user's statement). So, after all of this verbose introduction, my question is "Does anyone else out there have a similar system of expiring credits?" If you could describe how you calculate expired credits it would be a great help. If all expired credits had the exact same shelf life, we would be able to calculate the expired amount using: Total Deposits - Total Spending - Deposits Not Due To Expire = Amount to Expire However, because deposits can have different shelf lives, this formula does not work because more than one deposit can be partially spent at any given time.

    Read the article

  • Overflow exception while performing parallel factorization using the .NET Task Parallel Library (TPL

    - by Aviad P.
    Hello, I'm trying to write a not so smart factorization program and trying to do it in parallel using TPL. However, after about 15 minutes of running on a core 2 duo machine, I am getting an aggregate exception with an overflow exception inside it. All the entries in the stack trace are part of the .NET framework, the overflow does not come from my code. Any help would be appreciated in figuring out why this happens. Here's the commented code, hopefully it's simple enough to understand: class Program { static List<Tuple<BigInteger, int>> factors = new List<Tuple<BigInteger, int>>(); static void Main(string[] args) { BigInteger theNumber = BigInteger.Parse( "653872562986528347561038675107510176501827650178351386656875178" + "568165317809518359617865178659815012571026531984659218451608845" + "719856107834513527"); Stopwatch sw = new Stopwatch(); bool isComposite = false; sw.Start(); do { /* Print out the number we are currently working on. */ Console.WriteLine(theNumber); /* Find a factor, stop when at least one is found (using the Any operator). */ isComposite = Range(theNumber) .AsParallel() .Any(x => CheckAndStoreFactor(theNumber, x)); /* Of the factors found, take the one with the lowest base. */ var factor = factors.OrderBy(x => x.Item1).First(); Console.WriteLine(factor); /* Divide the number by the factor. */ theNumber = BigInteger.Divide( theNumber, BigInteger.Pow(factor.Item1, factor.Item2)); /* Clear the discovered factors cache, and keep looking. */ factors.Clear(); } while (isComposite); sw.Stop(); Console.WriteLine(isComposite + " " + sw.Elapsed); } static IEnumerable<BigInteger> Range(BigInteger squareOfTarget) { BigInteger two = BigInteger.Parse("2"); BigInteger element = BigInteger.Parse("3"); while (element * element < squareOfTarget) { yield return element; element = BigInteger.Add(element, two); } } static bool CheckAndStoreFactor(BigInteger candidate, BigInteger factor) { BigInteger remainder, dividend = candidate; int exponent = 0; do { dividend = BigInteger.DivRem(dividend, factor, out remainder); if (remainder.IsZero) { exponent++; } } while (remainder.IsZero); if (exponent > 0) { lock (factors) { factors.Add(Tuple.Create(factor, exponent)); } } return exponent > 0; } } Here's the exception thrown: Unhandled Exception: System.AggregateException: One or more errors occurred. --- > System.OverflowException: Arithmetic operation resulted in an overflow. at System.Linq.Parallel.PartitionedDataSource`1.ContiguousChunkLazyEnumerator.MoveNext(T& currentElement, Int32& currentKey) at System.Linq.Parallel.AnyAllSearchOperator`1.AnyAllSearchOperatorEnumerator`1.MoveNext(Boolean& currentElement, Int32& currentKey) at System.Linq.Parallel.StopAndGoSpoolingTask`2.SpoolingWork() at System.Linq.Parallel.SpoolingTaskBase.Work() at System.Linq.Parallel.QueryTask.BaseWork(Object unused) at System.Linq.Parallel.QueryTask.<.cctor>b__0(Object o) at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Linq.Parallel.QueryTaskGroupState.QueryEnd(Boolean userInitiatedDispose) at System.Linq.Parallel.SpoolingTask.SpoolStopAndGo[TInputOutput,TIgnoreKey](QueryTaskGroupState groupState, PartitionedStream`2 partitions, SynchronousChannel`1[] channels, TaskScheduler taskScheduler) at System.Linq.Parallel.DefaultMergeHelper`2.System.Linq.Parallel.IMergeHelper<TInputOutput>.Execute() at System.Linq.Parallel.MergeExecutor`1.Execute[TKey](PartitionedStream`2 partitions, Boolean ignoreOutput, ParallelMergeOptions options, TaskScheduler taskScheduler, Boolean isOrdered, CancellationState cancellationState, Int32 queryId) at System.Linq.Parallel.PartitionedStreamMerger`1.Receive[TKey](PartitionedStream`2 partitionedStream) at System.Linq.Parallel.AnyAllSearchOperator`1.WrapPartitionedStream[TKey](PartitionedStream`2 inputStream, IPartitionedStreamRecipient`1 recipient, BooleanpreferStriping, QuerySettings settings) at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.ChildResultsRecipient.Receive[TKey](PartitionedStream`2 inputStream) at System.Linq.Parallel.ScanQueryOperator`1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) at System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient) at System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings) at System.Linq.Parallel.QueryOpeningEnumerator`1.OpenQuery() at System.Linq.Parallel.QueryOpeningEnumerator`1.MoveNext() at System.Linq.Parallel.AnyAllSearchOperator`1.Aggregate() at System.Linq.ParallelEnumerable.Any[TSource](ParallelQuery`1 source, Func`2 predicate) at PFact.Program.Main(String[] args) in d:\myprojects\PFact\PFact\Program.cs:line 34 Any help would be appreciated. Thanks!

    Read the article

  • How do I convert decimal numbers to binary in Perl?

    - by David
    I am trying to make a program that converts decimal numbers or text into binary numbers in perl. The program asks for user input of a character or string , and then prints out the result to the console. How do I do this? My code I have been working on is below, but i cannot seem to fix it. print "Enter a number to convert: "; chomp($decimal = <STDIN>); print "\nConverting $number to binary...\n"; $remainder = $decimal%2; while($decimal > 0) { $decimal/2; print $remainder; }

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >