Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 164/269 | < Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >

  • CImg compile problems in Codegear 2009

    - by Seth
    I wish to use the CImg library for image processing in my current project. I am using Codegear C++ Builder 2009. I include CImg.h in the source file and put in the following code: int rows =5; int cols = 5; CImg<double> img(rows,cols); I get the following error: [BCC32 Error] CImg.h(39159): E2285 Could not find a match for 'CImg<unsigned char>::move_to<t>(const CImg<unsigned char>)' Does anyone know if there is a #define I should be using when building in Codegear C++ Builder 2009. Or is it simply not compatible?

    Read the article

  • How to convert a function that returns a int to a function that returns a bool using boost::bind?

    - by user814628
    I have something like the following: struct A{ virtual int derp(){ if(herp()) return 1; else return 0; } void slurp(){ boost::function<bool(int x, int y> purp = /** boost bind derp to match lvalue sig **/; } } Any ideas? I want to create the function prup which basically calls derp and ignores the (x,y) passed in. I need something like bool purp(int x, int y){ return derp(); } but want to avoid creating it as a member function, and rather just create it locally if possible?

    Read the article

  • Something similar to this C# code in Ruby on Rails

    - by Jimmy
    Hey guys, I am trying to get a collection of objects based on a conditions. Now normally in C# I would do something like this employeesCollection.Where(emp => emp.Name == "john"); how can I do something similar in Ruby on Rails (I am trying to map a collection of objects to a select but I only want to map certain objects that match a condition. My current ruby on rails code looks like this <%= select( 'page', 'id', @post.pages.map {|page| [page.title, page.id]}) %> I want to add a condition to an attribute of page Can anyone help?

    Read the article

  • Trigger to update data in another DB

    - by Permana
    I have the following schema: Database: test. Table: per_login_user, Field: username (PK), password Database: wavinet. Table: login_user, Field: username (PK), password What I want to do is to create a trigger. Whenever a password field on table per_login_user in database test get updated, the same value will be copied to field password in Table login_wavinet in database wavinet I have search trough Google and find this solution: http://forums.devshed.com/ms-sql-development-95/use-trigger-to-update-data-in-another-db-149985.html But, when I run this query: CREATE TRIGGER trgPasswordUpdater ON dbo.per_login_user FOR UPDATE AS UPDATE wavinet.dbo.login_user SET password = I.password FROM inserted I INNER JOIN deleted D ON I.username = D.username WHERE wavinet.dbo.login_wavinet.password = D.password the query return error message: Msg 107, Level 16, State 3, Procedure trgPasswordUpdater, Line 4 The column prefix 'wavinet.dbo.login_wavinet' does not match with a table name or alias name used in the query.

    Read the article

  • Tips for a successful AppStore submission?

    - by Andrew Grant
    In a day or two I'll be ready to submit my iPhone app to the AppStore and I'm curious whether people who have gone through this process have any tips / suggestions for a smooth submission process. Here's things I've covered; No memory leaks Tested performance on an actual device Doesn't crash :) Using correct certificates / profile What I'm a little unsure about are how to configure the "Bundle Display Name" /"Bundle Identifier" and "Bundle Name" in info.plist. I understand the first is the text that's shown on the iPhone itself, but what about the last? Does this have to match Bundle Identifier? Are there any other things I should add to the info.plist? I've noticed that when built for Adhoc distribution my app does not have any author/title information in iTunes.

    Read the article

  • Replacing multiple patterns in a block of data

    - by VikrantY
    Hi All, I need to find the most efficient way of matching multiple regular expressions on a single block of text. To give an example of what I need, consider a block of text: "Hello World what a beautiful day" I want to replace Hello with "Bye" and "World" with Universe. I can always do this in a loop ofcourse, using something like String.replace functions availiable in various languages. However, I could have a huge block of text with multiple string patterns, that I need to match and replace. I was wondering if I can use Regular Expressions to do this efficiently or do I have to use a Parser like LALR. I need to do this in JavaScript, so if anyone knows tools that can get it done, it would be appreciated.

    Read the article

  • Bulk get of child entities on Google app engine?

    - by dfrankow
    On Google App Engine in Python, I have a Visit entity that has a parent of Patient. A Patient may have multiple visits. I need to set the most_recent_visit (and some auxiliary visit data) somewhere for later querying, probably in another child entity that Brett Slatkin might call a "relationship index entity." I wish to do so in a bulk style as follows: 1. get 100 Patient keys 2. get all Visits that have any of the Patients from 1 as an ancestor 3. go through the Visits and get the latest for each Patient Is there any way to perform step 2 in a bulk get? I know there is a way to bulk get entities from a list of keys, and there is a way to match a single entity by its ancestor.

    Read the article

  • Regex and unicode

    - by dbr
    I have a script that parses the filenames of TV episodes (show.name.s01e02.avi for example), grabs the episode name (from the www.thetvdb.com API) and automatically renames them into something nicer (Show Name - [01x02].avi) The script works fine, that is until you try and use it on files that have Unicode show-names (something I never really thought about, since all the files I have are English, so mostly pretty-much all fall within [a-zA-Z0-9'\-]) How can I allow the regular expressions to match accented characters and the likes? Currently the regex's config section looks like.. config['valid_filename_chars'] = """0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*()_+=-[]{}"'.,<>`~? """ config['valid_filename_chars_regex'] = re.escape(config['valid_filename_chars']) config['name_parse'] = [ # foo_[s01]_[e01] re.compile('''^([%s]+?)[ \._\-]\[[Ss]([0-9]+?)\]_\[[Ee]([0-9]+?)\]?[^\\/]*$'''% (config['valid_filename_chars_regex'])), # foo.1x09* re.compile('''^([%s]+?)[ \._\-]\[?([0-9]+)x([0-9]+)[^\\/]*$''' % (config['valid_filename_chars_regex'])), # foo.s01.e01, foo.s01_e01 re.compile('''^([%s]+?)[ \._\-][Ss]([0-9]+)[\.\- ]?[Ee]([0-9]+)[^\\/]*$''' % (config['valid_filename_chars_regex'])), # foo.103* re.compile('''^([%s]+)[ \._\-]([0-9]{1})([0-9]{2})[\._ -][^\\/]*$''' % (config['valid_filename_chars_regex'])), # foo.0103* re.compile('''^([%s]+)[ \._\-]([0-9]{2})([0-9]{2,3})[\._ -][^\\/]*$''' % (config['valid_filename_chars_regex'])), ]

    Read the article

  • In SQL Server merge replication, how does reinitializing work?

    - by Craig Shearer
    I have set up a pull subscription to a merge publication in SQL Server. I use parameterized row filters on some tables. This works fine with the initial synchronization - just the rows using the filter arrive in the replicated (client) database. However, at some later point I'd like to be able to synchronize the replicated database again from the server and have new rows that match the parameterized row filters appear on the client database. The doucmentation seems to indicate that I can call Reinitialize() to do this. However, when I do try this and Synchronize again, I get an error saying that the script 'snapshot.pre' cannot be applied to the database. I've inspected the script and can see why - it's trying to drop some functions are used by the tables in the database. It would appear that for Reinitialize() to work it requires that the database be blank. Am I misunderstanding something here? Is there a way to make this work?

    Read the article

  • Regular expressions and matching URLs with metacharacters

    - by James P.
    I'm having trouble finding a regular expression that matches the following String. Korben;http://feeds.feedburner.com/KorbensBlog-UpgradeYourMind?format=xml;1 One problem is escaping the question mark. Java's pattern matcher doesn't seem to accept \? as a valid escape sequence but it also fails to work with the tester at myregexp.com. Here's what I have so far: ([a-zA-Z0-9])+;http://([a-zA-Z0-9./-]+);[0-9]+ Any suggestions? Edit: The original intent was to match all URLs that could be found after the first semi colon.

    Read the article

  • Using jQuery to find keywords in string

    - by Nic Hubbard
    In php, I have used preg_match_all() to find keywords (using the format %keyword%) in a string, which works wonderfully and returns an array of all found keywords. What I would like to do, is do the same thing using jQuery or javascript. I have tried using the filter() function, and it kind of works. But I think I am missing something. How can I find ALL instances of the keyword in a string, using a regex? Here is what I have worked out so far: $("[id^='editableContent-']").filter(function() { alert($(this).html().match(/\%(.*?)\%/)); }); Any suggestions are welcome!

    Read the article

  • FileSearch strictness issue

    - by JakeTheSnake
    I'm currently trying to search directories for any file labelled "??.??.????.xls" (for mm.dd.yyyy.xls). The problem I have is that the code I'm using also matches filenames such as "my-restaurant.12.01.2006.xls". I only want to match filenames with specifically the notation I used above. Dim Invoices As FileSearch Set Invoices = Application.FileSearch With Invoices .Filename = "??.??.????.xls" ' invDir is a directory I chose earlier on .LookIn = invDir .SearchSubFolders = True .MatchTextExactly = True End With Is there something I'm missing? I know I could do yet another check in my code elsewhere to make sure the filename's length is 14 characters, but is there a parameter I'm not considering in the FileSearch?

    Read the article

  • Pointing to vectors

    - by Matt Munson
    #include <iostream> #include <vector> using namespace std; int main () { vector <int> qwerty; qwerty.push_back(5); vector <int>* p = &qwerty; cout << p[0]; //error: no match for 'operator<<' in 'std::cout << * p' } I'm generally unclear on how to use pointers with vectors, so I'm pretty mystified as to why this is not working. To my mind, this should print 5 to screen.

    Read the article

  • How does one avoid "Value restriction" errors with F#'s Seq.cast?

    - by gatoatigrado
    I see that Seq has a cast function from IEnumerable to Seq, but how do I get it to work? open System.Text.RegularExpressions;; let v = Regex.Match("abcd", "(ab)");; Seq.cast (v.Captures);; This produces, error FS0030: Value restriction. The value 'it' has been inferred to have generic type val it : seq<'_a Either define 'it' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation.

    Read the article

  • Help porting a bit of Prototype JavaScript to jQuery

    - by ewall
    I have already implemented some AJAX pagination in my Rails app by using the example code for the will_paginate plugin--which is apparently using Prototype. But if I wanted to switch to using jQuery for future additions, I really don't want to have the Prototype stuff sitting around too (yes, I know it's possible). I haven't written a lick of JavaScript in years, let alone looked into Prototype and jQuery... so I could use some help converting this bit into jQuery-compatible syntax: document.observe("dom:loaded", function() { // the element in which we will observe all clicks and capture // ones originating from pagination links var container = $(document.body) if (container) { var img = new Image img.src = '/images/spinner.gif' function createSpinner() { return new Element('img', { src: img.src, 'class': 'spinner' }) } container.observe('click', function(e) { var el = e.element() if (el.match('.pagination a')) { el.up('.pagination').insert(createSpinner()) new Ajax.Request(el.href, { method: 'get' }) e.stop() } }) } }) Thanks in advance!

    Read the article

  • How to determine if birthday or anniversary occured during date range

    - by davekaro
    Given I have a birthday/anniversary DateTime, how can I determine if that date occurred during a specific date range? For example, Birthday = 1/2/2000 Date Range = 12/25/2008 - 1/3/2009 I need a method to determine whether or not this person's birthday happened during that date range - preferably in C#. I first went about changing the year of the birthday DateTime to match the date range, then just check if the "new" birthday DateTime is between the start and end date of the date range... but when the date range spans different years, like in my example above - I had to add a nasty if statement. Is there no better way?

    Read the article

  • tfs : branch moved folder based on label or date

    - by Andy
    I've moved a folder in tfs using the "move" command but now I cannot create branches off the moved folder based on date or label (label was created when source was in the old folder). I can however create a branch based on "latest version". I get an error message "no items match in if I try to branch of a label. I'm guessing the label references files using the old folder before I moved it. I also get no files if I try to "get specific version" by either date or label. I've tried to roll back moving the folder but this gives me errors such as "An unexpected error occured".

    Read the article

  • Consing lists with user-defined type in Haskell

    - by user1319603
    I have this type I defined myself: data Item = Book String String String Int -- Title, Author, Year, Qty | Movie String String String Int -- Title, Director, Year, Qty | CD String String String Int deriving Show -- Title, Artist, Year, Qty I've created an empty list all_Items = [] With the following function I am trying to insert a new book of type Item (Book) into the all_Items addBook all_Items = do putStrLn "Enter the title of the book" tit <- getLine putStrLn "Enter the author of the book" aut <- getLine putStrLn "Enter the year this book was published" yr <- getLine putStrLn "Enter quantity of copies for this item in the inventory" qty <- getLine Book tit aut yr (read qty::Int):all_Items return(all_Items) I however am receiving this error: Couldn't match expected type `IO a0' with actual type `[a1]' The error points to the line where I am using the consing operator to add the new book to the list. I can gather that it is a type error but I can't figure out what it is that I am doing wrong and how to fix it. Thanks in Advance!

    Read the article

  • Select a data template by item type programatically in WPF

    - by Michael Stoll
    Hi all, unfortunately the WPF ToolbarTray does not support binding to a collection of ToolbarViewModels (Correct me, if I'm wrong). Thus I want to create the Toolbars programmatically. So there are two tasks, which I don't know how to do: Select the data template based on the item type. Instantiate the data template as toolbar Both should do the same as WPF does, when we use ItemsControl with an enumerable content and empty template. I used reflector to anaylse what WPF does. Task 1 is done by FrameworkElement.FindTemplateResourceInternal, but this is internal, and I couldn't find any public methods to acomplish the task. Of course one could enumerate all resources and match the data template data type property, but this seems sub-optimal. Who know's how to acomplish these tasks?

    Read the article

  • The conceptual process of populating related tables in a database (MySql) from a CSV file

    - by user322772
    I'm new to relational databases and all the material I've read covered primary and foreign keys, normal forms, and joins but left out to populate the database once it's created. How do you import a CSV file so the fields match their related table? Say you were tying to build a beer database and had a CSV file with each line as a record. Header: brewer, beer_name, country, city, state, beer_category, beer_type, alcohol_content Record 1: Anheuser-Busch, Budweiser, United States, St. Louis, Mo, Pale lager, Regular, 5.0% Record 2: Anheuser-Busch, Bud Light, United States, St. Louis, Mo, Pale lager Light, 4.2% Record 3: Miller Brewing Company, Miller Lite, United States, Milwaukee, WI, Pale lager, Light, 4.2% You can create a "Brewer" table and a "Beer" table. When importing how does you connect the primary keys between the tables?

    Read the article

  • Why am I getting "Collection was modified; enumeration operation may not execute" when not modifying

    - by ccornet
    I have two collections of strings: CollectionA is a StringCollection property of an object stored in the system, while CollectionB is a List generated at runtime. CollectionA needs to be updated to match CollectionB if there are any differences. So I devised what I expected to be a simple LINQ method to perform the removal. var strDifferences = CollectionA.Where(foo => !CollectionB.Contains(foo)); foreach (var strVar in strDifferences) { CollectionA.Remove(strVar); } But I am getting a "Collection was modified; enumeration operation may not execute" error on strDifferences... even though it is a separate enumerable from the collection being modified! I originally devised this explicitly to evade this error, as my first implementation would produce it (as I was enumerating across CollectionA and just removing when !CollectionB.Contains(str)). Can anyone shed some insight into why this enumeration is failing?

    Read the article

  • What tools do you use when generating markup from mockups?

    - by Paul
    So I endeavor to spend most of time on the app server side of things but time to time I need to get my hands dirty and generate markup/css/js from a wireframe or mockup. As far as tools go, Ive found browsershots and Litmus app helpful and of course, vm's as well for checking things out live in ie-{6,7,8}. Otherwise I do the heavy lifting in vim. For generating new markup thats not tied to a target design I think some of the css frameworks & tools like sass look useful but Im skeptical of their utility when needing to generate markup to match a photoshop design. So what tips / tools do you keep in your markup generating utility belt when building solid markup from designs? My list so far: Browsershots Browserlab.adobe.com Haml / Less / Sass (not used but will probably explore)

    Read the article

  • Customised email alerts through MailChimp API

    - by user1293351
    I am building a site that runs an automated process every 30 minutes to match up new flights with their respective user. Once this process is completed I want to email the flight details out to the respective user. However the flight info will be different for every single user with their being 0-300+ potential emails. Is this something that the MailChimp API will allow or do? I found this page http://apidocs.mailchimp.com/api/how-to/transactional-campaigns.php which I am not sure if this effects me. Is the STS more suited to this? http://apidocs.mailchimp.com/sts/1.0/ Thanks Alex

    Read the article

  • PHP SQL Form Insert

    - by Prateek Sachan
    I've developed a form that inserts many things into the database. But somehow, when the page is filled up; it inserts only the user_password that too of the database admin. here is the code. Any help would be great. Invalid Name: We want names with more than 3 letters. Invalid E-mail: Type a valid e-mail please. Passwords are invalid: Passwords doesnt match or are invalid! Please enter your contact number. Please enter your age Congratulations! All fields are OK ;)

    Read the article

  • need to query MongoDB using php

    - by Mario Villarroel
    I need to query mongodb with something like this: ("something" < X OR "something" = "nll") AND ("someother"X OR "someother"= "nll") AND z=$z AND s=1 I've tried a few things, but can't get it to work, this is what I've tried: find( array( '$or'=array(array("something"=array("$le",$X)),array("something"="nll")), '$or'=array(array("someother"=array("$ge",$X)),array("someother"="nll")) )) But that's getting me the OR overwritten, so I'm lost on that... After diggin a bit more, I assembled this code that seems to be what I need, but doesn't work either: find( array('$and'=array( array( '$or' = array( array("something"=array('$gte'=$X)),array("something"="nll"))), array('$or' = array( array("someother"=array('$lte'=$X)),array("someother"="nll")))),"Z"=$z, "s"="1"); But this doesn't work as it returns zero results and I know for sure that there are more than 2 items that match on the db. (100% certain)

    Read the article

< Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >