Search Results

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

Page 175/269 | < Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >

  • Sharepoint lockout

    - by user301751
    Recently a guy from our 3rd line team thought it would be funny to delete my account from AD. This has now been re-added. Everything is back to normal apart from my Access to Sharepoint sites. I am getting "The file exists. (Exception from HRESULT: 0x80070050)" Error on all sites. After some googleing I came across a guy with the same issue and it was an issue with the SID being different from my old account. Since this I deleted my account from Site Administrators and re-added. This would refresh the SID with the new one. I also check on the Content database that the site ID matched using the following transactions and the SIDs match. select s.Id, w.FullUrl from Sites s inner join Webs w on s.RootWebId = w.Id select * from UserInfo where tp_Login='domain\username' and tp_SiteID='' I am now a bit clueless.

    Read the article

  • function to remove duplicate characters in a string

    - by Codenotguru
    The following code is trying to remove any duplicate characters in a string.Iam not sure if the code is right??Can anybody help me with the working of the code i.e whats actually happening when there is a match in characters? public static void removeDuplicates(char[] str) { if (str == null) return; int len = str.length; if (len < 2) return; int tail = 1; for (int i = 1; i < len; ++i) { int j; for (j = 0; j < tail; ++j) { if (str[i] == str[j]) break; } if (j == tail) { str[tail] = str[i]; ++tail; } } str[tail] = 0; }

    Read the article

  • Perl - string matching issue

    - by user2886545
    I have a problem I cannot understand. I have this string: gene_id "siRNA_Z27kG1_20543"transcript_id "siRNA_Z27kG1_20543_X_1";tss_id "TSS124620" And I want to change the gene_id. So, I have the following code: if ($line =~ /;transcript_id "([A-Za-z0-9:\-._]*)(_[oxOX][_.][0-9]*)";/) { $num = $2; $line =~ s/gene_id "([A-Za-z0-9:\-._]*)";/gene_id "$1$num";/g; print $new $line."\n"; } The aim of my code is to change siRNA_Z27kG1_20543 for siRNA_Z27kG1_20543_X_1. However, my code does not produce that output. Why? I can't understand that. My regex needs to be as it is because I match other strings (this time with success). Thanks.

    Read the article

  • Need a good website URL to test against

    - by Zombies
    I need a URL to just test basic http connectivity. It needs to be consistent and: Always be up Never change drastically due to IP or user agent. (IE: 301 Location redirect/ huge difference in content... minor would be tolerable) The URL itself has a consistent content-length. (IE: it doesn't vary from by 2kb at most, ever) A few examples, yet none match all 3 criteria: One example of always up: www.google.com (yet it 301 redirects based on IP location). Another good one is http://www.google.com/webhp?hl=en. but the problem there is that based on a given holiday, the content-length can really vary.

    Read the article

  • Can I use a string variable to reference a class variable?

    - by rson
    Here's the scenario: I have an external swf file with x number of movieclips in its library that I load into a containing swf. Each MC in the external swf is linked with a class name and referenced on frame 1 as such var unique1:lineSequence1 = new lineSequence1(); the unique1 variable name will match a string variable I create in the containing swf: function initLines():void{ lineLoader = new Loader(); lineLoader.load(new URLRequest("theLines.swf")); //load external swf lineLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, linesLoaded); } function linesLoaded(e:Event):void{ var loadedswf:MovieClip = e.target.content as MovieClip; var initialLines = projects[0].pageid; //projects is an xmllist trace("initialLines: "+initialLines); //returns "initialLines: unique1" lines_holder_mc.addChild(loadedswf.[initialLines]); } I would like to use the initialLines variable as the reference to unique1 instead of hardcoding unique1 into loadedswf.unique1 to reference said variable in the loaded swf.

    Read the article

  • How to check if string contains a string in string array

    - by Abu Hamzah
    edit: the order might change as you can see in the below example, both string have same name but different order.... How would you go after checking to see if the both string array match? the below code returns true but in a reality its should return false since I have extra string array in the _check what i am trying to achieve is to check to see if both string array have same number of strings. string _exists = "Adults,Men,Women,Boys"; string _check = "Men,Women,Boys,Adults,fail"; if (_exists.All(s => _check.Contains(s))) //tried Equal { return true; } else { return false; }

    Read the article

  • Haskell: Why is it saying my function type is off?

    - by linkmaster03
    I wrote a little Haskell program to find the area of a triangle, primarily to practice custom types, but it keeps throwing the following error on compile: areafinder.hs:7:4: Couldn't match expected type 'Triangle' against inferred type 'm b' In a stmt of a 'do' expression: putStr "Base: " In the expression: do { putStr "Base: "; baseStr I'm not sure where 'm b' comes from, so I'm at a loss here. Why is it throwing this error, and what can I do to fix it? Here is my code: module Main where data Triangle = Triangle Double Double -- base, height getTriangle :: Triangle getTriangle = do putStr "Base: " baseStr Double calcTriangle (Triangle base height) = base * height main = putStrLn ("Area = " ++ show (calcTriangle getTriangle)) Thanks. :)

    Read the article

  • jQuery: use Use filter(), but work with both results

    - by Tomalak
    In jQuery, filter() reduces your result to those elements that fulfill a certain condition. This splits the list in two parts. Working with the "good half" of the elements is easy: $("some selector").filter(function() { // determine result... return result; }).each( /* do something */ ); But how can I work with the "other half" of my elements, too - but without doing the equivalent of this: $("some selector").filter(function() { // determine result... return !result; }).each( /* do something else */ ); Basically, I'd like to feed two separate /* do something */ parts to a single filter. One for those that match, and one for the others - without having to filter twice. Am I missing a jQuery function that does this? P.S.: I guess I could do: $("some selector").each(function() { // determine result... if (result) /* do something */ else /* do something else */ }); But I was hoping for something nicer.

    Read the article

  • F# operator over-loading question

    - by jyoung
    The following code fails in 'Evaluate' with: "This expression was expected to have type Complex but here has type double list" Am I breaking some rule on operator over-loading on '(+)'? Things are OK if I change '(+)' to 'Add'. open Microsoft.FSharp.Math /// real power series [kn; ...; k0] => kn*S^n + ... + k0*S^0 type Powers = double List let (+) (ls:Powers) (rs:Powers) = let rec AddReversed (ls:Powers) (rs:Powers) = match ( ls, rs ) with | ( l::ltail, r::rtail ) -> ( l + r ) :: AddReversed ltail rtail | ([], _) -> rs | (_, []) -> ls ( AddReversed ( ls |> List.rev ) ( rs |> List.rev) ) |> List.rev let Evaluate (ks:Powers) ( value:Complex ) = ks |> List.fold (fun (acc:Complex) (k:double)-> acc * value + Complex.Create(k, 0.0) ) Complex.Zero

    Read the article

  • Merging getComputedStyle and evaluate in Greasemonkey

    - by Keheliya Gallaba
    I need to get all the text nodes with a certain font-face in a page to an array. I tried.. textnodes = document.evaluate("//* [@style='font-family: foo;']//text()[" + "not(ancestor::script) and not(ancestor::style)]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); and textnodes = document.evaluate("//* [@face='foo']//text()[" + "not(ancestor::script) and not(ancestor::style)]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); But these does not work with pages that is styled by external CSS files. Seems getComputedStyle() is the way to go. I think what I need is something like.. var tags = document.getElementsByTagName('*'); for (var i in tags) { var style = getComputedStyle(tags[i], ''); if (style.fontFamily.match(/foo/i)) { textnodes.push(tags[i]); } } But text nodes were not returned in this method. Is there anyway I can use a hybrid of xpath evaluate() and getComputedStyle() or any other way to achieve this?

    Read the article

  • How do you get the ID of a control in ASP.NET

    - by James
    I am attempting to loop through an array of numbers, match them to the checkbox they they are associated with, and checkmark that box. My checkbox is set up like: <input type="checkbox" runat="server" id="someID" name="somename" value="1234" /> My code when the page loads currently looks like: foreach (string interest in interests_Var){ foreach (var c in Page.Controls) { } } interests_Var is my array containing different numbers. We'll assume one of them is 1234. While looping through the page controls, I want to compare the value of the control to my number. If it equals my number, I want to then apply the attribute checked="checked". I'm assuming I have to find the ID of the control I am using, then use that ID to add a new attribute. Or is there a way I can add the attribute using the c variable? I'm not dead set on this setup, so if you know a better way, I'm all ears. Thanks for any help and suggestions.

    Read the article

  • C++ template overloading - wrong function called

    - by DeadMG
    template<typename T> T* Push(T* ptr); template<typename T> T* Push(T& ref); template<typename T, typename T1> T* Push(T1&& ref); I have int i = 0; Push<int>(i); But the compiler calls it ambiguous. How is that ambiguous? The second function is clearly the preferred match since it's more specialized. Especially since the T1&& won't bind to an lvalue unless I explicitly forward/move it. Sorry - i is an int. Otherwise, the question would make no sense, and I thought people would infer it since it's normally the loop iterator.

    Read the article

  • join select from multiple row values?

    - by user1869132
    Two tables 1) product -------------------- id | Name | price 1 | p1 | 10 2 | p2 | 20 3 | p3 | 30 2) product_attributes: --------------------------------------------------- id | product_id | attribute_name | attribute_value --------------------------------------------------- 1 | 1 | size | 10 2 | 1 | colour | red 3 | 2 | size | 20 I need to join these two tables. In the where clause I need to match both the two rows attribute values. Is it possible to get the result based on two rows value. Here if size=10 and colour=red. Output should be 1 | p1 | 10 It could be greatly helpful to get a query for this.

    Read the article

  • Using Forms authentication with remote auth system?

    - by chobo
    I am working on a website that uses a remote websites database to check for authentication (they are both share some database tables, but are separate website...) Right now I check the username and password against the remote websites account / member table, if there is a match I create a session. Questions: Is this secure? On authenticated pages I just check if a session of a specific type exists.Is it possible for someone to create an empty session or something that could bypass this? Is it possible to use Forms authentication with this setup? Right now if a user is authenticated I just get an object back with the username, email and id.

    Read the article

  • Regexp in iOS to find comments

    - by SteveDolphin23
    I am trying to find and process 'java-style' comments within a string in objective-C. I have a few regex snippets which almost work but I am stuck on one hurdle: different options seem to make the different styles work. For example, I am using this to match: NSArray* matches = [[NSRegularExpression regularExpressionWithPattern:expression options:NSRegularExpressionAnchorsMatchLines error:nil] matchesInString:string options:0 range:searchRange]; The options here allow me successfully find and process single line comments (//) but not multiline (/* */), if I change the option to NSRegularExpressionDotMatchesLineSeparators then I can make multiline work fine but I can't find the 'end' of a single line comment. I suppose really I need dot-matches-line-separators but I need a better way of finding the end of a single line comment? The regexp I have so far are: @"/\\*.*?\\*/" @"//.*$" it's clear to see if dot matches a line separator then the second one (single line) never 'finishes' but how do I fix this? I found some suggestions for single line that were more like: @"(\/\/[^"\n\r]*(?:"[^"\n\r]*"[^"\n\r]*)*[\r\n])" But that doesn't' seem to work at all! Thanks in advance for any pointers.

    Read the article

  • What's the best way to debug AJAX to PHP calls?

    - by Jascha
    I'm having a miserable time debugging one small function on my new project. Essentially I'm having a user log out via an AJAX call to my log out script on my server called "userfFunctions.php" I'm using AJAX so that I don't have the headache of writing more regex to match my mod_rewrites. Anyway, every so often, it seems as though my Post data just flat out dies and since the PHP is running behind the scenes, I feel like I have no way of finding out where the data flow is being disrupted. BTW This function works 19 hrs of the day. Here is the javascript function: function logOut(){ var data = new Object; data.log_out = true; $.ajax({ type: 'POST', url: 'http://www.mydomain.com/User_Validator', //<-- redirects to userFunctions.php data: data, success: function(data) { alert(data); // <-- a response is triggered but with no response data! } }); } the php side: if(isset($_POST['log_out'])){ echo 'alert this!'; } here is my awesome response:

    Read the article

  • Django populate select field based on model query

    - by Mike
    I have the following model class DNS(models.Model): domain = models.ForeignKey(Domain) host_start = models.CharField(max_length=150, blank=True, null=True) type = models.SmallIntegerField(max_length=1, default=0, choices=DNS_CHOICE) value = models.SmallIntegerField(max_length=3, default=0, blank=True, null=True) ip = models.IPAddressField(blank=True, null=True) host_end = models.ForeignKey("DNS", blank=True, null=True) other_end = HostnameField(max_length=150, blank=True, null=True) created = models.DateTimeField(auto_now_add=True) sticky = models.BooleanField(default=0) other = models.BooleanField(default=0) When I try to init a form with just foreignkeys on host_end.. it always shows all entries in the DNS table domain = Domain.objects.get(id=request.GET['domain'], user=request.user, active=1) form = DNSFormCNAME(initial={'ip': settings.MAIN_IP, 'type': request.GET['type'], 'host_end': DNS.objects.filter(domain=domain)}) I just want the zones that match that domain.. not all domains.

    Read the article

  • What algorithm would you use to code a parrot?

    - by Phil H
    A parrot learns the most commonly uttered words and phrases in its vicinity so it can repeat them at inappropriate moments. So how would you create a software version? Assuming it has access to a microphone and can record sound at will, how would you code it without requiring infinite resources? The best I can imagine is to divide the stream using silences in the sound, and then use some pattern recognition to encode each one as a list of tokens, storing new ones as you meet them. Hashing the token sequences and counting occurrences in a database, you could build up a picture of the most frequently uttered phrases. But given the huge variety in phrases, how do you prevent this just becoming a huge list? And the sheer number of pairs to match would surely generate lot of false positives from the combinatorial nature of matching. Would you use a neural net, since that's how a real parrot manages it? Or is there another, cleverer way of matching large-scale patterns in analogue data?

    Read the article

  • sql server bulk copy out/postgres copy from infile

    - by Chris Curvey
    I'm starting a conversion of a system from MS SQL Server to Postgres. I have the table structures converted, and I use "bcp" to get the data out of SQL Server. ERROR: invalid byte sequence for encoding "UTF8": 0x80 HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding". CONTEXT: COPY cm_outgoing, line 200: "200 c:\temp\200.xml 2009-10-10 01:50:44.000 1900-01-01 00:00:00.000" I've already used "sed" to get rid of the NUL (0x00) entries in the file, and I can't find any instances of 0x80 in the file that I'm trying to import. Any thoughts? Is there an easier way?

    Read the article

  • Hudson, is it possible to make a plugin configuration non-visible depending on job type?

    - by Haju
    With the plugin (SCM plugin) I'm working on the problem is that it doesn't work in any other job/project type than Freestyle-project. I'd like to hide the plugin configuration from project configuration page on other job/project types (maven, matrix etc), because it seems to distract people. I wonder if there's a "right" way of doing this, or any way at all? Currently the project type is checked in checkout-method as a first thing, and if it doesn't match, the build is failed instantly, but this is not completely satisfactory solution, since it causes a bit more work to the end user.

    Read the article

  • Why does SQL Server 2000 treat SELECT test.* and SELECT t.est.* the same?

    - by Chris Pebble
    I butter-fingered a query in SQL Server 2000 and added a period in the middle of the table name: SELECT t.est.* FROM test Instead of: SELECT test.* FROM test And the query still executed perfectly. Even SELECT t.e.st.* FROM test executes without issue. I've tried the same query in SQL Server 2008 where the query fails (error: the column prefix does not match with a table name or alias used in the query). For reasons of pure curiosity I have been trying to figure out how SQL Server 2000 handles the table names in a way that would allow the butter-fingered query to run, but I haven't had much luck so far. Any sql gurus know why SQL Server 2000 ran the query without issue? Update: The query appears to work regardless of the interface used (e.g. Enterprise Manager, SSMS, OSQL) and as Jhonny pointed out below it bizarrely even works when you try: SELECT TOP 1000 dbota.ble.* FROM dbo.table

    Read the article

  • FULLTEXT Irrelevant results

    - by Imran Omar Bukhsh
    Just came across this issue using the fulltext search of mysql. I have like 250 records ( long articles like stuff ) and am using the fulltext MATCH AGAINST IN BOOLEAN MODE. Now if I search for a keyword e.g. 'Samsung' and if this keyword is present in ALL the records then it returns all the 250 records which it should ( of course without `IN BOOLEAN MODE it would return nothing as the keyword is present in more than 50% of the records ). Now the problem is that in some articles the keyword 'Samsung' occurs once and in others a couple of times, but MYSQL is giving a score of 1 to all the records returned, even those which have 'Samsung' like 15 times in them.

    Read the article

  • iOS Development: Should the "playersToInvite" property contain an array of strings or an array of GKPlayer objects?

    - by BeachRunnerJoe
    Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation. Here's the description for that property in the docs... A list of players to invite to the match. Why did they even bother writing that? Thanks for your help!

    Read the article

  • Using pipes inside a class in C++

    - by Paul
    I'm trying to use this tutorial to make plots with Gnuplot in C++. However I will be using the pipe to Gnuplot from within a class, but then I run into some problems: I've got a header file where I declare all variables etc. I need to declare the pipe-variable here too, but how do I do that? I've tried doing it straight away, but it doesn't work: Logger.h: class Logger { FILE pipe; } Logger.cpp: Logger::Logger() { //Constructor *pipe = popen("gnuplot -persist","w"); } Gives the error Logger.cpp:28: error: no match for ‘operator=’ in ‘*((Logger*)this)->Logger::pipe = popen(((const char*)"gnuplot -persist"), ((const char*)"w"))’ Suggestions?

    Read the article

  • Java regex skipping matches

    - by Mihail Burduja
    I have some text; I want to extract pairs of words that are not separated by punctuation. Thi is the code: //n-grams Pattern p = Pattern.compile("[a-z]+"); if (n == 2) { p = Pattern.compile("[a-z]+ [a-z]+"); } if (n == 3) { p = Pattern.compile("[a-z]+ [a-z]+ [a-z]+"); } Matcher m = p.matcher(text.toLowerCase()); ArrayList<String> result = new ArrayList<String>(); while (m.find()) { String temporary = m.group(); System.out.println(temporary); result.add(temporary); } The problem is that it skips some matches. For example "My name is James", for n = 3, must match "my name is" and "name is james", but instead it matches just the first. Is there a way to solve this?

    Read the article

< Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >