Search Results

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

Page 181/269 | < Previous Page | 177 178 179 180 181 182 183 184 185 186 187 188  | Next Page >

  • Creating new Entities from Stored Procedure

    - by SK
    I have a stored procedure that retrieves existing rows from a table and also creates includes new rows that match the table definition and mapped entity (.net 3.5 entity framework). These new rows are not written to the database in the stored procedure. The stored procedure executes, but the new rows that were created will not load the navigation properties sucessfully i.e. the rows that do not actually exist in the database. e.g. database rows: key, data, FK 1, xxx, a 2, xxx, b returned rows from stored procedure: key, data, FK 1, xxx, a 2, xxx, b 3, yyy, a 4, yyy, b The entity will load FK entities a and b for rows 1 and 2, but for rows 3 and 4 the FK entity is null. Do I somehow need to add the new rows to the data context? or turn off tracking?

    Read the article

  • Is there a way to update a database when installing/upgrading an app?

    - by Adam
    I have a main application, and a bunch of sub-applications (they are separate apps, which do not appear on the android home dashboard). I was planning on having a SQLite DB which the main app maintains, and get a list of available sub-apps from. Is there a way to update this main database as the user installs the sub-apps? Two alternative I was thinking of include: User installs the sub-apps via the main app, which would then update the DB. Rather than use the DB to find all installed sub-apps, have each sub-app declare a category, and use intents to query for all applications which match that query (is this even possible? if so, advice is welcomed). Thanks!

    Read the article

  • How to compare 2 pdf files using command line or any tool

    - by Darzen
    I have to compare 2 pdf files and check if they are same or different. I have tried my luck with WinMerge and Beyond compare. however they dont solve my issue. The issue is that there are 2 files which are exactly same except for the time in which they were saved. I have a piece of code that embeds the time of saving into the file. but i am not supposed to do any modifications to the code I have. Hence the above mentioned tools will say that the files dont match and There is just one difference, that is timestamp. Can anyone suggest me a way to handle this. Please. Thanks

    Read the article

  • Perl regular expression question

    - by user368311
    Suppose I have variables $x1 = 'XX a b XX c d XX'; $x2 = 'XX a b XX c d XX e f XX'; I want a regular expression that will find each instance of letters between XX. I'm looking for a general solution, because I don't know how many XX's there are. I tried using /XX(.*?)XX/g but this only matches "a b" for x1 and "a b", "e f" for x2 because once the first match is found, the engine has already read the second "XX". Thanks for any help.

    Read the article

  • Assign RegEx submatches to variables or map (C++/C)

    - by Michael
    I need to extract the SAME type of information (e.g. First name, Last Name, Telephone, ...), from numerous different text sources (each with a different format & different order of the variables of interest). I want a function that does the extraction based on a regular expression and returns the result as DESCRIPTIVE variables. In other words, instead of returning each match result as submatch[0], submatch[1], submatch[2], ..., have it do EITHER of the following: 1.) return std::map so that the submatches can be accessed via: submatch["first_name"], submatch["last_name"], submatch["telephone"] 2.) return a variables with the submatches so that the submatches can be accessed via: submatch_first_name, submatch_last_name, submatch_telephone I can write a wrapper class around boost::regex to do #1, but I was hoping there would be a built-in or a more elegant way to do this in C++/Boost/STL/C.

    Read the article

  • Regex if-else expression

    - by craig
    I'm trying to extract the # of minutes from a text field using Oracle's REGEXP_SUBSTR() function. Data: Treatment of PC7, PT1 on left. 15 min. 15 minutes. 15 minutes 15 mins. 15 mins 15 min. 15 min 15min 15 In each case, I'm hoping to extract the '15' part of the string. Attempts: \d+ gets all of the numeric values, including the '7' and '1', which is undesirable. (\d)+(?=\ ?min) get the '15' from all rows except the last. (?((\d)+(?=\ ?min))((\d)+(?=\ ?min))|\d+), an if-else statement, doesnt' match anything. What is wrong with my if-else statement?

    Read the article

  • Google app engine-php: script handler

    - by Eve
    I try to create php web app using GAE. In the GAE tutorial, "A script handler executes a PHP script to handle the request that matches the URL pattern. The mapping defines a URL pattern to match, and the script to be executed" Now I want to map the url with the file having same name in the folder, e.g. if the url is /hello.* , it will map the file name hello.php in the folder. And if it is /hello1.*, hello1.php in the folder will be responded to the server. I thought this should be done directly by mapping the name of the url with the name in the folder. But if I left empty for the handler in the app.yaml, I got an error. So I want to know how to set up the handler in app.yaml?

    Read the article

  • How do I point a domain name to a Django url?

    - by username2
    I have a subdomain m.example.com that I want to point to the same location as example.com/mobile running on an apache2/django1.3 installation. example.com is the landing page, and I have the urls.py configured such that urls that match /^mobile$/ will be served the mobile version of the page. I looked into <VirtualHost>, but I think it requires a physical location for me to point m.example.com at and with the django urls there is no physical location except for the root of the project directory. I am unsure if the configuration change is made on the apache side or the django side. I've also looked into the mod_rewrite module for Apache, but I would prefer if I didnt have to redirect m.example.com to example.com/mobile

    Read the article

  • Matching Word with regular expression

    - by lbar
    I have the following text file: ... "somewords MYWORD";123123123123 "someother MYWORDOTHER";456456456456 "somedifferent MYWORDDIFFERENT";789789789 ... i need to match the word MYWORD, MYWORDOTHER, MYWORDDIFFERENT and then substitute the space before this word with ";". Someone can figure out a regex? I have done something like that: +[^ ][^ ][^ ][^ ][^ ][^ ][^ ]"; but this works only with a specific word lenght. I need to modify to get any word of any leght. Any help? Thank you.

    Read the article

  • Is this the best way to query an element and its children?

    - by Soviut
    I'm trying to query an element and its children to find ID's that begin with a particular string. var foundIDs = containerElement.find('[id^=something]').andSelf().filter('id^=something'); The find() method only searches descendants so I thought I'd try andSelf(). However, andSelf() does not take a selector. This means that the container element is included regardless of whether it matches the find query or not and I then have to perform a secondary filter() on it to remove the container element if it didn't match after all. I attempted to put andSelf() before the find() but it didn't seem to pick up the container element into the stack. containerElement.andSelf().find('[id^=something]'); Is there any better way to achieve what I'm doing?

    Read the article

  • Highlight curret page in jquery

    - by 3gwebtrain
    Hi, I have the 12 html pages. and all this pages are loads when the left navigation bar link clicked. in this, i need to add a class to the current link, which is clicked and loaded the page. i tried with this: $(function(){ $('#container li a').click(function(){ $('#container li a').removeClass('current'); var pathname = (window.location.pathname.match(/[^\/]+$/)[0]); var currentPage = $(this).attr('href'); if(currentPage==pathname){ $(this).addClass('current'); } else{ alert('wrong'); } // alert(pathname+' currentPage: '+currentPage); }) }) it works, but on page load, the class is removed, i don't know why it's happening.. any help?

    Read the article

  • How to query one table and add rows to another using that first query? MySQL

    - by Nickelbids
    Hello, I have some users setup in a MySQL table with different variables. I am trying to figure out what would be the best way to do this. Basically I want to award all of my registered and active users with bids which are stored in another table. So for the Table "users" I have ran this query: SELECT * FROM users WHERE active = 1 AND admin = 0 ORDER BY users.id ASC Which will show all active users who are not administrators. Now I would like to give each one of these users which are identified by the "ID" field in another table. So in the "bids" table I would need to add a new row for each one of those users with all of the same values except for the "user_id" field which will basically match the "id" field of the table "users" What would be the best approach for this. There are approximately 6,000+ users coming up in the first query. Please be gentle as I am not a programmer. Just need some friendly advice.

    Read the article

  • Problems when trying to submit iphone app

    - by ryug
    I'm a fairly new developer. When I try to submit my iphone app with xcode, I've got error as follows; Code Sign error: The identity 'iPhone Distribution' doesn't match any valid, non-expired certificate/private key pair in the default keychain After searching, I found out that I have to create a Distribution Provisioning Profile. However, my distribution provisioning profile doesn't work, even though my Development Provisioning Profile works perfectly. Could someone please help me with this problem? I'm stuck all day... and please forgive me that my English is not great. Thank you in advance.

    Read the article

  • Trying all permutations

    - by Malfist
    For my program, I am trying to assist the user, and reduce his or her work load. There are four input numbers. There is also an indeterminate amount of numbers they can be applied too. For example, they four input numbers could be {4,7,3,2} and the numbers they can be applied to are {4,9,23} The result should be: 4 (input) was applied to 4, leaving the sets looking like: {0,7,3,2} and then 7,2 (input) are applied to 9 leaving the sets looking like: {0,0,3,0} and {0,0,23} and because 3 or any other permutation including 3 does not match 23, 3 remains. How would I do this?

    Read the article

  • servlet authentication and further reference to the credentials

    - by user553592
    What I got so far: It all begins with an HTML form which prompts the user for a username and password. From there it post the acquired user/pass to a servlet, GateKeeper. GateKeeper determines if the user/pass combination match any records in the MySQL database. Here is the sql I use: SELECT id FROM Users WHERE username='?' AND password=MD5('?') where the ? indicate information provided the previous HTML form. What I need now: I need some way to store the username and id of the record in the database. GateKeeper redirects the user to a control panel upon success. Therefore, I need a method to reference the username to display simple greetings, etc and also the id so it eliminates unnecessary calls to the database. The control panel may make AJAX calls to Servlets that preform some sort of task to the MySQL database.

    Read the article

  • How to define a ternary operator in Scala which preserves leading tokens?

    - by Alex R
    I'm writing a code generator which produces Scala output. I need to emulate a ternary operator in such a way that the tokens leading up to '?' remain intact. e.g. convert the expression c ? p : q to c something. The simple if(c) p else q fails my criteria, as it requires putting if( before c. My first attempt (still using c/p/q as above) is c match { case(true) = p; case _ = q } another option I found was: class ternary(val g: Boolean = Any) { def |: (b:Boolean) = g(b) } implicit def autoTernary (g: Boolean = Any): ternary = new ternary(g) which allows me to write: c |: { b: Boolean = if(b) p else q } I like the overall look of the second option, but is there a way to make it less verbose? Thanks

    Read the article

  • Does '[ab]+' equal '(a|b)+' in python re module?

    - by user1477871
    I think pat1 = '[ab]' and pat2 = 'a|b' have the same function in Python(python2.7, windows) 're' module as a regular expression pattern. But I am confused with '[ab]+' and '(a|b)+', do they have the same function, if not plz explain details. ''' Created on 2012-9-4 @author: melo ''' import re pat1 = '(a|b)+' pat2 = '[ab]+' text = '22ababbbaa33aaa44b55bb66abaa77babab88' m1 = re.search(pat1, text) m2 = re.search(pat2, text) print 'search with pat1:', m1.group() print 'search with pat2:', m2.group() m11 = re.split(pat1, text) m22 = re.split(pat2, text) print 'split with pat1:', m11 print 'split with pat2:', m22 m111 = re.findall(pat1, text) m222 = re.findall(pat2, text) print 'findall with pat1:', m111 print 'findall with pat2:', m222 output as below: search with pat1: ababbbaa search with pat2: ababbbaa split with pat1: ['22', 'a', '33', 'a', '44', 'b', '55', 'b', '66', 'a', '77', 'b', '88'] split with pat2: ['22', '33', '44', '55', '66', '77', '88'] findall with pat1: ['a', 'a', 'b', 'b', 'a', 'b'] findall with pat2: ['ababbbaa', 'aaa', 'b', 'bb', 'abaa', 'babab'] why are 'pat1' and 'pat2' different and what's their difference? what kind of strings can 'pat1' actually match?

    Read the article

  • templated class : accessing derived normal-class methods

    - by user1019129
    I have something like this : class Container1 { public: method1() { ... } } class Container2 { public: method1() { ... } } template<class C = Container1> class X : public C { public: using C::method1(); ..... X(string& str) : C(str) {}; X& other_method() { method1(); ...; } } My question is why I have to use "using C::method1()", to be able to access the method.. Most of answers I found is for the case where templated-class inhering templated-class. Normally they mention using "this-", but this does not seem to work in this case. Can I do something else shorter... Also I'm suspecting the other error I'm getting is related to the same problem : no match call for (X<Container1>) (<std::string&>)

    Read the article

  • MySQL Database || Tables Issue

    - by user1780103
    I'm trying to write up a script where the user is able to purchase an amount of points for dollars. I want the transaction to be inserted into MySQL. I keep facing a: "Column count doesn't match value count at row 1" error. And I have no idea what I'm doing wrong. I have written up this: mysql_query("INSERT INTO paypal_donations VALUES (NULL, ".$account_id.", ".$char_id.", ".$price.", ".$dp.", NOW(), NOW(), 'Started', 0, 0, '', '');") or die(mysql_error()); But I don't know what to execute in MySQL, since I've never worked with it before. Could anyone write up a quick script that I can insert into MySQL for it to work.

    Read the article

  • How to use mod_rewrite to change external incoming images to local images?

    - by STRiDOR
    Hi, I'm trying to figure out how to use mod_rewrite so that I can replace linked images (coming in externally) and use local ones instead. Why am I doing this? I have a plugin which I'm integrating into my site, which uses ugly external images as buttons, and I want to redo these buttons to match my site. The links come in externally and are not embedded in a plugin php somewhere, so I figure there might be some way of using mod_rewrite to intercept and replace the incoming links. I hope someone can help, thanks!

    Read the article

  • How to break a loop when inputting unspecified raw_input?

    - by user1874510
    I want to write an interface using a while loop and raw_input. My code looks like this: while True: n = raw_input("'p' = pause, 'u' = unpause, 'p' = play 's' = stop, 'q' = quit) if n.strip() == 'p': mp3.pause() if n.strip() == 'u': mp3.unpause() if n.strip() == 'p': mp3.play() if n.strip() == 's': mp3.stop() if n.strip() == 'q': break But I want it to break if I input anything that isn't specified in the raw_input. if not raw_input: break Returns and IndentationError: unindent does not match any outer indentation level. if not raw_input: break Does not return any error but doesn't work as I want it to. As far as I know, it does nothing at all. Also, if there's a cleaner way to write my loop, I love to hear it.

    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

  • Is it possible to make a TListView search by the caption of a different column in Delphi?

    - by James
    Hi, When you set the Caption of a TListItem it seems to always set the Text for the first column in the row. When you start typing in the ListView it will search & select the closest match based on the caption of the first column. I have a situation where I need the caption of the first row to be empty, but still need the search functionality to work as normal (in this case the data I would be searching for may be in the 2nd/3rd column). Is this possible without using any 3rd party controls?

    Read the article

  • jQuery filter selector, is this right?

    - by fire
    It seems to work ok but I don't know if this can be impoved on or not. I want to select any HTML tag that has a class of edit-text-NUM or edit-html-NUM and change the color of it. Here is what I am using... jQuery(document).ready(function(){ jQuery('*') .filter(function() { return this.className.match(/edit-(text|html)-\d/); }) .css({ 'color': '#ff0000' }); }); Does that look ok and is the regex ok? *edit: Also is this efficient? I am aware that using jQuery('*') might be a bit of a hog if it's a large page. It only has to work from <body> down so maybe it could be changed?

    Read the article

  • C++ array of classes

    - by nickik
    I working on a game but I have a problem with the initialization of the level. (feld is just field in german) class level{ private: feld spielfeld[10][10]; public: /* other staff */ void init_feld(); }; void level::init_feld() { for(int i=0;i!=10;i++){ for(int n=0;n!=10;n++){ spielfeld[i][n] = new feld(land, i, n); } } } The Error: Error: no match for »operator=« in »((level*)this)-level::spielfeld[i][n] = (operator new(24u), (, ((feld*))))« /home/nick/stratego/feld.h:18:11: Remark: candidate is: feld& feld::operator=(const feld&) Process terminated with status 1 (0 minutes, 0 seconds) 2 errors, 0 warnings

    Read the article

< Previous Page | 177 178 179 180 181 182 183 184 185 186 187 188  | Next Page >