Search Results

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

Page 191/855 | < Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >

  • How to restrict the range of elements of C++ STL vector?

    - by cambr
    vector<int> l; for(int i=0;i<10;i++){ l.push_back(i); } I want the vector to only be able to store numbers from a specified range (or set). How can that be done, in general? In particular, I want to restrict the vector to beonly be able to store single digits. So, if I do a l[9]++, it should give me an error or warn me. (because 10 is not a single digit number). Similarly, l[0]-- should warn me. Is there a way to do this using C++ STL vector?

    Read the article

  • TFS get command erroneously returns "All files are up to date."

    - by NathanE
    We are just in the process of migrating our TFS repo to Mercurial as we've had enough of TFS. Unfortunately TFS has thrown us one last curve ball before it lets us go. We've wrote a script that we intend to have "get" each changeset (including timestamp, check-in comment etc) and then add them to the Mercurial repo and check it in. Unfortunately TFS is acting very strange when we execute the tf get * /version:C111 /overwrite command. It immediately returns "All files are up to date." But this is impossible. The workspace folder is empty! And viewing the details for the 111 changeset quite clearly shows that the changeset contains "stuff" i.e. the repo is certainly not empty. What could be causing this?

    Read the article

  • how to write regular expression to validate a string using regex in C#

    - by Charu
    I need to validate a user input based on condition. i wrote a regular expression to do so, but it's failing not sure why. Can somebody point where i am making mistake? Regex AccuracyCodeHexRegex = new Regex(@"^[PTQA]((0|8)[01234567]){2}$"); This is what i am trying to validate(If the string is a subset of these strings then it is valid): Phh, Thh, Qhh, Ahh where 'h' is a hex digit in the set {00, 80, 01, 81, 02, 82, 03, 83, 04, 84, 05, 85, 06, 86, 07, 87} Ex: P00 is valid P20 is not valid

    Read the article

  • How can I change column fore color in DataGridview as per condition?

    - by Ashish
    hi, i have one table like employee and one of its row is 'status' if status value is 'approve' then i want to show that row in green color and else i want to show it in red color. i have tried following but not working if (e.Row.RowType == DataControlRowType.Header) { string status = DataBinder.Eval(e.Row.DataItem, "IsApprove").ToString(); if (status == "pending") { e.Row.ForeColor = System.Drawing.Color.Red; // Change the row's Text color } } ALSO THIS ONE private void gvleavedetail_cellformatting(object sender, datagridviewcellformattingeventargs e) { // if the column is the artist column, check the // value. if (this.gvleavedetail.columns[e.columnindex].name == "artist") { if (e.value != null) { // check for the string "pink" in the cell. string stringvalue = (string)e.value; stringvalue = stringvalue.tolower(); if (stringvalue == "high") { e.cellstyle.backcolor = color.pink; } } } But in this case i'm getting error for datagridviewcellformattingeventargs I'm using VS2010

    Read the article

  • Assembly 6800 Looping? Testing specific bits in a word.

    - by Jeremy
    Hi all, Trying to help a friend out with a friend out with some assembly code, but I've run into a small problem. I'm trying to work out how I would loop through a 8 bit binary word and check the value of specific bits. I need to check bits 1, 3, 5 & 7 to see if they are 1. i.e. int count = 1; int bitAdd = 0; foreach (var bit in word) { if (count = 1 || count = 3 || count = 5 || count = 7) { bitAdd += 1; } count += 1; } Help is much appreciated.

    Read the article

  • Can using Chronic impair you sense of time?

    - by Trip
    Haha.. I'm using Chronic to parse the time users add in the Calendar. Where the code works and implements the right time, the end result is that, IF a user adds a time, then it has no date, and because it has no date, it will not show in results. Any ideas? def set_dates unless self.natural_date.blank? || Chronic.parse(self.natural_date).blank? # check if we are dealing with a date or a date + time if time_provided?(self.natural_date) self.date = nil self.time = Chronic.parse(self.natural_date) else self.date = Chronic.parse(self.natural_date).to_date self.time = nil end end unless self.natural_end_date.blank? || Chronic.parse(self.natural_end_date).blank? # check if we are dealing with a date or a date + time if time_provided?(self.natural_end_date) self.end_date = nil self.end_time = Chronic.parse(self.natural_end_date) else self.end_date = Chronic.parse(self.natural_end_date).to_date self.end_time = nil end end end

    Read the article

  • Suppress checking for changes on file system in Eclipse RCP

    - by panschk
    Okay, I guess this question is too difficult, but it's worth a try. I have an eclipse RCP application that edits HTML-files. I deal with the content of the files only in a W3C-Dom representation. There is some stuff that I can not do with that, so I the program edits each file each time after it is saved (save, save as). Of course, the file is then out of synch with the file system, and the next time I touch it, eclipse complains: "The file has been changed on the file system. Do you want to replace the editor contents with these changes? (Yes/No)" I do not want to load the changes into the editor ("No") Maybe there is a way to tell Eclipse programmatically to not check that file for changes, or to configure it to not check for changes on any file? edit: Everything has to be done either programatically or by editing some XML files. I can not expect the user to do anything;-)

    Read the article

  • Best way to fix an out-of-sync TFS workspace after a back-up/restore

    - by DanO
    Wednesday I had to restore from a back-up image I made on Monday. At the time of the snapshot I had about 20 files modified, which I later checked in, and more, on Tuesday. Now that I am back to a snapshot from Monday morning, my workspace has all of these files checked-out or added, etc. even my check-in comments and work-item associations. But I already did that check-in on Tuesday. I'm thinking I will shelve all the pending changes (just in-case), and then just undo all changes, and get latest (specific version). And I should be back to good. Any cautions or suggestions? (TFS 2008, VS2010)

    Read the article

  • SQL Server 2000, how to automate import data from excel

    - by Stan
    Say the source data comes in excel format, below is how I import the data. Converting to csv format via MS Excel Roughly find bad rows/columns by inspecting backup the table that needs to be updated in SQL Query Analyzer truncate the table (may need to drop foreign key constraint as well) import data from the revised csv file in SQL Server Enterprise Manager If there's an error like duplicate columns, I need to check the original csv and remove them I was wondering how to make this procedure more effecient in every step? I have some idea but not complete. For step 2&6, using scripts that can check automatically and print out all error row/column data. So it's easier to remove all errors once. For step 3&5, is there any way to automatically update the table without manually go through the importing steps? Could the community advise, please? Thanks.

    Read the article

  • PHP and MySQL SELECT problem.

    - by R.I.P.coalMINERS
    Trying to check if a name is already stored in the database from the login user. The name is a set of dynamic arrays entered by the user threw a set of dynamic form fields added by the user. Can some show me how to check and see if the name is already entered by the login user? I know my code can't be right. Thanks! MySQL code. SELECT * FROM names WHERE name = '" . $_POST['name'] . "' AND userID = '$userID' Here is the MySQL table. CREATE TABLE names ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, userID INT NOT NULL, name VARCHAR(255) NOT NULL, meaning VARCHAR(255) NOT NULL, PRIMARY KEY (id) );

    Read the article

  • Assistance with regular expressions in Python

    - by da5id
    I am still learning REGEX, and I've run into an issue ... I am trying to separate a string that is composed of a mixture of letters and numbers that are in decimal format: AB0.500CD1.05EF2.29 Into something like this: list1 = AB,CD,EF list2 = 0.500,1.05,2.29 A complication to all this is that I also have strings that look like this: AB1CD2EF3 Which I'd also like to separate into this: list1 = AB,CD,EF list2 = 1,2,3 A previous inquiry yielded the following snippet, import re pattern = re.compile(r'([a-zA-Z]+)([0-9]+)') for (letters, numbers) in re.findall(pattern,cmpnd): print numbers print letters This example works fine for strings of the 2nd kind, but only "finds" the leading digit in the numbers that contain decimal places in the strings of the first kind. I've attempted an approach using the following line: pattern = re.compile(r'([a-zA-Z]+)([0-9]+(\.[0-9]))') But this results in an error: "ValueError: too many values to unpack" Thanks for any and all assistance!

    Read the article

  • [WordPress 3.1.3] Sreen option is disabled when a plugin is activated

    - by RNorbe
    I'm pretty new to wordpress. I was assigned to create a custom plugin for one of our projects here. The plugin worked as expected and there is no problem activating/deactivating it. When I was exploring the admin panel I noticed that the screen option is off. I read from a blog somewhere that deactivating the plugin one by one to check which plugin has caused this. I did just this and found out that the custom plugin I created was the cause. My question is, is there way to check what have caused this? Some log file I can look into? There is no error message or warning when I activated the plugin and it is giving the output required. This is my first plugin, any advice will be helpful. Btw, this plugin will display a comment (most recent will be shown first) in a widget and there is prev/next navigation to go through the rest of the comments. Thanks, RNorbe

    Read the article

  • 404 on custom post types after updating Wordpress to 3.7

    - by Chris
    Since I updated Wordpress from 3.6 to 3.7, I'm not able to visit the single-pages on my custom post types, then I get a 404 error. I thought this would be a rewrite_rules issue, so I've tried the following: -Go to the Permalink settings, click save (flush rewrites) -Manually deleted the rewrite_rules from the option table in the DB (I was desparate, and it seriously worked for me one time) -Re-check my .htaccess, but this is the exactly same as instructed on the permalink page -switched off the plugins I also tried switching the permalink to the "ugly" url (eg. ?page=35) and check if the articles worked, and they did! So I'm pretty sure it's a permalink issue. Now I rolled back to 3.6 again, but I of course want to upgrade in the near future (security etc.). A remarkable thing was that during the rollback I checked out a single page (notice that I didn't rolled back the database yet, only the files) and surprisingly they worked again. Any suggestions on how to solve this?

    Read the article

  • Correct expression for checking leap years

    - by Debanjan
    What will be the exact definition of leap year? AFAIK "A year which is divisible by 4 is a leap year. But for century years' the years which are divisible by 400 is a leap year." But that definition makes 100, 200, 300, 400.... upto 1700 NOT LEAP years! But in Gregorian calendar all of them are all leap year, check this out. You can also try "call 1700" in Linux to verify. So the correct algorithm for leap years would be: if ( (year % 4 == 0) && ( year <= 1700 || year % 100 != 0 || year % 400 == 0 )) printf("%d is a leap year.\n", year); else printf("%d is not a leap year.\n", year); But is this specific to Gregorian calendar? Even if that is the case why is it not mentioned here? Regards, PS:The history of Gregorian callender seems interesting check out the September month of 1752.

    Read the article

  • What makes a web site 'finished' for delivery to a client?

    - by AP257
    Hi, Sorry if this question has already been answered, and sorry if it's too subjective to make sense, or for StackOverflow. I'm delivering a site to a client and I want to send them high-quality HTML/CSS/JS, fully validated, accessible etc. So I'm compiling a list of things to check, and useful tools for doing so, before I hand the code over. Here's a partial list, but what am I missing? Link checking for any broken links I might have missed - W3C link checker HTML validation for accessibility and broken-ness - W3C HTML validator CSS validation - W3C CSS validator Check for slow-loading page elements - Firebug and YSlow plugin What's missing - if you were a client, what else would you want to be sure has been checked? I'm wondering about the etiquette of things like comments, indentation, and minification; is it good practice to sort out all these? And what else have I missed? Thanks :)

    Read the article

  • [php + mysql] Save IP in database

    - by Knarf
    When a user logs inn I want to save their IP in the database. How would I do that? What type is best to use for the MySQL field? How would the PHP code to get IP look like? I'm thinking of using it as an extra security feature for the login/session stuff. I'm thinking of checking the IP the user logged in with from the DB with the IP the user have now as addition to checking the session. So that it first check the session, and then check if you have a valid IP. Is that an allright extra feature? And what other things can I do to make it more secure?

    Read the article

  • How to remove all words written in capital letters ONLY (by using sed and/or awk)

    - by Virtual_Lotos
    I am trying to delete all words written in capital letters only by using sed: sed -r "s/\b[A-Z]\w*\s*//g" < file1 > file2 But this solution capture all the words starting with capital letters and delete them (this in not the goal). Here's an example: file1 content: AAAAAAAAAAAA BBbbbbb AbAbAbAb aaaaaBBBBB AAAAAA BBBBBB A1-B1 a1-b1 A1-b1 AA AAAAA BBBBB AAAAA Abbbb AAA AAAAA AAAABB Abbbb Baaaa Aaaaa AB AAAAAA1 BBBBBBb AAAAAA 1 BBBBBB b Result should be like this (file2 content): BBbbbbb AbAbAbAb aaaaaBBBBB A1-B1 a1-b1 A1-b1 AA Abbbb AAA Abbbb Baaaa Aaaaa AB AAAAAA1 BBBBBBb AAAAAA 1 BBBBBB b Each line of at least one digit or one lowercase letter should remain intact (should not be deleted).

    Read the article

  • Javascript split with RegEx

    - by Rohan
    Hey again, I just asked a question about Regex, and received a great answer: http://stackoverflow.com/questions/3047201/javascript-split-without-losing-character Now, I have another question. My current Regex looks like this: var split = text.split(/(?=\w*\d*\d:\d\d)/); Basically, I'm trying to split using the timestamps (eg - 9:30 or 10:30, the difference between them is the extra digit in the latter). How do I go about this? Currently, if I have these two: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. The splits are : 9:30 pm The user did action A. ---- 1 ---- 0:30 pm Welcome, user John Doe. How do I add an optional check for the first character in the timestamp? Thanks!

    Read the article

  • How do I prevent buffer overflow converting a double to char?

    - by Tommy
    I'm converting a double to a char string: char txt[10]; double num; num = 45.344322345 sprintf(txt, "%.1f", num); and using ".1f" to truncate the decimal places, to the tenths digit. i.e. - txt contains 45.3 I usually use precision in sprintf to ensure the char buffer is not overflowed. How can I do that here also truncating the decimal, without using snprintf? (i.e. if num = 345694876345.3 for some reason) Thanks

    Read the article

  • wxPython formatting questions

    - by Kevin
    I have an app I was working on to learn more about wxPython( I have been primarily been a scripter ). I forgot about it now I am opening it back up. It's a screen scraper, and I have it working almost the way I want it, going to build a regex parser to strip out the links in every scrape that I don't need. The questions I have are this. In it current state, if I check more than one site, it goes out and scrapes, and returns it in separate windows, the for:each section in the Clicked function. I want to put them in a frame, in the window, altogether. I also want to know if I can take the list they are read into and send it to a checklist, so someone could check off separate items, I want to build a save function and keep certain ones. In regards to a save function, I want to keep saved checks, are there calls to the widgets to save their states? I know it's a lot, but thanks for the help.

    Read the article

  • What are good Opensource Billing Solution with Customer Portal?

    - by krunaloverflow
    I'm looking for an Online Billing Solution along with a Customer Portal in open source space so that I can customize it the way as required in future. My requires are: Flat & Subscription(Periodical) based Billing (orders/invoices) Able to set products/services, its prices add customers or customers can register themselves from client end (a web page) and mange their profile themselves from customer portal, pay online, order products, check invoices, cancel order / subscription, etc. An interface (web service or API) that would provide a mechanism to check when customer recieves service, his current status and then allow them access to the services (similar to subscription membership website ) Please provide me with the options I should consider.

    Read the article

< Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >