RegExp and group
Hi I'm currently working on an IDL compiler and was wondering if somebody can help me with a regular expression I use to read out methods from an IDL file.
this.methodPattern = Pattern.compile("\\s*" +
"(\\w+)" +
"\\s+(\\w+)\\s*" +
"[\\(]\\s*" +
"(?:(?:\\s*?(\\w+)\\s*(\\w+)\\s*?[,]?)?)*" +
"[\\)]" +
"\\s*(?:\\s*raises\\s*(\\w+))?;");
Now this is supposed to match something like
String abc(int a, int b, int c) raises RemoteException
which it does :)
The problem lies with the '+' quantifier which overwrites my parameters, now it only stores the last parameter in this case it would store:
group(i) -> int
group(i+1) -> c
The problem only lies in the highlighted part of the code, the rest is matched and stored properly.
it overwrites the previous parameters, is there a way to store all parameters instead of only the last one? I thought the + quantifier wouldn't cause issues like that.
I'm using JRE 1.6
If someone has an idea as to what I can do in this situation I would be most grateful for suggestions.
- I know I could just match the whole contents and the split the String into an Array, however I would prefer to keep it to one Pattern.
You probably want a compiler generator like
ANTLR or
JavaCC.Note that JavaCC has an IDL grammar; you can get it here:
https://javacc.dev.java.net/servlets/ProjectDocumentList?folderID=110&expandFolder=110&folderID=0
To use it, download it and do something like this:
$ cat Hello.idl
module HelloApp
interface HelloCallback
void callback(in string message);
interface Hello
string sayHello(in HelloCallback objRef, in string message);
$ javacc IDL.jj && javac *.java && java IDLParser Hello.idl
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file IDL.jj . . .
File "TokenMgrError.java" does not exist. Will create one.
File "ParseException.java" does not exist. Will create one.
File "Token.java" does not exist. Will create one.
File "SimpleCharStream.java" does not exist. Will create one.
Parser generated successfully.
Note: IDLParser.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
IDL Parser Version 0.1: Reading from file Hello.idl . . .
IDL Parser Version 0.1: IDL definitions parsed successfully.You can either add syntactic actions to collect the method names or convert this to a JJTree grammar and use a Visitor; the latter is the cleaner technique but the former may be a bit simpler.
Similar Messages
-
Hi,
I 've trouble with capturing group as mention in the example below
String s = "KLASSE3";
Pattern p = Pattern.compile("KLASSE(\\d)");
Matcher m= p.matcher(s);
System.out.println( m.groupCount());
System.out.println( m.group(1));
Running this gives :
1
Exception in thread "main" java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:421)
Tried with 1.5.0_08 and 1.6.0-b105
Thanks for any hintshame on me !!!
thanks very much dude -
what is difference between distribution list and share point group? Can we add distribution list into person and group column of share point list?
there is a workaround you can try, create audience and add DL to them and deal with the audience or convert DL to groups
https://social.technet.microsoft.com/Forums/en-US/02f0d773-8188-4d94-a448-0c04d838b0cf/distribution-lists-in-sharepoint?forum=sharepointgenerallegacy
Kind Regards,
John Naguib
Technical Consultant/Architect
MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
Please remember to mark your question as answered if this solves your problem -
Partition Name in Select and Group-By
Is there a function that returns the partition name a row is stored in? I'd like to use it in a SELECT statement, if it exists.
The goal is to get row counts per partition to determine skew on a hash-based partition (otherwise, I'd just select and group-by the partition key). I want to do something like this:
SELECT PARTITION_NAME, COUNT(*) as PER_PART_COUNT
FROM SOMETABLE
GROUP BY PARTITION_NAME;Obviously, I would replace the string "*PARTITION_NAME*" with whatever function returns that value.
NOTE: Before the forum sharks jump all over me, I did search the documentation and forums, but I came up empty handed.Hi,
This is hokey - but you can use the undocumented function "tbl$or$idx$part$num" like so:
SELECT atp.partition_name
, COUNT (*) AS count_rows
FROM all_tab_partitions atp
, (SELECT tbl$or$idx$part$num ("SCOTT"."TAB1"
, 0
, 1
, 0
, partition_col1 -- your 1st partition key column
, partition_col2 -- your 2nd partition key column
) AS part_num
, 'TAB1' AS table_name
, 'SCOTT' AS owner
FROM scott.tab1) pt
WHERE atp.table_name = pt.table_name
AND atp.table_owner = pt.owner
AND atp.partition_position = pt.part_num
GROUP BY atp.partition_name;Note - this probably won't perform well at all... but it could be an option...
Message was edited by:
PDaddy
... On 2nd thought - don't do it - it seems it is pretty unstable - brought my session to a halt a couple of times... Forget I mentioned it :)
... On 3rd thought - if you add ROWNUM - it works fine - seems you need to materialize the result set in the inner query - like so:
CREATE TABLE part_tab (part_key int
, a int
partition by range (part_key)
(partition p1 values less than (100)
,partition p2 values less than (200)
,partition p3 values less than (maxvalue)
insert into part_tab
select rownum
, rownum
FROM all_objects
where rownum <= 1000; SELECT atp.partition_name
, COUNT(*) AS count_rows
FROM all_tab_partitions atp
, (SELECT TBL$OR$IDX$PART$NUM("PART_TAB", 0, 1, 0, part_key) AS part_num
, 'PART_TAB' AS table_name
, user AS owner
, ROWNUM AS rn -- Materialize the result set by adding ROWNUM...
FROM part_tab) pt
WHERE atp.table_name = pt.table_name
AND atp.table_owner = pt.owner
AND atp.partition_position = pt.part_num
GROUP BY atp.partition_name; -
How to update a People and group field using a sandbox solution
Hi,
I am creating a sandbox solution for office 365 and creating a custom form using visual web part, which will allow users to enter data in a custom list.
And that list also have a user field. I am able to get SharePoint user field on the form (using javascript) which is searching for the user and get a value (working fine).
Issue: But I am not able to save the user value. Because to save user value I require web, UserID and login name, to construct SPFieldUserValue object or string in "111;#TestUser" format. Moreover that user should be present in
SiteUserInfoList.
I tried web.EnsureUser() but did not work under sanbox solution.
Can you please provide any pointer or workaround to the problem? I may be missing something here.
Thanks,
HimanshuHi,
According to your description, my understanding is that you want to update the people and group field in Sandbox solution.
In the sandbox solution, you can still use the web.EnsureUser() function to get the user information, see the thread below:
EnsureUser in sandboxed solution
In additional, there is a demo with your similiar requirement for your reference:
Using the People Picker Control in Sandbox Solutions / Office 365
Thanks
Best Regards,
Jerry Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Hi I do not want iTunes to open up automatically when I turn on my macbook pro. I tried going to System Preferences>Users and Groups>Login Items and then I took iTunes off the list but it still opens up automatically when I turn on my laptop. What should I do?
Hi r,
Make sure you close iTunes before shutdown. And you're quite welcome. -
I am trying to stop programs from opening automatically when I turn my computer on. I tried system preferences>users and groups>login items...then I deleted them itunes and emial from the list but it did nothing. They continue to open up every time I turn on my Macbook Pro.
Hi r,
It sounds like you're running Lion?
Have you tried running Verify and/or Repair Disk?
Have you tried running Repair Permissions?
Do you have at least 15% free space available on your HD? -
How to change default /Users and /Groups to different Volume?
Users are created in /Volumes/<boot>/Users and groups in /Volumes/<boot>/Groups.
We need these to be created on a different volume, eg., /Volumes/External/Users, and /Volumes/External/Groups.
Setup Assistant correctly put user Backups into */Volumes/External/Shared Items/Backups* and also correctly put web services on /Volumes/External/ServiceData -- we want to do the same for Groups and Users.
Groups are the most critical, as the group needs bulk storage. Users we could leave as is if it can't be done.
How can this be configured? We've read File Server Admin, Open Directory Admin, and Advanced Server admin from http://www.apple.com/server/macosx/resources/documentation.html without finding an answer.
Thanks in advance.1. Create new folders on the external volume to hold users and groups, but to prevent confusion name them something other than "Users" and "Groups". /Volumes/External/NetUsers and /Volumes/External/NetGroups would be reasonable choices.
2. Share both of these folders (in Server Admin -> server name in sidebar -> File Sharing -> Volumes & Browse modes -> select each folder -> click Share near the top right).
3. Enable both folders for automounting on clients (Server Admin -> server name in sidebar -> File Sharing -> Share Points-> select each folder -> Share Point tab under that -> Enable Automount option) with the default options (Directory: /LDAPv3/127.0.0.1, Protocol: AFP, Use for: User home folders and group folders). Be sure to click Save (not just OK in the dialog).
4. To migrate users, run Workgroup Manager, and change the home location for the users you want to move (select Accounts in the toolbar -> /LDAPv3/127.0.0.1 from the hidden pop-up menu under that -> User icon tab at the left -> select the user(s) you want to change -> Home tab on the right -> select the NetUsers option from the "Where" list). Then, for each user, run this command on the server: "sudo cp -Rp /Users/username /Volumes/External/NetUsers".
5. Similarly, move Group folders in WGM (Accounts -> /LDAP... -> Groups icon on left -> select groups to move -> Group Folder tab on right -> NetGroups in the list). Then, for each group, run "sudo cp -Rp /Groups/groupname /Volumes/External/NetGroups".
6. Test to make sure all is working before deleting the old user and group folders from /Users and /Groups (do NOT delete /Users and /Groups themselves, just the individual folders from under them). -
Generate report to show all users and groups in Shared Services in EPM 11x
Hi,
Is there any way to generate a report (like a migration report or job status report) which can be generated through workspace/shared services 11.1.1.3 so that my admin can look at all the users and groups created. Something that I can view and probably print out? Any suggestions?
~AdeebaYes, I knew this one. This basically shows me the users and groups assigned specific provision access. Is there any way to view a report that shows which users and groups have access to dimensions of an individual planning application?
~Adeeba -
Using member sorting and grouping with two reports sharing rows
Hi!
I have a problem with one report and I need some help or advise here.
I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
PRODUCT MATERIAL AMOUNT
TOTAL PROD_A-X 100
PROD_A_A MAT1 22
PROD_A_B MAT1 50
PROD_A_A MAT2 28
TOTAL PROD_B-X 120
PROD_B_A MAT1 30
PROD_B_A MAT2 50
PROD_B_B MAT2 40
This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
Thank you very muchHi!
I have a problem with one report and I need some help or advise here.
I have two dimensions with dynamic expansion in rows (PRODUCT, MATERIAL), and I use the option Member Sorting and Grouping at Member selector to obtain the total amount of PRODUCT group by PARENTH1:
PRODUCT MATERIAL AMOUNT
TOTAL PROD_A-X 100
PROD_A_A MAT1 22
PROD_A_B MAT1 50
PROD_A_A MAT2 28
TOTAL PROD_B-X 120
PROD_B_A MAT1 30
PROD_B_A MAT2 50
PROD_B_B MAT2 40
This works fine if I only have one report, but I need to create another one sharing the row and page axis with the Default Report, when I do that the option Member Sorting and Grouping doesn't work. I really need to have two reports with shared rows and also the summation by PARENTH1, how can I do that?
Thank you very much -
How do I Move video files from films to tv programmes and group the series together?
I've recently ripped a tv series from DVD and successfully converted to play on iPad and iPhone. However it's listed all the videos under the "films" tab as individual files. How do I move them into the TV programme tab and group them together?
Thanks for any help,
RickSelect the files and Get Info. On the Options tab change the media kind to TV Show. On the Video tab set the Show name. Working with individual files set increasing Episode IDs of the form s01e01 and enter Episode Numbers. Leave Season Number blank if you want multiple seasons listed as a single object.
tt2 -
I am 63 yrs old and not to computer literate. I know how to send an email to multiple people using my contact list and groups on my IMAC. I tried using a group name downloaded to my Ipad2 from my IMac. It does not work. If I choose a single email address it works. Any idea what I am doing wrong?
Thank you for your paitence and help.
SteveYou are not doing anything wrong. The feature that you need is totally lacking in the built in Mail app on the iPad.
There are a couple of third party mail apps that will let you do this ... MailShot and Group Email with Attachments. You can check them out in the App Store. -
SharePoint tool to create External Users and Groups
Our organization is currently looking for a product that will allow us to create user account and group for users outside the organization (e.g Clients, subcontractors, etc.) and that will only need to access to our external SharePoint Collaboration site.
We have one product right now but it is very problematic. For example if one of our clients need to change their email address which is their username it won't allow it so the account has to be re-created with the new email address and the permissions re-configured
all over again. The groups created using the tool called Roles most of the times don't work. We are testing our SharePoint 2013 environment so we thought it is a good time to find something new. If you know of some products that I can check please let
me know. I will really appreciate itHi,
According to your post, my understanding is that you wanted to create user account and group for users outside the organization.
External User Management seems to be a solution. It allows for easy management of external users and roles.
More information:
http://ventigrate.codeplex.com/wikipage?title=External%20User%20Management
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
How can I stop my iPhone from synching my contacts and groups lists twice?
How can I stop my iPhone from synching my contacts and groups lists twice....I am using iCloud but am not sure how correct this duplication.
Go into Settings>Mail, Contacts, Calendars. Is this happening at the bottom in the signature section, or in the header of the mail where your email address is? If it is the signature, then go to the Signature area of the Mail settings. If this is in the header, then go to the account in question and edit your account information to include your name instead of Johnny.
-
Hey Guys,
I'm a web developer (front end and back end, kind of a one man army sort of deal) and my current employer wishes to use crystal reports to display the results of the online survey apps/tools I have been working on for the last few months. However, I have been having trouble getting the reports to render in browser, and a lot of the ui components of the browser based report viewer (the interactive parameters and group tree) will not render properly in the design view of visual studio (ive attached a screen cap of what I'm talking about) or in the browser itself.
I am new to crystal reports and its community and if I am leaving out any critical details or have posted in the incorrect section please inform me and I will make changes as necessary.
Additional info:
Visual studio version: 2013 professional (trial)
Plugin version (exe file name): CRforVS_13_0_9.exe (I also installed the 64 bit run-time from this)
Server and OS versions: IIS 7.5 on Microsoft Windows Server 2008 R2
Any help you guys could provide would be greatly appreciated.
Cheers,
-MikeHi Mike
First thing you want to do is uninstall CRVS SP 9 and install CRVS SP 10. SP 10 is the first SP to support VS 2013.
Once that is done, let us know if that helped any.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Maybe you are looking for
-
Frame 12 converting relative paths to absolute paths
Hi all, We recently upgraded to Frame 12 and now have a persistent issue with relative paths to referenced images becoming absolute. These paths do not traverse a drive and so I believe Frame should be maintaining a relative path for these. In most
-
System.DirectoryServices.Protocols.SearchRequest Ldap Query Execution Problem
Hi, I am using DirectorySearcher class to query the active directory. It gives all the records in a single page (more than 5000). I want to get 100 records per page. So I moved to SearchRequest class. Using SearchRequest class I can get 100 reco
-
Problem in get_lead_selection_index( ). . pls help
Hi frnds, I have two tables.. one below the other.. the below table has drop down values. lets say table2 the above has the item list. lets say table1 WHen a new record is selected in the table 1, the below table2 has to update few values. for that i
-
Amount Field in fitv_vc_advanced...
Hi experts, Pls help me. I have one issue in fitv_vc_advances.Previously,once you enter the advance amount in travel request after saving the table row is disabled. now i enhanced the wddomodifyview of fitv_vc_advances to make table fields as editab
-
I had a similar problem on a Windows 7 system, but there I succeeded after a second attempt. On the XP system I desinstalled the Firefox program before every new attempt. But no way. Firefox appears in the Program groups in System Information, so I s