Error in eclipse but the page works - eclipse

when i write this line in my jsp page it works fin when i load the page.
<fmt:parseNumber var="leftDays"
value="${( ao.dateOuverturePlis.getTime() - now.getTime() ) / (1000*60*60*24) }"
integerOnly="true" />
but eclipse show me there is a error with red icon
Multiple annotations found at this line:
- Encountered " "(" "( "" at line 1,
column 31.
Was expecting one of:
"." ...
">" ...
"gt" ...
...
- EL Syntax Error
so how can i just get away this red error icon ?

It works finnaly we change it .getTime() by .time like that
<fmt:parseNumber var="leftDays"
value="${( ao.dateOuverturePlis.time - now.time ) / (1000*60*60*24) }"
integerOnly="true" />

Related

Updating my current script which modifies multiple lines into a single one

My current script copies text like this with a shortcut:
:WiltedFlower: aetheryxflower ─ 4
:Alcohol: alcohol ─ 3,709
:Ant: ant ─ 11,924
:Apple: apple ─ 15
:ArmpitHair: armpithair ─ 2
and pastes it modified into a single line
Pls trade 4 aetheryxflower 3 alcohol 11 ant 15 apple 2 armpithair <#id>
As you can see there are already two little problems, the first one is that it copies only the number/s before a comma if one existed instead of ignoring it. The second is that I always need to also copy before hitting the hotkey and start re/start the script, I've thought of modifying the script so that it uses the already selected text instead of the copied one so that I can bind it with a single hotkey.
That is my current script, it would be cool if anyone can also tell me what they used and why exactly, so that I also get better with ahk
!q::
list =
While pos := RegExMatch(Clipboard, "(\w*) ─ (\d*)", m, pos ? pos + StrLen(m) : 1)
list .= m2 " " m1 " "
Clipboard := "", Clipboard := "Pls trade " list " <#951737931159187457>"
ClipWait, 0
If ErrorLevel
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
return
If the pattern of your copied text dont change, you can use something like this:
#Persistent
OnClipboardChange:
list =
a := StrSplit(StrReplace(Clipboard, "`r"), "`n")
Loop,% a.Count() {
b := StrSplit( a[A_Index], ": " )
c := StrSplit( b[2], " - " )
list .= Trim( c[2] ) " " Trim( c[1] ) " "
}
Clipboard := "Pls trade " list " <#951737931159187457>"]
ToolTip % Clipboard ; just for debug
return
With your example text, the output will be:
Pls trade aetheryxflower ─ 4 alcohol ─ 3,709 ant ─ 11,924 apple ─ 15 armpithair ─ 2 <#951737931159187457>
And this will run EVERY TIME your clipboard changes, to avoid this, you can add at the top of the script #IfWinActive, WinTitle or #IfWinExist, WinTitle depending of your need.
The answer given would solve the problem, assuming that it never changes pattern as Diesson mentions.
I did the explanation of the code you provided with comments in the code below:
!q::
list = ; initalize a blank variable
; regexMatch(Haystack, regexNeedle, OutputVar, startPos)
; just for frame of reference in explanation of regexMatch
While ; loop while 'pos' <> 0
pos := RegExMatch(Clipboard ; Haystack is the string to be searched,
in this case the Clipboard
, "(\w*) ─ (\d*)" ; regex needle in this case "capture word characters
(a-z OR A-Z OR 0-9 OR _) any number of times, space dash space
then capture any number of digits (0-9)"
, m ; output var array base name, ie first capture will be in m1
second m2 and so on.
, pos ? pos + StrLen(m) : 1) ; starting position for search
"? :"used in this way is called a ternary operator, what is saying
is "if pos<>0 then length of string+pos is start position, otherwise
start at 1". Based on the docs, this shouldn't actually work well
since 'm' in this case should be left blank
list .= m2 " " m1 " " ; append the results to the 'list' variable
followed with a space
Clipboard := "" ; clear the clipboard.
Clipboard := "Pls trade " list " <#951737931159187457>"
ClipWait, 0 ; wait zero seconds for the clipboard to change
If ErrorLevel ; if waiting zero seconds for the clipboard to change
doesn't work, give error msg to user.
MsgBox, 48, Error, An error occurred while waiting for the clipboard.
return
Frankly this code is what I would call quick and dirty, and seems unlikely to work well all the time.

How to do colouring the contents of a mail while sending via unix terminal using mailx command?

I have a file(.txt) with below details(I am having more than 50 files but listed only 4) and while sending that file via mail I want to implement some coloring to it. I am not sure while it is possible or not, Could you please help me on this please ?
date filename_now avg_timestamp space count status
Nov 4 CHCK01_20161104.txt 06:39 2.15M 17153 Delayed --> RED
Nov 4 TRIPS11_20161104.txt 09:03 0.00M 024 On_Time --> GREEN
Nov 4 AR02_20161104.txt 09:31 0.00M 007 No_Files --> YELLOW
Nov 4 AR01_20161104.txt 09:31 0.04M 433 Delayed --> RED
This it I am getting in my mail(MS outlook), Can I implement coloring for the status field as requested?
Thanks a lot for your time.
If all you want to do is surround your lines with HTML font tags based on the value of the status column, this awk code should do the trick:
{
if ( /On_Time/ ) print "<font color=\"#00FF00\">", $0, "</font>"
if ( /Delayed/ ) print "<font color=\"#FF0000\">", $0, "</font>"
if ( /No_Files/ ) print "<font color=\"#FFFF00\">", $0, "</font>"
}

Drools rule issue after migrating to 6.x from 5.3

I am getting issue in below rule. This is working fine in 5.3 but throwing error (must be boolean expression).
String drl="import com.drools.Applicant;"
+ "rule \"Is of valid age\" "
+ " when $a : Applicant(age > 18 && name matches \"(?i).*\"+ name + \"(.|\n|\r)*\")"
+ " then $a.setValid( true ); "
+ " System.out.println(\"validation: \" + $a.isValid());\n"+
"end";
Issue is with line :
" when $a : Applicant(age > 18 && name matches \"(?i).\"+ name + \"(.|\n|\r)\")"
Any advise.
The expression isn't correct since name cannot be resolved as part of an experssion. Use a binding.
$a : Applicant($n: name, age > 18, name matches \"(?i).*\"+ $name + \"(.|\n|\r)*\")"
(I don't think the the constraint makes much sense - it's merely a test whether a name matches itself, with or without arbitrary characters before and after. Moreover, the ?i is superfluous.)

Xtext 2.8+ formatter, formatting HiddenRegion with comment

I am using Xtext 2.9 formatter and I am trying to format hiddenRegion which contains comment. Here is part of my document region i am trying to format:
Columns: 1:offset 2:length 3:kind 4: text 5:grammarElement
Kind: H=IHiddenRegion S=ISemanticRegion B/E=IEObjectRegion
35 0 H
35 15 S ""xxx::a::b"" Refblock:namespace=Namespace
50 0 H
50 1 S "}" Refblock:RCBRACKET
E Refblock PackageHead:Block=Refblock path:PackageHead/Block=Package'xxx_constants'/head=Model/packages[0]
51 0 H
51 1 S ":" PackageHead:COLON
E PackageHead Package:head=PackageHead path:Package'xxx_constants'/head=Model/packages[0]
52 >>>H "\n " Whitespace:TerminalRule'WS'
"# asd" Comment:TerminalRule'SL_COMMENT'
15 "\n " Whitespace:TerminalRule'WS'<<<
B Error'ASSD' Package:expressions+=Expression path:Package'xxx_constants'/expressions[0]=Model/packages[0]
67 5 S "error" Error:'error'
72 1 H " " Whitespace:TerminalRule'WS'
and corresponding part of the grammar
Model:
{Model}
(packages+=Package)*;
Expression:
Error | Warning | Enum | Text;
Package:
{Package}
'package' name=Name head=PackageHead
(BEGIN
(imports+=Import)*
(expressions+=Expression)*
END)?;
Error:
{Error}
('error') name=ENAME parameter=Parameter COLON
(BEGIN
(expressions+=Estatement)+
END)?;
PackageHead:
Block=Refblock COLON;
Problem is that when i try prepend some characters before error keyword
for example
error.regionFor.keyword('error').prepend[setSpace("\n ")]
This indentation is prepended before the comment and not behind it. This results into improper formatting in case of single line comment before the 'error' keyword.
To provide more clarity, here is example code from my grammar and description of desired behavior:
package xxx_constants {namespace="xxx::a::b"}:
# asd
error ASSD {0}:
Hello {0,world}
This is expected result: (one space to the left)
package xxx_constants {namespace="xxx::a::b"}:
# asd
error ASSD {0}:
Hello {0,world}
and this is the actual result with prepend method
package xxx_constants {namespace="xxx::a::b"}:
# asd
error ASSD {0}:
Hello {0,world}
As the document structure says, the HiddenRegion is in this case is the statement:
# asd
error
How can i prepend my characters directly before the keyword 'error' and not before the comment? Thanks.
I assume you're creating an indentation-sensitive language, because you're explicitly calling BEGIN and END.
For indentation-sensitive language my answer is: You'll want to overwrite
org.eclipse.xtext.formatting2.internal.HiddenRegionReplacer.applyHiddenRegionFormatting(List<ITextReplacer>)
The methods append[] and prepend[] you're using are agnostic to comments and at a later time applyHiddenRegionFormatting() is called to decide how that formatting is weaved between comments.
To make Xtext use your own subclass of HiddenRegionReplacer, overwrite
org.eclipse.xtext.formatting2.AbstractFormatter2.createHiddenRegionReplacer(IHiddenRegion, IHiddenRegionFormatting)
For languages that do not do whitespace-sensitive lexing/parsing (that's the default) the answer is to not call setSpace() to create indentation or line-wraps.
Instead, do
pkg.interior[indent]
pkg.regionFor.keyword(":").append[newLine]
pkg.append[newLine]

OWL2: Is it possible put Annotation on an ObjectIntersectionOf?

I know I can put annotations on a SubClassOf relation:
SubClassOf(
Annotation(rdfs:comment "This annotation is valid")
ObjectIntersectionOf(
ObjectHasValue(:prop1 :instance1)
ObjectHasValue(:prop2 :instance2)
)
ObjectHasValue(:prop3 :instance3)
)
However, what I really wanted to do is this:
SubClassOf(
ObjectIntersectionOf(
Annotation(rdfs:comment "This annotation is invalid")
ObjectHasValue(:prop1 :instance1)
ObjectHasValue(:prop2 :instance2)
)
ObjectHasValue(:prop3 :instance3)
)
What I want is to create an annotation meaningful to all objects with the relations :prop1 :instance1 and :prop2 :instance, and not to the subclass relation.
I don't want to create a class for the ObjectIntersectionOf, as I will have thousands of such classes on my real example.
Running pellet 2.3.1 on the file below yields the following error:
$ pellet.sh explain draft2.owl
There are 1 input files:
./draft2.owl
Start loading
org.semanticweb.owlapi.io.UnparsableOntologyException: Problem parsing file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl
Could not parse ontology. Either a suitable parser could not be found, or parsing failed. See parser logs below for explanation.
The following parsers were tried:
1) RDFXMLParser
2) OWLXMLParser
3) OWLFunctionalSyntaxOWLParser
4) TurtleOntologyParser
5) OWLOBOParser
6) KRSS2OWLParser
7) ManchesterOWLSyntaxOntologyParser
Detailed logs:
--------------------------------------------------------------------------------
Parser: RDFXMLParser
org.xml.sax.SAXParseException; systemId: file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
--------------------------------------------------------------------------------
Parser: OWLXMLParser
org.xml.sax.SAXParseException; systemId: file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
--------------------------------------------------------------------------------
Parser: OWLFunctionalSyntaxOWLParser
Encountered "" at line 8, column 9.
Was expecting one of:
(Line 7)
--------------------------------------------------------------------------------
Parser: TurtleOntologyParser
uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered "" at line 1, column 1.
Was expecting one of:
--------------------------------------------------------------------------------
Parser: OWLOBOParser
org.coode.owlapi.obo.parser.TokenMgrError: Lexical error at line 6, column 12. Encountered: "\n" (10), after : ""
--------------------------------------------------------------------------------
Parser: KRSS2OWLParser
de.uulm.ecs.ai.owlapi.krssparser.ParseException: Encountered " <NAME> "Prefix "" at line 1, column 1.
Was expecting:
<EOF>
--------------------------------------------------------------------------------
Parser: ManchesterOWLSyntaxOntologyParser
Encountered Prefix at line 1 column 1. Expected one of:
DifferentIndividuals:
Individual:
Class:
AnnotationProperty:
Import:
DisjointClasses:
ObjectProperty:
Datatype:
EquivalentClasses:
SameIndividual:
Prefix:
DataProperty:
DisjointProperties:
ValuePartition:
(Line 1)
at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:236)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:880)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:818)
at com.clarkparsia.pellet.owlapiv3.OWLAPILoader.parseFile(OWLAPILoader.java:142)
at org.mindswap.pellet.KBLoader.parse(KBLoader.java:99)
at com.clarkparsia.pellet.owlapiv3.OWLAPILoader.parse(OWLAPILoader.java:128)
at org.mindswap.pellet.KBLoader.createKB(KBLoader.java:65)
at pellet.PelletCmdApp.getKB(PelletCmdApp.java:210)
at pellet.PelletCmdApp.getKB(PelletCmdApp.java:198)
at pellet.PelletExplain.parseArgs(PelletExplain.java:204)
at pellet.Pellet.run(Pellet.java:104)
at pellet.Pellet.main(Pellet.java:59)
draft2.owl
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(:=<http://cipe.accamargo.org.br/ontologias/tnm.owl#>)
Ontology(<http://cipe.accamargo.org.br/ontologias/tnm.owl>
SubClassOf(
ObjectIntersectionOf(
Annotation(rdfs:comment "This annotation is invalid")
ObjectHasValue(:prop1 :instance1)
ObjectHasValue(:prop2 :instance2)
)
ObjectHasValue(:prop3 :instance3)
)
No, I don't think you can do this. The OWL 2 spec allows for annotations of ontologies, axioms, and entities, and complex class expressions are neither of those (see §10 Annotations).
Pellet has nothing to do with this, you get the error from the OWL API FSS parser since your ontology is syntactically invalid.