Posts

Showing posts from July, 2011

c++ - doubts regarding usage of :: (scope_resolution_operator) -

when studying book on c++, came across this. if declare class, class student {public: void func(int v1,int v2) { //some code } //some members. }; and use function same name out of class (non-member function) like, void func(int x,inty) and if wish call non-member function in member function of above declared class, syntax be, //inside member function... ::func(x,y); } correct me if wrong.otherwise, assuming wrote using namespace std; in beginning of program, below code equivalent previous one? //inside member function std::func(x,y); } and, answer change if use different namespace other std?? ie, provided use, using namespace abc are following declarations abc::func(x,y) and, ::func(x,y) absolutely equivalent under conditions or change under specific conditions?? thank you. in beginning of program, below code equivalent previous one? //inside member function std::func(x,y); no isn't. because preform qualified name lookup

ruby - Google fonts in Rails app is not working -

i trying use google fonts in rails app, it's not working @ all. application.html.erb: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= render 'layouts/fonts' %> _fonts.html.erb: <!--google fonts--> <%= stylesheet_link_tag 'application', 'http://fonts.googleapis.com/css?family=yesteryear', media: 'all', 'data-turbolinks-track' => true %> <%= stylesheet_link_tag 'application', 'http://fonts.googleapis.com/css?family=open+sans:400,400italic,600,600italic,700,700italic', media: 'all', 'data-turbolinks-track' => true %> in scss (app.scss) file have: #feature-text h2 { font-family: 'yesteryear', cursive; font-size: 46px; color: #000; } turns out needed add http s google fonts links: <!--google fonts--> <%= stylesheet_link_tag 'application', 'https:/

Open docx content within Eclipse XML editor -

given docx format consists of bunch of zipped xml files, wonder whether possible view / edit within eclipse ide without manual unzipping , rezipping. this plugin provides wanted feature: eclipse zip editor usage: install plugin via eclipse marketplace right-click on docx file choose open with > other , select zipeditor double-click on document.xml run formatter via ctrl + shift + f edit content , save on tab close zipeditor asks updating zip file

logfile - How to mainain log file in java -

i want store(append) output of java code after every execution in same file. including sop statements, execution time , no of files executed etc. try this: try(filewriter fw = new filewriter("outfilename", true); bufferedwriter bw = new bufferedwriter(fw); printwriter out = new printwriter(bw)) { out.println("the text"); // appends text //more code out.println("more text"); // appends text //more code, append more text etc. } catch (ioexception e) { //exception handling left exercise reader }

How to add text and images in pdf using tcl script -

i trying add content text graphics pdf using tcl script. have idea library has suitable apis adding text , images pdf using tcl script. thank you. try using library: http://pdf4tcl.sourceforge.net/ you can find documentation here: http://pdf4tcl.sourceforge.net/pdf4tcl.html also usefull link tcl wiki: http://wiki.tcl.tk/_/search?s=pdf& charset =utf-8

Python/pandas: sequence to series (transform a sequence so that each element of the series is a sum of sequence elements) -

i'm trying convert for-loop vector calculations. i'm not sure operation: for in np.arange(int_lookback, len(items)): res.ix[i] = items.ix[(i - lookback):i].diff().abs().sum() 'i' for-loop iterator. since haven't provided expected df , i'm guessing want compute successive difference between cells, take it's absolute value , perform rolling summation window length vary depending on lookback value. res = items.diff().abs().rolling(window=lookback).sum()

qliksense - Connecting to PostgreSQL from a Virtual Machine -

i have macos capitain os in wich have postgres , , have windows 8 running on vmware fusion, in wich have qliksence , qliksence needs connect postgres through wizard wich filled follows: host name: ip adress port: 5432 database: mydatabse username: myusername password: mypassword i'm sure database ,username , password correct, connection fails.any please,is there setup or configuration on postgres? update: error msg: error message :please check values username , host , other properties .description: access credentials not valid connection

How to remove the folders from the stream in perforce using p4v? -

how can remove empty folder stream in perforce (p4v)? a stream can't contain empty folder, nor can other depot path. you should provide little more information on you're seeing, empty folders have been perforce feature request 2 decades , far know have yet implemented. :)

saml 2.0 - How to add IDPs to OpenAM federation via CREST API? -

i know there rest apis openam functions self service, authentication etc.., i'm not able find right apis adding remote identity provider etc.., either i'm missing or there no such rest apis openam due reason. reason not planning on it, or it's not yet there in current release. is there way can register saml idps in openam without using openam admin console or ssoadm command? pointers right code components appreciated. in access manager 5 (openam 14) can manage saml entities using rest apis. create new hosted samlv2 idp need this: curl -x post \ 'http://idp.example.com:8080/openam/json/realm-config/federation/entityproviders/saml2?_action=create' \ -h 'content-type: application/json' \ -h 'iplanetdirectorypro: <admin_session_id>' \ -d '{ "_id": "http://idp.example.com:8080/openam", "metadata": "<?xml version=\"1.0\" encoding=\"utf-8\" standalo

influxdb - Adding Functionality to Grafana WorldMap panel -

Image
i using grafana worldmap panel , influxdb data source plot points of vehicle. now, when hover on these points, displays n/a:nan i don't know n/a : nan , want when hover on these points, should how many times point stored in database(or other info tags associated these points). how can that? some data influx: time geohash host location value 1490602036767444479 tekx7nfjs6rt luv-inspiron 100 1490603677196025990 tduw7hf1k3zs luv-inspiron 15 1490603780222510535 ttw58x6qxue9 luv-inspiron 6 1490603911122290125 ttw58x6qxue9 luv-inspiron 6 1490604983924097158 ttqn096mpz59 luv-inspiron 19 1490699614650281185 dr5rsgyct32n luv-inspiron bangalore 19 1490699654166573019 fdf92s8typst luv-inspiron bangalore 19 i added location recently, thats why not having location data. when add alias(metrics) in metrics tab, these show different colors acco

java - How can I surround code with my own custom code in eclipse? -

i have lot of code method invocations like: speak(name) foo(bar, "string", var2) i want surround parameter like: speak(check(name)) foo(check(bar), "string", check(var2)) i need many methods , parameters! how can create script/macro on eclipse click parameters , press key , surround check() method? a non-answer: don't this. instead of changing speak(name) to speak(check(name)) change speakwithcheck(name) meaning: either use refactoring capabilities of eclipse change method name; , invocations speakwithcheck() ; or @ least add new method describes doing instead of polluting many many places in source code this. you can declare speak() @deprecated; , on time rid of method altogether. the fact can somehow make such "mass manipulation" of code doesn't mean idea.

spring mvc - Authentication-Flows: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 -

Image
i'm refer project of ohadr, using spring security login , set new password email. link: authentication-flows: https://github.com/ohadr/authentication-flows i have finished steps as: 1. create account 2. confirm account email 3. login sucess 4. change or set new password (this step happened exception) but when input new password , confirm new password, received exception following as: severe: servlet.service() servlet [action] in context path [] threw exception [request processing failed; nested exception java.lang.stringindexoutofboundsexception: string index out of range: -1] root cause java.lang.stringindexoutofboundsexception: string index out of range: -1 @ java.lang.string.substring(unknown source) @ com.ohadr.web.crypto.service.cryptoservice.getdecodedstringfromencodedbased64string(cryptoservice.java:244) @ com.ohadr.web.crypto.service.cryptoservice.extractstringanddate(cryptoservice.java:107) @ com.ohadr.web.auth_flows.core.authenticationflowsprocessorimpl.han

excel vba - Vba- Query table limit for database table with a column having data type as nvarchar(5000) -

Image
i have excel application button click connects hana database using hana client (hdbodbc) , put data in sheet after fetch. method working fine except tables having column data type nvarchar(5000). in case, column values not displaying correctly. example, have unique id auto increment column, starts showing 0 many rows. below method using - function importroutine(sheet string, provider string, databaseschema string, server string, app string, row long, column long, commandtext string, displayname string, errorflag boolean) integer debug.print commandtext dim l querytable dim rs object dim cnt adodb.connection dim cmd adodb.command dim icols integer set cnt = new adodb.connection set cmd = new adodb.command set rcd = new adodb.recordset dim rangesheet string rangesheet = sheets(sheet).cells(row + 1, column).address dim connectionsheet string connectionsheet = "driver=" + provider + ";servernode=" + server + ";" + ge

swift - iOS FCM push notification not received if app is terminated -

i working on swift project , integrating fcm it. able receive push notification when app running when app in background state. when terminate (force close) app, on sending notification console, no notification shown. i working on ios 10 , implemented below code in didfinishlaunchingwithoptions: unusernotificationcenter.current().delegate = self unusernotificationcenter.current().requestauthorization(options: [.alert, .badge, .sound]) { granted, error in if error == nil { uiapplication.shared.registerforremotenotifications() if granted { print("notification access true!") } else { print("notification access false") } } } i have implemented unusernotificationcenterdelegate , it's methods. func usernotificationcenter(_ center: unusernotificationcenter, willpresent notification: unnotification, withcompletionhandler completionhandler: @escaping (unnotificationpr

Symfony Voter supports method receiving ROLE and Request instead attribute and entity -

the voter seems work on whole app... except on controller: $entity = $em->getreference('appbundle:offer',$id); $this->denyaccessunlessgranted('overview', $entity); where voter method receiving wrong arguments .... supports($attribute, $subject) dump($attribute)-> role_user // instead 'overview' dump($subject)-> request object // instead $entity the voter config is: app_voter: class: appbundle\security\authorization\appvoter public: true strategy: affirmative arguments: ['@role_hierarchy', '@security.token_storage'] tags: - { name: security.voter } the problem disappears if instead 'overview' write 'view' on controller code. i forgot add 'overview' method 'supports' : protected function supports($attribute, $subject) { // if attribute isn't 1 support, return false if (!in_array($attribute, array(self::overview, self

Can Symfony Bundle be used in non-Symfony project (f.e. Zend)? -

can reuse bundle created in symfony in non-symfony project, f.e. zend? (or can reuse components?) what services bundle? a symfony bundle can included in other projects, via composer.json & composer.lock file - doesn't mean there useful code run within bundle however. if there useful code part of bundle, can use directly, symfony bundle library include symfony-specific configuration. best practice bundle put useful, common code, separate library (which used independently - such symfony calls 'component'), , enable code (for example creating symfony services, or configuration) bundle configuration. there have been projects symfony bundles, , have configurations other frameworks well, such silex, , appropriate laravel configurations within same codebase.

javascript - jQuery need to change only text content in an element -

i have 2 li elements having icon,text in each element. want change first li icon , text on button click. replacing whole anchor tag content if use .text() $(document).ready(function(){ $("#changeicon").click(function(){ $("#listitems li:eq(0) span").removeclass("ic1").addclass("ic3"); //$("#listitems li:eq(0) a").text("icon3");//uncomment line , check }); }); span { display:block; width:32px; height:32px; } .ic1 { background:url("https://cdn4.iconfinder.com/data/icons/wirecons-free-vector-icons/32/menu-alt-32.png") no-repeat; } .ic2 { background:url("https://cdn0.iconfinder.com/data/icons/navigation-set-arrows-part-one/32/grid-32.png") no-repeat; } .ic3 { background:url("https://cdn2.iconfinder.com/data/icons/4web-3/139/menu-32.png") no-repeat; } .ic4 { background:url("https://cdn3.iconfinder.com/data/icons/eightyshades/512/45_menu-3

powershell - Find a particular file name existence and execute batch command -

i looking ps script search particular file name , check existence. if file exists should execute batch command. $version = "1.1.0" $packagename = "example.dto.$version" get-childitem "d:\test" | where-object { $_.name -match "$packagename.nupkg" } and batch command c:\nugetrestore\nuget.exe push "d:\test\$packagename.nupkg" saranuget -source "http://123.456.78.90/myget" -timeout 120 i unable integrate both this. this covers test matches multiple files: $version = "1.1.0" $packagename = "example.dto.$version" $filecheck = get-childitem "d:\test" | where-object { $_.name -match "$packagename.nupkg" } $filecheck | foreach-object { c:\nugetrestore\nuget.exe push "$($_.fullname)" saranuget -source "http://123.456.78.90/myget" -timeout 120 }

xml - How to use SimpleXMLElement Object attributes in PHP, yii2? -

i'm trying extract attributes xml file. i'm using simple xml_load_file() function load xml , saved in variable. when print variable this simplexmlelement object ( [service_http_path] => https://land-qc.qoda.com [l10] => https://jd10.loda.com [temp_http_preview_path] => https://land.qoda.com/temp_preview_path ) i want use service_http_path has https://land-qc.qoda.com . how capture url alone in variable? in advance. convert object array this $array= (array) $yourobject; after can this $url = $array['service_http_path']; this should give value.

setting up monitoring for integration to external systems from Azure -

Image
i have created azure web app contains method brings file external system calling soap service. how can sett monitoring on particular method? we can use application insights monitor our web application. can azure portal or visual studio tool, more details please refer document . following snippet document. azure application insights monitors live application detect , diagnose performance issues , exceptions. helps discover how app used. works web apps feature of azure app service, apps hosted on own on-premises iis servers, or on cloud vms. we can our azure portal, detail steps blow: step 1: navigate web app in azure portal. step 2: select application insights in monitoring blade service. step 3: select create new resource , enter name. step 4: select ok i test asp.net mvc project on azure. following detail steps. step 1: add application insights sdk step 2: update method , run app f5 step 3: execute method step 4: check operation deta

ios - i want to see instanceId for firebaseNotification in viewController by NSLog after receiving it from firebase -

i can instanceid firebase notification on appdelegate.m takes few seconds after app loaded. , want store server can't send server. why can't send push notification individually. so, please how should do , following code. //appdelegate.m #import "appdelegate.h" @import firebase; @import firebasemessaging; @interface appdelegate () @end @implementation appdelegate - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. [firapp configure]; [[uiapplication sharedapplication] setapplicationiconbadgenumber:0]; // add oberver handling token refresh callback [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(tokenrefreshcallback:) name:kfirinstanceidtokenrefreshnotification object:nil]; // request permissio

xmpp - How to change ejabberd MUC subject -

i've tried change muc subject using ejabberd api didn't work. use postman work api api : /api/change_room_option request body : { "name": "testgroup", "service": "conference.localhost", "option": "subject", "value": "booknerds" } error : "400 bad request" i've enabled change_room_option in ejabberd.yaml , set allow_change_subj true. using configuration , same request body format, change 'title' , 'description'. note : ran test using adium , change subject. when check in database, subject , subject_author have been updated. need set subject_author in request body? if yes - don't think it's possible since change_room_option accept 4 parameters stated here

r - make csv data import case insensitive -

i realize total newbie 1 (as in case), i'm trying learn r, , need import hundreds of csv files, have same structure, in column names uppercase, , in lower case. so have (for now) flow0300csv <- sys.glob("./csvfiles/*0300*.csv") (filename in flow0300csv) { flow0300 <- read.csv(filename, header=t,sep=";", colclasses = "character")[,c('code','class','name')] } but error because of lower cases. have tried apply "tolower" can't make work. tips? the problem here isn't in reading csv files, it's in trying index using column names don't exist in "lowercase" data frames. you can instead use grep() ignore.case = true index columns want. tmp <- read.csv(filename, header = t, sep = ";", colclasses = "character") ind <- grep(patt = "code|class|name", x = colnames(tmp), ignore.case = true) tmp[, ind

javascript - how perform zooming inside canvas image and the zooming should be centralized -

<div id="panid" class="moveable"> <canvas id="canvas" class="mg_image"> <img name="imagename2" id="mainimage" class="imagepics" *ngif="showimage" src="{{imagevisible ? droppedimage: firtsimagetobind}}"> </canvas> </div> my typescript code given below. foractivatezooming(event: mouseevent) { document.getelementbyid('panid').style.cursor = "zoom-in"; this.showimage = true; this.imagevisible = false; var zoomintensity = 5; var canvas = <htmlcanvaselement>document.getelementbyid("canvas"); var image = document.getelementbyid("mainimage"); var context = canvas.getcontext("2d"); context.moveto(0, 0); var img = document.getelementbyid("mainimage"); var srcofimg = img.attributes.get

OAuth interactions for UWP -

i following 1 of google's blog while changing oauth, https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html?m=1 the article mentions, google sign-in , oauth examples windows, examples demonstrating how use browser authenticate google users in various windows environments such universal windows platform (uwp), console , desktop apps the article not have link code samples universal windows platform (uwp). can please provide link same? here's link windows (console, uwp , wpf) samples https://github.com/googlesamples/oauth-apps-for-windows . i got here https://developers.google.com/identity/protocols/oauth2installedapp

javascript - Use php function in img "src" tag -

i want instead of specify file name manually, load files dynamicly function return string file name.i have function in php, show code - <a > <figure> <img src=\"images/parfumes/car.png\" class=\"parfume$productid\" value=\"$productprice \" height=\"225\" width=\"225\"> <figcaption >Цена: $productprice лв.</figcaption> </figure> </a>"; and function return string: function getppicture($id) { $path = 'images'; $files = scandir($path); foreach ($files $file) { if (is_file($file)) { echo "Файлът несъществува. Моля опитатайте отново!!"; } else { $ext = basename($file, '.*'); if ($ext == $id) { return $ext . ""; break; } } } } and

javascript - How to upsert MongoCollection but keep some values? -

hi, don't know how put title i'm sure understand so i'm trying set 2 fields on mongo collection when user click on button every 60sc have method running , make that: upsertcollectionmachines = meteor.bindenvironment(function() { machinescount = 0; var protocol; var port; machine.list({ inspect: true }, meteor.bindenvironment(function(err, machines) { if (typeof machines === "undefined") { console.error("impossible access 'machines' 'machine.list: '" + err); } else { machines.foreach(meteor.bindenvironment(function(machineinfo) { machinescount += 1; if (machineinfo.url != null) { var urltoarray = machineinfo.url.split(":") port = urltoarray[urltoarray.length - 1]; protocol = "https";

c++ - How to only disable destruction of objects in thread-local-storage? -

#include <cstdlib> #include <thread> #include <chrono> using namespace std; using namespace std::literals; struct { a() { cout << "a()" << endl; } ~a() { cout << "~a()" << endl; } }; g_a; int main() { thread([]() { thread_local a; this_thread::sleep_for(24h); }).detach(); exit(0); // not ok quick_exit(0); // still not ok } global objects , objects in thread-local-storage destructed after calling exit(0) ; global objects , objects in thread-local-storage not destructed after calling quick_exit(0) ; is possible: global objects destructed after calling some_exit_func(0) ; while objects in thread-local-storage not destructed. problem background: i have big legacy project, has used thread-local-storage store many c++ objects; before c++11, these objects not destructed automatically, former writer explicitly calls destructors. now, want re

adding facebook share button in gwt application -

Image
i have been working gwt , gxt since around few months, i working on web site needs interact social media web site facebook, i trying add fcebook share button in web site , tried below way - i tried using html - html facebookbutton = new html(); facebookbutton.sethorizontalalignment(hashorizontalalignment.align_center); facebookbutton.sethtml("<div class=\"fb-share-button\" data-href=\"https://developers.facebook.com/docs/plugins/\" data-layout=\"button\" data-size=\"small\" data-mobile-iframe=\"true\"><a class=\"fb-xfbml-parse-ignore\" target=\"_blank\" href=\"https://www.facebook.com/sharer/......src=sdkpreparse\"> <img src=\"img/social/facebook.png\" > </a></div>"); but nothing - tab.geturlheader() - want share i searched across , not find . is possible create such button in gwt/gxt way ..? any appreciated

php - Symfony search-box issue -

i've issue make search-box symfony , doctrine. use 2.8 version of symfony. my issue : entitymanager#persist() expects parameter 1 entity object, array given. 500 internal server error - orminvalidargumentexception so, type search-box type : /** * {@inheritdoc} */ public function buildform(formbuilderinterface $builder, array $options) { $builder->add('searchbox',searchtype::class,array('label'=>'vous cherchez : un auteur ? un éditeur ? un ouvrage ?','attr'=>array('class'=>'form-control'))); } /** * {@inheritdoc} */ public function configureoptions(optionsresolver $resolver) { $resolver->setdefaults(array( 'data_class1' => 'sb\mainbundle\entity\ouvrages', 'data_class2' => 'sb\mainbundle\entity\auteurs', 'data_class3' => 'sb\mainbundle\entity\editeurs' )); } and controller code after edit : public funct

c++ - Is it possible to std::move local stack variables? -

please consider following code: struct mystruct { int iinteger; string strstring; }; void myfunc(vector<mystruct>& vecstructs) { mystruct newstruct = { 8, "hello" }; vecstructs.push_back(std::move(newstruct)); } int main() { vector<mystruct> vecstructs; myfunc(vecstructs); } why work? at moment when myfunc called, return address should placed on stack of current thread. create newstruct object gets created, should placed on stack well. std::move, tell compiler, not plan use newstruct reference anymore. can steal memory. (the push_back function 1 move semantics.) but when function returns , newstruct falls out of scope. if compiler not remove memory, occupied existing structure stack, has @ least remove stored return address. this lead fragmented stack , future allocations overwrite "moved" memory. can explain me, please? edit: first of all: thank answers. have learned, still cannot understand, why followi

automation - How to recognise Webix objects using UFT? -

is there way recognise webix objects (where webix is javascript and html5 framework developing cross platform html5 and css3 compatible applications)using uft? have application web based not able recognise objects when checked page source showing me objects on page webix based. want know there possibility recognise these objects using uft or there plugin or patch available resolve issue? uft version 12.02 thanks in advance.

javascript - Getting new data in DOM without refresh -

i have page add time range, on button insert & save send data api , response set data table. problem is, data not showing dynamically. need refresh page see changes. try use $watch , not working or doing wrong. here plunker . you made mistakes: <div ng-controller="timepickerdemoctrl"> not wrapped whole stuff ng-submit changed ng-click as urbantimerange array should use $watchcollection instead of $watch look @ corrected variant .

c++ - Version `GLIBCXX_3.4.22' not found -

i have built c++ app on vm ubuntu 16.04 on have installed g++ compiler 6.2.0 in order support c++14 features. when tried run on new clean vm 16.04 has default g++ 5.4.0 error /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `glibcxx_3.4.22' not found pops up. i've noticed on vm updated compiler library libstdc++.so.6.0.22 has been installed. on clean vm i'd avoid update compiler tried install latest libstdc++6 package. library installed libstdc++.so.6.0.21 , problem persisted. how can install libstdc++.so.6.0.22 version? you try use pinning make sure packages want updated newer version. alternatively, compile program g++ 5.4, because according this page , compiler supports c++14, difference g++-6 defaults -std=c++14 , whereas g++-5 have set language standard explicitly.

appcompat - How to remove the Android SearchView left space? -

Image
i'm trying remove left space before search view of android, without success. tried every answer found on internet didn't work. i'm using appcompat themes activity. i'm targeting kitkat api (19). can me please? edit layout of activity <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/mainlayout" android:background="#6ed19e"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/backgroundlayout" android:background="#6ed19e"> <imageview android:src="@drawable/bgpattern" android:layout_width="match_parent" android:layout_height="wrap_content" android

c++ - Handling an error in a template method -

i having problem finding solution handling error in template function. template<typename k, typename v> const v& directhashmap<k, v>::lookup(k key) const { int pos = position(key); return _values.get(pos)->value; } i can't return error code because don't know type returning. prefer not use exceptions because never used exceptions in project before , not consistent if method exception. if has solution please let me know! feedback appreciated. you should instead return const_iterator collection. the end user can test see if it's equivalent .end() collection. how containers in stl typically work. (refer map::find , unordered_map::find , , unordered_set::find )

Strange behavior with Java enums -

i run strange behavior java enums. if write next enum: public enum test { public static final int c1 = 5; } you got compilation error, expected because did not declare enum constants in beginning. but strange part if add semicolon without constant name in beginning: public enum test { ; public static final int c1 = 5; } your code compiled successfully. maybe question dumb , there answer in java specification have not found 1 yet. if understands why java compiler so, please explain. as answer pointed out, relevant section of jls 8.9, 8.9.1 states: the body of enum declaration may contain enum constants. enum constant defines instance of enum type. enumbody: { [enumconstantlist] [,] [enumbodydeclarations] } to understand meaning of enumbody definition 1 must @ jls chapter 2.4, grammar notation , says the syntax {x} on right-hand side of production denotes 0 or more occurrences of x. also the syntax [x] on right-h