Search Results

Search found 4498 results on 180 pages for 'expression'.

Page 14/180 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • ZF2 Zend\Db Insert/Update Using Mysql Expression (Zend\Db\Sql\Expression?)

    - by Aleross
    Is there any way to include MySQL expressions like NOW() in the current build of ZF2 (2.0.0beta4) through Zend\Db and/or TableGateway insert()/update() statements? Here is a related post on the mailing list, though it hasn't been answered: http://zend-framework-community.634137.n4.nabble.com/Zend-Db-Expr-and-Transactions-in-ZF2-Db-td4472944.html It appears that ZF1 used something like: $data = array( 'update_time' => new \Zend\Db\Expr("NOW()") ); And after looking through Zend\Db\Sql\Expression I tried: $data = array( 'update_time' => new \Zend\Db\Sql\Expression("NOW()"), ); But get the following error: Catchable fatal error: Object of class Zend\Db\Sql\Expression could not be converted to string in /var/www/vendor/ZF2/library/Zend/Db/Adapter/Driver/Pdo/Statement.php on line 256 As recommended here: http://zend-framework-community.634137.n4.nabble.com/ZF2-beta3-Zend-Db-Sql-Insert-new-Expression-now-td4536197.html I'm currently just setting the date with PHP code, but I'd rather use the MySQL server as the single source of truth for date/times. $data = array( 'update_time' => date('Y-m-d H:i:s'), ); Thanks, I appreciate any input!

    Read the article

  • Parsing an arithmetic expression and building a tree from it in Java

    - by ChocolateBear
    Hi, I needed some help with creating custom trees given an arithmetic expression. Say, for example, you input this arithmetic expression: (5+2)*7 The result tree should look like: * / \ + 7 / \ 5 2 I have some custom classes to represent the different types of nodes, i.e. PlusOp, LeafInt, etc. I don't need to evaluate the expression, just create the tree, so I can perform other functions on it later. Additionally, the negative operator '-' can only have one child, and to represent '5-2', you must input it as 5 + (-2). Some validation on the expression would be required to ensure each type of operator has the correct the no. of arguments/children, each opening bracket is accompanied by a closing bracket. Also, I should probably mention my friend has already written code which converts the input string into a stack of tokens, if that's going to be helpful for this. I'd appreciate any help at all. Thanks :) (I read that you can write a grammar and use antlr/JavaCC, etc. to create the parse tree, but I'm not familiar with these tools or with writing grammars, so if that's your solution, I'd be grateful if you could provide some helpful tutorials/links for them.)

    Read the article

  • I need a fast runtime expression parser

    - by Chris Lively
    I need to locate a fast, lightweight expression parser. Ideally I want to pass it a list of name/value pairs (e.g. variables) and a string containing the expression to evaluate. All I need back from it is a true/false value. The types of expressions should be along the lines of: varA == "xyz" and varB==123 Basically, just a simple logic engine whose expression is provided at runtime. UPDATE At minimum it needs to support ==, !=, , =, <, <= Regarding speed, I expect roughly 5 expressions to be executed per request. We'll see somewhere in the vicinity of 100/requests a second. Our current pages tend to execute in under 50ms. Usually there will only be 2 or 3 variables involved in any expression. However, I'll need to load approximately 30 into the parser prior to execution. UPDATE 2012/11/5 Update about performance. We implemented nCalc nearly 2 years ago. Since then we've expanded it's use such that we average 40+ expressions covering 300+ variables on post backs. There are now thousands of post backs occurring per second with absolutely zero performance degradation. We've also extended it to include a handful of additional functions, again with no performance loss. In short, nCalc met all of our needs and exceeded our expectations.

    Read the article

  • Use regular expressions to match an ? but not a \?

    - by J.Milly
    I have a PHP regular expression that has been functioning fairly well to parse some odd legacy client templates until recently when we found an escaped question mark (\?) included in a template expression. I'm not strong enough with my regular expression-fu to wrap my feeble noodle around a negative look ahead or some techno-mumbo-jumbo so, tips or points in the right direction would be greatly appreciated. My PHP: preg_match_all("/\{\{IF (.*)\?(.*):(.*)\}\}/U", $template, $m, PREG_SET_ORDER);

    Read the article

  • ANTLR expressions rewrite intermediate tree

    - by user313856
    For expressions like 3+4 I would like to use the value 7 in an intermediate representation tree. I cannot work out how to get the returns value into a rewrite rule. expression returns [int v]: etc. How do I get expression.v into WR? At the moment I get (+ 3 4), I want (7) |^( WRITE c=expression) - ^(WRINT ^(INTC ^($c)) the next step is to emit 7 in an assembler.

    Read the article

  • javascript regex: match altered version of first match with only one expression

    - by theseion
    Hi there I'm writing a brush for Alex Gorbatchev's Syntax Highlighter to get highlighting for Smalltalk code. Now, consider the following Smalltalk code: aCollection do: [ :each | each shout ] I want to find the block argument ":each" and then match "each" every time it occurrs afterwards (for simplicity, let's say every occurrence an not just inside the brackets). Note that the argument can have any name, e.g. ":myArg". My attempt to match ":each": \:([\d\w]+) This seems to work. The problem is for me to match the occurrences of "each". I thought something like this could work: \:([\d\w]+)|\1 but the right hand side of the alternation seems to be treated as an independent expression, so backreferencing doesn't work. So my question is: is it even possible to accomplish what I want in a single expression? Or would I have to use the backreference within a second expression (via another function call)? Cheers.

    Read the article

  • Iterate over framesets with XPath expression in JavaScript?

    - by Derek Mahar
    Why does the following JavaScript, when run in Firefox 3.6.3, delete all FRAMESET elements in a document, but the similar script that instead uses an XPath expression to select the FRAMESET elements, does not? Is document.evaluate() simply unable to match FRAMESET elements? Is there an error in the XPath expression? Is there some other error? Select all FRAMESET elements using method document.getElementsByTagName() (succeeds): var framesets = document.getElementsByTagName('frameset'); for (var i = 0; i < framesets.length; i++) { framesets[i].parentNode.removeChild(framesets[i]); } Select all FRAMESET elements using an XPath expression (fails): var framesets = document.evaluate("//frameset", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < framesets.length; i++) { framesets[i].parentNode.removeChild(framesets[i]); }

    Read the article

  • regular expression with "|"

    - by WtFudgE
    I need to be able to check for a pattern with | in them. For example an expression like d*|*t should return true for a string like "dtest|test". I'm no regular expression hero so I just tried a couple of things, like: Regex Pattern = new Regex("s*\|*d"); //unable to build because of single backslash Regex Pattern = new Regex("s*|*d"); //argument exception error Regex Pattern = new Regex(@"s*\|*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex(@"s*|*d"); //argument exception error Regex Pattern = new Regex("s*\\|*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex("s*" + "\\|" + "*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex(@"s*\\|*d"); //argument exception error I'm a bit out of options, what should I then use? I mean this is a pretty basic regular expression I know, but I'm not getting it for some reason.

    Read the article

  • hierarchical clustering with gene expression matrix in python

    - by user248237
    how can I do a hierarchical clustering (in this case for gene expression data) in Python in a way that shows the matrix of gene expression values along with the dendrogram? What I mean is like the example here: http://www.mathworks.cn/access/helpdesk/help/toolbox/bioinfo/ug/a1060813239b1.html shown after bullet point 6 (Figure 1), where the dendrogram is plotted to the left of the gene expression matrix, where the rows have been reordered to reflect the clustering. How can I do this in Python using numpy/scipy or other tools? Also, is it computationally practical to do this with a matrix of about 11,000 genes, using euclidean distance as a metric? thanks.

    Read the article

  • Regular expression only for website

    - by Katie
    HI, I'm new to Regular Expression. I need to find just website in some text and I'm looking for a regular expression able to find out strings like: www.my.home, http://my.site.it But this regular expression should not find strings like: [email protected] or if the website is already inside html tag <a href="http://www.my.site.com/"><span style="font-style: normal;">www.mambo-test.org</span></a> I tried with this one: \b((https?://[^ ])|(www.[^ ])) but it also finds the website in the href and between the tag: <a href="http://www.my.site.com/"><span style="font-style: normal;">www.mambo-test.org</span></a> and I don't know how except this case.

    Read the article

  • whats wrong with this regular expression c#?

    - by Greezer
    I runned into a problem with my regular expressions, I'm using regular expressions for obtaining data from the string below: "# DO NOT EDIT THIS MAIL BY HAND #\r\n\r\n[Feedback]:hallo\r\n\r\n# DO NOT EDIT THIS MAIL BY HAND #\r\n\r\n" So far is got it working with: String sFeedback = Regex.Match(Message, @"\[Feedback\]\:(?<string>.*?)\r\n\r\t\n# DO NOT EDIT THIS MAIL BY HAND #").Groups[1].Value; This works except if the header is changed, therefore I want the regex to read from [feedback]: to the end of the string. (symbols, ascii, everything..) I tried: \[Feedback]:(?<string>.*?)$ Above regular expression does work in some regular expression builders online but in my c# code its not working and returns a empty string. can someone help me with this regular expression? thanks in advance

    Read the article

  • Expression.Call() to String.Equals() throws error

    - by Sam
    The following code: var constant = Expression.Constant("find me", typeof(string)); // memberExpression evaluates to a string var predicate = Expression.Call(memberExpression, "Equals", null, constant); is throwing the error More than one method 'Equals' on type 'System.String' is compatible with the supplied arguments. I'm guessing that's because there's Equals(Object) and Equals(String) - is there any way for me to specify which method I mean to use via the overload of Expression.Call() that takes an instance method name as a string? Or do I have to make a special case for calls to Equals() to take a MethodInfo instead?

    Read the article

  • Custom Expression in Linq-to-Sql Designer

    - by csharpnoob
    According to Microsoft: http://msdn.microsoft.com/de-de/library/system.data.linq.mapping.columnattribute.expression.aspx It's possible to add expression to the Linq-to-SQL Mapping. But how to configure or add them in Visual Studio in the Designer? Problem, when I add it manual to thex XYZ.designer.cs it on change it will be lost. //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ This is generated: [Column(Name="id", Storage="_id", DbType="Int")] public System.Nullable<int> id { ... But i need something like this [Column(Name="id", Storage="_id", DbType="Int", Expression="Max(id)")] public System.Nullable<int> id { ... Thanks.

    Read the article

  • "Cannot use fixed local inside lambda expression"

    - by JulianR
    I have an XNA 3.0 project that compiled just fine in VS2008, but that gives compile errors in VS2010 (with XNA 4.0 CTP). The error: Cannot use fixed local 'depthPtr' inside an anonymous method, lambda expression, or query expression depthPtr is a fixed float* into an array, that is used inside a Parallel.For lambda expression from System.Threading. As I said, this compiled and ran just fine on VS2008, but it does not on VS2010, even when targeting .NET 3.5. Has this changed in .NET 4.0, and even so, shouldn't it still compile when I choose .NET 3.5 as the target framework? Searching for the term "Cannot use fixed local" yields exactly one (useless) result, both in Google and Bing. If this has changed, what is the reason for this? I can imagine capturing a fixed pointer-type in a closure could get a bit weird, is that why? So I'm guessing this is bad practice? And before anyone asks: no, the use of pointers is not absolutely critical here. I would still like to know though :)

    Read the article

  • asp.net regular expression not working as expected

    - by Zaps
    Hi, I have a textbox and a regular expression validator applied to it. I want to make sure that the only allowed string inputted into the textbox are "Anything Entered" or "Something Else" or "Another String" otherwise I want an error to be displayed. This is the regular expression I have so far: ValidationExpression="(^Anything Entered)$|(^Something Else)$ |(^Another String)$" However when I enter the supposed valid strings the error is displayed. I cant figure out whats wrong with the expression. Any help would be greatly appreciated. Thanks, Zaps

    Read the article

  • regular expression

    - by Altariste
    Hi, I need to find all invocations of some logging macros in the code. The macro invocation is of the form: DEBUG[1-5] ( "methodName: the logged message", arguments) But the new versions of the macros are prepending the name of the method automatically, so my task is to write a Python script that will remove the duplicate function names specified already by the programmer. I'm using the sub function from the re module. I plan to substitute the part indicated by || signs below : ||DEBUG[1-5] ("methodName: || the logged message", arguments) with simply DEBUG[1-5](" The problem is following: To find the expressions I want to substitute, I use the following regular expression: ((DEBUG | INFO | all other macros names )[1-5]*)\s*\(\"\w+: But it doesn't match the whole expression ( from DEBUG right to the colon ), but only the macro name, that is for example DEBUG5. Is my expression wrong or there is some quirk in the Python regex processing? ( maybe the fact that I use the DEBUG[1-5] as a subgroup has something to do with this? ) Help from anyone more knowledgable than me appreciated :).

    Read the article

  • Search outlook 2003 using a regular expression

    - by Doug T.
    Every week I have to do the same report for my bosses. Our bug tracker sends us emails, and to be sure I caught everything I often need to search Outlook for all the bug email's I've received. If I could search the email subject using a regular exrpession, my life would be much easier. Can I search my inbox using a regular expression in Outlook 2003?

    Read the article

  • RegexClean Transformation

    Use the power of regular expressions to cleanse your data right there inside the Data Flow. This transformation includes a full user interface for simple configuration, as well as advanced features such as error output configuration. Two regular expressions are used, a match expression and a replace expression. The transformation is designed around the named capture groups or match groups, and even supports multiple expressions. This allows for rich and complex expressions to be built, all through an easy to reuse transformation where a bespoke Script Component was previously the only alternative. Some simple properties are available for each column selected – Behaviour The two behaviour modes offer similar functionality but with a difference. Replace, replaces tokens with the input, and Emit overwrites the whole string. Cascade Cascade allows you to define multiple expressions, each on a new line. The match expression will be processed into one operation per line, which are then processed in order at run-time. Multiple replace expressions can also be specified, again each on a new line. If there is no corresponding replace expression for a match expression line, then the last replace expression will be used instead. It is common to have multiple match expressions, but only a single replace expression. Match Expression The expression used to define the named capture groups. This is where you can analyse the data, and tag or name elements within it as found by the match expression. Replace Expression The replace determines the final output. It will reference the named groups from the match expression and assembles them into the final output. If you want to use regular expressions to validate data then try the Regular Expression Transformation. Quick Start Guide Select a column. A new output column is created for each selected column; there is no option for in-place replacement of column values. One input column can be used to populate multiple output columns, just select the column again in the lower grid, using the Input Columns drop-down selector. Amend the output column name and size as required. They default to the same as the input column selected. Amend the behaviour as required, the default is Replace. Amend the cascade option as required, the default is true. Finally enter your match and replace regular expressions Quick Sample #1 Parse an email address and extract the user and domain portions. Format as a web address passing the user portion as a URL parameter. This uses two match groups, user and host, which correspond to the text before the @ and after it respectively. Behaviour is Emit, and cascade of false, we only have a single match expression. Match Expression ^(?<user>[^@]+)@(?<host>.+)$ Replace Expression - http://www.${host}?user=${user} Results Sample Input Sample Output [email protected] http://www.adventure-works.com?user=zheng0 The component is provided as an MSI file, however to complete the installation, you will have to add the transformation to the Visual Studio toolbox manually. Right-click the toolbox, and select Choose Items.... Select the SSIS Data Flow Items tab, and then check the RegexClean Transformation from the list. Downloads The RegexClean Transformation is available for both SQL Server 2005 and SQL Server 2008. Please choose the version to match your SQL Server version, or you can install both versions and use them side by side if you have both SQL Server 2005 and SQL Server 2008 installed. RegexClean Transformation for SQL Server 2005 RegexClean Transformation for SQL Server 2008 Version History SQL Server 2005 Version 1.0.0.105 - Public Release (28 Jan 2008) SQL Server 2005 Version 1.0.0.105 - Public Release (28 Jan 2008) Screenshot

    Read the article

  • TFS Build Server not finding 'Microsoft.Expression.Interactions&rsquo;

    - by Chris Skardon
    We’ve been trying to get the build server to pick up the Microsoft.Expression.Interactions.dll needed so we can use things like the ExtendedVisualStateManager and the DataStateBehavior. Adding the DataStateBehavior in Blend adds the reference to the project, so it all compiles fine on the local machine. Checking in the code into a CI server throws up some ugliness: d:\Builds\6\Source\MyFile.xaml (290): The tag 'DataStateBehavior' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactions'. Errr, it should do…?? The reference is there, so… ahhhhh! A quick check of the properties and we’re using the dll from the c:\program files (x86)\ location, no wonder the build server can’t find it – let’s add the dll into our (ever expanding) ‘lib’ folder, reference that version, and check that bad boy in… No. Still No. Still get the same error. What the??? The reference is still pointing to the program files location?? Ok, so let’s modify the csproj file using the wonderful notepad, changing the reference from <Reference Include="Microsoft.Expression.Interactions, /* loadsa shizzle here */ /> to <Reference Include="Microsoft.Expression.Interactions">     <HintPath>..\Lib\Microsoft.Expression.Interactions.dll</HintPath> </Reference> Check that in, aaaand… Success!!! The reason for this (from what I can gather from here) is that we’re using the Productivity Power Tools, and they try to be clever about referencing dlls, and changed what we’d asked (i.e. for the local version) to use the original program files location.. Editing the file in notepad (sweet sweet notepad) gets around this issue… Irritating, took a while to figure this out… Meh :)

    Read the article

  • regular expression to find all cell addresses in string

    - by Nike
    I have a string which may contain cell address, which is look like: A1, B34, Z728 - only capital letters and AA3, ABA92, ZABC83 - there may be several letters before Integer number. The typical source string is look like: =3+7*A1-B3*AB28 I need to get collection of all cells in the string: A1, B3, AB28 I tried to use Regex.Matches method with the following regular expression: @"[A..Z]+?[1..9]+?", but it doesn't work. Can anybody help me to write the regular expression?

    Read the article

  • Sensible Doctrine Expression and Zend_Auth setCredentialTreatment()

    - by takeshin
    How to create reasonable expression to store password in database using Doctrine and Zend_Auth::setCredentialTreatment()? I don't want to use md5() and the code must be portable, and with salt. I would call this not easy one to guess: setCredentialTreatment("SHA1(CONCAT(username, SHA1(CONCAT(username, ?)))"); but it is not portable to all databases. Seems that Doctrine_Expression has only md5 expression portability.

    Read the article

  • Biztalk - local variable in expression shape

    - by Jeremy Stein
    Sometimes when I'm writing XLANG/s code in an expression shape, it would be more readable if I could just use a temporary variable within the scope of that one code block. I hate to clutter up the entire orchestration with a variable declaration. Is there a way to declare a variable within an expression shape?

    Read the article

  • Regular Expression With Mask

    - by Kumar
    I have a regular expression for phone numbers as follows: ^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$ I have a mask on the phone number textbox in the following format: (___)___-____ How can I modify the regular expression so that it accommodates the mask?

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >