Search Results

Search found 5101 results on 205 pages for 'expression trees'.

Page 119/205 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • How to parse a midlet JAD file in C#?

    - by codemonkie
    Besides doing it manually using regular expression search, is there other better ways to parse a JAD file? I need to be able to search for and replace/insert a new MIdlet-Install-Notify property to a JAD file given, also updating the value of the MIDlet-Jar-URL property. Using ANTLR or TinyPG is a bit overkill for my case. TIA

    Read the article

  • Write Scheme data structures so they can be eval-d back in, or alternative

    - by Jesse Millikan
    I'm writing an application (A juggling pattern animator) in PLT Scheme that accepts Scheme expressions as values for some fields. I'm attempting to write a small text editor that will let me "explode" expressions into expressions that can still be eval'd but contain the data as literals for manual tweaking. For example, (4hss->sexp "747") is a function call that generates a legitimate pattern. If I eval and print that, it becomes (((7 3) - - -) (- - (4 2) -) (- (7 2) - -) (- - - (7 1)) ((4 0) - - -) (- - (7 0) -) (- (7 2) - -) (- - - (4 3)) ((7 3) - - -) (- - (7 0) -) (- (4 1) - -) (- - - (7 1))) which can be "read" as a string, but will not "eval" the same as the function. For this statement, of course, what I need would be as simple as (quote (((7 3... but other examples are non-trivial. This one, for example, contains structs which print as vectors: pair-of-jugglers ; --> (#(struct:hand #(struct:position -0.35 2.0 1.0) #(struct:position -0.6 2.05 1.1) 1.832595714594046) #(struct:hand #(struct:position 0.35 2.0 1.0) #(struct:position 0.6 2.0500000000000003 1.1) 1.308996938995747) #(struct:hand #(struct:position 0.35 -2.0 1.0) #(struct:position 0.6 -2.05 1.1) -1.3089969389957472) #(struct:hand #(struct:position -0.35 -2.0 1.0) #(struct:position -0.6 -2.05 1.1) -1.8325957145940461)) I've thought of at least three possible solutions, none of which I like very much. Solution A is to write a recursive eval-able output function myself for a reasonably large subset of the values that I might be using. There (probably...) won't be any circular references by the nature of the data structures used, so that wouldn't be such a long job. The output would end up looking like `(((3 0) (... ; ex 1 `(,(make-hand (make-position ... ; ex 2 Or even worse if I could't figure out how to do it properly with quasiquoting. Solution B would be to write out everything as (read (open-input-string "(big-long-s-expression)")) which, technically, solves the problem I'm bringing up but is... ugly. Solution C might be a different approach of giving up eval and using only read for parsing input, or an uglier approach where the s-expression is used as directly data if eval fails, but those both seem unpleasant compared to using scheme values directly. Undiscovered Solution D would be a PLT Scheme option, function or library I haven't located that would match Solution A. Help me out before I start having bad recursion dreams again.

    Read the article

  • Last words of a ??? programmer

    - by Peter
    What will the last words of some kind of programmer be? Like: LW of a Perl programmer: I don't have to write documentation. The source is formatted so well, I can read it anytime later... or Im just going to write a regular expression to find this, then I'm done...

    Read the article

  • Invoking a PL/SQL function from EclipseLink

    - by Mark Robinson
    I'm trying to execute a PL/SQL function in EclipseLink which uses Oracle Specific types(eg. Boolean). I've tried using PLSQLStoredProcedureCall which complains that I'm not executing a procedure and I have tried using StoredFunctionCall but that returns PLS-00382: expression is of wrong type Has anyone developed a solution to invoke functions in EclipseLink with Oracle Types? I have heard that it would be possible to extend StoredFunctionCall but I'd rather leverage existing functionality as much as possible.

    Read the article

  • Python : Small Regex problem

    - by user316758
    Hi, when I try to extract this video ID (AIiMa2Fe-ZQ) with a regex expression, I can't get the dash an all the letters after. Someone can help me please? Thanks >>> id = re.search('(?<=\?v\=)\w+', 'http://www.youtube.com/watch?v=AIiMa2Fe-ZQ') >>> print id.group(0) >>> AIiMa2Fe

    Read the article

  • Selecting an element based on text and attribute of its sibling, using Xpath

    - by Adam Asham
    Looking at the document, the goal is to select the second cell from the second row, in the first table. I've created the following expression: //row/td[2]/text()[td[@class="identifier"]/span[text()="identifier"]] but it does not return any rows. Unfortunately I do not see what's wrong. To me, it looks alright. The expression should: select the text in the second cell in any row where the text of a span equals to "identifier" and the span is located in cell with a "identifier" class I'd appreciate it if you could point out what I'm doing wrong. Sample XML document: <?xml version="1.0"?> <html> <table class="first"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td class="identifier"> <span>identifier</span> </td> <td> foo <span>ignore</span> bar </td> </tr> <tr> <td>row 3, cell 1</td> <td>row 3, cell 2</td> </tr> </table> <table class="second"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td class="identifier"> <span>not an identifier</span> </td> <td> not a target </td> </tr> <tr> <td>row 3, cell 1</td> <td>row 3, cell 2</td> </tr> </table> </html>

    Read the article

  • Converting VB .NET code to C#

    - by Brono The Vibrator
    I have the follwing VB .NET code I am trying to convert to C# Dim decryptedBytes(CInt(encryptedStream.Length - 1)) As Byte I tried this: int tempData = Convert.ToInt32(encryptedStream.Length - 1); Byte decryptedBytes; decryptedBytes = decryptedBytes[tempData]; but got this error message: Cannot apply indexing with [] to an expression of type byte. Please note that the VB .NET code works.

    Read the article

  • Pros and Cons of programming languages for XML & string manipulation

    - by aepheus
    I don't mean this to be opinionated. What are serious pros/cons of various server-side languages in regards to creating/modifying xml. I'm currently researching new platform/language direction and we deal with a lot of xml. We also do a lot of string manipulation, what advantages/disadvantages do different languages have in regards to string manipulation. I'm thinking along the lines of regular expression searching and replacing.

    Read the article

  • Move from *this in an rvalue method?

    - by FredOverflow
    In C++0x, methods can be overloaded on whether or not the expression that denotes the object on which the method is called is an lvalue or an rvalue. If I return *this from a method called via an rvalue, do I need to explicitly move from *this or not? Foo Foo::method() && { return std::move(*this); // Is this move required or not? } Unfortunately, I can't simply test this on my compiler since g++ does not support this feature yet :(

    Read the article

  • Cancel Key press event

    - by Asim Sajjad
    How can I return the key, mean if I want to allow only interger value in the textbox , how can I don't allow user to not enter value other then integer, regarding, keypress event, I know there are other ways such as expression to match the string value, but I want to not assign invalid value to the textbox. if (( value 0 a&&(value <=9)) then assigned else return thanks in advance

    Read the article

  • Regex matching wrong strings

    - by Joe Smalley
    I have this PHP/SQL query: $sql = sprintf("SELECT * FROM %sCubeCart_filemanager WHERE filepath REGEXP '%s[\\/\\\\][^\\/\\\\]+$' AND type = '%d' AND disabled = '0' ORDER BY filepath ASC %s", $this->_config['dbprefix'], str_replace(array('\\','/'),'.',$folder), $type, $limit); if '$folder' == 'iha9' it is finding results like 'iha91' and 'iha99' too. Something is wrong with the regular expression, but I don't know how they work, can anyone help?!

    Read the article

  • Changing namespace of Stream

    - by phenevo
    Hi, I've got asmx with method [Webmethod] public Ssytem.IO.Stream GetStream(string path) { ... } and winforms application which has webreference to this webservice. I cannot do something on my winforms application like something: var myStream= (System.IO.Stream)client.GetStream(path); because i Cannot cast expression "MyWinformsApp.MyService.Stream" to Stream. Why is that ?

    Read the article

  • Reporting Services Matrix Order

    - by James Stewart
    I've got a reporting services report which display data in a matrix. The matrix rows are ordered by the report on a specific field's value. Trouble is I want a particular value to always appear last in the matrix even though it won't naturally be ordered there. Is there a way I can do this using an expression? Thanks.

    Read the article

  • Search for content in functions with regex

    - by Marlun
    Hello, How would I with regular expression search for functions which contains the use of a global variable without running "global $var" first? The files looks like this: class TestClass { function correctFunc() { global $var; $name = $var->name; } function invalidFuncIWantToFind() { $age = $var->user->age; } } I want to find the function names of all the invalidFuncIWantToFind. At work this would have really speeded up our work but I didn't get how to do it.

    Read the article

  • Detecting that a MemberExpression has a value

    - by cs
    How do I detect if a MemberExpression has a value that needs to be compiled/evaluated? I have two separate member expression outputs, the first which has a value, and the second which doesn't. What is the best way to differentiate between the two? exp **{value(Microsoft.Connect.Api.Client.Tests.SearchQueryUnitTests+<>c__DisplayClass6).handle}** [System.Linq.Expressions.MemberExpression]: **{value(Microsoft.Connect.Api.Client.Tests.SearchQueryUnitTests+<>c__DisplayClass6).handle}** NodeType: MemberAccess Type: {Name = "String" FullName = "System.String"} vs exp {x.CreatedBy} [System.Linq.Expressions.MemberExpression]: {x.CreatedBy} NodeType: MemberAccess Type: {Name = "String" FullName = "System.String"}

    Read the article

  • How to implement an interface member that returns void in F#

    - by Drew Noakes
    Imagine the following interface in C#: interface IFoo { void Bar(); } How can I implement this in F#? All the examples I've found during 30 minutes of searching online show only examples that have return types which I suppose is more common in a functional style, but something I can't avoid in this instance. Here's what I have so far: type Bar() = interface IFoo with member this.Bar = void Fails with FS0010: Unexpected keyword 'void' in expression.

    Read the article

  • How to test when a feature was added to Perl?

    - by Eric Strom
    Are there any services similar to codepad that will allow you to test Perl constructs on old versions of perl? Ideally, a system where you could enter an expression and it will tell you the oldest version of perl that it will work with. Of course it's possible to use CPANTS for this, but that seems like an abuse of the service (if only for making the BackPan bigger). And it could take several days/weeks to get decent test coverage on old versions.

    Read the article

  • use variable within a linq query

    - by jstawski
    take this linq into consideration: list.Where(sil => sil.XML.Element("ticket") != null && sil.XML.Element("ticket").Attribute("id").Value == smsRequestIn.TicketID) if the "ticket" element is not null it searches for it twice and hence is not very effective. Is there a way to use some sort of variables within the linq expression so I can reference the variable instead of doing a double search for the "ticket" element or is linq intelligent enough to not do a double search?

    Read the article

  • match only extionless url

    - by user162428
    I want a regex expression which only match extionless url. In otherwords if a extion is present in url then completely ignore it. /(.+)/(.+) this will match both extionless and with extenion url i want to match only extionless URL www.site.com/sports/cricket should match www.site.com/sports/cricket.aspx shouldn't match Thanks in advance

    Read the article

  • Can a storyboard access the UserControl that it resides in?

    - by Jeremy
    I have a usercontrol, and I want a storyboard inside the user control to fade the user control out. Using Expression Blend, I can create the storyboard and cause it to fade the user control out, but when I run the silverlight application I get an error on FindControl stating that it can't find the control. I'm guessing the find control only searches the children of the parent, but does not look at the parent itself. Is there any way around this?

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >