Win a copy of Event Streams in Action this week in the Java in General forum!

Negar Afrasiabi

Ranch Hand
+ Follow
since Jan 08, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Negar Afrasiabi

I have jar file named as example.jar that I can execute it in CMD in windows by java -jar example.jar. I want to write a shell script that I can execute the example.jar file. I wrote this script



but there is an error


please help me.Thank you
2 weeks ago
Hi I'm new on RestLet this is a simple example that I want to post a Json representation but after running the client I have error which is mentioned in the below.please help me in this regard.Thank you so much.


Error:
Jul 20, 2019 2:00:03 PM org.restlet.engine.http.connector.HttpClientHelper start
INFO: Starting the default HTTP client
Exception in thread "main" Internal Server Error (500) - Internal Server Error
at org.restlet.resource.ClientResource.handle(ClientResource.java:870)
at org.restlet.resource.ClientResource.post(ClientResource.java:1209)
at Client.main(Client.java:44)


The resource





The client has error in line 44 which is






The server is running without any error

1 month ago
Hi
I have two lists  Edge1List and Edge2List which I add to element on them. Edge1List:[o,p] and Edge2List: [p,null]. I convert Edge1List and Edge2List to JsonArray with the name of EdgeJsonArray1 and EdgeJsonArray2 respectively. I want to show that o from EdgeJsonArray1 is connect to p from EdgeJsonArray2 and p from  EdgeJsonArray1 is connected to null from EdgeJsonArray2 which is I put them in a Jsonobject name as EdgeJsonObjsub with different key.


The result that I obtained by running the program:

{"Edges": [{
   "Edge 1": {
       "From": "p",
       "to": "null"
   },
   "Edge 0": {
       "From": "p",
       "to": "null"
   }
}]}

The expected result is:

{"Edges": [{
   "Edge 0": {
       "From": "o",
       "to": "p"
   },
   "Edge 1": {
       "From": "p",
       "to": "null"
   }
}]}


1 month ago
Hi
I run a program and I have some results as an output.I want to save these results and then use them as an input of another program? How can I do this?
5 months ago
I have a list of number with size 8 such as
[-10,4,8,-10,0,10,12,-2]
I want to find the index of minimum value in this list and exclude the value -10 as a minimum value.In this example -10 is the minimum value but as I said I want to exclude the -10 as a minimum value. So -2 is the minimum value in this list and the index of -2 is 8.so the result should be index 8.
This is the problem I hope it is understandable.
6 months ago
This is just an example so I know that java is case sensetive and summation is different from Summation.Thank you for your hints.  And I do not know how to write the code with this logic.Do you have any idea to help me in this regard?
6 months ago
I want to find thr Index of minimum value and exclude only the value of -10
6 months ago
Hi
I have a list named as a Summation.I want to say find the index with the minimum value in the list but that minimum value should not be -10. I know that with the Collections.min() I can find the minimum value which is -10 and the index is 0.But how can I write a code which find minimum value except -10.
Thank you in advance for your help.


Summation: [-10.0, 3.885143684429, 9279769.72987182, 1.0878570214, 9355609.7444]

6 months ago
I need to get the index of the minimum value in each x and y in my 3D array (array [x][y][z]) in Java. MY array holds several numbers which are double.I'm a beginner, so please don't hate me and help me. Thanks!
6 months ago
Question: How can I write a method in class Decision that when the status==1 Id of nodes return.

I have a Class Node with variable Id and nodeCapacity. In this class, I have constructor for the class and setter & getter.


I have another Class which is Decision.In this class I have a integer variable named as status and another variable named as nodes that is a kind of class  Nodes .





In the class main I have static void main method.
Line 10-22 :I have an array of class Nodes which is named as nodes. I assign  value to  each index of array.Then I print the array.
Line 27-46 I have an array of class Decision which is named dec.I assign  value to  each index of array.Then I print the array.




Result:
*Nodes*
ID=0 nodeCapacity38
ID=1 nodeCapacity15
ID=2 nodeCapacity34
ID=3 nodeCapacity12
Decision[0]= node:0 status:1
Decision[1]= node:1 status:0
Decision[2]= node:2 status:1
Decision[3]= node:3 status:0

Expected Result:
*Nodes*
ID=0 nodeCapacity38
ID=1 nodeCapacity15
ID=2 nodeCapacity34
ID=3 nodeCapacity12
Decision[0]= node:0 status:1
Decision[1]= node:1 status:0
Decision[2]= node:2 status:1
Decision[3]= node:3 status:0
Method:
node:1
node:2









6 months ago

Carey Brown wrote:

Carey Brown wrote:

Negar Afrasiabi wrote:I add the this method in class Decision But Still I have problem

You have the same problem as before, you are trying to print arrays without enclosing them in Arrays.toString(...).



Which of those three variables is an array?



nodes and  inctances
6 months ago
sorry I do not get you.What should I do?

and I have another question as well. if I want to say if the variable satus of decision class is equal to one print the node Id. Then how should I write this??

6 months ago
I add the this method in class Decision But Still I have problem

6 months ago
I use both toString and depp string but I still have the same problem.




The result is like this

*Nodes*
ID=0 nodeCapacity38
ID=1 nodeCapacity15
ID=2 nodeCapacity34
ID=3 nodeCapacity12
*VnfInstances*
ID=0 VnfType=0 capacity20.0
ID=1 VnfType=0 capacity10.0
ID=2 VnfType=1 capacity25.0
ID=3 VnfType=1 capacity35.0
ID=4 VnfType=2 capacity11.0
ID=5 VnfType=2 capacity18.0
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]
[Decision@6d06d69c, Decision@7852e922, Decision@4e25154f, Decision@70dea4e, Decision@5c647e05, Decision@33909752, Decision@55f96302, Decision@3d4eac69, Decision@42a57993, Decision@75b84c92, Decision@6bc7c054, Decision@232204a1, Decision@4aa298b7, Decision@7d4991ad, Decision@28d93b30, Decision@1b6d3586, Decision@4554617c, Decision@74a14482, Decision@1540e19d, Decision@677327b6, Decision@14ae5a5, Decision@7f31245a, Decision@6d6f6e28, Decision@135fbaa4]



6 months ago
I do not have any Error in the program the result actually is incorrect This is the result That I have.The decision part has a problem.
*Nodes*
ID=0 nodeCapacity38
ID=1 nodeCapacity15
ID=2 nodeCapacity34
ID=3 nodeCapacity12
*VnfInstances*
ID=0 VnfType=0 capacity20.0
ID=1 VnfType=0 capacity10.0
ID=2 VnfType=1 capacity25.0
ID=3 VnfType=1 capacity35.0
ID=4 VnfType=2 capacity11.0
ID=5 VnfType=2 capacity18.0
*Decision*
(1) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(1) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
(0) Nodes[LNodes;@15db9742 instance[LVnfInstances;@6d06d69c
6 months ago