How does the chain edge connection works in Jaseci? - jaseci

I'm new to Jaseci world. Here I'm trying to figure out how the chaining edge connections between nodes works in jaseci. In the following code snippet was taken from the Jaseci Bible.
node person;
edge friend;
edge family;
walker init {
node1 = spawn node::person;
node2 = spawn node::person;
node2 <-[friend]- here -[friend]-> node1 <-[family]-> node2;
}
According to the bible the graph is as follows;
The chain connection works left to right. I don't get how the line node2 <-[friend]- here -[friend]-> node1 <-[family]-> node2; creates the e1 edge. Can someone help me to understand this?.

It appears the diagram doesn't match the code. Must be an error in the Bible. I just plopped your code example in a file and ran it with jsctl -m jac dot nextion.jac. I got this output:
strict digraph root {
"n0" [ label="n0:root" ]
"n1" [ label="n1:person" ]
"n2" [ label="n2:person" ]
"n0" -> "n1" [ label="e0:friend" ]
"n0" -> "n2" [ label="e1:friend" ]
"n1" -> "n2" [ label="e2:family", dir="both" ]
}
If you render this in graphviz online it looks like

Related

How to customize system calls in gVisor?

I am a student and try to customize the system calls in gVisor. I have successfully compiled the gVisor on go-branch. And I have got the right message when I change the pkg/sentry/kernel/syslog.go file. Here is the result that can show I have successfully compiled the runsc (the runtime of gVisor).
sudo docker run --runtime=runsc -it ubuntu dmesg
[ 0.000000] asdf Starting gVisor...
[ 0.360765] 6666...
[ 0.529799] 5555...
[ 0.959593] iiiiii...
[ 1.343602] 7777...
[ 1.347068] 4444...
[ 1.424063] 00000...
[ 1.470641] 22222...
[ 1.858755] 99999...
[ 2.213219] 8888...
[ 2.679995] cccccc ..
[ 2.943468] asdf asdf Setting up VFS2...
[ 3.429006] Ready!
And I have noticed the package gvisor/pkg/sentry/syscalls/linux which contains all the syscalls and they are registered in file gvisor/pkg/sentry/syscalls/linux/linux64.go. However, I failed to customize the syscalls in gVisor.
Thanks very much.

vscode remote container extension launching got stuck at "installing extensions"

When I am using this remote container extension for launching a container, sometime it will stuck at "installing extensions".
It will stuck at this state as follow for a long time and no response.
Sometime it works fine and fast, sometime does not.
I have commented all the extensions in devcontainer.json file but it still happens sometime.
I dont know whether it a network issue or something else. And I want to know how can I make it stable?
Thanks!
This is my devcontainer.json.
{
"name": "gazebo_ros_docker",
"dockerFile": "Dockerfile",
"extensions": [
// "ms-iot.vscode-ros",
// "ms-vscode.cpptools",
// "mhutchie.git-graph"
],
"runArgs": [
"-it",
"--rm",
"--privileged",
"-e ROS_HOSTNAME=localhost",
"-e ROS_MASTER_URI=http://localhost:11311",
"--name=ros_container",
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// "postCreateCommand": "bash /catkin_ws/src/panda_simulation/scripts/docker-setup.sh",
"workspaceMount": "source=${localWorkspaceFolder},target=/catkin_ws,type=bind",
// "workspaceMount": "source=${localWorkspaceFolder},target=/catkin_ws,type=bind,consistency=delegated",
"workspaceFolder": "/catkin_ws",
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind",
],
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}",
},
"containerUser": "docker_ros"
}
I did not find the best way to solve this problem. But I export the images of the vscode-processed container and launch it. It is working well now.

Myself word gives an error in Netlogo

I have a problem in Netlogo when I use "myself" word
this is the code i am using in my project
ask players [
if ([owner] of the-ball != nobody) [
ifelse([team] of ([owner] of the-ball) = [team] of myself and (myself != [target] of the-ball) )[
set team-have-ball? true
] [
set team-have-ball? false
]
]
]
the error says There is no agent for MYSELF to refer to.

Illegal character in query at index 40: facebook

Sorry, I am reformulating the question; I was so frustrated by this Error that I posted the question in a snap.
I am trying to use camel-facebook component and using very simple route that figures as such in the blueprint.xml file:
from uri="facebook://me?oAuthAppId={{oAuthAppId}}&oAuthAppSecret={{oAuthAppSecret}}&oAuthAccessToken={{oAuthAccessToken}}&consumer.delay=86400000"/>
I am using :
Red Hat JBoss Developer Studio
Version: 10.1.0.GA
Actually I see the bundle started :
[ 348] [Active ] [Created ] [ ] [ 80] MyApp [fbdemo] (1.0.0.SNAPSHOT)
Also :
[ 333] [Active ] [ ] [ ] [ 50] camel-facebook (2.17.0.redhat-630187)
Perhaps I have the error mentioned above, I put XXXXXXXXX for oAuth*.
2017-02-14 16:02:16,128 | ERROR | 68)-192.168.56.1 | BlueprintCamelContext | 234 - org.apache.camel.camel-blueprint - 2.17.0.redhat-630187 | Error occurred during starting Camel: CamelContext(blueprintContext) due Failed to create route fbRoute: Route(fbRoute)[[From[facebook://me?oAuthAppId={{oAuthAppId}}... because of Failed to resolve endpoint: facebook://me?oAuthAppId=XXXXXXXXXXXXXX
&oAuthAppSecret=XXXXXXXXXXXXXXXXXXXXXX&oAuthAccessToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&consumer.delay=86400000 due to: Illegal character in query at index 40: facebook://me?oAuthAppId=XXXXXXXXXXXXXXXXXXXXXXX
&oAuthAppSecret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&oAuthAccessToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&consumer.delay=86400000
org.apache.camel.FailedToCreateRouteException: Failed to create route fbRoute: Route(fbRoute)[[From[facebook://me?oAuthAppId={{oAuthAppId}}... because of Failed to resolve endpoint: facebook://me?oAuthAppId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
&oAuthAppSecret=XXXXXXXXXXXXXXXXXXXXXXXXXXXX&oAuthAccessToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&consumer.delay=86400000 due to: Illegal character in query at index 40: facebook://me?oAuthAppId=XXXXXXXXXXXXXXXX
Shall the oAuthAccessToken be the Application AccesToken or User AccessToken that I get from Facebook Graph Explorer. Note that I don`t have any special character in code secret only a | ( pipe) in case the AccessToken is the Appli AccessToken not User AccessToken. How to figure the index 40.
Thank you very much
If you are using xml then you need to check that all "&" symbols are encoded as "&" so it will looks like:
<from url="facebook://me?oAuthAppId=XXXXXXXXXXXXX&oAuthAppSecret=XXXXXXXXXXXXXXXXXXXXXXXXX&oAuthAccessToken=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&consumer.delay=86400000" />

K8s pods affinity & anti-affinity, soft (preferredDuringScheduling) not respected in 1.4?

I am experimenting with K8s 1.4 pod affinity-antiaffinity. I am trying to get K8s to cluster together pods of the same service on the same node as much as possible (i.e. only go to next node if not possible to put more on the node where the service is already in). To do so, I setup:
A hard (requiredDuringScheduling) anti-affinity to exclude running where a diffrent service is already running (pod_label_xyz not in [value-a])
A soft (preferredDuringScheduling) affinity to try to run where the same service (pod_label_xyz in [value-a]) - weight 100
A soft (preferredDuringScheduling) anti-affinity to try not to run where the same service is not already running (pod_label_xyz not present) - weight 100
When there is 5 nodes and 3 services pod_label_xyz & (value-a, value-b, value-c) with 1 pod each created with a replication controller, the first pods get scheduled properly and when scaling up any of them, the 1st hard rule is respected by K8s. However, the 2nd and 3rd (which is actually redundant of the 2nd) is not respected. I see that when I scale up K8s tries to push pods to empty node (not used by any other service) even though there is capacity to schedule more where the service is already running. In fact if I scale up even more, new pods get created on the original node as well as the new (previously unused nodes).
Please advise if I am missing something
Thank you
Here is the annotation i used
scheduler.alpha.kubernetes.io/affinity: >
{
"podAffinity":{
"preferredDuringSchedulingIgnoredDuringExecution":[
{
"weight":100,
"podAffinityTerm":{
"labelSelector":{
"matchExpressions":[
{
"key":"pod_label_xyz",
"operator":"Exists"
},
{
"key":"pod_label_xyz",
"operator":"In",
"values":[
"value-a"
]
}
]
},
"namespaces":[
"sspni-882-frj"
],
"topologyKey":"kubernetes.io/hostname"
}
}
]
},
"podAntiAffinity":{
"requiredDuringSchedulingIgnoredDuringExecution":[
{
"labelSelector":{
"matchExpressions":[
{
"key":"pod_label_xyz",
"operator":"Exists"
},
{
"key":"pod_label_xyz",
"operator":"NotIn",
"values":[
"value-a"
]
}
]
},
"namespaces":[
"sspni-882-frj"
],
"topologyKey":"kubernetes.io/hostname"
}
],
"preferredDuringSchedulingIgnoredDuringExecution":[
{
"weight":100,
"podAffinityTerm":{
"labelSelector":{
"matchExpressions":[
{
"key":"pod_label_xyz",
"operator":"DoesNotExist"
}
]
},
"namespaces":[
"sspni-882-frj"
],
"topologyKey":"kubernetes.io/hostname"
}
}
]
}
}