Search Results

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

Page 170/269 | < Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >

  • Hashbytes comparison in stored proceduring not matching record

    - by Michael Itzoe
    The password field in my user table (SQL Server 2008) is encrypted using HASHBYTES on insertion. I have a stored procedure with parameters for the username and plain-text password which does a SELECT using that username and the password sent through HASHBYTES, then returns the user record if it finds a match. The SP is always returning an empty recordset, but if I copy and paste just the SELECT from the SP to a new query window, it returns the matched record. There're no other statements in the SP. I'm missing something here; what is it?

    Read the article

  • 2 or more Controls only 1 is considered Active

    - by Don
    I have 2 controls (MyCtrl) next to each other called ctrlLeft and ctrlRight. Whenever one receives interaction it is considered active (by default the left one). I override OnDraw and customize the look of the active one a bit. Currently I have a property Active and an event that I subscribe to from all MyCtrl in there I store a reference to the active one like this: if (sender is MyCtrl) { ctrlActive = (sender as MyCtrl); ctrlLeft.Active = !(ctrlRight.Active = (ctrlActive == ctrlRight)); } Either way I need to have ctrlActive as I use it for other things but what I am wondering is if this is the best way make them aware of each other? Another option I thought of was to store references to every possible MyCtrl and then loop through em all and activate / deactivate the one that match sender just in case I in the future add a ctrlMiddle. Are my thoughts wrong, is there better options to do this. For example, how does radiobuttons accomplish their similar functionality?

    Read the article

  • Regex pattern help (I almost have it, just need a bit of expertise to finish it)

    - by Mohammad
    I need to match two cases js/example_directory/example_name.js and js/example_directory/example_name.js?12345 (where 12345 is a digit string of unknown length and the directory can be limitless in depth or not exist at all) I need to capture in both cases everything between js/ and .js and if ? exists capture the digit string after ? This is what I have so far ^js/(.*).js\??(\d+)? This works except it also captures js/example_directory/example_name.js12345 I want the regex to ignore that. Any suggestions? Thank you all! Test your patterns here

    Read the article

  • Could someone give me their two cents on this optimization strategy

    - by jimstandard
    Background: I am writing a matching script in python that will match records of a transaction in one database to names of customers in another database. The complexity is that names are not unique and can be represented multiple different ways from transaction to transaction. Rather than doing multiple queries on the database (which is pretty slow) would it be faster to get all of the records where the last name (which in this case we will say never changes) is "Smith" and then have all of those records loaded into memory as you go though each looking for matches for a specific "John Smith" using various data points. Would this be faster, is it feasible in python, and if so does anyone have any recommendations for how to do it?

    Read the article

  • How do I UPDATE a Linked Server table where "alias" is required, in SQL Server 2000?

    - by Mark Hurd
    In SQL Server 2005 tablename can be used to distinguish which table you're referring to: UPDATE LinkedServer.database.user.tablename SET val=u.val FROM localtable u WHERE tablename.ID=u.ID In SQL Server 2000 this results in Server: Msg 107, Level 16, State 2 The column prefix 'tablename' does not match with a table name or alias name used in the query. Trying UPDATE LinkedServer.database.user.tablename SET val=u.val FROM localtable u WHERE LinkedServer.database.user.tablename.ID=u.ID results in Server: Msg 117, Level 15, State 2 The number name 'LinkedServer.database.user.tablename' contains more than the maximum number of prefixes. The maximum is 3. And, of course, UPDATE LinkedServer.database.user.tablename SET val=u.val FROM localtable u WHERE ID=u.ID results in Server: Msg 209, Level 16, State 1 Ambiguous column name 'ID'. (In fact searching on "The number name contains more than the maximum number of prefixes. The maximum is 3." I found the answer, but I've typed up this question and I'm going to post it! :-) )

    Read the article

  • C errors - Cannot combine with previous 'struct' declaration specifier && Redefinition of 'MyMIDINotifyProc' as different kind of symbol

    - by user1905634
    I'm still new to C but trying to understand it better by working my way through a small MIDI audio unit (in Xcode 4.3.3). I've been searching for an answer to this all day and still don't even understand exactly what the problem is. Here's the code in question: //MyMIDINotifyProc.h #ifndef MIDIInstrumentUnit_CallbackProcs_h #define MIDIInstrumentUnit_CallbackProcs_h void MyMIDINotifyProc (const MIDINotification *message, void *refCon); #endif //MyMIDINotifyProc.c #include <CoreMIDI/CoreMIDI.h> #include "MyMIDINotifyProc.h" void MyMIDINotifyProc (const MIDINotification *message, void *refCon) { //manage notification } In the header definition I get this: ! Cannot combine with previous 'struct' declaration specifier I've made sure the definitions match and tried renaming them and I still get this in my .c file: ! Redefinition of 'MyMIDINotifyProc' as different kind of symbol Which points to the .h definition as the 'Previous definition'. I know that MIDIServices.h in the CoreMIDI framework defines: typedef void (*MIDINotifyProc)(const MIDINotification *message, void *refCon); But I don't understand if/why that would cause an error. I would be grateful if anyone could offer some help.

    Read the article

  • Jquery check array perform function

    - by mtwallet
    Hello. I am creating a site that requires a very small postcode checker. I have approx 8 postcode prefix's, HX, HD, BD, LS etc in an array. I also have a simple input field and submit btn. When the user types in a postcode for example HX5 9DU I want Jquery to check the array, if there is match for the first 2/3 letters I want a div to fade in displaying a message. How would I do this? Many thanks in advance.

    Read the article

  • Searching for simple variable names like 'c' or 'x' in Emacs.

    - by wpeters
    I often wish to search for variables that are simply called 'c' or 'count'. For example int c, count; Unfortunately when I use an incremental search for 'c' or 'count' I get a lot of unnecessary hits like the 'c' in 'choice', or the 'count' in 'wordcount' which do not interest me. I know Emacs can do i-searches with regular expressions but I don't know the correct regular expression needed to match just 'c' and 'count'. These words are often surrounded by any number of white spaces. Anyone know the regex I can use to narrow my search?

    Read the article

  • what is the right 'rails' way to add a link_to a new custom method

    - by jpwynn
    We're adding a new method 'delete_stuff' to the WidgetsController of a scaffolded app. in routes we added match 'widget/delete_stuff/:id' = 'widgets#delete_stuff' I CAN manually create html (GET) links like <a href="/widget/delete_stuff/<% widget.id %>">My Custom Delete Stuff</a> But that's bad on so many levels (uses GET instead of DELETE, doesn't permit a CONFIRM dialog, isnt DRY, etc) Problem is I can't figure out how to use the url helpers for a custom method... trying to do something like this: <% link_to 'DeleteStuff', @widget, :confirm => 'Are you sure?', :method => :delete %> But that just gets ignored when the html is rendered. I'm clearly missing something fundamental on how to use link_to, any help will be appreciated! Cheers, JP

    Read the article

  • Send copy of class to view class so it can render him? ( iPhone )

    - by Johannes Jensen
    I'm making a game for the iPhone, and I have a class called Robot. Then I have a class called View, which renders everything. I want to send a copy of my Robot, which I defined in my ViewController, and I send it to gameView (which is View *gameView), like this: robot = [Robot new]; [gameView setRobot: [robot copy]]; I tried to make a copy but that didn't work, I could also do it with a pointer to Robot (&robot) but sometimes it just crashes ? I tried this in my View.h @interface definition: @property (copy) Robot* robot; but I get the error /RobotsAdventure/Classes/View.h:24: error: setter '-robot' argument type does not match property type :/ Help? I'm pretty new at this, heh.

    Read the article

  • Implementation Details as a "Document" ( In generic terms) - Python, C++

    - by mgj
    Hi..:) For documentation and presentation purposes, we often find professionals/students creating SRS, coding guidelines etc. for these things there is some kind of a checklist which one could use to appropriately match what could relate to a specific case and accordingly one does a documentation for each. On those grounds could you please give me some sort of a checklist( any points/guidelines) one could use for going about Implementation( in the form of Implementation Details) in Python and C++ . Although this might sound specific as the query is "Implementation Details" and is different for different cases as one goes about the REAL implementation, I just want a SET of guidelines one should follow ( Preferably In Python, C++ specific, even for any other language is Welcome) if this( Implementation Details ) has to also be documented or presented. Hope the question is clear, I am sorry if it still sounds ambiguous, I guess this is the best I could do to frame my query. Thank you for your time...:)

    Read the article

  • Show surrounding words when searching for a specific word in a text file (Ruby)

    - by Ezra
    Hi, I'm very new to ruby. I'm trying to search for any instance of a word in a text file (not the problem). Then when the word is discovered, it would show the surrounding text (maybe 3-4 words before and after the target word, instead of the whole line), output to a list of instances and continue searching. Example "The quick brown fox jumped over the lazy dog." Search word = "jumped" Output = "...brown fox jumped over the..." Any help is appreciated. Thanks! Ezra def word_exists_in_file f = File.open("test.txt") f.each do line print line if line.match /someword/ return true end end false end

    Read the article

  • Rack URL Mapping

    - by Puru puru rin..
    Hi, I am trying to write two kind of Rack routes. Rack allow us to write such routes like so: app = Rack::URLMap.new('/test' => SimpleAdapter.new, '/files' => Rack::File.new('.')) In my case, I would like to handle those routes: "/" or "index" "/*" in order to match any other routes So I had trying this: app = Rack::URLMap.new('/index' => SimpleAdapter.new, '/' => Rack::File.new('./public')) This works well, but... I don't know how to add '/' path (as alternative of '/index' path). The path '/*' is not interpreted as a wildcard, according to my tests. Do you know how I could do? Thanks

    Read the article

  • Examining a lambda expression at runtime in C#

    - by Ben Aston
    I have a method Get on a type MyType1 accepting a Func<MyType2, bool> as a parameter. An example of its use: mytype1Instance.Get(x => x.Guid == guid)); I would like create a stub implementation of the method Get that examines the incoming lambda expression and determines what the value of guid is. Clearly the lambda could be "anything", but I'm happy for the stub to make an assumption about the lambda, that it is trying to match on the Guid property. How can I do this? I suspect it involves the use of the built-in Expression type?

    Read the article

  • How can I make this REGEX cleaner?

    - by Solignis
    I have this regex I made to compare OS names to a line in a VMX file. It started out as seperate elsif statments but I ended up making into a single if statment. Anyhow here is the code, I am trying to find a way to make the code cleaner but it put each match on a seperate line it no longer works. elsif ($vmx_file =~ m/guestOSAltName\s+=\s"Microsoft\sWindows\sServer\s2003,Web\sEdition"|"Microsoft\sWindows\sSmall\sBusiness\sServer\s2003"|"Microsoft\sWindows\s2000\sAdvanced\sServer"|"Microsoft\sWindows\s2000\sServer"|"Microsoft\sWindows\s2000\sProfessional"|"Microsoft\sWindows\s98"|"Microsoft\sWindows\s95"|"Microsoft\sWindows\sNT\s4"/) { $virtual_machines{$vm}{"Architecture"} = "32-bit";

    Read the article

  • Problems with mod_rewrite and 301 redirects from one dynamic url to another

    - by user349891
    Hey all, I'm having all kinds of problems with a bunch of apache redirects just now and could really use some help! I'm wating to put in a 301 redirect for a load of urls from a client's old site to their new site in the following format; Old - page.php?pageNum_rs_all=0&totalRows_rs_all=112 New - page/sub?foo=bar The values in the query sting for the old site don't in any way tie up to any ids or references on the new site, I only want to match that specific request and redirect to the new page. It feels like I've tried just about every combination of rewriterule I can find online but still nothing seems to be working. This is running on Apache 2.2. The rule I started with (and keep going back to) is; RewriteRule ^/page.php\?pageNum_rs_all=0&totalRows_rs_all=112 /page/sub?foo=bar [R=301,L,NE] Any help would be greatly appreciated! c.

    Read the article

  • Remove redundant entries, scala way

    - by andersbohn
    Edit: Added the fact, that the list is sorted, and realizing 'duplicate' is misleading, replaced that with 'redundant' in the title. I have a sorted list of entries stating a production value in a given interval. Entries stating the exact same value at a later time adds no information and can safely be left out. case class Entry(minute:Int, production:Double) val entries = List(Entry(0, 100.0), Entry(5, 100.0), Entry(10, 100.0), Entry(20, 120.0), Entry(30, 100.0), Entry(180, 0.0)) Experimenting with the scala 2.8 collection functions, so far I have this working implementation: entries.foldRight(List[Entry]()) { (entry, list) => list match { case head :: tail if (entry.production == head.production) => entry :: tail case head :: tail => entry :: list case List() => entry :: List() } } res0: List[Entry] = List(Entry(0,100.0), Entry(20,120.0), Entry(30,100.0), Entry(180,0.0)) Any comments? Am I missing out on some scala magic?

    Read the article

  • How do you optimize database performance when providing results for autocomplete/iterative search?

    - by Howiecamp
    Note: In this question I'm using the term "autocomplete" (or "iterative search") to refer to returning search-as-you-type results, e.g. like Google Search gives you. Also my question is not specific to web applications vs. fat client apps. How are SQL SELECT queries normally constructed to provide decent performance for this type of query, especially over arbitrarily large data sets? In the case where the search will only query based on the first n characters (easiest case) am I still issuing a new SELECT result FROM sometable WHERE entry LIKE... on each keypress. Even with various forms of caching this seems like it might result in poor performance. In cases where you want your search string to return results with prefix matches, substring matches, etc. it's an even more difficult problem. Looking at a case of searching a list of contacts, you might return results that match FirstName + LastName, LastName + FirstName, or any other substring.

    Read the article

  • How to fetch, display Amazon Marketplace listings by item?

    - by Matt G.
    Hi all, My question pretty much says it all: I'm looking for a way to display Amazon Marketplace listings based on an item lookup. Example: If I do a call to ItemLookup with an ASIN of 0590353403 (Harry Potter and the Sorcerer's Stone), I'm looking for a result set of perhaps the top ten new or used Marketplace listings, preferably with seller information attached. I apologize if this is clearly documented somewhere, but I have been looking all through the Amazon API docs and on Google to no avail. StackOverflow doesn't seem to have any Related Questions that match what I'm asking, either. Thanks in advance!

    Read the article

  • How do I not include part of a regular expression

    - by Axilus
    I'm pretty new to using regexes and I can figure out how I would go about extracted a specific number from a string. Suppose the string was any amount of whitespace or random text and somewhere within it is this, "Value: $1000.00." In order to retrieve that value I am currently using this: string value = Convert.ToString(Regex.Match(BodyContent, @"Value:[ \t]*\$?\d*(\.[0-9]{2})?", RegexOptions.Singleline)); So the variable 'value' now has, "Value: $1000.00" stored in it. My question is, using Regex is there a way to use 'Value:' to find the number value but only store the actual number value (i.e. 1000.00) in the 'value' variable?

    Read the article

  • Perl Regex Mismatch Issue

    - by Russell C.
    This is a really basic regex question but since I can't seem to figure out why the match is failing in certain circumstances I figured I'd post it to see if anyone else can point out what I'm missing. I'm trying to pull out the 2 sets of digits from strings of the form: 12309123098_102938120938120938 1321312_103810312032123 123123123_10983094854905490 38293827_1293120938129308 I'm using the following code to process each string: if($string && $string =~ /^(\d)+_(\d)+$/) { if(IsInteger($1) && IsInteger($2)) { print "success ('$1','$2')"; } else { print "fail"; } } Where the IsInterger() function is as follows: sub IsInteger { my $integer = shift; if($integer && $integer =~ /^\d+$/) { return 1; } return; } This function seems to work most of the time but fails on the following for some reason: 1287123437_1268098784380 1287123437_1267589971660 Any ideas on why these fail while others succeed? Thanks in advance for your help!

    Read the article

  • What is the correct way to tell if Pango has found the right font?

    - by Thedward
    I create a font description with: pango_font_description_from_string() Then load a font with: pango_context_load_font() This process seems to result in some default font regardless of the string I give it. Is there any sane way for me to determine if the returned font is the result of an alias (e.g. "Sans", "Monospace") or just the last chance default font? For example, if I request the font "Monospace" and get back "DejaVu Sans Mono" then I should be able to declare that a good match. However, if I request "OquieZee" and get back "DejaVu Sans" then I'd like to know that I just got back the default font because the font I requested doesn't actually exist on the system. When I first saw pango_font_description_better_match() I thought it might be of help, but it turned out to be a dead end.

    Read the article

  • Multiple key map in c++

    - by Morgan
    Hi, I'm wondering if any of you know of a c++ associative map container type which I can perform multiple key lookups on. The map needs to have constant time lookups but I don't care if it's ordered or unordered. It just needs to be fast. For example, I want to store a bunch of std::vector objects in a map with an integer and a void* as the lookup keys. Both the int and the void* must match for my vector to be retrieved. Does anything like this exist already? Or am I going to have to roll my own. If so, any suggestions? I've been trying to store a boost::unordered_map inside another boost::unordered_map, but I have not had any success with this method yet. Maybe I will continue Pershing this method if there is no simpler way. Thanks!

    Read the article

  • Why doesn't Python's `re.split()` split on zero-length matches?

    - by Tim Pietzcker
    One particular quirk of the (otherwise quite powerful) re module in Python is that re.split() will never split a string on a zero-length match, for example if I want to split a string along word boundaries: >>> re.split(r"\s+|\b", "Split along words, preserve punctuation!") ['Split', 'along', 'words,', 'preserve', 'punctuation!'] instead of ['', 'Split', 'along', 'words', ',', 'preserve', 'punctuation', '!'] Why does it have this limitation? Is it by design? Do other regex flavors behave like this?

    Read the article

  • searching within a compressed sorted fixed width file

    - by user275455
    Assume I have a regular compressed fixed width file that is sorted on one of the fields. Given that I know the length of the records, I can use lseek to implement a binary search to records with fields that match a given value without having to read the entire file. Now the difficulty is that the file is gzipped. Is it possible to do this without completely inflating the file? If not with gzip. is there any compression that supports this kind of behavior?

    Read the article

< Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >