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
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.
Hi folks!
I read the german article about "Make" on Wikipedia and found the following 2 lines:
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
Why is the dependency expression left out and why does the target use a double file extension?
I'm working on 2 cases:
assume I have those var:
a = "hello"
b = "hello-SP"
b = "not_hello"
1 - Any partial matches
I want to accept any string that has the var a inside, so b and c would match.
2 - Patterned match
I want to match a string that has a inside, followed by '-', so b would match, c does not.
I am having problem, because I always used the syntax /expression/ to define Regexp, so how dinamicaly define an RegExp on Ruby??
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?
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.
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!
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?
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 often have a situation where I want to do some conditional logic and then return a part of the condition. How can I do this without repeating the part of the condition in the true or false expression?
For example:
ClassName.method.blank? ? false : ClassName.method
Is there any way to avoid repeating ClassName.method?
Here is a real-world example:
PROFESSIONAL_ROLES.key(self.professional_role).nil? ?
948460516 : PROFESSIONAL_ROLES.key(self.professional_role)
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
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.
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.
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?
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.
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????
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 !
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
Is there any way, given a function passed as a parameter, to alter its input parameter string before evaluating it?
Here's pseudo-code for what I'm hoping to achieve:
test.func <- function(a, b) {
# here I want to alter the b expression before evaluating it:
b(..., val1=a)
}
Given the function call passed to b, I want to add in a as another parameter without needing to always specify ... in the b call. So the output from this test.func call should be:
test.func(a="a", b=paste(1, 2))
"1" "2" "a"
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.
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'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?
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"