Search Results

Search found 5070 results on 203 pages for 'algorithm'.

Page 142/203 | < Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >

  • How does Microsoft generate the Event ID for winqual events?

    - by Tim
    I am curious about the IDs that are used to identify items in winqual. I assume it is some sort of hash. Is this published? Hash of the module name, its version and an offset? That seems appropriate but the size is too small to cover the possibilities unless some truncation/lossy algorithm is used. This seems to be generated with the minidump on the client machine.

    Read the article

  • Rectangles Covering

    - by den bardadym
    I have N rectangles with sides parallel Ox and Oy. Exists another rectangele (model). I need create algorithm, which can tell: is model covered by N rectangles? and code him. I have some ideas. First I think need sort rectangles by left side (it can be done by O(n log n)). Then I think need use vertical sweeping line. Thanks.

    Read the article

  • Matrix "Zigzag" Reordering

    - by fbrereto
    I have an NxM matrix in Matlab that I would like to reorder in similar fashion to the way JPEG reorders its subblock pixels: (referenced from here) I would like the algorithm to be generic such that I can pass in a 2D matrix with any dimensions. I am a C++ programmer by trade and am very tempted to write an old school loop to accomplish this, but I suspect there is a better way to do it in Matlab.

    Read the article

  • C# A random BigInt generator

    - by Tony
    Hi, I'm about to implement the DSA algorithm, but there is a problem: choose "p", a prime number with L bits, where 512 <= L <= 1024 and L is a multiple of 64 How to implement a random generator of that number? Int64 has "only" 63 bits length

    Read the article

  • How to use a separate class to validate credit card numbers in C#

    - by EvanRyan
    I have set up a class to validate credit card numbers. The credit card type and number are selected on a form in a separate class. I'm trying to figure out how to get the credit card type and number that are selected in the other class (frmPayment) in to my credit card class algorithm: public enum CardType { MasterCard, Visa, AmericanExpress } public sealed class CardValidator { public static string SelectedCardType { get; private set; } public static string CardNumber { get; private set; } private CardValidator(string selectedCardType, string cardNumber) { SelectedCardType = selectedCardType; CardNumber = cardNumber; } public static bool Validate(CardType cardType, string cardNumber) { byte[] number = new byte[16]; int length = 0; for (int i = 0; i < cardNumber.Length; i++) { if (char.IsDigit(cardNumber, i)) { if (length == 16) return false; number[length++] = byte.Parse(cardNumber[i]); //not working. find different way to parse } } switch(cardType) { case CardType.MasterCard: if(length != 16) return false; if(number[0] != 5 || number[1] == 0 || number[1] > 5) return false; break; case CardType.Visa: if(length != 16 & length != 13) return false; if(number[0] != 4) return false; break; case CardType.AmericanExpress: if(length != 15) return false; if(number[0] != 3 || (number[1] != 4 & number[1] != 7)) return false; break; } // Use Luhn Algorithm to validate int sum = 0; for(int i = length - 1; i >= 0; i--) { if(i % 2 == length % 2) { int n = number[i] * 2; sum += (n / 10) + (n % 10); } else sum += number[i]; } return (sum % 10 == 0); } }

    Read the article

  • 50 sequences in one line

    - by user343934
    I have alignment file and long record in it. Suppose while displaying to an end user i want to show Sequence ID and 50 sequences in each line and continue further till the end of file. Can anyone suggest me algorithm or example code in python. Thanks in advance

    Read the article

  • How to generate irregular ball shapes?

    - by tomato
    What kind of algorithms would generate random "goo balls" like those in World of Goo. (btw, if you haven't played it yet, highly recommended). I'm using Proccesing, but any generic algorithm would do. I guess it boils down to how to "randomly" make balls that are kind of round, but not perfectly round, and still looking realistic. Thanks in advance!

    Read the article

  • LZMA compression settings details

    - by Shadi
    Hi everyone, I really need to know what each lzma parameter (mf, fb, lp, ...) means. I could not find any good documentation in the internet. I need details of this algorithm. the most detailed one is: http://www.bugaco.com/7zip/MANUAL/switches/method.htm I would appreciate any help. Best wishes, Shadi.

    Read the article

  • Exception in thread "main" java.lang.OutOfMemoryError, How to find and fix??

    - by or.nomore
    hey, I'm trying to programming a crossword creator. using a given dictionary txt file and a given pattern txt file. The basic idea is using DFS algorithm. the problem begin when the dictionary file is v-e-r-y big (about 50000 words). then i recive the : Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded i know that there is a part in my program that waists memory, but i don't know where it is, how to find it and how to fix it

    Read the article

  • Forcing deallocation of large cache object in Java

    - by Jack
    I use a large (millions) entries hashmap to cache values needed by an algorithm, the key is a combination of two objects as a long. Since it grows continuously (because keys in the map changes, so old ones are not needed anymore) it would be nice to be able to force wiping all the data contained in it and start again during the execution, is there a way to do effectively in Java? I mean release the associated memory (about 1-1.5gb of hashmap) and restart from the empty hashmap..

    Read the article

  • Negative numbers, arrays javascript!

    - by zizzamia
    I was implementing a routing algorithm in javascript, but when I assign a negative one variable in the array gives me this error: invalid array length. var node = new Array() node[0] = new Array(6,7) node[1] = new Array(5,-4,8) node[2] = new Array(-2) //Here, invalid array length I do not know how to resolve this error.

    Read the article

  • String Processing Algorithms..

    - by RBA
    Hi, Please share some good websites where I can learn more on String Processing Techniques and could grill myself more into different kinds of algorithm available in this field.. Thanks..

    Read the article

  • Finding N contiguous zero bits in an integer to the left of the MSB position of another integer

    - by James Morris
    The problem is: given an integer val1 find the position of the highest bit set (Most Significant Bit) then, given a second integer val2 find a contiguous region of unset bits, with the minimum number of zero bits given by width to the left of the position (ie, in the higher bits). Here is the C code for my solution: typedef unsigned int t; unsigned const t_bits = sizeof(t) * CHAR_BIT; _Bool test_fit_within_left_of_msb( unsigned width, t val1, t val2, unsigned* offset_result) { unsigned offbit = 0; unsigned msb = 0; t mask; t b; while(val1 >>= 1) ++msb; while(offbit + width < t_bits - msb) { mask = (((t)1 << width) - 1) << (t_bits - width - offbit); b = val2 & mask; if (!b) { *offset_result = offbit; return true; } if (offbit++) /* this conditional bothers me! */ b <<= offbit - 1; while(b <<= 1) offbit++; } return false; } Aside from faster ways of finding the MSB of the first integer, the commented test for a zero offbit seems a bit extraneous, but necessary to skip the highest bit of type t if it is set. I have also implemented similar algorithms but working to the right of the MSB of the first number, so they don't require this seemingly extra condition. How can I get rid of this extra condition, or even, are there far more optimal solutions? Edit: Some background not strictly required. The offset result is a count of bits from the high bit, not from the low bit as maybe expected. This will be part of a wider algorithm which scans a 2D array for a 2D area of zero bits. Here, for testing, the algorithm has been simplified. val1 represents the first integer which does not have all bits set found in a row of the 2D array. From this the 2D version would scan down which is what val2 represents. Here's some output showing success and failure: t_bits:32 t_high: 10000000000000000000000000000000 ( 2147483648 ) --------- ----------------------------------- *** fit within left of msb test *** ----------------------------------- val1: 00000000000000000000000010000000 ( 128 ) val2: 01000001000100000000100100001001 ( 1091569929 ) msb: 7 offbit:0 + width: 8 = 8 mask: 11111111000000000000000000000000 ( 4278190080 ) b: 01000001000000000000000000000000 ( 1090519040 ) offbit:8 + width: 8 = 16 mask: 00000000111111110000000000000000 ( 16711680 ) b: 00000000000100000000000000000000 ( 1048576 ) offbit:12 + width: 8 = 20 mask: 00000000000011111111000000000000 ( 1044480 ) b: 00000000000000000000000000000000 ( 0 ) offbit:12 iters:10 ***** found room for width:8 at offset: 12 ***** ----------------------------------- *** fit within left of msb test *** ----------------------------------- val1: 00000000000000000000000001000000 ( 64 ) val2: 00010000000000001000010001000001 ( 268469313 ) msb: 6 offbit:0 + width: 13 = 13 mask: 11111111111110000000000000000000 ( 4294443008 ) b: 00010000000000000000000000000000 ( 268435456 ) offbit:4 + width: 13 = 17 mask: 00001111111111111000000000000000 ( 268402688 ) b: 00000000000000001000000000000000 ( 32768 ) ***** mask: 00001111111111111000000000000000 ( 268402688 ) offbit:17 iters:15 ***** no room found for width:13 ***** (iters is the count of iterations of the inner while loop)

    Read the article

  • SHA2 Certificates in Windows 2003 CA

    - by rursw1
    Hi all, Is it possible to create a certificate template that uses SHA-2 (sha256, sha224, sha384, sha512), from a Windows server 2003 CA? I know how to do it in Windows server 2008 based CA, with the new version (version 3) - it is possible to specify the hash algorithm (Under the "Cryptography" tab of the template properties). But is it possible in 2003 based CA? Thanks.

    Read the article

  • How to create a complete binary tree of height 'h' using Python?

    - by Jack
    Here is the node structure class Node: def __init__(self, data): # initializes the data members self.left = None self.right = None self.parent = None self.data = data complete binary tree Definition: A binary tree in which every level, except possibly the deepest, is completely filled. At depth n, the height of the tree, all nodes must be as far left as possible. -- http://www.itl.nist.gov/div897/sqg/dads/HTML/completeBinaryTree.html I am looking for an efficient algorithm.

    Read the article

  • How do you tell if two wildcards overlap?

    - by Tom Ritter
    Given two strings with * wildcards, I would like to know if a string could be created that would match both. For example, these two are a simple case of overlap: Hello*World Hel* But so are all of these: *.csv reports*.csv reportsdump.csv Is there an algorithm published for doing this? Or perhaps a utility function in Windows or a library I might be able to call or copy?

    Read the article

  • Parsing plain text to some structured object

    - by Jeriho
    I am working on parsing plain text and converting it to key-value pairs. For example, plain text: some_uninteresting_thing key1 valueA, valueB, valueC key2 valueD key3 valueE valueF key4 valueG(valueH, valueI) key5 some_uninteresting_thing valueJ some_uninteresting_thing key6 some_uninteresting_thing (key6 shouldn't be mapped because has no appropriate values) As you can see plain text is lenient. What java library can handle this? If no such library exist, any suggestions on algorithm to do this.

    Read the article

< Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >