Search Results

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

Page 92/205 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • Casting in mixed type calculations in C?

    - by yCalleecharan
    Hi, If I define these variables: double x0, xn, h; int n; and I have this mathematical expression: h = (xn - x0)/n; Is it necessary that I cast n into double prior doing the division for maximum accuracy like in h = (xn - x0)/ (double) n; I wrote a program to check the above but both expressions give the same answers. I understand that C will promote the integer to double type as variables xn and x0 are of type double but strangely enough in a book, the second expression with casting was emphasized. Thanks a lot...

    Read the article

  • antlr: How to rewrite only specific

    - by user1293945
    I am sure antlr can solve my problem, but can't figure out how to implement it, even high level. I rapidly got caught into syntax problems of antlr itself. My grammar is quite simple and made of following tokens and rules. Don't really need to go in their details here. The evaluator resolves to expressions, which finally resolve to IDENT: evaluator : expression EOF! ; ... ... term : PARTICIPANT_TYPE(IDENT | '('! expression ')'! | max | min | if_ | NUMBER)+ ; Now, I would like to analyse and rewrite the 'term', so that IDENT tokens (and them only) get re-written with the PARTICIPANT_TYPE. All the others should simply remain the same.

    Read the article

  • Next line matching the regex in bash

    - by Lin_freak
    I have a file in the format: Port Number IP address Port Number IP address (Not sure how the output will be displayed here but let me tell you they are on separate lines) and so on.... I use the command grep -C 1 'port number' file.txt i.e. I want all IP addresses corresponding to a particular port. Making it simple, I want the next line matching a regular expression. Like if my regular expression matches line 2,4 and 6 then I want lines 3, 5 and 7 to be printed. How to do that?

    Read the article

  • Is there a way to create a string that matches a given C# regex?

    - by Chris Phillips
    My application has a feature that parses text using a regular expression to extract special values. I find myself also needing to create strings that follow the same format. Is there a way to use the already defined regular expression to create those strings? For example, assume my regex looks something like this: public static Regex MyRegex = new Regex( @"sometext_(?<group1>\d*)" ); I'd like to be able to use MyRegex to create a new string, something like: var created = MyRegex.ToString( new Dictionary<string, string>() {{ "group1", "data1" }}; Such that created would then have the value "sometextdata1".

    Read the article

  • How to choose programaticaly the column to be queried by Linq using PropertyInfo???

    - by Richard77
    Hello, I would like to control how linq querries my database programaticaly. For instance, I'd like to query the column X, column Y, or column Z, depending on some conditions. First of all, I've created an array of all the properties inside my class called myPropertyInfo. Type MyType = (typeOf(MyClass)); PropertyInfo[] myPropertyInfo = myType.GetProperties( BindingFlags.Public|BindingFlags.Instance); The myPropertyInfo array allows me to access each property details (Name, propertyType, etc) through the index*[i]* Now, how can I use the above information to control how linq queries my DB? Here's a sample of a querry I'd like to exploit. var myVar = from tp in db.MyClass select tp.{expression}; Expression using myPropertyInfo[i] to choose which property(column) to query. I'm not sure if that's the way of doing it, but if there's another way to do so, I'll be glad to learn. Thanks for helping.

    Read the article

  • How to make validation for a textbox that accept only comma(,) & digit in asp.net application?

    - by prateeksaluja20
    I am working on a website. I am using C# 2008. I want to make a text box that accept only numbers & comma(,). for example-919981424199,78848817711,47171111747 or there may be a single number like 919981424199. I was able to do one thing My text box only containing number by using this Regular Expression validation.in its property-Validation Expression i wrote "[0-9]+". This is working but now my requirement is to send bulk SMS & each number is separated by (,). I tried a lot but not getting the ans. so please help me to sort out this problem.

    Read the article

  • How to create a NSPredicate to find entries with leading numerical value?

    - by Toastor
    Hello, I'm using NSPredicates to fetch entities based on a name attribute. Creating a predicate for names beginning with letters was easy (@"name BEGINSWITH %@", searchLetter), however now I'd like to fetch all entities with a name that begins with a numerical value, or rather a non-alphabetical number. What would be the appropriate predicate expression here? Right now I don't want to get too deep into predicate programming, as this is all I need right now and time flies. So, please, don't point me to the Predicate Programming Guide, I just need that expression.. :) Thanks alot guys!

    Read the article

  • Looking for another regex explanation

    - by Sam
    In my regex expression, I was trying to match a password between 8 and 16 character, with at least 2 of each of the following: lowercase letters, capital letters, and digits. In my expression I have: ^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,16})$ But I don't understand why it wouldn't work like this: ^((?=\d)(?=[a-z])(?=[A-Z])(?=\d)(?=[a-z])(?=[A-Z]){8,16})$ Doesnt ".*" just meant "zero or more of any character"? So why would I need that if I'm just checking for specific conditions? And why did I need the period before the curly braces defining the limit of the password? And one more thing, I don't understand what it means to "not consume any of the string" in reference to "?=".

    Read the article

  • drawing hierarchical tree with orthogonal lines ( HV-Drawing – Binary Tree)

    - by user267530
    Hi I need to work on drawing a hierarchical tree structure (HV-Drawing – Binary Tree) with orthogonal lines(straight rectangular connecting lines) between root and children ( like the following: http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+layout ). I want to know if there are any open source examples of the algorithm of drawing trees like that so that I can implement the same algorithm in actionscript. Thanks Palash

    Read the article

  • JFace: difference between ITreeContentProvider and ILazyTreeContentProvider

    - by Alexey Romanov
    After reading JavaDoc for ILazyTreeContentProvider and Virtual Tables and Trees I am a bit confused. Do they really mean that with a simple ITreeContentProvider all elements have to be loaded when the tree is created? I expected that getChildren() would only be called when expanding an element (and hasChildren() to be called to determine whether the plus sign should be shown). Or are they intended for the case where some elements have many children?

    Read the article

  • Recursion Vs Loops

    - by sachin
    I am trying to do work with examples on Trees as given here: http://cslibrary.stanford.edu/110/BinaryTrees.html These examples all solve problems via recursion, I wonder if we can provide a iterative solution for each one of them, meaning, can we always be sure that a problem which can be solved by recursion will also have a iterative solution, in general. If not, what example can we give to show a problem which can be solved only by recursion/Iteration? --

    Read the article

  • Simplest database implementation

    - by MaX
    I am looking for a really simple database implementation; basically one with no complex parsing SQL engine. What I am looking for is something demonstrating B+ trees and ACID storage (Suitable for educational purposes). What I have found up-till now form my current searches was hamster-db. I am looking for something even simpler with a smaller code-base. If there is any such opensource project in your knowledge please let me know.

    Read the article

  • Implementing PyMyType_Check methods with Python C API?

    - by Paul D.
    All the Python-provided types have a check method (i.e., PyList_Check) that allows you to check if an arbitrary PyObject* is actually a specific type. How can I implement this for my own types? I haven't found anything good online for this, though it seems like a pretty normal thing to want to do. Also, maybe I'm just terrible at looking through large source trees, but I cannot for the life of me find the implementation of PyList_Check or any of it's companions in the Python (2.5) source.

    Read the article

  • Perl vs Python but with more style than normally

    - by user350571
    I'm learning perl and everytime I search for perl stuff in the internet I get some random page with people saying that perl should die because code written in it looks like a lesson in steganography. Then they say that python is clean and stuff like that. Now, I know that those comparisons are always stupid and made by fellows that feel that languages are a extension of their boring personality so, let me ask instead: can you give me the implementation of a widely known algorithm to deal with a data structure like red-black trees in both languages so I can compare?

    Read the article

  • Perl vs Python: implementation of algorithms to deal with advanced data structures

    - by user350571
    I'm learning perl and everytime I search for perl stuff in the internet I get some random page with people saying that perl should die because code written in it looks like a lesson in steganography. Then they say that python is clean and stuff like that. Now, I know that those comparisons are always stupid and made by fellows that feel that languages are a extension of their boring personality so, let me ask instead: can you give me the implementation of a widely known algorithm to deal with a data structure like red-black trees in both languages so I can compare?

    Read the article

  • Looking a lightweight PHP ORM

    - by allenskd
    At first I was going to use doctrine ORM as the main one but it was an overkill, unneeded features and probably excessive calls. One of the main reasons was the "helper" that handled traverse trees (the hierarchy tree) easily but I'm starting to prefer building my own class. This is what I'm looking for: 1) Can manage multiple database connections, (sort of like doctrine manager) 2) Models 3) flexible All suggestions are welcome

    Read the article

  • nearest neighbor - k-d tree - wikipedia proof.

    - by user123930
    On the wikipedia entry for k-d trees, an algorithm is presented for doing a nearest neighbor search on a k-d tree. What I don't understand is the explanation of step 3.2. How do you know there isn't a closer point just because the difference between the splitting coordinate of the search point and the current node is greater than the difference between the splitting coordinate of the search point and the current best?

    Read the article

  • XML: When to use attributes instead of child nodes?

    - by Rosarch
    For tree leaves in XML, when is it better to use attributes, and when is it better to use descendant nodes? For example, in the following XML document: <?xml version="1.0" encoding="utf-8" ?> <savedGame> <links> <link rootTagName="zombies" packageName="zombie" /> <link rootTagName="ghosts" packageName="ghost" /> <link rootTagName="players" packageName="player" /> <link rootTagName="trees" packageName="tree" /> </links> <locations> <zombies> <zombie> <positionX>41</positionX> <positionY>100</positionY> </zombie> <zombie> <positionX>55</positionX> <positionY>56</positionY> </zombie> </zombies> <ghosts> <ghost> <positionX>11</positionX> <positionY>90</positionY> </ghost> </ghosts> </locations> </savedGame> The <link> tag has attributes, but it could also be written as: <link> <rootTagName>trees</rootTagName> <packageName>tree</packageName> </link> Similarly, the location tags could be written as: <zombie positionX="55" positionY="56" /> instead of: <zombie> <positionX>55</positionX> <positionY>56</positionY> </zombie> What reasons are there to prefer one over the other? Is it just a stylistic issue? Any performance considerations?

    Read the article

  • drawing hierarchical tree with orthogonal lines

    - by user267530
    Hi I need to work on drawing a hierarchical tree structure with orthogonal lines(straight rectangular connecting lines) between root and children ( like the following: http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+layout ). I want to know if there are any open source examples of the algorithm of drawing trees like that so that I can implement the same algorithm in actionscript. Thanks Palash

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >