Call with something like:
> echo '11*19 + 3 * 9'|python exp2gviz.py -|dot -Earrowsize=0.4 -Nfixedsize=1 -Grankdir=BT -Tpng>gviz_out.png;feh gviz_out.png
To get something like:
""" | |
Reads a Graphml file and instantiate the right type Networkx graph. | |
Notes: | |
1. This is still work in progress. At its current state, the code will comfortably read "simple" graphml files. | |
2. The next step is to enable the routine to selectively read in (graph, node, edge) level data based on the | |
namespace used. | |
3. This will probably be implemented with named tuples and it should support at least simple reads (if not full | |
complex writes too). |
""" | |
A very small scheme-like language to try out the structural pattern matching | |
features of python 3.11 | |
Features: | |
* Mathematical expressions +,-,*,/ involving integers, variables and functions | |
* Functions are defined via lambda. | |
* Values (including functions) are assigned to variables via let | |
For more information regarding the concepts this language depends on, see: |
module stacklang_list::stacklang_list | |
// A very simple stack language | |
// | |
// The stack is represented as a list with the top of the stack extending the list from the left. | |
// For example, to add two numbers: eval([add(), push(1), push(1)]) | |
import IO; | |
// Symbols |
""" | |
A brief script to indicate the "location" of a possibly misspelled 'Washington' | |
in the current (v1.20-2023-02-28-ror-data.json) ROR dataset | |
:author: Athanasios Anastasiou | |
:date: Mar 2023 | |
""" | |
import json |
from neomodel import (config, StructuredNode, StringProperty, IntegerProperty, | |
UniqueIdProperty, RelationshipTo, db) | |
import os | |
class Country(StructuredNode): | |
code = StringProperty(unique_index=True, required=True) | |
class City(StructuredNode): | |
name = StringProperty(required=True) | |
country = RelationshipTo(Country, 'FROM_COUNTRY') |