if i have somthing like that:
func (x1:x2:x3:xs) = xs
then x1,x2,x3 must exist, yes?
they can't be [], but must(again, MUST) be with a value, yes?
also, the xs can be [] or [a] or [a,a,a] (etc'), yes?
(in [a] i mean that it's a list with one number, and [a,a,a] is list of three numbers).
also i have function that define isPrefixOf:
m...
How can i call a javascript function if a string contains any of the items in an array()?
Yes, i can use jquery :)
...
By clicking on the "mylink" I want the link to be replaced by the number "123", which is extracted from parent tag.
I think I'm not doing the ".match(...." right.
jQuery:
$(document).ready(function(){
$(".link").click(function(){
var comid = $(this).parents("div.comment").attr("class").match(/comment-([0-9]+)/)[1];
$(".link")...
Is it possible to fetch posts matching categorie x "AND" tag y?
Read the docs, it seems you can do:
query_posts('tag=bread,baking');
or
query_posts('cat=2,6,17,38');
... is it possible to use both cat and tag simultaneously?
...
<div>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
</div>
I want to find (and addClass to) the <p> tags that DO NOT contain text, directly inside itself or its children.
...
Just need a little push as I have this almost working.
I want to feed jquery a URL and have it strip everthing but the video url.
Here is my code:
var url = 'http://www.youtube.com/watch?v=bxp8NWvIeSo';
$results = url.match("[\\?&]v=([^&#]*)");
alert($results);
});
I'm getting this as an output -
?v=bxp8NWvIeSo,bxp8NWvIeS...
I'm trying to parse command line arguments in an F# application. I'm using pattern matching over parameters list to accomplish it. Something like:
let rec parseCmdLnArgs =
function
| [] -> { OutputFile = None ; OtherParam = None }
| "/out" :: fileName :: rest -> let parsedRest = parseCmdLnArgs rest
...
I need check whether a given array will match another array. I can't figure out how to either manipulate the first array, or to match it some other way.
I need to match this array:
Array
(
[1] => site
[2] => blog
[3] => index.php
)
to match this:
Array
(
[site] => Array
(
[path] => site
...
Hi,
Take the following URI:
http:\/\/.*\.google\.com/search/results\.php*
I am simply trying to match all single forward slashes ( / ) between two alphanumeric characters in a given URI. In the case above, the two just before search and results. Could you point me in the right direction?
EDIT
The intention is to do search and repla...
I use the following call for getting information from a database:
select * from submissions
where
match( description ) against ('+snowboard' in boolean mode )
and (!disabled or disabled='n')
order by datelisted desc limit 30
Which means everything with ‘snowboard' in the description is found. Now here’s the problem:
select ...
Hi I am usually programming in c++ so XML/XSL/XPATH is not my strong side, but I need to do a transformation and I cannot seem to find a good way of doing it.
We have an xml file that is formatted like this:
<outer>
<element/>
<other_element/>
<message pri="info">
[[!CDATA Error: something is not working]]
</message>
<me...
Is there a way to retrieve the (starting) character positions inside a string of the results of a regex match() in Javascript?
...
I have a html file that has invoice details
I would like to know is there a way that I can retrieve only the invoice numbers and store it separately in my sql database using php?
<p>Invoice ID: 0201</p>
<p>MID : Q987</p>
<p>Desciption: Solid Concrete Blocks</p>
<p>Qty: 7478 Blocks </p>
<p> </p>
<p>Invoice ID: 0324</p>
<p>MID : Q44...
We are working on clean-up and analysis of a lot of human-entered customer data. We need to decide programmatically whether 2 addresses (for example) are the same, even though the data was entered with slight variations.
Right now we run each address through fairly simplistic string replacement (replacing avenue with ave, for example)...
Hey,
Trying to solve this for a very long time now...
SELECT MATCH(name) AGAINST('абраксас')
(russian) doesn't work, but
SELECT MATCH(name) AGAINST('abraxas')
(english) work perfectly.
I know it's something with character-set, but I tried all kind of settings and it didn't work.
For now it's latin-1.
LIKE works
This is the show v...
This simple regex matching returns a string instead of an object on every browser but the latest firefox...
text = "language. Filename: My Old School Yard.avi. File description: File size: 701.54 MB. View on Megavideo. Enter this, here:"
name = text.match(/(Filename:)(.*) File /);
alert(typeof(name));
as far as i know ...
I am looking for the algorithm (or combo) that would allow someone to find new longtail PPC search phrases based on say one corekeyword.
Eg #1 word word corekeyword
eg #2 word corekeyword word
Google search tool allows a limited number vertically - mostly of eg#1 (https://adwords.google.com.au/select/KeywordToolExternal)
I also know ...
I have the following code which I use to match fancybox possible elements:
$('a.grouped_elements').each(function(){
var elem = $(this);
// Convert everything to lower case to match smart
if(elem.attr('href').toLowerCase().match('/gif|jpg|jpeg|png/') != null) {
elem.fancybox();
}
});
It works great with JPGs but...
Currently, I am testing every integer element against each other to find which ones match. The arrays do not contain duplicates within their own set. Also, the arrays are not always equal lengths. Are there any tricks to speed this up? I am doing this thousands of times, so it's starting to become a bottle neck in my program, which is ...
String match = "hello";
String text = "0123456789hello0123456789";
int position = getPosition(match, text); // should be 10, is there such a method?
...