Search Results

Search found 21356 results on 855 pages for 'check digit'.

Page 195/855 | < Previous Page | 191 192 193 194 195 196 197 198 199 200 201 202  | Next Page >

  • Erlang - list comprehensions - populating records

    - by tbikeev
    I have a simple record structure consisting of a header (H) and a list of the data lines (D) 1:N. All header lines must start with a digit. All data lines have a leading whitespace. There also might be some empty lines (E) in between that must be ignored. L = [H, D, D, E, H, D, E, H, D, D, D]. I would like to create a list of records: -record(posting,{header,data}). using list comprehension. Whats the best way to do it?

    Read the article

  • How do I left pad a database column in FrontBase?

    - by PleaseStand
    I have a table of items (let's call it WIDGET) that each have their own eight-digit barcode numbers stored in a VARCHAR field (let's call it BARCODE; the table's primary key is in a separate integer field ID). My problem is that some personnel have omitted the leading zeros instead of entering the entire number while others have not. All new data is being entered with all eight digits present, but I would like to update all the existing records (several hundred in all) to eight digits for the sake of consistency. 1 → 00000001 234 → 00000234 5678 → 00005678 00009012 → 00009012 I know FrontBase supports all of SQL-92, but SQL-92 has no function specifically for left-padding strings. I already came up with a solution, but I am posting this question to see if anyone can think of a better way of doing this than I did.

    Read the article

  • binary number comparison

    - by EquinoX
    If I have a 32 bit two's complement number and I want to know what is the easiest way to know of two numbers are equal... what would be the fastest bitwise operator to know this? I know xor'ing both numbers and check if the results are zero works well... any other one's? how about if a number is greater than 0?? I can check the 31'st bit to see if it's greater or equal to 0..but how about bgtz?

    Read the article

  • A better way of representing File Attachment into a list(c#3.0)

    - by Newbie
    I have written List<Attachment> lstAttachment = new List<Attachment>(); //Check if any error file is present in which case it needs to be send if (new FileInfo(Path.Combine(errorFolder, errorFileName)).Exists) { Attachment unprocessedFile = new Attachment(Path.Combine(errorFolder, errorFileName)); lstAttachment.Add(unprocessedFile); } //Check if any processed file is present in which case it needs to be send if (new FileInfo(Path.Combine(outputFolder, outputFileName)).Exists) { Attachment processedFile = new Attachment(Path.Combine(outputFolder, outputFileName)); lstAttachment.Add(processedFile); } Working fine and is giving the expected output. Basically I am attaching the file to the list based on whether the file is present or not. I am looking for any other elegant solution than the one I have written. Reason: Want to learn differnt ways of representing the same program. I am using C#3.0 Thanks.

    Read the article

  • PHP / XHTML. Should I place everything in echo tags?

    - by 110175914651386975417
    A quick question involving PHP development, I seem to be wondering about this more and more as I develop more complex sites. Basically say we have a basic PHP / XHTML inbox (messaging system). I perform checks at the top (check if user is logged in, check if user has correct permissions etc). Then use the 'header('location:www.abc.com)' function if the authentication fails. The question is do I write the rest of the inbox code in a huge 'else' block or just use standard html. I read somewhere about about it being bad to put any code after using the 'header' function.

    Read the article

  • 1-DimArray Counting same elements (0,1)

    - by Chris
    Hello, I have a 1-dim array that fills up a table of 40 random elements (all the values are either 0 or 1). So i wanne "count" the largest row of the values net to each otherto each other.. Meaning for example : 111100101 = the longest row would be 1111 (= 4 elements of the same kind closest to each other). So 011100 would result in the longest row being 3 elements (3 x 1). My problem i have no idea how to check upon the "next element" and check if its a 0 or 1. Like the first would be 1111 (count 4) but the next would be a 0 value = meaning i have to stop counting. My idea was placing this value (4) in a other array (example: 111100101) , and place the value of the 1's back on zero. And start the process all over again. To find the largest value i have made a other method that checks up the biggest value in the array that keeps track of the count of 0's 1's, this is not the problem. But i cannot find a way to fill the array tabelLdr up. (having all the values of the group of elements of the same kind (being 0 or 1). In the code below i have 2 if's and offcourse it will never go into the second if (to check if the next value in the array is != then its current state (being 0 or 1) Best Regards. public void BerekenDeelrij(byte[] tabel, byte[] tabelLdr) { byte LdrNul = 0, Ldréén = 0; //byte teller = 0; for (byte i = 0; i < tabel.Length; i++) { if (tabel[i] == 0) { LdrNul++; //this 2nd if cleary does not work, but i have no idea how to implend this sort of idea in my program. if (tabel[i] == 1) //if value != 0 then the total value gets put in the second array tabelLdr, { tabelLdr[i] = LdrNul; LdrNul = 0; } } if (tabel[i] == 1) { Ldréén++; if (tabel[i] == 0) { tabelLdr[i] = Ldréén; Ldréén = 0; } } }/*for*/ }

    Read the article

  • Is vim able to detect the natural language of a file, then load the correct dictionary ?

    - by Niels
    I am using several languages, and currently I am obliged to indicate to vim with which of these the spell check must be done. Is there a way to set up vim so that it automatically detects the correct one? I vaguely remember that in a previous version of vim, when the spell check was not integrated, the vimspell script made this possible. It would be even better if this could apply not only to a file but also to a portion of a file, since I frequently mix several languages in a single file. Of course, I would like to avoid to load several dictionaries simultaneously.

    Read the article

  • Reading from CSVs in Python repeatedly?

    - by matt
    I'm trying to check the value of extracted data against a csv I already have. It will only loop through the rows of the CSV once, I can only check one value of feed.items(). Is there a value I need to reset somewhere? Is there a better/more efficient way to do this? Thanks. orig = csv.reader(open("googlel.csv", "rb"), delimiter = ';') goodrows = [] for feed in gotfeeds: for link,comments in feed.items(): for row in orig: print link if link in row[1]: row.append(comments) goodrows.append(row)

    Read the article

  • XAML Binding to property

    - by imslavko
    I have check box in my XAML+C# Windows Store application. Also I have bool property: WindowsStoreTestApp.SessionData.RememberUser which is public and static. I want check box's property IsChecked to be consistent (or binded, or mapped) to this bool property. I tried this: XAML <CheckBox x:Name="chbRemember1" IsChecked="{Binding Mode=TwoWay}"/> C# chbRemember1.DataContext = SessionData.RememberUser; Code for property: namespace WindowsStoreTestApp { public class SessionData { public static bool RememberUser { get; set; } } } But it doesn't seem to work. Can you help me?

    Read the article

  • Secure Menu Items Based on User

    - by Mike Wills
    On this winform application I am writing, I want to secure one menu item from most users. It runs a month-end and cannot be easily backed out if accidentally run. The menu option opens up a window to prompt the user for some information before processing. I don't care where exactly I do the check, but I want to be sure only certain users can run this function. A Google search (on my question title above) didn't turn up anything obvious. Can anyone point me in a direction to pick up who is signed into Windows and how to check if they are authorized?

    Read the article

  • How can i do something like IList<T>.Contains(OtherObjectType) ?

    - by Noctris
    Hi, I have the following classes: Client ClientCacheMedia ( contains Client, Media and some other parameters so it is the link between the media and the client) Media where client contains an IList. Now what i would like to do, is have a way to check if this ilist contains a certain media so : Client.ClientCacheMedia.Contains(MyMedia) is there any way to let the IList accept media as an object to match ? ( i can easily override the Equals Property on ClientCacheMedia to check if the media passed is the one that the ClientCacheMedia.Media contains, it's just the Ilist that will not accept any other object on the Contains Method.

    Read the article

  • Finding a integer number after a beginning t=

    - by user2966696
    I have a string like this: 33 00 4b 46 ff ff 03 10 30 t=25562 I am only interested in the five digits at the very end after the t= How can I get this numbers with a regular expression out of it? I tried grep t=..... but I also got all characters including the t= in the beginning, which I would like to drop? After finding that five digit number, I would like to divide this by 1000. So in the above mentioned case the number 25.562. Is this possible with grep and regular expressions? Thanks for your help.

    Read the article

  • how to do collision detection for hollow(?) movieclips in flash AS3?

    - by Pieter888
    Hey everyone, I'm making small interactive games in flash to learn AS3, now I ran into a problem that I need some help with. I need to check the collision between the player and the wall which is normally simple using the hitTestObject function. But now I made a wall object totally surrounding the player with corridors and turn, a collision playground so to speak. Now when I use the hitTestObject function to check whether the player is in collision with the wall it tells me it always collides supposedly because the player object is within the bounds of the wall object. So assuming that I'm correct about the error: How can I prevent getting a collision when I'm inside the bounds of the wall object but not touching the actual walls in that object?

    Read the article

  • Determining the level of Android permission

    - by k4b
    I have some Android permissions which I would like to know to which permision PROTECTION LEVEL they belong. Does anybody know how can this be checked? For example I need to know the PROTECTION LEVEL of android.permission.RECEIVE_BOOT_COMPLETED permission, but I would like to check many more. EDIT: I see that I didn't put it clearly: What I mean is not an API level with which permission was introduced, but permission protection level, one of four: Normal, Dangerous, Signeture, SignatureOrSystem. It determines for example how this permision is presented to user during the application installation. How can I check to which protection level certain permission belongs?

    Read the article

  • Rails subscription limitations

    - by David Lyod
    I have an application with set limits on subscription attributes i/e a user can have five projects for subscription A but have ten for subscription B At present I run a check on there current usage when linking to the create action and if they are over there limit I do not display the link to create a new project. On the view (for the new project ) I again run the check (in a helper) to see if they can create a new project and if they are not I display a message stating so and a little upgrade link. Is this a secure method of stopping a user bypassing there subscription attribute limitations ? What about direct PUT requests etc ?

    Read the article

  • How to set up a specific registration on Database

    - by ymorenz
    I'm creating a database so I can access names of people from a university. But I would like to create a registration ID for each person like 1012607, of which the first 2 numbers would be the year (11 for 2011) and the third digit would be the semester they registered (1 in the beginning of the year and 2 in the end of the year). The other 4 digits would be incremental. I don't know how to code a prefixed number in MySQL that can change only the last 4 digits and after a year change the first 2 digits every time you have a new registration. Can someone please help me?

    Read the article

  • Is checkdnsrr() function good enough to establish domain (in)availability?

    - by Stipe
    I want to create simple script to check domain availability. Can anybody tell me is this function enough to check domain availability before user can register: <?php $recordexists = checkdnsrr("www.google.com", "ANY"); if ($recordexists) echo "The domain name has been taken. Sorry!"; else echo "The domain name is available!"; ?> or should I go with some other whois script like http://www.mrscripts.co.uk/index.php?op=lite

    Read the article

  • Checking variable from a different class in C#

    - by Josh
    Greetings- I have 2 classes. One is called "Programs" and the other is called "Logs". The class called Programs has public const string m_sEnviron = ""; near the top and I need to check what the m_sEnviron variable is set to through my class called Logs. The variable m_sEnviron will get set from a scheduler called Tidal so how can I check its value from a different class. If this is not the best to do this then please let me know what the better ways are. Thanks in advance. Regards,

    Read the article

  • Recursive solution to finding patterns

    - by user2997162
    I was solving a problem on recursion which is to count the total number of consecutive 8's in a number. For example: input: 8801 output: 2 input: 801 output: 0 input: 888 output: 3 input: 88088018 output:4 I am unable to figure out the logic of passing the information to the next recursive call about whether the previous digit was an 8. I do not want the code but I need help with the logic. For an iterative solution, I could have used a flag variable, but in recursion how do I do the work which flag variable does in an iterative solution. Also, it is not a part of any assignment. This just came to my mind because I am trying to practice coding using recursion.

    Read the article

< Previous Page | 191 192 193 194 195 196 197 198 199 200 201 202  | Next Page >