suppose i have taken one picture from my iphone camera and now i want to compare this image with other images and find best match image from that.
is it possible or not?
I need to find « in a string with a regex. How would you add that into the following:
String RegExPattern = @"^[0-9a-df-su-z]+\.\s«";
Regex PatternRegex = new Regex(RegExPattern);
return (PatternRegex.Match(Source).Value);
I am using Lucene MultiFieldQueryParser and the implementation is as shown below
QueryParser parser = new MultiFieldQueryParser (Version.LUCENE_30,new String[] {"First Name","Middle Name","Last Name"}, standardAnalyzer); Query query = parser.parse(queryString);
and using it to find a match for the input string in my DB columns First Name, Middle Name and Last name .
I am able to get the hits with normal search and fuzzy search - The only problem I am facing is finding which column of the three generated the hit - Can you pls help me here - Thanks
While reading a file I get broken UTF-8 String error whenever I have the following in my file
través
if I change it to normal e then it works.
Whats the way to fix this?
error only happens if I do line.lstrp or any other function. Just printing the lines is ok.
problem even happens when I try to match the string with regex.
I tried to create a regular expression which catches all RFC-valid addresses but it's ok if some false-positives come through (though hopefully not so many). This is waht I came up so far:
/^\b\S+@\S+\.[^\s@]{2,}\b$/
Is there any RFC-valid address which doesn't match against this expression or do you have any suggestions to improve it? I don't mind the false positives but I would be glad if you show me a few, too.
In Haskell, there is a function "take n list" which returns the first n elements from a list. For example "sum (take 3 xs)" sums up the first three elements in the list xs. Does F# have an equivalent? I expected it to be one of the List-functions, but I can't spot anything that seems to match.
Hello,
I am using a regular expression search to match up and replace some text. The text can span multiple lines (may or may not have line breaks).
Currently I have this:
$regex = "\<\?php eval.*?\>"
Get-ChildItem -exclude *.bak | Where-Object {$_.Attributes -ne "Directory"} |ForEach-Object {
$text = [string]::Join("`n", (Get-Content $_))
$text -replace $RegEx ,"REPLACED"}
Looking for any help regarding the problem. Here's the deal: I have a database that has a teams table and it contains team_id. On one of my pages, I generate a list of links that contain the team_id of the creator in their get URL. I need the team_id on the next page but can't figure out how to pass it through any other way. Using a form and POST isn't an option because this method would only pass through the last links data on the list. Storing in a session isn't an option either because there is no way to discretely pass the the variables I need to a function to set the session variables. I have tried and it can pretty easily be viewed from viewing the source code. So here's some sample code to see exactly what I'm dealing with.
<?
if(mysql_num_rows($result2)>0){ ?>
<a class="fltrt btn btn-danger btn-small" onclick="test()" href="acceptmatch-exec.php?match_id=<?php echo $match_id; ?>&team_id=<?php echo $team_id;?>&action=cancel">Cancel Match</a>
<?}else{?>
<a class="fltrt btn btn-success btn-small" href="acceptmatch-exec.php?match_id=<?php echo $match_id; ?>&team_id=<?php echo $team_id;?>&action=accept">Accept Match</a>
<?} ?>
The code above is generated multiple times on a page via a while loop that was excluded. I want to pass the match_id and team_id variables without being seen anywhere. If I made this a form, it wouldn't pass the correct variables unless there is only one result at the time (not likely). I'm sure there has to be an easy method that is eluding me, so please share thoughts on how to solve this. I feel as though I am not explaining it well enough, but it's not really easy to explain. I basically want something that works like GET but acts like POST and can be hidden from people viewing source code or link locations.
Thanks
I have a string that looks like "(3) New stuff" where 3 can be any number.
I would like to add or subtract to this number.
I figured out the following way:
var thenumber = string.match((/\d+/));
thenumber++;
string = string.replace(/\(\d+\)/ ,'('+ thenumber +')');
Is there a more elegant way to do it?
I need to check if an element is x pixels from the bottom of the page, to dynamically load new content. currently, scrollTop and height do not match even if the bar is on the bottom.
jquery is allowed, although basic javascript would be more helpful.
I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like:
search oldlog\(.*\n\s+([\r\n.]*)\);replace newlog\(\1\)
Any ideas?
putStrLn "Enter the Artist Name"
art <- getLine
putStrLn "Enter the Number of CD's"
num <- getLine
let test= buyItem currentStockBase art num
printListIO (showcurrentList test)
the values i have to pass for buyItem is
buyItem currentStockBase "Akon" 20
but i want to send "Akon" to art and for 20 i want to send num
it gives me this error
ERROR file:.\Project2.hs:126 - Type error in application
*** Expression : buyItem currentStockBase art num
*** Term : num
*** Type : [Char]
*** Does not match : Int
please help me
I'm having some trouble using an NSUInteger, I've tried various things and googled, but not found the answer ?
I have... I also tried ... nonatomic, retain
@property (readwrite, assign) NSUInteger *anAmount;
@synthesize anAmount;
error: type of property 'anAmount' does not match type of ivar 'anAmount'
Also when I release it in dealloc I get a warning..
warning: invalid receiver type 'NSUInteger'
I'm searching files and returning lines that include the search text, and I'm not really sure the best way to display the information I get. Every time I get a match, I want to show, in some sort of control, the File it came from, and the whole text line. (aka streamreader.ReadLine() result). First I tried just putting it all in a read-only text box, but it doesn't have a scroll bar.
What is the best form control to help me display this data neatly?
Hi!
I'm writing a static page controller.
I get the menuname in the routes.rb and it's call the static controller show method.
match '/:menuname' = 'static#show'
And static_controller.rb:
@static=Staticpage.where("menuname =
?", params[:menuname])
But if I want print @static.title in the view, I get this error:
undefined method `title' for #
Whats wrong?
the SQL query looks good:
SELECT staticpages.* FROM staticpages WHERE (menuname = 'asd')
There are many similar questions, but apparently no perfect match, that's why I'm asking.
I'd like to split a random string (e.g. 123xx456yy789) by a list of string delimiters (e.g. xx, yy) and include the delimiters in the result (here: 123, xx, 456, yy, 789).
Good performance is a nice bonus. Regex should be avoided, if possible.
Anyone help? When I run this I get " invalid quantifier ?<=href= "
var aHrefMatch = new RegExp("(?<=href\=")[^]+?(?=")");
var matchedLink = mystring.match(aHrefMatch);
But I know the regular expression is valid.
Any ideas?
I'm writing a program which needs to traverse a set of directories. Tried to use the following code:
file.eachDirMatch(/.*[^.svn]/){
//some code here
}
But that ended up match none of my directories. I realize this boils down figuring out the right regex hang head in shame but even after revisiting some Java Regular Expression documentation I thought this should work.
I'm using the 'poster' attribute on a video tag and the way it seems to work at least in webkit browsers is that it loads the poster image and then once enough of the video has loaded, it replaces that poster with an auto-generated poster from the video file itself.
However, my poster images don't match the auto-generated posters which results in a weird experience of one image loading, then being replaced in a few seconds by the auto-generated image. Is there any way to prevent the auto-generated image from being used?
How can I match the following pattern?
"anything123.anythingelse"
Alphanum of any length, with exactly 1 "." in the middle, and then alphanum of any length?
Thanks.
I've created this code branch so that if the permalink settings do no match at least one of the OR conditions, I can execute the "do something" branch. However, I believe there is a flaw in the logic, since I've set permalinks to /%postname%.html and it still tries echo's true;
I believe I need to change the ORs to AND, right?
if (get_option('permalink_structure') !== "/%postname%/" ||
get_option('my_permalinks') !== "/%postname%/" ||
get_option('permalink_structure') !== "/%postname%.html" ||
get_option('my_permalinks') !== "/%postname%.html"))
{
//do something
echo "true";
}
I have a list of tuples, say [{x, a, y}, {x, b, y}].
Is there a built-in function (or can I use a combination of BIFs) to delete all tuples matching {x, _, y}, as in match and delete based on the first and third term in the tuples, ignoring the second?
I have a PHP script that checks the HTTP Referer.
if ($_SERVER['HTTP_REFERER'] == 'http://www.example.com/') {...}
However, this seems inherintly unsafe ... because what happens if the user goes to 'http://example.com/' or 'http://www.ExaMple.com' (both of which don't match the equality test).
Question: what's a better equality test to ensure that the HTTP Referer is coming from 'example.com' ?
Is it possible to return the color of the line when it is added to a Microsoft Chart control? I want to set the background color of the item in a treeview to match the color in the chart.
I have noticed that the quality of the images produced by the JPEGEncoder does not match that of other encoders available (i.e. php's built in image compression functions from the gd library)
Any explanation ? or hints/workarounds for improving the quality of compressed images by JPEGEncoder ??