Hi,
I'm using regular expression to count the total spaces in a line (first occurrence).
match(/^\s*/)[0].length;
However this reads it from the start to end, How can I read it from end to start.
Thanks
I know that Selenium has a built-in method getTable("tableName.row.column") can return a cell conveniently. However how can I return a whole column?
I've tried getText() directly, however only the first cell was returned,
getText("//tbody[@id='recordsTable']/tr[contains(@class, 'someclass')]")
But getXpathCount() with the same Xpath expression showed there're multiple elements matched.
getXpathCount("//tbody[@id='recordsTable']/tr[contains(@class, 'someclass')]") // result is 15
Please kindly help, many thanks!
I'm trying to rename the columns. The syntax should be the column name between double quotes incase of two words, like this:
SELECT p_Name "Product Name" from items
So I'm trying to do it in C# code like this:
string sqlqry1 = "SELECT p_Name \"Prodcut Name\" from items";
But I get an error:
Syntax error (missing operator) in query expression 'p_Name "Prodcut Name"'.
It seems am having somthing wrong with the quotes, but I can't figure out.
I have the following function:
$('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings))
.each(function () {
aData.push(this.value);
});
In typescript I am getting a message saying:
Error 3 Function declared a non-void return type, but has no return expression
Why am I getting this message? I can resolve the message by saying "return true". Should I always specify a return type for this?
I have a to-many relationship in my data model, and I'd like to get all the objects that have no corresponding objects in the relationship. For example:
Customer - Purchases
I want to get all Customers that have 0 Purchases.
I've read somewhere that I could use "Purchases[SIZE] = 0", but this gives me an unsupported function expression error, which I think means it doesn't work with a SQLite backing store (which I don't want to switch from, due to some performance constraints).
Any ideas?
Possible Duplicate:
A comprehensive regex for phone number validation
I would like a regular expression in this format. It Must match one of the following formats:
(###)###-####
###-###-####
###.###.####
##########
Strip all whitespace. Make sure it's a valid phone number, then (if necessary) translate it to the first format listed above.
According to the ARM manual, it should be possible to access the banked registers for a specific CPU mode as, for instance, "r13_svc". When I try to do this gcc yells at me with the following error:
immediate expression requires a # prefix -- `mov r2,sp_svc'
What's wrong?
In Eclipse (and Flash/Flex Builder) you get the option with Ctrl+Shift+F to do a file search and look for a regular expression. Would be a real handy thing to know.
I want to find the word negate if it appears in a Flex/java comment like the following:
// It was negated because
or
/*
The negate option was....
*/
or
/**
* We have to negate the value
*/
Any ideas? Will test them out at http://www.regexplanet.com/simple/index.html
So I have this code here:
toWords :: String - [a]
toWords "" = []
toWords (nr1 : rest)
| nr1 == ' ' = toWords rest
| otherwise = nr1 : toWords rest
The "toWords" function should simply remove all spaces and return a list with all the words. But I keep getting this error:
test.hs:5:18:
Couldn't match expected type a' against inferred typeChar'
`a' is a rigid type variable bound by
the type signature for `toWords' at test.hs:1:22
In the first argument of `(:)', namely `nr1'
In the expression: nr1 : toWords rest
In the definition of `toWords':
toWords (nr1 : rest)
| nr1 == ' ' = toWords rest
| otherwise = nr1 : toWords rest Failed, modules loaded:
none.
My URL's can be absolute or relative:
$rel = "date/album/001.jpg";
$abs = "http://www.site.com/date/album/image.jpg";
function getFilename($url) {
$imgName = explode("/", $url);
$imgName = $imgName[count($imgName) - 1];
echo $imgName;
}
There must be a faster way to do this right?
Maybe a reg expression? But that's Chinese to me..
I want to validate login name with special characters !@#S%^*()+_-?/<:"';. space using regular expression in ruby on rails. These special characters should not be acceptable. What is the code for that?
Thanks,
Pallavi
In Java regular expression, it has "\B" as a non-word boundary.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html
If I have a 'char', how can I check it is a non-word boundary?
Thank you.
Hi, I am using jsf 1.2_12, here i am not able to find Method Expression or getExpressionFactory in Facescontext.getcurrentInstance().getApplication. What could be the problem. kindly help.
Given the following fragment of html:
<fieldset>
<legend>My Legend</legend>
<p>Some text</p>
Text to capture
</fieldset>
Is there an xpath expression that will return only the 'Text to capture' text node?
Trying /fieldset/text() yields three nodes, not just the one I need.
Hi,
How to properly construct regular expression for "grep" linux program, to find all email in, say /etc directory ?
Currently, my script is following:
grep -srhw "[[:alnum:]]*@[[:alnum:]]*" /etc
It working OK - a see some of the emails, but when i modify it, to catch the one-or-more charactes before- and after the "@" sign ...
grep -srhw "[[:alnum:]]+@[[:alnum:]]+" /etc
.. it stops working at all
Also, it does't catches emails of form "[email protected]"
Help !
I use this regex on some input,
[^a-zA-Z0-9@#]
However this ends up removing lots of html special characters within the input, such as
227;, #1606;, #1588; (i had to remove the & prefix so that it wouldn't show up as the actual value..)
is there a way that I can convert them to their values so that it will satisfy the regexp expression? I also have no idea why the text decided to be so big.
In Perl, I would write:
$x = "abbbc";
$x =~ s/(b+)/z/;
print "Replaced $1 and ended up with $x\n";
# "Replaced bbb and ended up with azc"
How do I do this in Python -- do a regular-expression string replacement and record what it was that got replaced?
Once i run this query, getting the following error. please help.
select
OrderDetails.Sku,orderdetails.mf_item_number,orderdetails.Qty,orderdetails.Price,Supplier.SupplierId,
Supplier.SupplierName,Supplier.DropShipFees,
cost = (Select Supplier_Item.Price
from
Supplier_Item,orderdetails,Supplier
where
Supplier_Item.SKU=OrderDetails.Sku and
Supplier_Item.SupplierId=Supplier.SupplierID
) from
orderdetails,Supplier,Group_Master
where invoiceid='339740' and
OrderDetails.Mfr_ID =
Supplier.SupplierId and
Group_Master.Sku = OrderDetails.Sku
Msg 512, Level 16, State 1, Line 2
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , , = or when the subquery is used as an expression.
while using
USE mssqltips_tde;
CREATE DATABASE ENCRYPTION KEY with ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE TDECert
GO
getting error
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword
'KEY'. Msg 319, Level 15, State 1,
Line 3 Incorrect syntax near the
keyword 'with'. If this statement is a
common table expression or an
xmlnamespaces clause, the previous
statement must be terminated with a
semicolon.
please help in resolving the same as i need to implement Encryption on my DB
I want the paging of master-detail report (SSRS) in detail table, i have joined two tables for datasource. I have given the expression in table group like this '=Int((RowNumber("list1_Details_Group")-1)/12)' but it breaks the page after every list instead of rows????
When indenting java code with annotations, vim insists on indenting like this:
@Test
public void ...
I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not sure if I can use that together with regular cindent.
edit: The filetype plugin was already turned on I just got a bit confused about indenting plugins. The accepted answer may be a bit hackish but works for me as well.
Hi,
Could anyone help me with how can we create chart for every row of the dataset in SSRS (rdl) !
Suppose the dataset has the following data
Name Age
------- -------
A 25
B 26
C 22
3 chart needs to be drawn for the x-axis/y-axis combination of A/25, B/26, C/22. How can I loop through rows of the dataset. And how can I restrict the chart to that particular data point. What would be the xsl expression corresponding to this functionality.
I am using htaccess in my projec.there is login section i want to show the my account page as http:///www/domain.com/username . But there is a problem because i have also made a cms which is open as http:///www/domain.com/cms .
Although i have validate the user name But there is same page open when i open the cms or user profile page.
I have pass the regular expression in htaccess but stil not required result is come
How can I write a Linq expression that select item from a List and join them together ?
Example
IList<string> data = new List<string>();
data.Add("MyData1");
data.Add("MyData2");
string result = //some linq query... I try data.Select(x => x + ",");
//result = "MyData1, MyData2"
I'm going to reuse OGNL library out of Struts2 scope. I have rather large set of formulas, that is why I would like to precompile all of them:
Ognl.parseExpression(expressionString);
But I'm not sure if precompiled expression can be used in multi-thread environment. Does anybody knows if it can be used?