Search Results

Search found 32 results on 2 pages for 'puneet dudeja'.

Page 2/2 | < Previous Page | 1 2 

  • ANTLR : How to replace all characters defined as space with actual space

    - by Puneet Pawaia
    Hi All, My ANTLR code is as follow : LPARENTHESIS : ('('); RPARENTHESIS : (')'); fragment CHARACTER : ('a'..'z'|'0'..'9'|); fragment QUOTE : ('"'); fragment WILDCARD : ('*'); fragment SPACE : (' '|'\n'|'\r'|'\t'|'\u000C'|';'|':'|','); WILD_STRING : (CHARACTER)* ( ('?') (CHARACTER)* )+ ; PREFIX_STRING : (CHARACTER)+ ( ('*') )+ ; WS : (SPACE) { $channel=HIDDEN; }; PHRASE : (QUOTE)(LPARENTHESIS)?(WORD)(WILDCARD)?(RPARENTHESIS)?((SPACE)+(LPARENTHESIS)?(WORD)(WILDCARD)?(RPARENTHESIS)?)*(SPACE)+(QUOTE); WORD : (CHARACTER)+; What I would like to do is to replace all characters marked as space to be replaced with actual space character in the PHRASE. Also if possible, I would then like all continuous spaces to be represented by a single space. Any help would be most appreciated. For some reason, I am finding it hard to understand ANTLR. Any good tutorials out there ?

    Read the article

  • Mapping enum with fluent nhibernate

    - by Puneet
    I am following the http://wiki.fluentnhibernate.org/Getting%5Fstarted tutorial to create my first NHibernate project with Fluent NHibernate I have 2 tables 1) Account with fields Id AccountHolderName AccountTypeId 2) AccountType with fields Id AccountTypeName Right now the account types can be Savings or Current So the table AccountTypes stores 2 rows 1 - Savings 2 - Current For AccoutType table I have defined enum public enum AccountType { Savings=1, Current=2 } For Account table I define the entity class public class Account { public virtual int Id {get; private set;} public virtual string AccountHolderName {get; set;} public virtual string AccountType {get; set;} } The fluent nhibernate mappings are: public AgencyMap() { Id(o => o.Id); Map(o => o.AccountHolderName); Map(o => o.AccountType); } When I try to run the solution, it gives an exception - InnerException = {"(XmlDocument)(2,4): XML validation error: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'meta, subselect, cache, synchronize, comment, tuplizer, id, composite-id' in namespace 'ur... I guess that is because I have not speciofied any mapping for AccountType. The questions are: How can I use AccountType enum instead of a AccountType class? Maybe I am going on wrong track. Is there a better way to do this? Thanks!

    Read the article

  • string substitution regular expression not working in tcl

    - by Puneet Mittal
    i am trying to replace all the special characters including white space, hyphen, etc, to underscore, from a string variable in tcl. I wrote the code below but it doesn't seem to be working. set varname $origVar puts "Variable Name :>> $varname" if {$varname != ""} { regsub -all {[\s-\]\[$^?+*()|\\%&#]} $varname "_" $newVar } puts "New Variable :>> $newVar" one issue is that, instead of replacing the string in $varname, it is replacing the data inside $origVar. No idea why, and also i read the example code (for proper syntax) in my tcl book and according to that it should be something like this regsub -all {[\s-][$^?+*()|\\%&#]} $varname "_" newVar so i used the same syntax but it didn't work and gave the same result as modifying the $origVar instead of required $varname value.

    Read the article

  • android : widget long press & movement handling in user activity.

    - by Puneet kaur
    hi, please suggest me a way to handle widget long press event & its movement in user defined home screen .i.e i have activity whose background handles the long click and then we can choose the approprait widget from the list ,but the problem is that i am not able to implement the long click on widget and its movement in my activity. for code reference see the link below http://www.google.com/support/forum/p/Android+Market/thread?tid=25992cd433e6b826&hl=en thanks

    Read the article

  • Fulltext search not returning expected results

    - by Puneet
    I am experimenting with SQL Server full text search. I have a simple Categories table with Id as the primary key: CREATE TABLE [dbo].[Category]( [Id] [int] IDENTITY(1,1) NOT NULL, [CategoryName] [varchar](100) NOT NULL, ) My Query is: SELECT * FROM FREETEXTTABLE (Category, CategoryName, 'music') AS F INNER JOIN Category C ON F.[Key] = C.Id ORDER BY F.Rank DESC This returns me several records with the word music in them, but it does NOT return any record with word ‘musical’. Although, it can be said that the string being searched is not very big and using the LIKE operator will resolve it. I would like to use fulltext search because this simple example is going to be extended to include other tables and fileds.

    Read the article

< Previous Page | 1 2