Search Results

Search found 1839 results on 74 pages for 'comma separated'.

Page 40/74 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • What's the RegEx to make sure that delimiters are escaped?

    - by Kuyenda
    I'm looking for a regular expression that will check whether or not delimiters in a string are escaped with a backward slash. The delimiters I am concerned about are comma (\,), colon (\:), semicolon (\;) and of course the backward slash itself has to be escaped (\). For example, the string "test" should return a match because there are no delimiters in it, and no escaping is necessary. The string "te\;st" would return a match because the semicolon delimiter is escaped. "te;st" and "t\;s:t" would both fail because the both contain at least one delimiter that is not escaped. I know that I need a conditional and a positive look behind, and this is what I have so far, but it is not giving me the expected answer. ^(?<delimiter>[:;,\\])?(?(delimiter)\(?<=(?:\\\\)*\\)k<delimiter>|.)$ Any suggestions on how I can make this work? Thanks.

    Read the article

  • All things equal what is the fastest way to output data to disk in C++?

    - by user260197
    I am running simulation code that is largely bound by CPU speed. I am not interested in pushing data in/out to a user interface, simply saving it to disk as it is computed. What would be the fastest solution that would reduce overhead? iostreams? printf? I have previously read that printf is faster. Will this depend on my code and is it impossible to get an answer without profiling? Edit: Output data needs to be in text format, whether tab or comma separated. This will require formatting, precision, etc. Running in Windows.

    Read the article

  • Basic Objective-C syntax: "%@"?

    - by cksubs
    Hi, I'm working through the Stanford iPhone podcasts and have some basic questions. The first: why is there no easy string concatenation? (or am I just missing it?) I needed help with the NSLog below, and have no idea what it's currently doing (the %@ part). Do you just substitute those in wherever you need concatenation, and then comma separate the values at the end? NSString *path = @"~"; NSString *absolutePath = [path stringByExpandingTildeInPath]; NSLog(@"My home folder is at '%@'", absolutePath); whereas with any other programing language I'd have done it like this: NSLog(@"My home folder is at " + absolutePath); Thanks! (Additionally, any good guides/references for someone familiar with Java/C#/etc style syntax transitioning to Objective-C?)

    Read the article

  • Is it possible to keep only one Database for both web and desktop applications?

    - by B4NZ41
    I'm experiencing a trouble with my business model, let me explain better. I'm developing a software for 1 year and few months, it's for the food industry, more exactly a software to: Delivery, Take Way, Table Reservation, POS, Accounts Payable and Receivable, Prints(receipt), Kitchen Monitors Orders, Customers Orders Control and Fiscal Area. Well, I had separated the software mainly in two areas, one is web area and the other is desktop area (Used by Admins only) and local installed. 1 - Web Area (Basically do the follow:) Show Catalog with the products Customers Make Orders Customers Pay for the Orders etc ... as mentioned above 2 - Desktop Area Manage Orders Manage Customers Manage Suppliers Manage Accounts Payable and Receivable etc ... as mentioned above The web area is hosted in an online web server (scripts and database are online). The Desktop area is hosted locally in a Linux machine with a local database and local scripts files. My question is: Is it possible to keep only one Database for both applications? If YES, please what is the best approach? Follow my technical specification environment Database: Actually I have two databases working and I would love to keep only one. Operating System: Linux (Kernel 2.6.X and above) or Windows (XP and above) For the Web Area Apache, PHP, Python, Java Script, Shell Script and MySQL. For the Desktop Area: PHP-GTK2, Apache, PHP, MySQL and Shell Script.

    Read the article

  • Is there any professional way to illustrate difference between 2 diagrams?

    - by lamwaiman1988
    I made a documented which is to describe the difference between the same logical structure from different version ( e.g Structure A from version 8 and Structure A from version 9 ). Luckily I've got the logical structure diagram from the 2 functional specification. I've managed to copy the image of each logical structure and paste them in MS Word and compare the 2 version side by side. I don't know if there is a standard way to illustrate the difference. I simply draw a cross over the removed logical member from the previous version and draw a rectangle around the new logical member of the next version. I know my way is kinda childish. I am wondering how to present them professionally. In addition, You won't believe this, but MS Word doesn't have a shape of CROSS, so I am actually using a multiplication sign that look like a giant monster: This is why I hate myself. Unlike 2 separated lines, this shape is easy to use, draw and resize. I am wondering if MS Word would care about a normal cross.

    Read the article

  • Which method of adding items to the ASP.NET Dictionary class is more efficient?

    - by ahmd0
    I'm converting a comma separated list of strings into a dictionary using C# in ASP.NET (by omitting any duplicates): string str = "1,2, 4, 2, 4, item 3,item2, item 3"; //Just a random string for the sake of this example and I was wondering which method is more efficient? 1 - Using try/catch block: Dictionary<string, string> dic = new Dictionary<string, string>(); string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { try { string s2 = s.Trim(); dic.Add(s2, s2); } catch { } } } 2 - Or using ContainsKey() method: string[] strs = str.Split(','); foreach (string s in strs) { if (!string.IsNullOrWhiteSpace(s)) { string s2 = s.Trim(); if (!dic.ContainsKey(s2)) dic.Add(s2, s2); } }

    Read the article

  • Issue with a JPA query

    - by boyd4715
    I am trying to execute the following JPA query: public static final String UPDATE_INVENTORY_CUSTOMER_FOR_AMS_MAPPING = "UPDATE Inventory inventory SET" + " inventory.customer.id = :" + DataAccessConstants.PARAM_CUSTOMER_ID + " ,inventory.lastUpdateUserId = :" + DataAccessConstants.PARAM_USER_ID + " where inventory.amsConsignorName = :" + DataAccessConstants.PARAM_AMS_CONSIGNOR_NAME + " and inventory.amsConsignorOrgCd = :" + DataAccessConstants.PARAM_AMS_CONSIGNOR_ORG_CD + " and inventory.amsConsignorTypeName = :" + DataAccessConstants.PARAM_AMS_CONSIGNOR_TYPE + " and inventory.status.code in (:" + DataAccessConstants.PARAM_STATUS + ")"; but it is seeing the following: update ATL_INVENTORY, set CONSIGNOR_ID=?, LAST_UPDATE_USER_ID=? where AMS_CONSIGNOR_NAME=? and AMS_CONSIGNOR_ORG_CD=? and AMS_CONSIGNOR_TYPE_NAME=? and (CODE in (? , ? , ? , ?)) Any ideal as to why there is a comma after the table name?

    Read the article

  • Extracting Data Daily from MySQL to a Local MySQL DB

    - by Sunny Juneja
    I'm doing some experiments locally that require some data from a production MySQL DB that I only have read access to. The schemas are nearly identical with the exception of the omission of one column. My goal is to write a script that I can run everyday that extracts the previous day's data and imports it into my local table. The part that I'm most confused about is how to download the data. I've seen names like mysqldump be tossed around but that seems a way to replicate the entire database. I would love to avoid using php seeing as I have no experience with it. I've been creating CSVs but I'm worried about having the data integrity (what if there is a comma in a field or a \n) as well as the size of the CSV (there are several hundred thousand rows per day).

    Read the article

  • What is the most concise, unambiguous syntax for operator associated methods (for overloading etc.) that doesn't pollute the namespace?

    - by Doug Treadwell
    Python tends to add double underscores before its built-in or overloadable operator methods, like __add(), whereas C++ requires declaring overloaded operators as operator + (Thing& thing) { /* code */ } for example. Personally I like the operator syntax because it seems to be more explicit and keeps these operator overloading methods separated from other methods without introducing weird prefix notation. What are your thoughts? Also, what about the case of built-in methods that are needed for the programming language to work properly? Is name mangling (like adding __ prefix or sys or something) the best solution here? What do you think about having another type of method declaration, like ... "system method" for lack of creativity at the moment. So there would be two kinds of declarations: int method_name() { ... } system int method_name() { ... } ... and the call would need to be different to distinguish between them. obj.method_name(); vs obj:method_name(); perhaps, assuming a language where : can be unambiguously used in this situation. obj.method_name() vs obj.(system method_name)() Sure, the latter is ugly, but the idea is to make the common case simple and system stuff should be kept out of the way. Maybe the Objective-C notation of method calls? [obj method_name]? Are there more alternatives? Please make suggestions.

    Read the article

  • Retrive multiple values from single dimension value / key JSON

    - by jonnypixel
    I'm busting my head trying to work this out. "ContentBlock1":["2","22"] I have been trying to get the 2 and the 22 into a comma sepertaed string so i can use it within a MySQL IN(2,22) query. I currently have tried several ways but none seem to work for me. $ContentBlock = my json data; $cid = json_decode($ContentBlock,true); foreach ($cid as $key){ $jsoncid = "$key ,"; } And then: SELECT * FROM content WHERE featured=1 AND state=1 AND catid IN($jsoncid) ORDER BY ordering ASC LIMIT 4");

    Read the article

  • Best way to find all input elements inside a form using jQuery

    - by Aayush
    I need to find all form elements inside inside a form and trigger a flag on change in the value. Currently I am using the method below. I am not sure if this works or not. But It surely works for: .find('input[type=text]) $('#form').find('input[type=text], input[type=radio], input[type=checkbox], select, textarea').each(function(){ $(this).change(function(){ if( change !== 1 ) change = 1; }); }) Now I have added multiple elements with the comma. Will this work and is this the best way to do this. Appreciate all the help. Thanks!

    Read the article

  • Need help with Excel 2007 Formula - Many to many update

    - by Monica
    I'm experienced with database development, but not so much with Excel. I'm looking for help writing an Excel formula that would help my client's spreadsheet behave like a database. This is what I'm looking to do, but I can't figure out how to write it in Excel 2007: "If Q4 (on sheet 2) contains A2 (on sheet 1), append A1 (on sheet 1) with Q5 (on sheet 2)" Some factors: 1) This formula may find multiple instances of A2, so it should not stop after finding the first match 2) The values, as they are created in A1, should be separated with comma and space 3) This is a many to many relationship between Q4 and A2 Thanks for any help with this. I've tried vlookups, match, if statements, but they all fall short in one way or another.

    Read the article

  • Difference of answers while using split function in Ruby

    - by N L
    Given the following inputs: line1 = "Hey | Hello | Good | Morning" line2 = "Hey , Hello , Good , Morning" file1=length1=name1=title1=nil Using ',' to split the string as follows: file1, length1, name1, title1 = line2.split(/,\s*/) I get the following output: puts file1,length1,name1,title1 >Hey >Hello >Good >Morning However, using '|' to split the string I receive a different output: file1, length1, name1, title1 = line2.split(/|\s*/) puts file1,length1,name1,title1 >H >e >y Both the strings are same except the separating symbol (a comma in first case and a pipe in second case). The format of the split function I am using is also the same except, of course, for the delimiting character. What causes this variation?

    Read the article

  • JQuery Facebook like Tag feature

    - by Tech
    Hi, Does anyone know of a very basic tag JQuery script? (Facebook like tag feature) All I want to do is when I type @ in a text box for it to search an AJAX search, it then brings back a display name i.e. "Bob Johnson" and an associated Id and stores the Id in a comma delimited list. So an example would be the following .... [TextArea] [Name 1] [Name 2] [Name 3] The thing is it also needs to remove this entry (Id) once the tag gets removed, also it needs to load into a DIV which has a scrollbar so that the list doesn't get to big. If anyone know's how/if this is possible that would be great. Thanks.

    Read the article

  • Top down or bottom up approach?

    - by george_zakharov
    this is the closest I think I can get to define my problem. I'm an interface designer and now I'm working with a team of programmers to develop a new CMS for a heavy media site. I'm sorry if it's a very, very dumb question to ask here, but I really need some help. As I've started developing a specification list for a prototype it turned out a very big one. I do realize now that the client-side will be JS heavy, with lots of DnD and other "cool designer stuff". The CMS will even include a small project management system for its users, nothing big like Basecamp, but with a live feed of comments etc. The problem is the the team has now separated. Someone is proposing the existing backend solution used in other CMS, someone is proposing to rewrite everything from scratch. The point to keep the code is that it is faster, the point to rewrite is to make it better for the proposed design (include Node.js and other stuff I don't actually get). The question is — can the UI specs influence back-end? The guys that propose to use the existing solution did everything with the Yii framework (as far as I know), and they say that everything on server is not affected by this "interface coolness". Others say that it does, that even autosave can't work without server load. Please, if this is really incomprehensible, again, I'm sorry, and I'll happy to clarify it after your questions. Thanks in advance

    Read the article

  • python - selenium script syntax error

    - by William Hawkes
    Okay, I used selenium to test some automation, which I got to work. I did an export of the script for python. When I tried to run the python script it generated, it gave me a "SyntaxError: invalid syntax" error message. Here's the python script in question: from selenium import selenium import unittest, time, re class WakeupCall(unittest.TestCase): def setUp(self): self.verificationErrors = [] self.selenium = selenium("localhost", 4444, "*chrome", "http://the.web.site") self.selenium.start() def test_wakeup_call(self): sel = self.selenium sel.open("/index.php#deposit") sel.wait_for_page_to_load("30000") sel.click("link=History") sel.wait_for_page_to_load("30000") try: self.failUnless(sel.is_text_present("key phrase number 1.")) except AssertionError, e: self.verificationErrors.append(str(e)) The last line is what generated the "SyntaxError: invalid syntax" error message. A "^" was under the comma. The rest of the script goes as follows: def tearDown(self): self.selenium.stop() self.assertEqual([], self.verificationErrors) if name == "main": unittest.main()

    Read the article

  • help me with the following sql query

    - by rupeshmalviya
    could somebody correct my following query, i am novice to software development realm, i am to a string builder object in comma separated form to my query but it's not producing desired result qyery is as follows and string cmd = "SELECT * FROM [placed_student] WHERE passout_year=@passout AND company_id=@companyId AND course_id=@courseId AND branch_id IN('" + sb + "')"; StringBuilder sb = new StringBuilder(); foreach (ListItem li in branch.Items) { if (li.Selected == true) { sb.Append(Convert.ToInt32(li.Value) +", "); } } li is integer value of my check box list which are getting generated may be differne at different time ...please also suggest me some good source to learn sql..

    Read the article

  • User interface for addition/deletion of items to a list?

    - by agentcris
    I have a ban list that I'm building as part of an application that displays articles. This ban list will contain keywords, which if found in an article, would lead to the article disabled(the article will not be displayed on the front-end) I'm having a tough time visualizing the UI. I could always display a textarea and ask the user to enter keywords comma separated and when they want to delete again the textarea will be presented and they can edit the entered keywords. But I find my idea very unfriendly to the user. My question is how do I program the UI so that its easy to add new keywords. I also would like to be adviced on a nifty way showing the existing keywords and also deleting them. This ban list will be part of the admin panel/backend and will be accessible only to the site administrator.

    Read the article

  • High-level strategy for distinguishing a regular string from invalid JSON (ie. JSON-like string detection)

    - by Jonline
    Disclaimer On Absence of Code: I have no code to post because I haven't started writing; was looking for more theoretical guidance as I doubt I'll have trouble coding it but am pretty befuddled on what approach(es) would yield best results. I'm not seeking any code, either, though; just direction. Dilemma I'm toying with adding a "magic method"-style feature to a UI I'm building for a client, and it would require intelligently detecting whether or not a string was meant to be JSON as against a simple string. I had considered these general ideas: Look for a sort of arbitrarily-determined acceptable ratio of the frequency of JSON-like syntax (ie. regex to find strings separated by colons; look for colons between curly-braces, etc.) to the number of quote-encapsulated strings + nulls, bools and ints/floats. But the smaller the data set, the more fickle this would get look for key identifiers like opening and closing curly braces... not sure if there even are more easy identifiers, and this doesn't appeal anyway because it's so prescriptive about the kinds of mistakes it could find try incrementally parsing chunks, as those between curly braces, and seeing what proportion of these fractional statements turn out to be valid JSON; this seems like it would suffer less than (1) from smaller datasets, but would probably be much more processing-intensive, and very susceptible to a missing or inverted brace Just curious if the computational folks or algorithm pros out there had any approaches in mind that my semantics-oriented brain might have missed. PS: It occurs to me that natural language processing, about which I am totally ignorant, might be a cool approach; but, if NLP is a good strategy here, it sort of doesn't matter because I have zero experience with it and don't have time to learn & then implement/ this feature isn't worth it to the client.

    Read the article

  • .NET Format a string with fixed spaces

    - by treant
    Does the .NET String.Format method allow placement of a string at a fixed position within a fixed length string. " String Goes Here" " String Goes Here " "String Goes Here " How is this done using .NET? Edit - I have tried Format/PadLeft/PadRight to death. They do not work. I don't know why. I ended up writing my own function to do this. Edit - I made a mistake and used a colon instead of a comma in the format specifier. Should be "{0,20}". Thanks for all of the excellent and correct answers.

    Read the article

  • Why does the assignment operator return a value and not a reference?

    - by Nick Lowman
    I saw the example below explained on this site and thought both answers would be 20 and not the 10 that is returned. He wrote that both the comma and assignment returns a value, not a reference. I don't quite understand what that means. I understand it in relation to passing variables into functions or methods i.e primitive types are passed in by value and objects by reference but I'm not sure how it applies in this case. I also understand about context and the value of 'this' (after help from stackoverflow) but I thought in both cases I would still be invoking it as a method, foo.bar() which would mean foo is the context but it seems both result in a function call bar(). Why is that and what does it all mean? var x = 10; var foo = { x: 20, bar: function () {return this.x;} }; (foo.bar = foo.bar)();//returns 10 (foo.bar, foo.bar)();//returns 10

    Read the article

  • PHP, how can I produce a string, a unique list of values up to three items, for use after IN in a query?

    - by Jules
    I need to produce a string for use in an query e.g. SELECT whatever from Keywords.word IN (here); At the moment I have string which could be $search = "one word or four"; or $search = "one"; or $search = "one one"; I need to validate this into some acceptable for my query. I want a unique list of words, separated with a comma up to a maximum of three. This is what I have so far. $array = explode(" ",$search); $unique = array_unique ($array); I'm sure there must be a quicker way than evaluating each of the items for blank and selecting the first three.

    Read the article

  • Split string on first two colons

    - by Mark Miller
    I would like to split a column of strings on the first two colons, but not on any subsequent colons: my.data <- read.table(text=' my.string some.data 12:34:56:78 -100 87:65:43:21 -200 a4:b6:c8888 -300 11:bb:ccccc -400 uu:vv:ww:xx -500', header = TRUE) desired.result <- read.table(text=' my.string1 my.string2 my.string3 some.data 12 34 56:78 -100 87 65 43:21 -200 a4 b6 c8888 -300 11 bb ccccc -400 uu vv ww:xx -500', header = TRUE) I have searched extensively and the following question is the closest to my current dilemma: Split on first comma in string Thank you for any suggestions. I prefer to use base R.

    Read the article

  • C# Replace two specific commas in a string with many commas

    - by Hal
    I am trying to change the date format in each line from commas to hyphens. The index of the comma separating the month and day day and year varies. lines_in_List[i] = lines_in_List[i].Insert(0, cnt + ","); // Insert Draw # in 1st column string one_line = lines_in_List[i]; // 0,5,1,2012,1,10,19,16,6,36,,, // 1,11,5,2012,49,35,23,37,38,28,,, // 2,12,10,2012,8,52,53,54,47,15,,, // ^-^--^ replace the ',' with a '-'. StringBuilder changed = new StringBuilder(one_line); changed[3] = '-'; changed[5] = '-'; changed[3] = '-'; lines_in_List[i] = changed.ToString(); }

    Read the article

  • Removing repeated characters, including spaces, in one line

    - by Thumper
    I currently have a string, say $line='55.25040882, 3,,,,,,', that I want to remove all whitespace and repeated commas and periods from. Currently, I have: $line =~ s/[.,]{2,}//; $line =~ s/\s{1,}//; Which works, as I get '55.25040882,3', but when I try $line =~ s/[.,\s]{2,}//; It pulls out the ", " and leaves the ",,,,,,". I want to retain the first comma and just get rid of the whitespace. Is there a way to elegantly do this with one line of regex? Please let me know if I need to provide additional information.

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >