[Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Bhagya Dimenguwari
Hi,

I tried to add new document to an API with the Source Type "File". I used
the requested parameters as [1] referring firebug  information [2] and it
does not allow to add the document and got the exception [3].

I am going to test Integration test by referring test case - *APIM2-622:Add
documentation to an API [ sample & SDK | File ] through the publisher REST
api* in test link

*.*
Are there any document to refer for add a new file through the REST Api?


[1]

action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
-org.wso2.carbon.caching.core.permissiontree.*
-org.wso2.carbon.caching.infinispan.*
-org.wso2.carbon.event.core.internal.delivery.jms.*
-org.wso2.carbon.event.core.qpid.*
-org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
-org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
-org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
-org.wso2.carbon.apimgt.keymgt.service.thrift.*
-org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
-org.wso2.carbon.throttle.module.utils.*
-org.wso2.carbon.throttle.module.utils.impl.*
-org.wso2.carbon.throttle.module.handler.*
-org.wso2.carbon.throttle.core.impl.domainbase.*
-org.wso2.carbon.throttle.module.*
-org.wso2.carbon.throttle.core.impl.ipbase.*
-org.wso2.uri.template.parser.*=text/plain=samples=file

[2]

-95753468186848783342988543
Content-Disposition: form-data; name="mode"
-95753468186848783342988543
Content-Disposition: form-data; name="docUrl" http://
-95753468186848783342988543
Content-Disposition: form-data; name="sourceType" file
-95753468186848783342988543
Content-Disposition: form-data; name="summary" add new doc
-95753468186848783342988543
Content-Disposition: form-data; name="docType" samples
-95753468186848783342988543
Content-Disposition: form-data; name="docName" filterdoc
-95753468186848783342988543
Content-Disposition: form-data; name="version" 1.1.2
-95753468186848783342988543
Content-Disposition: form-data; name="apiName" APIM1234
-95753468186848783342988543
Content-Disposition: form-data; name="action" addDocumentation
-95753468186848783342988543
Content-Disposition: form-data; name="provider" admin
-95753468186848783342988543
Content-Disposition: form-data; name="mimeType" text/plain
-95753468186848783342988543
Content-Disposition: form-data; name="optionsRadios" samples
-95753468186848783342988543
Content-Disposition: form-data; name="optionsRadios1" file
-95753468186848783342988543
Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
-org.wso2.carbon.caching.core.permissiontree.*
-org.wso2.carbon.caching.infinispan.*
-org.wso2.carbon.event.core.internal.delivery.jms.*
-org.wso2.carbon.event.core.qpid.*
-org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
-org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
-org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
-org.wso2.carbon.apimgt.keymgt.service.thrift.*
-org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
-org.wso2.carbon.throttle.module.utils.*
-org.wso2.carbon.throttle.module.utils.impl.*
-org.wso2.carbon.throttle.module.handler.*
-org.wso2.carbon.throttle.core.impl.domainbase.*
-org.wso2.carbon.throttle.module.*
-org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*

[3]

hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject Error while
creating an attachment for Document-
APIM622PublisherTestHowTo-File-summary-1.0.0. Empty File Attachment.

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- org.wso2.carbon.apimgt.api.APIManagementException: Empty File Attachment.

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at
org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_addDocumentation(APIProviderHostObject.java:2990)


INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)


INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- at

Re: [Dev] [DAS] Issue in connecting db2 with DAS

2015-09-16 Thread Gokul Balakrishnan
Sure Anjana, I'll work on this.

On 15 September 2015 at 19:07, Nayomi Dayarathne  wrote:

> Hi Anjana,
>
> Reported the JIRA[1].
>
> [1]. https://wso2.org/jira/browse/DAS-142
>
> Thanks.
>
>
> Nayomi Dayarathne
>
> *Software Engineer-QA*
> Mobile : +94 (0) 775246619 <+94+(0)+775246619>
>
> *nay...@wso2.com *
>
> On Tue, Sep 15, 2015 at 6:42 PM, Anjana Fernando  wrote:
>
>> Hi Nayomi,
>>
>> Yeah, for now, do test with the changed configuration name change. But we
>> will have to come up with an approach for this, since the query
>> configuration will most probably be identical for both situations. @Gokul,
>> shall we do an improvement in the database name section there to support
>> like "*" wildcard character. Maybe it will be easy if we just allow users
>> to give an regex in the place of the name, so it can be matched. Can you
>> please create an improvement JIRA and get it implemented.
>>
>> Cheers,
>> Anjana.
>>
>> On Tue, Sep 15, 2015 at 6:31 PM, Nayomi Dayarathne 
>> wrote:
>>
>>> Hi Anjana,
>>>
>>> Following error was seen when connecting DAS 3.0 with db2 .
>>>
>>>
>>> ERROR
>>> {org.wso2.carbon.analytics.dataservice.AnalyticsDataServiceComponent} -
>>> Error in activating analytics data service: Cannot find a database section
>>> in the RDBMS configuration for the database:
>>> {Category=large_dataset_optimized, Database Product Name=DB2/LINUXX8664,
>>> Version=10.5}
>>> org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException:
>>> Cannot find a database section in the RDBMS configuration for the database:
>>> {Category=large_dataset_optimized, Database Product Name=DB2/LINUXX8664,
>>> Version=10.5}
>>>
>>>
>>>
>>> After discussing with Gokul, we found that root cause for the error was
>>> the incompatibility of db2 type(windows/linux) that has mentioned in the
>>> rdbms-config.xml with the db2 we were trying to connect with DAS.
>>>
>>> Default rdbms-config.xml has the configurations for db2 for windows but
>>> not linux. And we have used db2 which was configured for linux environment .
>>>
>>>
>>> Therefore, as a workaround suggested by Gokul, we changed the name of
>>> the db2 configuration in rdbms-config.xml as DB2/LINUXX8664 (linux verison).
>>>
>>> Hence, we would like to know whether we are going to add db2
>>> configuration for both OS's or are we just going to mention it in the DAS
>>> document ?
>>>
>>>
>>>
>>>
>>>
>>> Nayomi Dayarathne
>>>
>>> *Software Engineer-QA*
>>> Mobile : +94 (0) 775246619 <+94+(0)+775246619>
>>>
>>> *nay...@wso2.com *
>>>
>>
>>
>>
>> --
>> *Anjana Fernando*
>> Senior Technical Lead
>> WSO2 Inc. | http://wso2.com
>> lean . enterprise . middleware
>>
>
>


-- 
Gokul Balakrishnan
Senior Software Engineer,
WSO2, Inc. http://wso2.com
Mob: +94 77 593 5789 | +1 650 272 9927
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [VOTE] Release WSO2 CEP 4.0.0 RC3

2015-09-16 Thread Sriskandarajah Suhothayan
Hi Devs,

WSO2 CEP 4.0.0 RC3 Release Vote

This release fixes the following issues:
https://wso2.org/jira/issues/?filter=12398

Please download CEP 4.0.0 RC3 and test the functionality and vote. Vote
will be open for 72 hours or as needed.

Binary distribution at:
http://svn.wso2.org/repos/wso2/people/suho/packs/cep/4.0.0/RC3/


Maven staging repository:
http://maven.wso2.org/nexus/content/repositories/orgwso2cep-106

The tag to be voted upon :
*https://github.com/wso2/product-cep/releases/tag/v4.0.0-RC3
*


[-] Broken - do not release (explain why)
[+] Stable - go ahead and release

Thanks and Regards,
WSO2 CEP Team

-- 

*S. Suhothayan*
Technical Lead & Team Lead of WSO2 Complex Event Processor
*WSO2 Inc. *http://wso2.com
* *
lean . enterprise . middleware


*cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | blog:
http://suhothayan.blogspot.com/ twitter:
http://twitter.com/suhothayan  | linked-in:
http://lk.linkedin.com/in/suhothayan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DEV] Issue in sending events using a datasource via the event simulator

2015-09-16 Thread Nayomi Dayarathne
Hi Lasantha,

Thanks for fixing the issue.

Regards.

Nayomi Dayarathne

*Software Engineer-QA*
Mobile : +94 (0) 775246619 <+94+(0)+775246619>

*nay...@wso2.com *

On Tue, Sep 15, 2015 at 9:32 PM, Nayomi Dayarathne  wrote:

> Hi all,
>
> There is an issue in sending events using a datasource via the event
> simulator in DAS 3.0.
>
> Events has not published into the event stream when sending data via
> database event simulation.Database connection is also healthy.Therefore,
> seems the issue is with the database event simulation.
>
> Reported a JIRA[1] regarding this issue.
>
> [1].https://wso2.org/jira/browse/DAS-138
>
>
> Thanks.
>
> Nayomi Dayarathne
>
> *Software Engineer-QA*
> Mobile : +94 (0) 775246619 <+94+(0)+775246619>
>
> *nay...@wso2.com *
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AS] [Tests] Port offset change in test cases where offset values are hardcoded

2015-09-16 Thread Manuri Amaya Perera
Hi,

Thank you for the suggestions.

The property was added as follows.

eg:


localhost


9864
9544


101




On Thu, Sep 3, 2015 at 12:34 PM, Nuwan Wimalasekara  wrote:

> HI Supun,
>
>
> On Thu, Sep 3, 2015 at 12:29 PM, Supun Malinga  wrote:
>
>>
>>
>> On Thu, Sep 3, 2015 at 12:24 PM, Nuwan Wimalasekara 
>> wrote:
>>
>>> Hi Manuri,
>>> There are some test classes which start a new server with a port offset
>>> and those port configuration are kept in automation.xml and referred by a
>>> name.
>>>
>>
>> This is true Nuwan. But the concern is that in the test cases where we
>> use a offset. We have the offset hardcoded. Instead we need to read it from
>> the config file (automation.xml).
>> So what we thought is to put it as a property in the config of the
>> instances.
>> eg:
>> > nonBlockingTransportEnabled="false">
>> 
>> localhost
>> 
>> 
>> 9764
>> 9444
>> 
>> **
>> **
>> **
>> 
>>
> +1. This is better approach.  Then we can read the offset from the config
> property and set
>
> Thanks,
> Nuwanw
>
>>
>> thanks,
>>
>>
>>>
>>
>>> Ex: if the portOffset is 1, then the config is as bellow. Then the test
>>> class refer the post and hot config by referring the name
>>> "appServerInstance0002" and generate the server URLs.
>>>
>>> >> nonBlockingTransportEnabled="false">
>>> 
>>> localhost
>>> 
>>> 
>>> 9764
>>> 9444
>>> 
>>> 
>>>
>>> Now you have to increase the port offset in this classes to be 100 +
>>> portOffset and according to new port offset you have to change the
>>> configuration as well.
>>>
>>> >> nonBlockingTransportEnabled="false">
>>> 
>>> localhost
>>> 
>>> 
>>> 9864
>>> 9544
>>> 
>>> 
>>>
>>> Thanks,
>>> Nuwanw
>>>
>>> On Thu, Sep 3, 2015 at 12:07 PM, Manuri Amaya Perera 
>>> wrote:
>>>
 Adding Dev

 On Thu, Sep 3, 2015 at 11:50 AM, Manuri Amaya Perera 
 wrote:

> Hi,
>
> At the moment, in automation.xml in test modules, the -DportOffset
> parameter has been set to 100 and the port values in relevant instances
> also have been changed accordingly.
>
> But in the test cases where internally a server is set up, the port
> offset values are being hard coded. These values also need to be moved
> forward by 100. A configuration can be added to automation.xml which can 
> be
> read and used to do this.
>
> I'd like to discuss the best way to address this problem.
>
> Thank you.
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>



 --

 *Manuri Amaya Perera*

 *Software Engineer*

 *WSO2 Inc.*

 *Blog: http://manuriamayaperera.blogspot.com
 *

>>>
>>>
>>>
>>> --
>>> Nuwan Wimalasekara
>>> Senior Software Engineer - Test Automation
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> phone: +94 71 668 4620
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Supun Malinga,
>>
>> Senior Software Engineer,
>> WSO2 Inc.
>> http://wso2.com
>> email: sup...@wso2.com 
>> mobile: +94 (0)71 56 91 321
>>
>
>
>
> --
> Nuwan Wimalasekara
> Senior Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> phone: +94 71 668 4620
>
>
>
>


-- 

*Manuri Amaya Perera*

*Software Engineer*

*WSO2 Inc.*

*Blog: http://manuriamayaperera.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] APIM showing subscription details even after subscription is removed

2015-09-16 Thread Udara Liyanage
Hi,

Thanks for the info.

On Tue, Sep 15, 2015 at 6:36 PM, Madusanka Premaratne 
wrote:

> Hi Udara,
> The consumer key secret pair is generated against the oauth app you select
> while subscribing. After removing the subscription, only the subscribed api
> wii be removed from subscribed APIs (at the bottom of the screenshot)
> You may see the drop down "Applications with Subscriptions" in the top of
> the subscription page. When you change the app there, the consumer_key,
> consumer_secret and access_token changes accordingly. If you delete the
> particular app only you will be able to delete those info.
>
> Thanks,
> Madusanka
>
>
> On Wed, Sep 16, 2015 at 12:08 AM, Udara Liyanage  wrote:
>
>> Hi,
>>
>> 1) Create an API in publisher
>> 2) Subscribe to the API
>> 3) Generate keys - UI will show the generated keys
>> 4) Now remove the subscription - Still the earlier subscription
>> details(including) keys are shown. I guess it should n't ?
>>
>> Attached a screenshot.
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Madusanka Premaratne* | Associate Software Engineer
> WSO2, Inc | lean. enterprise. middleware.
> #20, Palm Grove, Colombo 03, Sri Lanka
> Mobile: +94 71 835 70 73| Work: +94 112 145 345
> Email: madusan...@wso2.com | Web: www.wso2.com
>
> [image: Facebook]  [image: Twitter]
>  [image: Google Plus]
>  [image:
> Linkedin]  [image: Instagram]
>  [image: Skype]
> 
>
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Lakshman Udayakantha
Hi Saneth,

to upload the file for documentation use this command

curl -X POST -b cookies
http://localhost:9774/publisher/site/blocks/documentation/ajax/docs.jag -F
"action=addDocumentation" -F "provider=admin" -F "apiName=testAPi" -F
"version=1.0.0" -F "docName=testDoc2" -F "docType=how to" -F
"sourceType=file" -F "docUrl=" -F "summary=testing" -F
"docLocation=@test.txt"

here test.txt is the document. you can add the file path there with @.


Thanks

On Wed, Sep 16, 2015 at 1:30 PM, Saneth Dharmakeerthi 
wrote:

> HI Madusanka,
>
> We have referred that document and it contains how to add inline
> document,  its working fine, problem is how to add a .txt file or a .pdf
> using  the REST API.
>
> Thanks and Best Regards,
>
> Saneth Dharmakeerthi
> Senior Software Engineer
> WSO2, Inc.
> Mobile: +94772325511
>
> On Wed, Sep 16, 2015 at 1:04 PM, Madusanka Premaratne  > wrote:
>
>> Hi Bhagya,
>> Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the
>> link
>>
>> [1] - https://docs.wso2.com/display/AM191/Publisher+APIs
>>
>> Thanks,
>> Madusanka
>>
>> On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
>> wrote:
>>
>>> Hi,
>>>
>>> I tried to add new document to an API with the Source Type "File". I
>>> used the requested parameters as [1] referring firebug  information [2] and
>>> it does not allow to add the document and got the exception [3].
>>>
>>> I am going to test Integration test by referring test case - *APIM2-622:Add
>>> documentation to an API [ sample & SDK | File ] through the publisher REST
>>> api* in test link
>>>
>>> *.*
>>> Are there any document to refer for add a new file through the REST Api?
>>>
>>>
>>> [1]
>>>
>>>
>>> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
>>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>>> -org.wso2.carbon.caching.core.permissiontree.*
>>> -org.wso2.carbon.caching.infinispan.*
>>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>>> -org.wso2.carbon.event.core.qpid.*
>>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>>> -org.wso2.carbon.throttle.module.utils.*
>>> -org.wso2.carbon.throttle.module.utils.impl.*
>>> -org.wso2.carbon.throttle.module.handler.*
>>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>>> -org.wso2.carbon.throttle.module.*
>>> -org.wso2.carbon.throttle.core.impl.ipbase.*
>>> -org.wso2.uri.template.parser.*=text/plain=samples=file
>>>
>>> [2]
>>>
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="mode"
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docUrl" http://
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="sourceType" file
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="summary" add new doc
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docType" samples
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docName" filterdoc
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="version" 1.1.2
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="apiName" APIM1234
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="action" addDocumentation
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="provider" admin
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="mimeType" text/plain
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="optionsRadios" samples
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="optionsRadios1" file
>>> -95753468186848783342988543
>>> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
>>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>>> -org.wso2.carbon.caching.core.permissiontree.*
>>> -org.wso2.carbon.caching.infinispan.*
>>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>>> -org.wso2.carbon.event.core.qpid.*
>>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>>> 

Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Saneth Dharmakeerthi
HI Madusanka,

We have referred that document and it contains how to add inline document,
 its working fine, problem is how to add a .txt file or a .pdf using  the
REST API.

Thanks and Best Regards,

Saneth Dharmakeerthi
Senior Software Engineer
WSO2, Inc.
Mobile: +94772325511

On Wed, Sep 16, 2015 at 1:04 PM, Madusanka Premaratne 
wrote:

> Hi Bhagya,
> Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the
> link
>
> [1] - https://docs.wso2.com/display/AM191/Publisher+APIs
>
> Thanks,
> Madusanka
>
> On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
> wrote:
>
>> Hi,
>>
>> I tried to add new document to an API with the Source Type "File". I used
>> the requested parameters as [1] referring firebug  information [2] and it
>> does not allow to add the document and got the exception [3].
>>
>> I am going to test Integration test by referring test case - *APIM2-622:Add
>> documentation to an API [ sample & SDK | File ] through the publisher REST
>> api* in test link
>>
>> *.*
>> Are there any document to refer for add a new file through the REST Api?
>>
>>
>> [1]
>>
>>
>> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>> -org.wso2.carbon.caching.core.permissiontree.*
>> -org.wso2.carbon.caching.infinispan.*
>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>> -org.wso2.carbon.event.core.qpid.*
>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>> -org.wso2.carbon.throttle.module.utils.*
>> -org.wso2.carbon.throttle.module.utils.impl.*
>> -org.wso2.carbon.throttle.module.handler.*
>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>> -org.wso2.carbon.throttle.module.*
>> -org.wso2.carbon.throttle.core.impl.ipbase.*
>> -org.wso2.uri.template.parser.*=text/plain=samples=file
>>
>> [2]
>>
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="mode"
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docUrl" http://
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="sourceType" file
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="summary" add new doc
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docType" samples
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docName" filterdoc
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="version" 1.1.2
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="apiName" APIM1234
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="action" addDocumentation
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="provider" admin
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="mimeType" text/plain
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="optionsRadios" samples
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="optionsRadios1" file
>> -95753468186848783342988543
>> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
>> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
>> -org.wso2.carbon.caching.core.permissiontree.*
>> -org.wso2.carbon.caching.infinispan.*
>> -org.wso2.carbon.event.core.internal.delivery.jms.*
>> -org.wso2.carbon.event.core.qpid.*
>> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
>> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
>> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
>> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
>> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
>> -org.wso2.carbon.throttle.module.utils.*
>> -org.wso2.carbon.throttle.module.utils.impl.*
>> -org.wso2.carbon.throttle.module.handler.*
>> -org.wso2.carbon.throttle.core.impl.domainbase.*
>> -org.wso2.carbon.throttle.module.*
>> -org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*
>>
>> [3]
>>
>> hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 
>>
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject 

Re: [Dev] [APIM] - Required parameters for add documentation to an API with the source type File

2015-09-16 Thread Madusanka Premaratne
Hi Bhagya,
Did you try WSO2 Publisher APIs[1]. Find Add/Update API Document in the link

[1] - https://docs.wso2.com/display/AM191/Publisher+APIs

Thanks,
Madusanka

On Wed, Sep 16, 2015 at 12:11 PM, Bhagya Dimenguwari 
wrote:

> Hi,
>
> I tried to add new document to an API with the Source Type "File". I used
> the requested parameters as [1] referring firebug  information [2] and it
> does not allow to add the document and got the exception [3].
>
> I am going to test Integration test by referring test case - *APIM2-622:Add
> documentation to an API [ sample & SDK | File ] through the publisher REST
> api* in test link
>
> *.*
> Are there any document to refer for add a new file through the REST Api?
>
>
> [1]
>
>
> action=addDocumentation=admin=APIM620PublisherTest=1.0.0=APIM622PublisherTestHowTo-File-summary=samples=file=http://==Testingfilename="filters.txt;
> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
> -org.wso2.carbon.caching.core.permissiontree.*
> -org.wso2.carbon.caching.infinispan.*
> -org.wso2.carbon.event.core.internal.delivery.jms.*
> -org.wso2.carbon.event.core.qpid.*
> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
> -org.wso2.carbon.throttle.module.utils.*
> -org.wso2.carbon.throttle.module.utils.impl.*
> -org.wso2.carbon.throttle.module.handler.*
> -org.wso2.carbon.throttle.core.impl.domainbase.*
> -org.wso2.carbon.throttle.module.*
> -org.wso2.carbon.throttle.core.impl.ipbase.*
> -org.wso2.uri.template.parser.*=text/plain=samples=file
>
> [2]
>
> -95753468186848783342988543
> Content-Disposition: form-data; name="mode"
> -95753468186848783342988543
> Content-Disposition: form-data; name="docUrl" http://
> -95753468186848783342988543
> Content-Disposition: form-data; name="sourceType" file
> -95753468186848783342988543
> Content-Disposition: form-data; name="summary" add new doc
> -95753468186848783342988543
> Content-Disposition: form-data; name="docType" samples
> -95753468186848783342988543
> Content-Disposition: form-data; name="docName" filterdoc
> -95753468186848783342988543
> Content-Disposition: form-data; name="version" 1.1.2
> -95753468186848783342988543
> Content-Disposition: form-data; name="apiName" APIM1234
> -95753468186848783342988543
> Content-Disposition: form-data; name="action" addDocumentation
> -95753468186848783342988543
> Content-Disposition: form-data; name="provider" admin
> -95753468186848783342988543
> Content-Disposition: form-data; name="mimeType" text/plain
> -95753468186848783342988543
> Content-Disposition: form-data; name="optionsRadios" samples
> -95753468186848783342988543
> Content-Disposition: form-data; name="optionsRadios1" file
> -95753468186848783342988543
> Content-Disposition: form-data; name="docLocation"; filename="filters.txt"
> Content-Type: text/plain -org.wso2.carbon.caching.core.identity.*
> -org.wso2.carbon.caching.core.permissiontree.*
> -org.wso2.carbon.caching.infinispan.*
> -org.wso2.carbon.event.core.internal.delivery.jms.*
> -org.wso2.carbon.event.core.qpid.*
> -org.wso2.carbon.registry.synchronization.* -org.wso2.throttle.*
> -org.wso2.carbon.apimgt.hostobjects.AssetStoreHostObject.java
> -org.wso2.carbon.apimgt.gateway.handlers.security.thrift.*
> -org.wso2.carbon.apimgt.keymgt.service.thrift.*
> -org.wso2.carbon.apimgt.impl.workflow.* -org.wso2.carbon.apimgt.usage.*
> -org.wso2.carbon.throttle.module.utils.*
> -org.wso2.carbon.throttle.module.utils.impl.*
> -org.wso2.carbon.throttle.module.handler.*
> -org.wso2.carbon.throttle.core.impl.domainbase.*
> -org.wso2.carbon.throttle.module.*
> -org.wso2.carbon.throttle.core.impl.ipbase.* -org.wso2.uri.template.parser.*
>
> [3]
>
> hPublisherRestAPITestCase.testAddDocumentToAnAPIHowToFile 
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - [2015-09-16 11:24:34,175] ERROR - APIProviderHostObject Error while
> creating an attachment for Document-
> APIM622PublisherTestHowTo-File-summary-1.0.0. Empty File Attachment.
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - org.wso2.carbon.apimgt.api.APIManagementException: Empty File Attachment.
>
> INFO [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
> - at
> 

Re: [Dev] [Private PaaS] API Manager template module seems be messed up

2015-09-16 Thread Rajkumar Rajaratnam
Hi Guys,

Have we fixed the two issues discussed in this thread? If not, better to
track it via a JIRA.

Thanks,
Raj.

On Thu, Sep 10, 2015 at 4:53 PM, Pubudu Gunatilaka  wrote:

> Hi,
>
> +1 for this approach
>
> What we initially thought was to list down all the parameters in the
> module.ini file which are not default values. User can either override
> those values from environment variables or use the module.ini file.
>
> Thank you!
>
> On Thu, Sep 10, 2015 at 10:16 AM, Rajkumar Rajaratnam 
> wrote:
>
>> What I meant is, why don't we do this?
>>
>> if CONFIG_PARAM_LOCAL_MEMBER_HOST is set {
>> {{ CONFIG_PARAM_LOCAL_MEMBER_HOST
>> }}
>> } else {
>> 127.0.0.1
>> }
>>
>> Thanks.
>>
>> On Thu, Sep 10, 2015 at 3:59 PM, Rajkumar Rajaratnam 
>> wrote:
>>
>>> Any reason to treat the following config parameters differently, than
>>> other config parameters?
>>>
>>> CONFIG_PARAM_CLUSTERING=false
>>> CONFIG_PARAM_DOMAIN=wso2.carbon.domain
>>> CONFIG_PARAM_WKA_MEMBERS=[127.0.0.1:4000]
>>> CONFIG_PARAM_LOCAL_MEMBER_HOST=127.0.0.1
>>> CONFIG_PARAM_LOCAL_MEMBER_PORT=4000
>>> CONFIG_PARAM_PORT_OFFSET=0
>>> CONFIG_PARAM_MB_PORT=61616
>>> CONFIG_PARAM_EMBEDDED_LDAP=true
>>>
>>> These are enabled in module.ini file by default, where as other
>>> parameters are disabled. And the default values of these config elements
>>> are removed from templates files and moved to module.ini.
>>>
>>> This is not consistent with other config parameters. Because of this, we
>>> always have to pass these parameters to configurator, even though we don't
>>> need to override the default ones.
>>>
>>> By accident, I commented out all the config parameters from module.ini
>>> and I have passed only the needed parameters to the configurator as
>>> environment variables via puppet. I ended up with some issues since I
>>> haven't pass the above parameters as environment variables (even though I
>>> don't want to override the default ones!). So isn't good if leave the
>>> default values in the template files itself? This way, we don't have
>>> explicitly pass the default values, just like other config parameters.
>>>
>>> wdyt?
>>>
>>> Thanks,
>>> Raj.
>>>
>>> On Tue, Sep 8, 2015 at 1:19 AM, Rajkumar Rajaratnam 
>>> wrote:
>>>


 On Tue, Sep 8, 2015 at 1:16 AM, Reka Thirunavukkarasu 
 wrote:

> Hi Raj,
>
> Yah..Seems some old reference is there in the
> master-datasources.xml.template which will not affect the configurations,
> if the parameters are defined correctly in the cartridge definition. 
> Please
> ignore the section with CONFIG_PARAM_CONFIG_DB_APIM_URL.
>
> Please refer [1] for the sample configuration. We will clean this in
> the immediate next release(beta)..
>

 ​+1. Not a blocker or urgent. ​


>
> [1]
> https://github.com/wso2/product-private-paas/blob/master/samples/cartridges/ec2/wso2am-190/wso2am-190-gw-manager.json
>
> Thanks,
> Reka
>
> On Mon, Sep 7, 2015 at 6:19 PM, Rajkumar Rajaratnam <
> rajkum...@wso2.com> wrote:
>
>> Hi,
>>
>> I think API Manager's master-datasources.xml.template is messed up.
>> For example, same db username/password parameter is used for all the
>> databases and jdbc/WSO2REG_DB is defined twice with two different
>> if-checks, why?
>>
>> Please check and fix [1]. Please check other modules also.
>>
>> [1]
>> https://github.com/wso2/product-private-paas/blob/master/cartridges/templates-modules/wso2am-1.9.0/templates/repository/conf/datasources/master-datasources.xml.template
>>
>> Thanks,
>> Raj.
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>> ​​
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


 --
 Rajkumar Rajaratnam
 Committer & PMC Member, Apache Stratos
 Software Engineer, WSO2

 Mobile : +94777568639
 Blog : rajkumarr.com

>>>
>>>
>>>
>>> --
>>> Rajkumar Rajaratnam
>>> Committer & PMC Member, Apache Stratos
>>> Software Engineer, WSO2
>>>
>>> Mobile : +94777568639
>>> Blog : rajkumarr.com
>>>
>>
>>
>>
>> --
>> Rajkumar Rajaratnam
>> Committer & PMC Member, Apache Stratos
>> Software Engineer, WSO2
>>
>> Mobile : +94777568639
>> Blog : rajkumarr.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Pubudu Gunatilaka*
> Software Engineer
> WSO2, Inc.: 

[Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread Ashen Weerathunga
Hi all,

I am currently doing the integration of anomaly detection feature for ML. I
have a problem of choosing the best accuracy measure for the model. I can
get the confusion matrix which consists of true positives, true negatives,
false positives and false negatives. There are few different measures such
as sensitivity, accuracy, F1 score, etc. So what will be the best measure
to give as the model accuracy for anomaly detection model.

[1] Some details
about those measures.

Terminology and derivations
from a confusion matrix  true
positive (TP)eqv. with hittrue negative (TN)eqv. with correct rejectionfalse
positive (FP)eqv. with false alarm
, Type I error
false negative (FN)eqv. with
miss, Type II error 
--
sensitivity  or true
positive rate (TPR)eqv. with hit rate
, recall
[image:
\mathit{TPR} = \mathit{TP} / P = \mathit{TP} / (\mathit{TP}+\mathit{FN})]
specificity  (SPC)
or true negative rate[image: \mathit{SPC} = \mathit{TN} / N = \mathit{TN} /
(\mathit{TN}+\mathit{FP})]precision
 or positive
predictive value 
(PPV)[image: \mathit{PPV} = \mathit{TP} / (\mathit{TP} + \mathit{FP})]negative
predictive value 
(NPV)[image: \mathit{NPV} = \mathit{TN} / (\mathit{TN} + \mathit{FN})]
fall-out 
or false
positive rate  (FPR)[image:
\mathit{FPR} = \mathit{FP} / N = \mathit{FP} / (\mathit{FP} + \mathit{TN})
= 1-\mathit{SPC}]false negative rate
 (FNR)[image:
\mathit{FNR} = \mathit{FN} / (\mathit{TP} + \mathit{FN}) = 1-\mathit{TPR}]false
discovery rate 
(FDR)[image:
\mathit{FDR} = \mathit{FP} / (\mathit{TP} + \mathit{FP}) = 1 - \mathit{PPV}]
--
accuracy  (ACC)[image: \mathit{ACC}
= (\mathit{TP} + \mathit{TN}) / (\mathit{TP} + \mathit{FP} + \mathit{FN} +
\mathit{TN})]F1 score is the harmonic
mean

of precision 
and sensitivity [image:
\mathit{F1} = 2 \mathit{TP} / (2 \mathit{TP} + \mathit{FP} +
\mathit{FN})]Matthews
correlation coefficient
 (MCC)[image:
\frac{ \mathit{TP} \times \mathit{TN} - \mathit{FP} \times \mathit{FN} }
{\sqrt{ (\mathit{TP}+\mathit{FP}) ( \mathit{TP} + \mathit{FN} ) (
\mathit{TN} + \mathit{FP} ) ( \mathit{TN} + \mathit{FN} ) }
}]Informedness[image:
\mathit{TPR} + \mathit{SPC} - 1]Markedness
[image: \mathit{PPV} +
\mathit{NPV} - 1]

*Sources: Fawcett (2006) and Powers (2011).*[1]

[2]


Thanks and Regards,
Ashen
-- 
*Ashen Weerathunga*
Software Engineer - Intern
WSO2 Inc.: http://wso2.com
lean.enterprise.middleware

Email: as...@wso2.com
Mobile: +94 716042995 <94716042995>
LinkedIn:
*http://lk.linkedin.com/in/ashenweerathunga
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Missing Fix for CRLF Injection in Kernel Master branch

2015-09-16 Thread Malithi Edirisinghe
Hi Niranjan,

Fix for master is sent on 4th of July with PR [1].

[1] https://github.com/wso2/carbon4-kernel/pull/278

Thanks,
Malithi.


On Wed, Sep 16, 2015 at 5:10 PM, Niranjan Karunanandham 
wrote:

> Hi Malithi,
>
> The current fix (PR [1]) is only sent to the 4.4.x branch and I was not
> able to find the PR for master branch. I think this fix should be in both
> the patch and Minor release branch.
>
> [1] - https://github.com/wso2/carbon4-kernel/pull/447
>
> Regards,
> Nira
>
> --
>
> *Niranjan Karunanandham*
> Senior Software Engineer - WSO2 Inc.
> WSO2 Inc.: http://www.wso2.com
>



-- 

*Malithi Edirisinghe*
Senior Software Engineer
WSO2 Inc.

Mobile : +94 (0) 718176807
malit...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ES : Unable to retrieve resource from registry

2015-09-16 Thread Himasha Guruge
Hi,

In an ES asset extension, I'm saving a resource (text with some html tags)
to the registry, and later on with ajax GET i'm trying to retrieve that
content. ( var result = userReg.get(path))

 A result object is given but when trying to access result.content it gives
null. Any idea how to overcome this? I was creating the resource before
with mediaType:text/plain. Could changing the mediaType solve this?


Thanks,

Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Missing Fix for CRLF Injection in Kernel Master branch

2015-09-16 Thread Niranjan Karunanandham
Hi Malithi,

The current fix (PR [1]) is only sent to the 4.4.x branch and I was not
able to find the PR for master branch. I think this fix should be in both
the patch and Minor release branch.

[1] - https://github.com/wso2/carbon4-kernel/pull/447

Regards,
Nira

-- 

*Niranjan Karunanandham*
Senior Software Engineer - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Missing Fix for CRLF Injection in Kernel Master branch

2015-09-16 Thread Niranjan Karunanandham
Thanks Malithi.

On Wed, Sep 16, 2015 at 5:19 PM, Malithi Edirisinghe 
wrote:

> Hi Niranjan,
>
> Fix for master is sent on 4th of July with PR [1].
>
> [1] https://github.com/wso2/carbon4-kernel/pull/278
>
> Thanks,
> Malithi.
>
>
> On Wed, Sep 16, 2015 at 5:10 PM, Niranjan Karunanandham  > wrote:
>
>> Hi Malithi,
>>
>> The current fix (PR [1]) is only sent to the 4.4.x branch and I was not
>> able to find the PR for master branch. I think this fix should be in both
>> the patch and Minor release branch.
>>
>> [1] - https://github.com/wso2/carbon4-kernel/pull/447
>>
>> Regards,
>> Nira
>>
>> --
>>
>> *Niranjan Karunanandham*
>> Senior Software Engineer - WSO2 Inc.
>> WSO2 Inc.: http://www.wso2.com
>>
>
>
>
> --
>
> *Malithi Edirisinghe*
> Senior Software Engineer
> WSO2 Inc.
>
> Mobile : +94 (0) 718176807
> malit...@wso2.com
>



-- 

*Niranjan Karunanandham*
Senior Software Engineer - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GREG 5.0.0]Error at graceful restart

2015-09-16 Thread Ajith Vitharana
This is not solr related thing. According to the stack trace human task
scheduler jobs are  not properly terminate  with the server shutdown.

-Ajith

On Wed, Sep 16, 2015 at 1:02 AM, Chalitha Waldeniyage 
wrote:

> Hi Ajith,
>
> We have observed the same issue reported in [1] .But this was resolved
> after changing the configs in Event broker.xml  and cleaning the external
> solar data. But not sure it was the cause though.
> In additional to this it was reported in [2] as well.
>
> [1] https://wso2.org/jira/browse/REGISTRY-2762
>
> [2] https://wso2.org/jira/browse/REGISTRY-2787
>
> Thank you,
> Chalitha.
>
> On Tue, Sep 15, 2015 at 10:12 PM, Ajith Vitharana  wrote:
>
>> Observed same issue today henced create a JIRA
>> https://wso2.org/jira/browse/IDENTITY-3580
>>
>> -Ajith
>>
>> On Thu, Sep 10, 2015 at 1:28 PM, Ajith Vitharana  wrote:
>>
>>> Hi All.
>>>
>>>
>>> [2015-09-10 13:21:42,373] ERROR
>>> {org.wso2.carbon.humantask.core.scheduler.SimpleScheduler} -  Error loading
>>> immediate jobs from database.
>>> 
>>> org.apache.openjpa.persistence.PersistenceException: Database is already
>>> closed (to disable automatic closing at VM shutdown, add
>>> ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-140] {SELECT t0.id,
>>> t0.JOB_DETAILS, t0.JOB_NAME, t0.NODEID, t0.SCHEDULED, t0.TASKID,
>>> t0.JOB_TIME, t0.TRANSACTED, t0.JOB_TYPE FROM HT_JOB t0 WHERE (t0.NODEID = ?
>>> AND t0.JOB_TIME < ?) ORDER BY t0.JOB_TIME ASC LIMIT ?} [code=90121,
>>> state=90121]
>>> FailedObject: SELECT DISTINCT t FROM
>>> org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.HumanTaskJob t WHERE
>>> t.nodeId = ?1 AND t.time < ?2 order by t.time [java.lang.String]
>>> at
>>> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4918)
>>> at
>>> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878)
>>> at
>>> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
>>> at
>>> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)
>>> at
>>> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)
>>> at
>>> org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
>>> at
>>> org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:40)
>>> at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
>>> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
>>> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
>>> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
>>> at
>>> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
>>> at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:286)
>>> at
>>> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
>>> at
>>> org.wso2.carbon.humantask.core.dao.jpa.openjpa.HumanTaskDAOConnectionImpl.dequeueImmediate(HumanTaskDAOConnectionImpl.java:248)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$2.call(SimpleScheduler.java:344)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$2.call(SimpleScheduler.java:342)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:881)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:830)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.doLoadImmediate(SimpleScheduler.java:342)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$LoadImmediateTask.run(SimpleScheduler.java:297)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$1.call(SimpleScheduler.java:149)
>>> at
>>> org.wso2.carbon.humantask.core.scheduler.SimpleScheduler$1.call(SimpleScheduler.java:146)
>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> at java.lang.Thread.run(Thread.java:745)
>>> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Database
>>> is already closed (to disable automatic closing at VM shutdown, add
>>> ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-140] {SELECT t0.id,
>>> t0.JOB_DETAILS, t0.JOB_NAME, t0.NODEID, t0.SCHEDULED, t0.TASKID,
>>> t0.JOB_TIME, t0.TRANSACTED, t0.JOB_TYPE FROM HT_JOB t0 WHERE (t0.NODEID = ?
>>> AND t0.JOB_TIME < ?) ORDER BY t0.JOB_TIME ASC LIMIT ?} [code=90121,
>>> state=90121]
>>> at
>>> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247)
>>> at
>>> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:227)
>>> at
>>> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(LoggingConnectionDecorator.java:72)
>>> at
>>> 

[Dev] [CEP 3.1.0] Syncing failed when becoming a Passive Node for tenant

2015-09-16 Thread Anuruddha Liyanarachchi
Hi,

I created CEP HA cluster with Deployment for full-active-active mode as per
[1].
I am seeing following error when starting the 2nd member.
I have also attached execution plan [2].

What is causing this issue ?

[2015-09-16 13:22:38,191] ERROR - {HAManager}  Syncing failed when becoming
a Passive Node for tenant:-1234 on:SecondDerivativeOfRequestsInFlightFinder
execution plan
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
java.util.concurrent.LinkedBlockingQueue
at
org.wso2.siddhi.core.util.collection.queue.SiddhiQueue.restoreState(SiddhiQueue.java:48)
at
org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor.restoreState(SecondDerivativeFinderWindowProcessor.java:229)
at
org.wso2.siddhi.core.query.processor.window.WindowProcessor.restore(WindowProcessor.java:113)
at
org.wso2.siddhi.core.snapshot.SnapshotService.restore(SnapshotService.java:70)
at org.wso2.siddhi.core.SiddhiManager.restore(SiddhiManager.java:443)
at
org.wso2.carbon.event.processor.core.internal.ha.HAManager.becomePassive(HAManager.java:161)
at
org.wso2.carbon.event.processor.core.internal.ha.HAManager.tryChangeState(HAManager.java:111)
at
org.wso2.carbon.event.processor.core.internal.ha.HAManager.init(HAManager.java:97)
at
org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.addExecutionPlanConfiguration(CarbonEventProcessorService.java:358)
at
org.wso2.carbon.event.processor.core.EventProcessorDeployer.processDeploy(EventProcessorDeployer.java:138)
at
org.wso2.carbon.event.processor.core.internal.util.EventProcessorConfigurationFilesystemInvoker.reload(EventProcessorConfigurationFilesystemInvoker.java:86)
at
org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.activateInactiveExecutionPlanConfigurations(CarbonEventProcessorService.java:749)
at
org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.notifyServiceAvailability(CarbonEventProcessorService.java:530)
at
org.wso2.carbon.event.processor.core.internal.ds.EventProcessorServiceDS.setHazelcastInstance(EventProcessorServiceDS.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:432)
at
org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
at
org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:950)
at
org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent.init(HazelcastClusteringAgent.java:214)
at
org.wso2.carbon.core.util.ClusteringUtil.enableClustering(ClusteringUtil.java:44)
at
org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:175)
at
org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:282)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at

Re: [Dev] [CEP 3.1.0] Syncing failed when becoming a Passive Node for tenant

2015-09-16 Thread Ramindu De Silva
Hi Anuruddha,

Is it possible to send me the artefacts you used for this scenario, so that
i can reproduce and debug and see whats causing this issue.

Best Regards,

On Wed, Sep 16, 2015 at 7:30 PM, Anuruddha Liyanarachchi <
anurudd...@wso2.com> wrote:

> Hi,
>
> I created CEP HA cluster with Deployment for full-active-active mode as
> per [1].
> I am seeing following error when starting the 2nd member.
> I have also attached execution plan [2].
>
> What is causing this issue ?
>
> [2015-09-16 13:22:38,191] ERROR - {HAManager}  Syncing failed when
> becoming a Passive Node for tenant:-1234
> on:SecondDerivativeOfRequestsInFlightFinder execution plan
> java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
> java.util.concurrent.LinkedBlockingQueue
> at
> org.wso2.siddhi.core.util.collection.queue.SiddhiQueue.restoreState(SiddhiQueue.java:48)
> at
> org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor.restoreState(SecondDerivativeFinderWindowProcessor.java:229)
> at
> org.wso2.siddhi.core.query.processor.window.WindowProcessor.restore(WindowProcessor.java:113)
> at
> org.wso2.siddhi.core.snapshot.SnapshotService.restore(SnapshotService.java:70)
> at org.wso2.siddhi.core.SiddhiManager.restore(SiddhiManager.java:443)
> at
> org.wso2.carbon.event.processor.core.internal.ha.HAManager.becomePassive(HAManager.java:161)
> at
> org.wso2.carbon.event.processor.core.internal.ha.HAManager.tryChangeState(HAManager.java:111)
> at
> org.wso2.carbon.event.processor.core.internal.ha.HAManager.init(HAManager.java:97)
> at
> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.addExecutionPlanConfiguration(CarbonEventProcessorService.java:358)
> at
> org.wso2.carbon.event.processor.core.EventProcessorDeployer.processDeploy(EventProcessorDeployer.java:138)
> at
> org.wso2.carbon.event.processor.core.internal.util.EventProcessorConfigurationFilesystemInvoker.reload(EventProcessorConfigurationFilesystemInvoker.java:86)
> at
> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.activateInactiveExecutionPlanConfigurations(CarbonEventProcessorService.java:749)
> at
> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.notifyServiceAvailability(CarbonEventProcessorService.java:530)
> at
> org.wso2.carbon.event.processor.core.internal.ds.EventProcessorServiceDS.setHazelcastInstance(EventProcessorServiceDS.java:102)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:432)
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:950)
> at
> org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent.init(HazelcastClusteringAgent.java:214)
> at
> org.wso2.carbon.core.util.ClusteringUtil.enableClustering(ClusteringUtil.java:44)
> at
> org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:175)
> at
> org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:282)
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
> at
> 

Re: [Dev] [CEP 3.1.0] Syncing failed when becoming a Passive Node for tenant

2015-09-16 Thread Sriskandarajah Suhothayan
>From the logs it looks like its an issue in
SecondDerivativeFinderWindowProcessor check the getting and restoring the
state part.

Suho

On Wed, Sep 16, 2015 at 10:16 PM, Ramindu De Silva 
wrote:

> Hi Anuruddha,
>
> Is it possible to send me the artefacts you used for this scenario, so
> that i can reproduce and debug and see whats causing this issue.
>
> Best Regards,
>
> On Wed, Sep 16, 2015 at 7:30 PM, Anuruddha Liyanarachchi <
> anurudd...@wso2.com> wrote:
>
>> Hi,
>>
>> I created CEP HA cluster with Deployment for full-active-active mode as
>> per [1].
>> I am seeing following error when starting the 2nd member.
>> I have also attached execution plan [2].
>>
>> What is causing this issue ?
>>
>> [2015-09-16 13:22:38,191] ERROR - {HAManager}  Syncing failed when
>> becoming a Passive Node for tenant:-1234
>> on:SecondDerivativeOfRequestsInFlightFinder execution plan
>> java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
>> java.util.concurrent.LinkedBlockingQueue
>> at
>> org.wso2.siddhi.core.util.collection.queue.SiddhiQueue.restoreState(SiddhiQueue.java:48)
>> at
>> org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor.restoreState(SecondDerivativeFinderWindowProcessor.java:229)
>> at
>> org.wso2.siddhi.core.query.processor.window.WindowProcessor.restore(WindowProcessor.java:113)
>> at
>> org.wso2.siddhi.core.snapshot.SnapshotService.restore(SnapshotService.java:70)
>> at org.wso2.siddhi.core.SiddhiManager.restore(SiddhiManager.java:443)
>> at
>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.becomePassive(HAManager.java:161)
>> at
>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.tryChangeState(HAManager.java:111)
>> at
>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.init(HAManager.java:97)
>> at
>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.addExecutionPlanConfiguration(CarbonEventProcessorService.java:358)
>> at
>> org.wso2.carbon.event.processor.core.EventProcessorDeployer.processDeploy(EventProcessorDeployer.java:138)
>> at
>> org.wso2.carbon.event.processor.core.internal.util.EventProcessorConfigurationFilesystemInvoker.reload(EventProcessorConfigurationFilesystemInvoker.java:86)
>> at
>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.activateInactiveExecutionPlanConfigurations(CarbonEventProcessorService.java:749)
>> at
>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.notifyServiceAvailability(CarbonEventProcessorService.java:530)
>> at
>> org.wso2.carbon.event.processor.core.internal.ds.EventProcessorServiceDS.setHazelcastInstance(EventProcessorServiceDS.java:102)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at
>> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
>> at
>> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:432)
>> at
>> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
>> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
>> at
>> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
>> at
>> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>> at
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>> at
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>> at
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>> at
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>> at
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>> at
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:950)
>> at
>> org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent.init(HazelcastClusteringAgent.java:214)
>> at
>> org.wso2.carbon.core.util.ClusteringUtil.enableClustering(ClusteringUtil.java:44)
>> at
>> 

Re: [Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread Sinnathamby Mahesan
Dear Ashen
 Sensitivity  - in view of reducing the false negative
Precision - in view of reducing the false positive

F1 score combines both as the harmonic mean of precision and sensitivity

That's why F1 is chosen normally and is simple  (2TP / (2TP + FN + FP))



By the way, which you consider is True positive
(a) Anomaly  - Anomaly
or
(b) Normal - Normal

I think case (a) is more suited to your with regard to your objective.

Or If you have trouble in choosing which way:

You could consider Accuracy (Acc) which is somewhat similar to F1, but
gives same weight to TP and TN
Acc= ( ( TP + TN) / (TP + TN + FN + FP))



= Good Luck




On 16 September 2015 at 15:35, Ashen Weerathunga  wrote:

> Hi all,
>
> I am currently doing the integration of anomaly detection feature for ML.
> I have a problem of choosing the best accuracy measure for the model. I can
> get the confusion matrix which consists of true positives, true negatives,
> false positives and false negatives. There are few different measures such
> as sensitivity, accuracy, F1 score, etc. So what will be the best measure
> to give as the model accuracy for anomaly detection model.
>
> [1] Some
> details about those measures.
>
> Terminology and derivations
> from a confusion matrix  true
> positive (TP)eqv. with hittrue negative (TN)eqv. with correct rejectionfalse
> positive (FP)eqv. with false alarm
> , Type I error
> false negative (FN)eqv. with
> miss, Type II error 
> --
> sensitivity  or
> true positive rate (TPR)eqv. with hit rate
> , recall
> [image:
> \mathit{TPR} = \mathit{TP} / P = \mathit{TP} / (\mathit{TP}+\mathit{FN})]
> specificity  (SPC)
> or true negative rate[image: \mathit{SPC} = \mathit{TN} / N = \mathit{TN}
> / (\mathit{TN}+\mathit{FP})]precision
>  or positive
> predictive value 
> (PPV)[image: \mathit{PPV} = \mathit{TP} / (\mathit{TP} + \mathit{FP})]negative
> predictive value 
> (NPV)[image: \mathit{NPV} = \mathit{TN} / (\mathit{TN} + \mathit{FN})]
> fall-out 
> or false positive rate 
> (FPR)[image: \mathit{FPR} = \mathit{FP} / N = \mathit{FP} / (\mathit{FP}
> + \mathit{TN}) = 1-\mathit{SPC}]false negative rate
>  (FNR)[image:
> \mathit{FNR} = \mathit{FN} / (\mathit{TP} + \mathit{FN}) = 
> 1-\mathit{TPR}]false
> discovery rate  
> (FDR)[image:
> \mathit{FDR} = \mathit{FP} / (\mathit{TP} + \mathit{FP}) = 1 - \mathit{PPV}]
> --
> accuracy  (ACC)[image:
> \mathit{ACC} = (\mathit{TP} + \mathit{TN}) / (\mathit{TP} + \mathit{FP} +
> \mathit{FN} + \mathit{TN})]F1 score
> is the harmonic mean
> 
> of precision
>  and
> sensitivity [image:
> \mathit{F1} = 2 \mathit{TP} / (2 \mathit{TP} + \mathit{FP} + 
> \mathit{FN})]Matthews
> correlation coefficient
>  (MCC)[image:
> \frac{ \mathit{TP} \times \mathit{TN} - \mathit{FP} \times \mathit{FN} }
> {\sqrt{ (\mathit{TP}+\mathit{FP}) ( \mathit{TP} + \mathit{FN} ) (
> \mathit{TN} + \mathit{FP} ) ( \mathit{TN} + \mathit{FN} ) } 
> }]Informedness[image:
> \mathit{TPR} + \mathit{SPC} - 1]Markedness
> [image: \mathit{PPV} +
> \mathit{NPV} - 1]
>
> *Sources: Fawcett (2006) and Powers (2011).*[1]
> 
> [2]
> 
>
> Thanks and Regards,
> Ashen
> --
> *Ashen Weerathunga*
> Software Engineer - Intern
> WSO2 Inc.: http://wso2.com
> lean.enterprise.middleware
>
> Email: as...@wso2.com
> Mobile: +94 716042995 <94716042995>
> LinkedIn:
> *http://lk.linkedin.com/in/ashenweerathunga
> *
>



-- 
~~
Sinnathamby Mahesan



~~
~~

Re: [Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread CD Athuraliya
Hi Ashen,

Please note the class imbalance which can typically occur in anomaly data
when selecting evaluation measures (anomalous data can be very infrequent
compared to normal data in a real-world dataset). Please check how this
imbalance affects evaluation measures. I found this paper [1] on this topic.

And since the data clusters play a vital role in this model it would be
better if we can show some measures on them as well IMO.

[1] http://marmota.dlsi.uji.es/WebBIB/papers/2007/1_GarciaTamida2007.pdf

Regards,
CD

On Thu, Sep 17, 2015 at 6:18 AM, A. R.Weerasinghe 
wrote:

> I'm sorry, that was a general answer.
>
> For anomaly detection, I'd say sensitivity or specificity (depending what
> is positive and what is negative: Mahesan's point) is more important than
> the others.
>
> For example, in a data set of 10,000 samples, where 100 of these samples
> are labeled positive (anomalous), a predictor that predicts "Negative" for
> every instance it is presented with evaluates to Precision = 100%, Accuracy
> = 99%, and Specificity = 100%. This predictor would be entirely useless,
> and yet these measures show it performs very well. The same predictor would
> evaluate to Recall (sensitivity) = 0%. In this case, Sensitivity seems to
> be most in tune with how well the classifier is actually performing.
>
> The other extreme is a data set where many of the examples are positive
> (normal). For example if 9,900 out of 10,000 instances are positive, and a
> classifier predicts positive on all instances, then Precision = 99%,
> Accuracy = 99%, Specificity = 0%, and Recall = 100%. In this case,
> Specificity shows that this classifier is problematic.
>
> Hope this helps.
>
>
>
> On Thu, Sep 17, 2015 at 6:05 AM, A. R.Weerasinghe 
> wrote:
>
>> Usually F1 measure and area under ROC curve.
>>
>> Ruvan.
>>
>>
>> On Thu, Sep 17, 2015 at 5:20 AM, Sinnathamby Mahesan <
>> sinnatha...@wso2.com> wrote:
>>
>>> Dear Ashen
>>>  Sensitivity  - in view of reducing the false negative
>>> Precision - in view of reducing the false positive
>>>
>>> F1 score combines both as the harmonic mean of precision and sensitivity
>>>
>>> That's why F1 is chosen normally and is simple  (2TP / (2TP + FN + FP))
>>>
>>>
>>>
>>> By the way, which you consider is True positive
>>> (a) Anomaly  - Anomaly
>>> or
>>> (b) Normal - Normal
>>>
>>> I think case (a) is more suited to your with regard to your objective.
>>>
>>> Or If you have trouble in choosing which way:
>>>
>>> You could consider Accuracy (Acc) which is somewhat similar to F1, but
>>> gives same weight to TP and TN
>>> Acc= ( ( TP + TN) / (TP + TN + FN + FP))
>>>
>>>
>>>
>>> = Good Luck
>>>
>>>
>>>
>>>
>>> On 16 September 2015 at 15:35, Ashen Weerathunga  wrote:
>>>
 Hi all,

 I am currently doing the integration of anomaly detection feature for
 ML. I have a problem of choosing the best accuracy measure for the model. I
 can get the confusion matrix which consists of true positives, true
 negatives, false positives and false negatives. There are few different
 measures such as sensitivity, accuracy, F1 score, etc. So what will be the
 best measure to give as the model accuracy for anomaly detection model.

 [1] Some
 details about those measures.

 Terminology and derivations
 from a confusion matrix
  true positive (TP)eqv.
 with hittrue negative (TN)eqv. with correct rejectionfalse positive
 (FP)eqv. with false alarm , Type
 I error false negative (FN)eqv.
 with miss, Type II error 
 --
 sensitivity  or
 true positive rate (TPR)eqv. with hit rate
 , recall
 [image:
 \mathit{TPR} = \mathit{TP} / P = \mathit{TP} / (\mathit{TP}+\mathit{FN})]
 specificity 
 (SPC) or true negative rate[image: \mathit{SPC} = \mathit{TN} / N =
 \mathit{TN} / (\mathit{TN}+\mathit{FP})]precision
  or positive
 predictive value
  (PPV)[image:
 \mathit{PPV} = \mathit{TP} / (\mathit{TP} + \mathit{FP})]negative
 predictive value
  (NPV)[image:
 \mathit{NPV} = \mathit{TN} / (\mathit{TN} + \mathit{FN})]fall-out
  or false
 positive rate  
 (FPR)[image:

Re: [Dev] ES : Unable to retrieve resource from registry

2015-09-16 Thread Chanaka Jayasena
You can access the content with userReg.content(path);

Refer to [1] for a sample where we read and write resources from registry
with product ES.

[1] -
https://github.com/wso2/carbon-store/blob/master/apps/publisher/modules/registry/registry.operator.js

thanks,
Chanaka

On Wed, Sep 16, 2015 at 5:06 PM, Himasha Guruge  wrote:

>
> Hi,
>
> In an ES asset extension, I'm saving a resource (text with some html tags)
> to the registry, and later on with ajax GET i'm trying to retrieve that
> content. ( var result = userReg.get(path))
>
>  A result object is given but when trying to access result.content it
> gives null. Any idea how to overcome this? I was creating the resource
> before with mediaType:text/plain. Could changing the mediaType solve this?
>
>
> Thanks,
>
> Himasha Guruge
> *Software Engineer*
> WS*O2* *Inc.*
> Mobile: +94 777459299
> himas...@wso2.com
>



-- 
Chanaka Jayasena
Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
email: chan...@wso2.com; cell: +94 77 785 5565
blog: http://chanaka3d.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record

2015-09-16 Thread Madusanka Premaratne
Hi Bimali,
H2 databases corrupt sometimes since it stores as a file. Please refer to
the mail thread[1] for more details.

[1] - [Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading
record excception is throwing APIM GIT build while adding a new API.

Thanks,
Madusanka

On Thu, Sep 17, 2015 at 10:38 AM, Bimali Dayananda  wrote:

> Hi,
>
> I get the following error message when I run a setup locally. It says a
> file is corrupted but couldn't find the corrupted file.
>
> org.h2.jdbc.JdbcSQLException: File corrupted while reading record: "234 of
> 233". Possible solution: use the recovery tool [90030-140]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
> at org.h2.message.DbException.get(DbException.java:167)
> at org.h2.message.DbException.get(DbException.java:144)
> at org.h2.store.PageStore.readPage(PageStore.java:1094)
> at org.h2.store.PageStore.getPage(PageStore.java:561)
> at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:218)
> at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:221)
> at org.h2.index.PageDataIndex.(PageDataIndex.java:74)
> at org.h2.table.RegularTable.(RegularTable.java:75)
> at org.h2.store.PageStore.addMeta(PageStore.java:1443)
> at org.h2.store.PageStore.readMetaData(PageStore.java:1380)
> at org.h2.store.PageStore.recover(PageStore.java:1178)
> at org.h2.store.PageStore.openExisting(PageStore.java:317)
> at org.h2.store.PageStore.open(PageStore.java:271)
> at org.h2.engine.Database.getPageStore(Database.java:2059)
> at org.h2.engine.Database.open(Database.java:534)
> at org.h2.engine.Database.openDatabase(Database.java:207)
> at org.h2.engine.Database.(Database.java:202)
> at org.h2.engine.Engine.openSession(Engine.java:56)
> at org.h2.engine.Engine.openSession(Engine.java:146)
> at org.h2.engine.Engine.getSession(Engine.java:125)
> at org.h2.engine.Session.createSession(Session.java:122)
> at
> org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
> at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
> at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
> at org.h2.Driver.connect(Driver.java:73)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
> at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
> at
> org.wso2.carbon.registry.core.config.RegistryConfigurationProcessor.populateRegistryConfig(RegistryConfigurationProcessor.java:149)
> at
> org.wso2.carbon.registry.core.config.RegistryContext.(RegistryContext.java:461)
> at
> org.wso2.carbon.registry.core.config.RegistryContext.(RegistryContext.java:442)
> at
> org.wso2.carbon.registry.core.config.RegistryContext.getBaseInstance(RegistryContext.java:321)
> at
> org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.getEmbeddedRegistryService(RegistryCoreServiceComponent.java:627)
> at
> org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:563)
> at
> org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:117)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
> at
> 

Re: [Dev] [ESB] Escape double quotation marks in property values?

2015-09-16 Thread Rajith Vitharana
Try XML encoding and put it there, example "abc"
Online XML encoder -
http://coderstoolbox.net/string/#!encoding=xml=encode=us_ascii
Thanks,

On Thu, Sep 17, 2015 at 10:52 AM, Bhathiya Jayasekara 
wrote:

> Hi all,
>
> Is there a way to do $subject?
>
> Basically what I'm looking for is something like this. (below one is not
> working though)
>
>  type="STRING">
>
> Thanks,
>
> --
> *Bhathiya Jayasekara*
> *Senior Software Engineer,*
> *WSO2 inc., http://wso2.com *
>
> *Phone: +94715478185 <%2B94715478185>*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> *
> *Twitter: https://twitter.com/bhathiyax *
> *Blog: http://movingaheadblog.blogspot.com
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rajith Vitharana

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94715883223
Blog : http://lankavitharana.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [CEP 3.1.0] Syncing failed when becoming a Passive Node for tenant

2015-09-16 Thread Sriskandarajah Suhothayan
have you properly migrated SecondDerivativeFinderWindowProcessor to new
siddhi version. the bug is there.

Suho

On Thu, Sep 17, 2015 at 9:32 AM, Anuruddha Liyanarachchi <
anurudd...@wso2.com> wrote:

> Hi Ramindu,
>
> Please find the CEP artefacts that is being used [1].
> Please note that the node starts first is not throwing any error.
>
> [1]
> https://drive.google.com/a/wso2.com/file/d/0Bw0NgSFZG5YkWUZybUoxbzM0TTg/view?usp=sharing
> 
>
> On Wed, Sep 16, 2015 at 10:34 PM, Sriskandarajah Suhothayan  > wrote:
>
>> From the logs it looks like its an issue in
>> SecondDerivativeFinderWindowProcessor check the getting and restoring the
>> state part.
>>
>> Suho
>>
>> On Wed, Sep 16, 2015 at 10:16 PM, Ramindu De Silva 
>> wrote:
>>
>>> Hi Anuruddha,
>>>
>>> Is it possible to send me the artefacts you used for this scenario, so
>>> that i can reproduce and debug and see whats causing this issue.
>>>
>>> Best Regards,
>>>
>>> On Wed, Sep 16, 2015 at 7:30 PM, Anuruddha Liyanarachchi <
>>> anurudd...@wso2.com> wrote:
>>>
 Hi,

 I created CEP HA cluster with Deployment for full-active-active mode
 as per [1].
 I am seeing following error when starting the 2nd member.
 I have also attached execution plan [2].

 What is causing this issue ?

 [2015-09-16 13:22:38,191] ERROR - {HAManager}  Syncing failed when
 becoming a Passive Node for tenant:-1234
 on:SecondDerivativeOfRequestsInFlightFinder execution plan
 java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
 java.util.concurrent.LinkedBlockingQueue
 at
 org.wso2.siddhi.core.util.collection.queue.SiddhiQueue.restoreState(SiddhiQueue.java:48)
 at
 org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor.restoreState(SecondDerivativeFinderWindowProcessor.java:229)
 at
 org.wso2.siddhi.core.query.processor.window.WindowProcessor.restore(WindowProcessor.java:113)
 at
 org.wso2.siddhi.core.snapshot.SnapshotService.restore(SnapshotService.java:70)
 at org.wso2.siddhi.core.SiddhiManager.restore(SiddhiManager.java:443)
 at
 org.wso2.carbon.event.processor.core.internal.ha.HAManager.becomePassive(HAManager.java:161)
 at
 org.wso2.carbon.event.processor.core.internal.ha.HAManager.tryChangeState(HAManager.java:111)
 at
 org.wso2.carbon.event.processor.core.internal.ha.HAManager.init(HAManager.java:97)
 at
 org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.addExecutionPlanConfiguration(CarbonEventProcessorService.java:358)
 at
 org.wso2.carbon.event.processor.core.EventProcessorDeployer.processDeploy(EventProcessorDeployer.java:138)
 at
 org.wso2.carbon.event.processor.core.internal.util.EventProcessorConfigurationFilesystemInvoker.reload(EventProcessorConfigurationFilesystemInvoker.java:86)
 at
 org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.activateInactiveExecutionPlanConfigurations(CarbonEventProcessorService.java:749)
 at
 org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.notifyServiceAvailability(CarbonEventProcessorService.java:530)
 at
 org.wso2.carbon.event.processor.core.internal.ds.EventProcessorServiceDS.setHazelcastInstance(EventProcessorServiceDS.java:102)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at
 org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
 at
 org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:432)
 at
 org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
 at
 org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
 at
 org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
 at
 org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
 at
 org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
 at
 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
 at
 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
 at
 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
 at
 org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
 at
 

[Dev] "Method threw 'java.lang.LinkageError' exception" while calling a stub method

2015-09-16 Thread Chamila Wijayarathna
Hi all,

Currently I am trying to call some methods of BPS-HumanTaskClientAPIAdmin
from an IS back end component. To do this I have added
"HumanTaskClientAPIAdmin.wsdl", "ws-humanyask-types.xsd" and "xml.xsd"
files to currently existing service stub at IS, which is
org.wso2.carbon.identity.workflow.mgt.bps.stub
[1]. I took the HumanTaskClientAPIAdmin.wsdl from a latest BPS pack and
other 2 files from [2].
I newly added following task to the pom.xml of the service stub.







*
http://services.deployer.humantask.carbon.wso2.org
=org.wso2.carbon.humantask.stub.upload,http://services.deployer.humantask.carbon.wso2.org/xsd=org.wso2.carbon.humantask.stub.upload.types
"/>
   *

In my backend component where I need to call the methods of this stub, we
already had a dependency to the stub.


**



*org.wso2.carbon.identity
org.wso2.carbon.identity.workflow.mgt.bps.stub*

Then I added following code to call the service through the stub.




















*int tenantId =
CarbonContext.getThreadLocalCarbonContext().getTenantId();List
bpsProfiles = 
bpsProfileDAO.listBPSProfiles(tenantId);HumanTaskClientAPIAdminStub
stub = null;TSimpleQueryInput input = new TSimpleQueryInput();TStatus
readyState = new TStatus();//TSimpleQueryCategory queryCategory = new
TSimpleQueryCategory("ALL_TASKS",
true);readyState.setTStatus("READY");input.addStatus(readyState);input.setPageSize(10);input.setPageNumber(0);input.setSimpleQueryCategory(TSimpleQueryCategory.ALL_TASKS);for
(int i = 0; i < bpsProfiles.size(); i++) {String host =
bpsProfiles.get(i).getHost();URL servicesUrl = new URL(new
URL(host), "services/HumanTaskClientAPIAdmin");stub = new
HumanTaskClientAPIAdminStub(servicesUrl.toString());ServiceClient
client = stub._getServiceClient();authenticate(client,
bpsProfiles.get(i).getUsername(), bpsProfiles.get(i).getUsername());
 TTaskSimpleQueryResultSet results = stub.simpleQuery(input);}*

But when I call the stub.simpleQuery() method I am getting an error
without any details and when I debugged the code, I found out that it
gives a *Method threw 'java.lang.LinkageError' exception. Cannot
evaluate org.apache.axiom.soap.impl.llom.soap11.SOAP11BodyImpl.toString()*
error at auto generated stub method while creating the SOAP envelope.
Following is the auto generated code for above method.























































































































*public  
org.wso2.carbon.identity.workflow.mgt.bps.stub.types.TTaskSimpleQueryResultSet
simpleQuery(
org.wso2.carbon.identity.workflow.mgt.bps.stub.types.TSimpleQueryInput
simpleQueryInput587)throws
java.rmi.RemoteException
,org.wso2.carbon.humantask.stub.upload.IllegalStateFault
 ,org.wso2.carbon.humantask.stub.upload.IllegalArgumentFault{
org.apache.axis2.context.MessageContext _messageContext = null;
try{   org.apache.axis2.client.OperationClient _operationClient =
_serviceClient.createClient(_operations[22].getName());
_operationClient.getOptions().setAction("http://docs.oasis-open.org/ns/bpel4people/ws-humantask/api/200803/simpleQuery
");
 _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);

addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,"&");
   // create a message context  _messageContext = new
org.apache.axis2.context.MessageContext();// create SOAP
envelope with that payload  org.apache.axiom.soap.SOAPEnvelope env
= null;
org.oasis_open.docs.ns.bpel4people.ws_humantask.api._200803.SimpleQuery
dummyWrappedType = null;
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
   simpleQueryInput587,
dummyWrappedType,
  optimizeContent(new
javax.xml.namespace.QName("http://docs.oasis-open.org/ns/bpel4people/ws-humantask/api/200803
",
  "simpleQuery")));
//adding SOAP soap_headers
_serviceClient.addHeadersToEnvelope(env);// set the message context
with that soap envelope_messageContext.setEnvelope(env);// add the
message contxt to the operation
client_operationClient.addMessageContext(_messageContext);//execute
the operation client_operationClient.execute(true);
org.apache.axis2.context.MessageContext _returnMessageContext =
_operationClient.getMessageContext(
org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
org.apache.axiom.soap.SOAPEnvelope _returnEnv =
_returnMessageContext.getEnvelope();
 java.lang.Object object = fromOM(

[Dev] [ESB] Escape double quotation marks in property values?

2015-09-16 Thread Bhathiya Jayasekara
Hi all,

Is there a way to do $subject?

Basically what I'm looking for is something like this. (below one is not
working though)



Thanks,

-- 
*Bhathiya Jayasekara*
*Senior Software Engineer,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [CEP 3.1.0] Syncing failed when becoming a Passive Node for tenant

2015-09-16 Thread Anuruddha Liyanarachchi
Hi Ramindu,

Please find the CEP artefacts that is being used [1].
Please note that the node starts first is not throwing any error.

[1]
https://drive.google.com/a/wso2.com/file/d/0Bw0NgSFZG5YkWUZybUoxbzM0TTg/view?usp=sharing


On Wed, Sep 16, 2015 at 10:34 PM, Sriskandarajah Suhothayan 
wrote:

> From the logs it looks like its an issue in
> SecondDerivativeFinderWindowProcessor check the getting and restoring the
> state part.
>
> Suho
>
> On Wed, Sep 16, 2015 at 10:16 PM, Ramindu De Silva 
> wrote:
>
>> Hi Anuruddha,
>>
>> Is it possible to send me the artefacts you used for this scenario, so
>> that i can reproduce and debug and see whats causing this issue.
>>
>> Best Regards,
>>
>> On Wed, Sep 16, 2015 at 7:30 PM, Anuruddha Liyanarachchi <
>> anurudd...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I created CEP HA cluster with Deployment for full-active-active mode as
>>> per [1].
>>> I am seeing following error when starting the 2nd member.
>>> I have also attached execution plan [2].
>>>
>>> What is causing this issue ?
>>>
>>> [2015-09-16 13:22:38,191] ERROR - {HAManager}  Syncing failed when
>>> becoming a Passive Node for tenant:-1234
>>> on:SecondDerivativeOfRequestsInFlightFinder execution plan
>>> java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
>>> java.util.concurrent.LinkedBlockingQueue
>>> at
>>> org.wso2.siddhi.core.util.collection.queue.SiddhiQueue.restoreState(SiddhiQueue.java:48)
>>> at
>>> org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor.restoreState(SecondDerivativeFinderWindowProcessor.java:229)
>>> at
>>> org.wso2.siddhi.core.query.processor.window.WindowProcessor.restore(WindowProcessor.java:113)
>>> at
>>> org.wso2.siddhi.core.snapshot.SnapshotService.restore(SnapshotService.java:70)
>>> at org.wso2.siddhi.core.SiddhiManager.restore(SiddhiManager.java:443)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.becomePassive(HAManager.java:161)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.tryChangeState(HAManager.java:111)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.ha.HAManager.init(HAManager.java:97)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.addExecutionPlanConfiguration(CarbonEventProcessorService.java:358)
>>> at
>>> org.wso2.carbon.event.processor.core.EventProcessorDeployer.processDeploy(EventProcessorDeployer.java:138)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.util.EventProcessorConfigurationFilesystemInvoker.reload(EventProcessorConfigurationFilesystemInvoker.java:86)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.activateInactiveExecutionPlanConfigurations(CarbonEventProcessorService.java:749)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.CarbonEventProcessorService.notifyServiceAvailability(CarbonEventProcessorService.java:530)
>>> at
>>> org.wso2.carbon.event.processor.core.internal.ds.EventProcessorServiceDS.setHazelcastInstance(EventProcessorServiceDS.java:102)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:606)
>>> at
>>> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:376)
>>> at
>>> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:432)
>>> at
>>> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:416)
>>> at
>>> org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:334)
>>> at
>>> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
>>> at
>>> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>>> at
>>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>>> at
>>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>>> at
>>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>>> at
>>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>>> at
>>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>>> at
>>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>>> at
>>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>>> 

Re: [Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread Srinath Perera
Ashen, when you conclude this, can you write a blog/ article on comparing
different methods and why given thing is better.

--Srinath

On Thu, Sep 17, 2015 at 9:59 AM, Srinath Perera  wrote:

> Seshika and myself were talking to forester analyst and he mentioned "Lorenz
> curve" is used in fraud cases.
>
> Please read and find out what it is and how it compare to RoC etc.
>  see
> https://www.quora.com/What-is-the-difference-between-a-ROC-curve-and-a-precision-recall-curve-When-should-I-use-each
>
> On Thu, Sep 17, 2015 at 9:07 AM, CD Athuraliya 
> wrote:
>
>> Hi Ashen,
>>
>> Please note the class imbalance which can typically occur in anomaly data
>> when selecting evaluation measures (anomalous data can be very infrequent
>> compared to normal data in a real-world dataset). Please check how this
>> imbalance affects evaluation measures. I found this paper [1] on this topic.
>>
>> And since the data clusters play a vital role in this model it would be
>> better if we can show some measures on them as well IMO.
>>
>> [1] http://marmota.dlsi.uji.es/WebBIB/papers/2007/1_GarciaTamida2007.pdf
>>
>> Regards,
>> CD
>>
>> On Thu, Sep 17, 2015 at 6:18 AM, A. R.Weerasinghe 
>> wrote:
>>
>>> I'm sorry, that was a general answer.
>>>
>>> For anomaly detection, I'd say sensitivity or specificity (depending
>>> what is positive and what is negative: Mahesan's point) is more important
>>> than the others.
>>>
>>> For example, in a data set of 10,000 samples, where 100 of these samples
>>> are labeled positive (anomalous), a predictor that predicts "Negative" for
>>> every instance it is presented with evaluates to Precision = 100%, Accuracy
>>> = 99%, and Specificity = 100%. This predictor would be entirely useless,
>>> and yet these measures show it performs very well. The same predictor would
>>> evaluate to Recall (sensitivity) = 0%. In this case, Sensitivity seems to
>>> be most in tune with how well the classifier is actually performing.
>>>
>>> The other extreme is a data set where many of the examples are positive
>>> (normal). For example if 9,900 out of 10,000 instances are positive, and a
>>> classifier predicts positive on all instances, then Precision = 99%,
>>> Accuracy = 99%, Specificity = 0%, and Recall = 100%. In this case,
>>> Specificity shows that this classifier is problematic.
>>>
>>> Hope this helps.
>>>
>>>
>>>
>>> On Thu, Sep 17, 2015 at 6:05 AM, A. R.Weerasinghe 
>>> wrote:
>>>
 Usually F1 measure and area under ROC curve.

 Ruvan.


 On Thu, Sep 17, 2015 at 5:20 AM, Sinnathamby Mahesan <
 sinnatha...@wso2.com> wrote:

> Dear Ashen
>  Sensitivity  - in view of reducing the false negative
> Precision - in view of reducing the false positive
>
> F1 score combines both as the harmonic mean of precision and
> sensitivity
>
> That's why F1 is chosen normally and is simple  (2TP / (2TP + FN + FP))
>
>
>
> By the way, which you consider is True positive
> (a) Anomaly  - Anomaly
> or
> (b) Normal - Normal
>
> I think case (a) is more suited to your with regard to your objective.
>
> Or If you have trouble in choosing which way:
>
> You could consider Accuracy (Acc) which is somewhat similar to F1, but
> gives same weight to TP and TN
> Acc= ( ( TP + TN) / (TP + TN + FN + FP))
>
>
>
> = Good Luck
>
>
>
>
> On 16 September 2015 at 15:35, Ashen Weerathunga 
> wrote:
>
>> Hi all,
>>
>> I am currently doing the integration of anomaly detection feature for
>> ML. I have a problem of choosing the best accuracy measure for the 
>> model. I
>> can get the confusion matrix which consists of true positives, true
>> negatives, false positives and false negatives. There are few different
>> measures such as sensitivity, accuracy, F1 score, etc. So what will be 
>> the
>> best measure to give as the model accuracy for anomaly detection model.
>>
>> [1] Some
>> details about those measures.
>>
>> Terminology and derivations
>> from a confusion matrix
>>  true positive (TP)eqv.
>> with hittrue negative (TN)eqv. with correct rejectionfalse positive
>> (FP)eqv. with false alarm ,
>> Type I error false
>> negative (FN)eqv. with miss, Type II error
>> 
>> --
>> sensitivity 
>> or true positive rate (TPR)eqv. with hit rate
>> , recall
>> 

Re: [Dev] ES : Unable to retrieve resource from registry

2015-09-16 Thread Himasha Guruge
Thanks Chanaka, will try it out.


Regards,
Himasha

On Thu, Sep 17, 2015 at 10:15 AM, Chanaka Jayasena  wrote:

> You can access the content with userReg.content(path);
>
> Refer to [1] for a sample where we read and write resources from registry
> with product ES.
>
> [1] -
> https://github.com/wso2/carbon-store/blob/master/apps/publisher/modules/registry/registry.operator.js
>
> thanks,
> Chanaka
>
> On Wed, Sep 16, 2015 at 5:06 PM, Himasha Guruge  wrote:
>
>>
>> Hi,
>>
>> In an ES asset extension, I'm saving a resource (text with some html
>> tags) to the registry, and later on with ajax GET i'm trying to retrieve
>> that content. ( var result = userReg.get(path))
>>
>>  A result object is given but when trying to access result.content it
>> gives null. Any idea how to overcome this? I was creating the resource
>> before with mediaType:text/plain. Could changing the mediaType solve this?
>>
>>
>> Thanks,
>>
>> Himasha Guruge
>> *Software Engineer*
>> WS*O2* *Inc.*
>> Mobile: +94 777459299
>> himas...@wso2.com
>>
>
>
>
> --
> Chanaka Jayasena
> Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
> email: chan...@wso2.com; cell: +94 77 785 5565
> blog: http://chanaka3d.blogspot.com
>



-- 
Himasha Guruge
*Software Engineer*
WS*O2* *Inc.*
Mobile: +94 777459299
himas...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] org.h2.jdbc.JdbcSQLException: File corrupted while reading record

2015-09-16 Thread Bimali Dayananda
Hi,

I get the following error message when I run a setup locally. It says a
file is corrupted but couldn't find the corrupted file.

org.h2.jdbc.JdbcSQLException: File corrupted while reading record: "234 of
233". Possible solution: use the recovery tool [90030-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.store.PageStore.readPage(PageStore.java:1094)
at org.h2.store.PageStore.getPage(PageStore.java:561)
at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:218)
at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:221)
at org.h2.index.PageDataIndex.(PageDataIndex.java:74)
at org.h2.table.RegularTable.(RegularTable.java:75)
at org.h2.store.PageStore.addMeta(PageStore.java:1443)
at org.h2.store.PageStore.readMetaData(PageStore.java:1380)
at org.h2.store.PageStore.recover(PageStore.java:1178)
at org.h2.store.PageStore.openExisting(PageStore.java:317)
at org.h2.store.PageStore.open(PageStore.java:271)
at org.h2.engine.Database.getPageStore(Database.java:2059)
at org.h2.engine.Database.open(Database.java:534)
at org.h2.engine.Database.openDatabase(Database.java:207)
at org.h2.engine.Database.(Database.java:202)
at org.h2.engine.Engine.openSession(Engine.java:56)
at org.h2.engine.Engine.openSession(Engine.java:146)
at org.h2.engine.Engine.getSession(Engine.java:125)
at org.h2.engine.Session.createSession(Session.java:122)
at
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:241)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:219)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:111)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:95)
at org.h2.Driver.connect(Driver.java:73)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188)
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at
org.wso2.carbon.registry.core.config.RegistryConfigurationProcessor.populateRegistryConfig(RegistryConfigurationProcessor.java:149)
at
org.wso2.carbon.registry.core.config.RegistryContext.(RegistryContext.java:461)
at
org.wso2.carbon.registry.core.config.RegistryContext.(RegistryContext.java:442)
at
org.wso2.carbon.registry.core.config.RegistryContext.getBaseInstance(RegistryContext.java:321)
at
org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.getEmbeddedRegistryService(RegistryCoreServiceComponent.java:627)
at
org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.buildRegistryService(RegistryCoreServiceComponent.java:563)
at
org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent.activate(RegistryCoreServiceComponent.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:347)
at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at
org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at

Re: [Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread Srinath Perera
Seshika and myself were talking to forester analyst and he mentioned "Lorenz
curve" is used in fraud cases.

Please read and find out what it is and how it compare to RoC etc.
 see
https://www.quora.com/What-is-the-difference-between-a-ROC-curve-and-a-precision-recall-curve-When-should-I-use-each

On Thu, Sep 17, 2015 at 9:07 AM, CD Athuraliya  wrote:

> Hi Ashen,
>
> Please note the class imbalance which can typically occur in anomaly data
> when selecting evaluation measures (anomalous data can be very infrequent
> compared to normal data in a real-world dataset). Please check how this
> imbalance affects evaluation measures. I found this paper [1] on this topic.
>
> And since the data clusters play a vital role in this model it would be
> better if we can show some measures on them as well IMO.
>
> [1] http://marmota.dlsi.uji.es/WebBIB/papers/2007/1_GarciaTamida2007.pdf
>
> Regards,
> CD
>
> On Thu, Sep 17, 2015 at 6:18 AM, A. R.Weerasinghe 
> wrote:
>
>> I'm sorry, that was a general answer.
>>
>> For anomaly detection, I'd say sensitivity or specificity (depending what
>> is positive and what is negative: Mahesan's point) is more important than
>> the others.
>>
>> For example, in a data set of 10,000 samples, where 100 of these samples
>> are labeled positive (anomalous), a predictor that predicts "Negative" for
>> every instance it is presented with evaluates to Precision = 100%, Accuracy
>> = 99%, and Specificity = 100%. This predictor would be entirely useless,
>> and yet these measures show it performs very well. The same predictor would
>> evaluate to Recall (sensitivity) = 0%. In this case, Sensitivity seems to
>> be most in tune with how well the classifier is actually performing.
>>
>> The other extreme is a data set where many of the examples are positive
>> (normal). For example if 9,900 out of 10,000 instances are positive, and a
>> classifier predicts positive on all instances, then Precision = 99%,
>> Accuracy = 99%, Specificity = 0%, and Recall = 100%. In this case,
>> Specificity shows that this classifier is problematic.
>>
>> Hope this helps.
>>
>>
>>
>> On Thu, Sep 17, 2015 at 6:05 AM, A. R.Weerasinghe 
>> wrote:
>>
>>> Usually F1 measure and area under ROC curve.
>>>
>>> Ruvan.
>>>
>>>
>>> On Thu, Sep 17, 2015 at 5:20 AM, Sinnathamby Mahesan <
>>> sinnatha...@wso2.com> wrote:
>>>
 Dear Ashen
  Sensitivity  - in view of reducing the false negative
 Precision - in view of reducing the false positive

 F1 score combines both as the harmonic mean of precision and sensitivity

 That's why F1 is chosen normally and is simple  (2TP / (2TP + FN + FP))



 By the way, which you consider is True positive
 (a) Anomaly  - Anomaly
 or
 (b) Normal - Normal

 I think case (a) is more suited to your with regard to your objective.

 Or If you have trouble in choosing which way:

 You could consider Accuracy (Acc) which is somewhat similar to F1, but
 gives same weight to TP and TN
 Acc= ( ( TP + TN) / (TP + TN + FN + FP))



 = Good Luck




 On 16 September 2015 at 15:35, Ashen Weerathunga 
 wrote:

> Hi all,
>
> I am currently doing the integration of anomaly detection feature for
> ML. I have a problem of choosing the best accuracy measure for the model. 
> I
> can get the confusion matrix which consists of true positives, true
> negatives, false positives and false negatives. There are few different
> measures such as sensitivity, accuracy, F1 score, etc. So what will be the
> best measure to give as the model accuracy for anomaly detection model.
>
> [1] Some
> details about those measures.
>
> Terminology and derivations
> from a confusion matrix
>  true positive (TP)eqv.
> with hittrue negative (TN)eqv. with correct rejectionfalse positive
> (FP)eqv. with false alarm ,
> Type I error false
> negative (FN)eqv. with miss, Type II error
> 
> --
> sensitivity  or
> true positive rate (TPR)eqv. with hit rate
> , recall
> [image:
> \mathit{TPR} = \mathit{TP} / P = \mathit{TP} / (\mathit{TP}+\mathit{FN})]
> specificity 
> (SPC) or true negative rate[image: \mathit{SPC} = \mathit{TN} / N =
> \mathit{TN} / (\mathit{TN}+\mathit{FP})]precision
> 

Re: [Dev] [ML] Accuracy Measure for Anomaly Detection?

2015-09-16 Thread madhuka udantha
Hi,

This is good survey paper that can be found regard to Anomaly detection
[1], According to your need; it seems you will no need to go through whole
the survey papers. But few sub topics will be very useful for you. This
paper will be useful for your work.

[1] Varun Chandola, Arindam Banerjee, and Vipin Kumar. 2009. Anomaly
detection: A survey. ACM Comput. Surv. 41, 3, Article 15 (July 2009), 58
pages. DOI=10.1145/1541880.1541882

[Cited by 2458]

On Wed, Sep 16, 2015 at 3:35 PM, Ashen Weerathunga  wrote:

> Hi all,
>
> I am currently doing the integration of anomaly detection feature for ML.
> I have a problem of choosing the best accuracy measure for the model. I can
> get the confusion matrix which consists of true positives, true negatives,
> false positives and false negatives. There are few different measures such
> as sensitivity, accuracy, F1 score, etc. So what will be the best measure
> to give as the model accuracy for anomaly detection model.
>
> [1] Some
> details about those measures.
>
> Terminology and derivations
> from a confusion matrix  true
> positive (TP)eqv. with hittrue negative (TN)eqv. with correct rejectionfalse
> positive (FP)eqv. with false alarm
> , Type I error
> false negative (FN)eqv. with
> miss, Type II error 
> --
> sensitivity  or
> true positive rate (TPR)eqv. with hit rate
> , recall
> [image:
> \mathit{TPR} = \mathit{TP} / P = \mathit{TP} / (\mathit{TP}+\mathit{FN})]
> specificity  (SPC)
> or true negative rate[image: \mathit{SPC} = \mathit{TN} / N = \mathit{TN}
> / (\mathit{TN}+\mathit{FP})]precision
>  or positive
> predictive value 
> (PPV)[image: \mathit{PPV} = \mathit{TP} / (\mathit{TP} + \mathit{FP})]negative
> predictive value 
> (NPV)[image: \mathit{NPV} = \mathit{TN} / (\mathit{TN} + \mathit{FN})]
> fall-out 
> or false positive rate 
> (FPR)[image: \mathit{FPR} = \mathit{FP} / N = \mathit{FP} / (\mathit{FP}
> + \mathit{TN}) = 1-\mathit{SPC}]false negative rate
>  (FNR)[image:
> \mathit{FNR} = \mathit{FN} / (\mathit{TP} + \mathit{FN}) = 
> 1-\mathit{TPR}]false
> discovery rate  
> (FDR)[image:
> \mathit{FDR} = \mathit{FP} / (\mathit{TP} + \mathit{FP}) = 1 - \mathit{PPV}]
> --
> accuracy  (ACC)[image:
> \mathit{ACC} = (\mathit{TP} + \mathit{TN}) / (\mathit{TP} + \mathit{FP} +
> \mathit{FN} + \mathit{TN})]F1 score
> is the harmonic mean
> 
> of precision
>  and
> sensitivity [image:
> \mathit{F1} = 2 \mathit{TP} / (2 \mathit{TP} + \mathit{FP} + 
> \mathit{FN})]Matthews
> correlation coefficient
>  (MCC)[image:
> \frac{ \mathit{TP} \times \mathit{TN} - \mathit{FP} \times \mathit{FN} }
> {\sqrt{ (\mathit{TP}+\mathit{FP}) ( \mathit{TP} + \mathit{FN} ) (
> \mathit{TN} + \mathit{FP} ) ( \mathit{TN} + \mathit{FN} ) } 
> }]Informedness[image:
> \mathit{TPR} + \mathit{SPC} - 1]Markedness
> [image: \mathit{PPV} +
> \mathit{NPV} - 1]
>
> *Sources: Fawcett (2006) and Powers (2011).*[1]
> 
> [2]
> 
>
> Thanks and Regards,
> Ashen
> --
> *Ashen Weerathunga*
> Software Engineer - Intern
> WSO2 Inc.: http://wso2.com
> lean.enterprise.middleware
>
> Email: as...@wso2.com
> Mobile: +94 716042995 <94716042995>
> LinkedIn:
> *http://lk.linkedin.com/in/ashenweerathunga
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Cheers,
Madhuka Udantha
http://madhukaudantha.blogspot.com

Re: [Dev] [ES] Unbounded Data Field Tables Not Working As Expected

2015-09-16 Thread Chanaka Jayasena
Hi Rasika,

It seems like the issue is with the "getAllParameters" method where it
swallow the params with same name as you pointed out. But the issue is
specific to requests with multipart/form-data forms. i will try to debug
the code and provide a solution.

thanks,
Chanaka

On Fri, Sep 11, 2015 at 9:33 PM, Rasika Perera  wrote:

> Hi ES Team,
>
> I tried to create an Asset Type with following model elements in RXT using
> ES v2.3.6;
>
> 
>> 
>> Step Description
>> 
>> 
>> Step Description
>> 
>> 
>
>
> When creating an asset using "ES Publisher"; All model elements are
> rendered correctly as per the image.
>
> [image: Inline image 1]
>
> But after submitting the form; when viewing the created artifact it has
> only "step 2" value. This is also confirmed when viewing the artifact from
> the "carbon console". And also, when adding an artifact using "carbon
> console"; artifact is created correctly.
>
> How can I get all values(e.g. step1, step2) into the unbounded artifact
> field?
>
> Note: I observed that; the form input elements for "step 1" and "step 2"
> has the same "name" attribute."asset-api.js"[1] uses jaggery API
>  `request.getAllParameters()` to read all submitted parameters where they
> are stored on a map structure[2]. Hence, Parameters with the same key will
> be overridden.
>
> [1]
> https://github.com/wso2/carbon-store/blob/9d79318fd657e278b1e7c7450681c0845c2964a6/apps/store/modules/asset-api.js#L127
>
> [2]
> https://github.com/wso2/jaggery/blob/542105b0bc01ec229773f905fc8a7e87a4bb167e/components/hostobjects/org.jaggeryjs.hostobjects.web/src/main/java/org/jaggeryjs/hostobjects/web/RequestHostObject.java#L254
>
> --
> With Regards,
>
> *Rasika Perera*
> Software Engineer
> M: +94 71 680 9060 E: rasi...@wso2.com
> LinkedIn: http://lk.linkedin.com/in/rasika90
>
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Chanaka Jayasena
Senior Software Engineer; WSO2, Inc.;  http://wso2.com/
email: chan...@wso2.com; cell: +94 77 785 5565
blog: http://chanaka3d.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] CEP over Out-of-Order Data Streams

2015-09-16 Thread Sriskandarajah Suhothayan
Hi Miyuru

Any update on this ?

Suho

On Tue, Sep 8, 2015 at 7:58 PM, Miyuru Dayarathna  wrote:

> Hi Suho,
>
> Ok, I will work on that.
>
> --
> Thanks,
> Miyuru Dayarathna
> Senior Technical Lead
> Mobile: +94713527783
> Blog: http://miyurublog.blogspot.com
>
> On Tue, Sep 8, 2015 at 5:38 PM, Sriskandarajah Suhothayan 
> wrote:
>
>> Can you merge this code to siddhi and send a pull we will be able to add
>> this to the release
>>
>> Suho
>>
>> On Tue, Sep 8, 2015 at 5:17 PM, Miyuru Dayarathna 
>> wrote:
>>
>>> Hi Suho,
>>>
>>> I have completed developing the K-Slack extension for Siddhi and I have
>>> hosted the code in [1 ]. I have
>>> tested the KSlackExtension class [2
>>> ]
>>> using a test scenario described in [3
>>> ]
>>> and I have verified the correctness of the implementation. The test case is
>>> accessible from [4
>>> ].
>>> We need to discuss whether we should keep the following Siddhi syntax or
>>> change it to some different version by removing the use of "window."
>>> construct. This code assumes that the very first field present in the input
>>> event as the timestamp used for reordering the events.
>>>
>>> @info(name = 'query1') from inputStream#window.ooh:kslack() select
>>> eventtt , price, volume insert into outputStream;
>>>
>>> I have assigned myself the Redmine issue [5
>>> ]. Next, I will move onto testing
>>> the performance of K-slack approach using the DEBS 2013 Grand Challenge
>>> data set. Also I will try out other approaches for Out-of-Order event
>>> processing which I have mentioned in the slides.
>>>
>>> [1] https://github.com/miyurud/Siddhi_Dev
>>>
>>> [2]
>>> https://github.com/miyurud/Siddhi_Dev/blob/master/modules/siddhi-extensions/ooh/src/main/java/org/wso2/siddhi/extension/ooh/KSlackExtension.java
>>>
>>> [3]
>>> https://drive.google.com/a/wso2.com/file/d/0B8UIlB9H3rv_THpoRi0xTFFERVE/view?usp=sharing
>>>
>>> [4]
>>> https://github.com/miyurud/Siddhi_Dev/blob/master/modules/siddhi-extensions/ooh/src/test/java/org/wso2/siddhi/extension/ooh/KSlackExtensionTestCase.java
>>>
>>> [5] https://redmine.wso2.com/issues/4032
>>>
>>> 
>>> --
>>> Thanks,
>>> Miyuru Dayarathna
>>> Senior Technical Lead
>>> Mobile: +94713527783
>>> Blog: http://miyurublog.blogspot.com
>>>
>>
>>
>>
>> --
>>
>> *S. Suhothayan*
>> Technical Lead & Team Lead of WSO2 Complex Event Processor
>> *WSO2 Inc. *http://wso2.com
>> * *
>> lean . enterprise . middleware
>>
>>
>> *cell: (+94) 779 756 757 <%28%2B94%29%20779%20756%20757> | blog:
>> http://suhothayan.blogspot.com/ twitter:
>> http://twitter.com/suhothayan  | linked-in:
>> http://lk.linkedin.com/in/suhothayan *
>>
>
>
>
> --
> Thanks,
> Miyuru Dayarathna
> Senior Technical Lead
> Mobile: +94713527783
> Blog: http://miyurublog.blogspot.com
>



-- 

*S. Suhothayan*
Technical Lead & Team Lead of WSO2 Complex Event Processor
*WSO2 Inc. *http://wso2.com
* *
lean . enterprise . middleware


*cell: (+94) 779 756 757 | blog: http://suhothayan.blogspot.com/
twitter: http://twitter.com/suhothayan
 | linked-in:
http://lk.linkedin.com/in/suhothayan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev