Search Results

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

Page 28/74 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • What's the fastest way to check if a word from one string is in another string?

    - by Mike Trpcic
    I have a string of words; let's call them bad: bad = "foo bar baz" I can keep this string as a whitespace separated string, or as a list: bad = bad.split(" "); If I have another string, like so: str = "This is my first foo string" What's the fasted way to check if any word from the bad string is within my comparison string, and what's the fastest way to remove said word if it's found? #Find if a word is there bad.split(" ").each do |word| found = str.include?(word) end #Remove the word bad.split(" ").each do |word| str.gsub!(/#{word}/, "") end

    Read the article

  • how to load json in separate method

    - by frosty
    I need to generate the playlist dynamically. What is the best way to extract the playlist so that the playlist json below is separated into a different method or variable. $f(videoid, "/swf/flowplayer-3.1.5.swf", { playlist: [ { url: videoUrl }, { url: '59483.flv', title: 'Palm trees and the sun' }, { url: '58192.flv', title: 'Happy feet in a car' }, { url: '63617.flv', title: 'People jogging' } ], wmode: 'opaque', plugins: { gatracker: { url: "/swf/flowplayer.analytics-3.1.5.swf", trackingMode: "Bridge", debug: false } } });

    Read the article

  • Delphi: Multiple tokens edit component

    - by Dorin
    Hello, I'm looking for an enchanced edit component that allow users to input multiple tokens (items) manually separated by some symbol, or to select them from another source. It's something like "TO" field in outlook or facebook that allow you to input multiple recipients. Can anyone suggest any solution? Thanks in advice!

    Read the article

  • pass ...rest to a NetConnection call

    - by dome
    I want to pass a rest in a netconnection call, something like this: public function requestData(service : String, ...params) : void { nc.call(service, params); } this doesn't work since the call is expecting each parameter to be separated by commas, like: nc.call(service, params[0], params[1], params[2]); I've read some posts about apply, but I can't find a solution for this specific case.

    Read the article

  • Regex Question ...

    - by kate
    Hi, Could someone help me with the following RegEx query: based on the following rules: 1) 1 letter followed by 4 letters or numbers, then 2) 5 letters or numbers, then 3) 3 letters or numbers followed by a number and one of the following signs: ! & @ ? You will have to allow customers to input the fidelity card code as a 15-character string, or as 3 groups of 5 chars, separated by one space.

    Read the article

  • latex computer output segments

    - by Flavius
    I have a verbatim environment containing computer output as text. This text is sematically made of two sections, each section being separated from the other by an empty line. The number of sections and their content is known, so I don't need to parse the text, but the line between the sections is very important (as it gives semantics to the "text"). Each segment is made of multiple lines. How could I write (1) and (2) on the left handside at the centre of each segment?

    Read the article

  • tool to auto-format R code

    - by Keith
    Is there any tool (editor, script, whatever...) available that can automatically reformat R code? It does not need to be customizable but it must be able to recognize statements separated by either semicolons or newlines since this code has both. If it can put all statements on a separate line, consistently indent code blocks and consistently place braces I will be very happy.

    Read the article

  • Extending Visual Studio with a Custom Designer

    - by Mick
    How do I create a custom Visual Studio 2008 UI designer for a C# file? For example, when you double click on a DataSet in the Solution Explorer, a UI screen appears that allows you to edit the DataSet, even though it is defined in XML/code (which you can right click and "View Code"). Usually this code is separated from user code in some way, either by region ("Windows Forms Designer Generated Code"), by codegen (".g.cs" for WPF XAML files), or some other means like partial classes.

    Read the article

  • Rails routes matching query parameters

    - by Harry Wood
    Rails routes are great for matching RESTful style '/' separated bits of a URL, but can I match query parameters in a map.connect config. I want different controllers/actions to be invoked depending on the presence of a parameter after the '?'. I was trying something like this... map.connect "api/my/path?apple=:applecode", :controller = 'apples_controller', :action = 'my_action' map.connect "api/my/path?banana=:bananacode", :controller = 'bananas_controller', :action = 'my_action' For routing purposes I don't care about the value of the parameter, as long as it is available to the controller in the 'params' hash

    Read the article

  • MODX parse error function implode (is it me or modx?)

    - by Ian
    Hi, I cannot for the life of me figure this out, maybe someone can help. Using MODX a form takes user criteria to create a filter and return a list of documents. The form is one text field and a few checkboxes. If both text field and checkbox data is posted, the function works fine; if just the checkbox data is posted the function works fine; but if just the text field data is posted, modx gives me the following error: Error: implode() [function.implode]: Invalid arguments passed. I've tested this outside of modx with flat files and it all works fine leading me to assume a bug exists within modx. But I'm not convinced. Here's my code: <?php $order = array('price ASC'); //default sort order if(!empty($_POST['tour_finder_duration'])){ //duration submitted $days = htmlentities($_POST['tour_finder_duration']); //clean up post array_unshift($order,"duration DESC"); //add duration sort before default $filter[] = 'duration,'.$days.',4'; //add duration to filter[] (field,criterion,mode) $criteria[] = 'Number of days: <strong>'.$days.'</strong>'; //displayed on results page } if(!empty($_POST['tour_finder_dests'])){ //destination/s submitted $dests = $_POST['tour_finder_dests']; foreach($dests as $value){ //iterate through dests array $filter[] = 'searchDests,'.htmlentities($value).',7'; //add dests to filter[] $params['docid'] = $value; $params['field'] = 'pagetitle'; $pagetitle = $modx->runSnippet('GetField',$params); $dests_array[] = '<a href="[~'.$value.'~]" title="Read more about '.$pagetitle.'" class="tourdestlink">'.$pagetitle.'</a>'; } $dests_array = implode(', ',$dests_array); $criteria[] = 'Destinations: '.$dests_array; //displayed on results page } if(is_array($filter)){ $filter = implode('|',$filter);//pipe-separated string } if(is_array($order)){ $order = implode(',',$order);//comma-separated string } if(is_array($criteria)){ $criteria = implode('<br />',$criteria); } echo '<br />Order: '.$order.'<br /> Filter: '.$filter.'<br /> Criteria: '.$criteria; //next: extract docs using $filter and $order, display user's criteria using $criteria... ?> The echo statement is displayed above the MODX error message and the $filter array is correctly imploded. Any help will save my computer from flying out the window. Thanks

    Read the article

  • Jquery validator plugin- Validates at least one in the group

    - by christian
    [http://jsfiddle.net/mhmBs/][1] I tried using the method that he uses in a jquery validator plugin.. My error container is separated from the form, it is outside the form. When I use that method to validated that the user input at least one from 3 input text boxes. It validates the field, but the other items to be validated is ignored specially the items before 3 input text boxes.

    Read the article

  • Reading data from text file in C

    - by themake
    I have a text file which contains words separated by space. I want to take each word from the file and store it. So i have opened the file but am unsure how to assign the word to a char. FILE *fp; fp = fopen("file.txt", "r"); //then i want char one = the first word in the file char two = the second word in the file

    Read the article

  • Proper way to use multiple stylesheets...so it WORKS?

    - by thatryan
    I am making a site where I need to have styles separated for layout, colors and typography. So basically I took my main style sheet and just copied it 3 times, and in removed everything but coloring from one, everything but type related in another and etc. But when I link to them now there must be some cascade issue or something, because a lot of the type stuff is not being applied. Is there a proper way to do this?

    Read the article

  • Shell Script - print selected columns

    - by teepusink
    Hi, I have a txt file with columns separated by tabs and based on that file, I want to create a new file that only contains information from some of the columns. This is what I have now awk '{ print $1, $5 }' filename newfilename That works except that when column 5 contains spaces e.g 123 Street, only 123 shows up and the street is considered as another column. How can I achieve what I'm trying to do? Thanks, Tee

    Read the article

  • regex breaks on \n

    - by Sourabh
    hi segmentText = <input from textarea>; testRgx = [/( \d+\.| [^\W\d_]\.|.)+?([!?.?](?= |$)|$)/g]; arrSegments = segmentText.match(testRgx); This expression fails if segmentText has \n or other white spaces in it.I want to add \n in to the list of chars that the above pattern use [!?.?] = [!?.?\n] so that the segment is separated based on the \n character

    Read the article

  • mvc create my own html helper, how can i access httpcontext?

    - by rj
    Hi, I've come across two recommendations for creating custom html helpers: either extend an existing one, or write your own class. I'd prefer to keep my custom code separated, it seems a bit sloppy to extend helpers for a decent-size application. But the benefit I see in extending is that 'This HtmlHelper helper' is passed as a parameter, through which I can get ViewContext.HtmlContext. My question is, how can I roll my own helper class and still have ViewContext.HtmlContext available to me? Thanks!

    Read the article

  • where to put the unittest for library in rails

    - by lidaobing
    Hello, I am a ruby and rails newbie. And I am working on a rails application with RadRails. RadRails has a "Switch to Test" function for my controller, model, etc. but not for my library. if I have class Foo::Bar in /lib/foo/bar.rb, where should I put the unittest for it? or should I separate the foo library in a separated project? Thanks.

    Read the article

  • Movable Type: Specify only one keyword from MTEntryKeywords

    - by kohei
    Hi, I have several keywords (1~3 words) stored in <MTEntryKeywords> field separated by commas. I want to take out the first keyword from MTEntryKeywords. Example 1: In the Keywords field I have entered: gadgets,phone,apple, Want to display: gadgets Example 2: In the Keywords field I have entered: food,coffee,apple, Want to display: food Any ideas?

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >