Plantuml Rendering Differences Online and Locally - graphviz

Using plantuml's online renderer, consider the following diagram:
specified by the following code:
#startuml
title
FooBar
endtitle
cloud Cloud {
node "Machine" #beige {
node OPT #yellow [
Optimizer
]
}
}
node Torch #yellow
OPT ==> Torch : response
Torch ==> OPT : request
#enduml
However, when I render the exact same code (copy-pasted) on my local machine, I get a scrunchy, ugly, unacceptable rendering:
$ cat > hairball.txt
<<< paste the above text >>>
$ plantuml hairball.txt
$ xdg-open hairball.png
I have the latest versions of dot and plantuml on my ubuntu machine:
$ dot -V
dot - graphviz version 2.40.1 (20161225.0304)
$ plantuml -v
(0.000 - 1008 Mo) 1000 Mo - PlantUML Version 1.2019.05
I'm out of ideas about how to diagnose and fix this and would be grateful for help.

how about:
download PyCharm
Install Plugins: PlantUML integration
Settings → Plugins → Search "PlantUML integration" → Install
Pycharm → Settings → Other Settings → PlantUML → "Graphviz doe executable: your dot.exe path"
test.puml
It looks fine.

Related

How to install Dirac (a Chrome DevTools fork for ClojureScript) on macOS Monterey 12.5 if error: "Could not locate clojure/data/ files" appears?

I am trying to install Dirac on a Macbook Air M1 running Monterey 12.5.
I am following the documentation which indicates:
curl -s https://raw.githubusercontent.com/binaryage/dirac/master/install > /tmp/dirac.install && sudo bash /tmp/dirac.install
The installation seems to have worked out since it exists on binaries:
Pedros-MacBook-Air:bin pedro$ pwd
/usr/local/bin
Pedros-MacBook-Air:bin pedro$ ls -1
dirac
lein
Unfortunately, when I go to the 2nd step on manual which is running dirac, the error below is retrieved:
Pedros-MacBook-Air:bin pedro$ dirac
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/update-keys
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-keys
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes, being replaced by: #'clojure.tools.analyzer.utils/update-vals
WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes.uniquify, being replaced by: #'clojure.tools.analyzer.utils/update-vals
Execution error (FileNotFoundException) at dirac.nrepl.compilation.direct/eval15283$loading (direct.clj:1).
Could not locate clojure/data/json__init.class, clojure/data/json.clj or clojure/data/json.cljc on classpath.
Full report at:
/var/folders/fh/7d_1drwd2ps3zw03j9ftkqs80000gn/T/clojure-1010884132545121253.edn
Initially, I tried running it at home folder. I thought it would work out fine.
Then, I decided to run it inside a project folder that had the file clojure/data/json.clj
included in the the project.clj file. Unfortunately, even this approach did not work out.
Below you see a simplified version of the project.clj file:
(defproject abcd ; Should be copied from shadow-cljs.edn
:description "xxxx"
:url "xxxx"
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.339"]
[org.clojure/tools.nrepl "RELEASE"]
[binaryage/devtools ~devtools-version]
[binaryage/dirac ~dirac-version]
[org.clojure/data.json "2.4.0"]
[figwheel ~figwheel-version]
;; Selmer for templating of .json config files
[selmer "1.12.50"]]
... (omitted content because it seems irrelevant) ...
:profiles {:repl
{:repl-options {:port 8230
:nrepl-middleware [dirac.nrepl/middleware]
:init (do
(require 'dirac.agent)
(dirac.agent/boot!))
}}})
1 - I thought Dirac would work out even outside of the project folder. Is it necessary to be in the project folder?
2 - Why is Dirac complaining about the Json library even though it is listed as a dependency?
Is there any difference between clojure/data/json.clj (error message retrieved) and org.clojure/data.json (my dependency)?
You've received a workaround on dirac/issues/98: adding {:deps {org.clojure/data.json {:mvn/version "2.4.0"}}} to ~/.clojure/deps.edn.
The local launcher script has a dependency on the release version of ClojureScript, that no longer includes clojure/data.json. A better workaround is changing the /usr/local/bin/dirac file line 119 by adding clojure.data.json there as well (or pinning to a ClojureScript version before 1.11.51):
DEPS="{:deps {\
$DIRAC_CLI_DEPS_COORDINATE \
org.clojure/clojurescript {:mvn/version \"RELEASE\"} \
org.clojure/data.json {:mvn/version \"2.4.0\"} \
clj-logging-config/clj-logging-config {:mvn/version \"1.9.12\"} \
}}"
Explanation
The dependency org.clojure/data.json was removed from ClojureScript in version 1.11.51 of May 13th 2022. See release notes:
Vendorization of tools.reader, data.json, and transit-clj (...) After conferring with the Clojure Team, we decided to vendorize all these dependencies. This way we can AOT everything and be confident that we won’t create a conflict that can’t easily be fixed via normal dependency management. (...) The dependance on data.json has been removed.

Cannot use rmarkdown from RGui

I would like to generate a PDF via RMarkdown from the RGui.
I am able to knit the file via RStudio but it fails every time via RGui.
This is "essai.r" file that contains the render command.
library(rmarkdown)
library(knitr)
Sys.setenv(RSTUDIO_PANDOC="C:/Program Files (x86)/Pandoc")
rmarkdown::render("essai.Rmd", output_format = "pdf_document", clean = FALSE)
This is "essai.rmd"
---
title: "test"
output: pdf_document
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
And this is my configuration:
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows Server 2012 R2 x64 (build 9600)
locale:
[1] LC_COLLATE=French_Switzerland.1252 LC_CTYPE=French_Switzerland.1252 LC_MONETARY=French_Switzerland.1252
[4] LC_NUMERIC=C LC_TIME=French_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] knitr_1.12.3 rmarkdown_0.9.5
loaded via a namespace (and not attached):
[1] magrittr_1.5 formatR_1.4 tools_3.3.0 htmltools_0.3.6 yaml_2.1.13 Rcpp_0.11.2
[7] stringi_1.0-1 stringr_1.0.0 digest_0.6.13 evaluate_0.8
And this is the error that appears every time:
> source("essai.r")
"C:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS essai.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output essai.pdf --template "C:\PROGRA~1\R\R-33~1.0\library\RMARKD~1\rmd\latex\DEFAUL~2.TEX" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"
pandoc.exe: Cannot decode byte '\xbd': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
Erreur : pandoc document conversion failed with error 1
I made sure that both files are saved as UTF-8. And also I tried to change my system locale.
What am I missing?
Regards

How do I install RODBC on Mac with unixodbc and freetds?

After a fairly extensive search, I noticed that a number of people are having a hard time finding a start-to-finish guide that answers this question. (At least one question notes that a solution exists, but the proposed solution does not get around the fact that, by default, RODBC attempts to compile against iODBC, which is not included with Yosemite.) I just went through this process, so I thought I would document it here in the hope that it will benefit others. I am connecting to a SQL Server database.
Using Homebrew as my OS X package manager, I can install RODBC with the following steps (assuming I have already installed R).
Install unixodbc:
$ brew install unixodbc
Install freetds (replacing /usr/local/Cellar/unixodbc/2.3.2_1 with your unixodbc directory, if necessary):
$ brew install --with-tdsver=8.0 --with-msdblib --with-unixodbc=/usr/local/Cellar/unixodbc/2.3.2_1 freetds
Configure your freetds installation (the following is a minimal configuration file):
freetds.conf
# server specific section
[global]
; tds version = 8.0
; dump file = /tmp/freetds.log
; debug flags = 0xffff
; timeout = 10
; connect timeout = 10
text size = 64512
[TESTSQL]
# insert the actual host below
host = <xxx.xx.x.xx>
port = 1433
tds version = 8.0
Test the freetds config:
$ tsql -H `<xxx.xx.x.xx>` -p 1433 -U `<username>` -P `<password>`
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> exit
Configure your unixodbc installation (the following is a minimal configuration file):
$ sudo vim /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbcinst.ini
odbcinst.ini
[MSSQL]
Description = Microsoft SQL Server driver
Driver = /usr/local/Cellar/freetds/0.95.18/lib/libtdsodbc.so
(and another minimal installation file):
$ sudo vim /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbc.ini
odbc.ini
[ODBC Data Sources]
TESTSQL = Test database
[TESTSQL]
Driver = MSSQL
Servername = TESTSQL
Port = 1433
Database = TMSEPRD
TDS_Version = 8.0
Test the new configuration with isql:
$ isql TESTSQL `<username>` `<password>`
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> quit
Create a symbolic link to the files in your home directory:
$ ln -vs /usr/local/Cellar/freetds/0.95.18/etc/freetds.conf ~/.freetds.conf
$ ln -vs /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbc.ini ~/.odbc.ini
$ ln -vs /usr/local/Cellar/unixodbc/2.3.2_1/etc/odbcinst.ini ~/.odbcinst.ini
Find and modify your RProfile file by appending the following line(s) of code to the file (replacing /usr/local/include with the include directory that contains your sql.h and sqlext.h files; the second line may be unnecessary if the directory does not exist):
$ vim /Library/Frameworks/R.framework/Versions/3.2/Resources/library/base/R/Rprofile
Sys.setenv(ODBC_INCLUDE="/usr/local/include")
Sys.setenv(ODBC_LIBS="/usr/local/lib")
Now download the RODBC package source (which you an download here) to your Downloads folder.
Open a new R console session and install the package (replacing RODBC_1.3-12.tar.gz with the name of your package source):
install.packages("~/Downloads/RODBC_1.3-12.tar.gz", repos=NULL, type="source")
The package should now work:
> library(RODBC)
> myconn <- odbcConnect("TESTSQL", uid="<userid>", pwd="<password>")
Thanks to Jared Folkins and Gabi Huiber for help with figuring out what directories R looks in by default for the requisite files for RODBC.

d3 plugin installation issue in iPython

I found this question:
http://grokbase.com/t/scipy.org/ipython-dev/12bygp3793/try-jsplugins-d3graph.
In the solution is suggested compiling ipython from:
https://github.com/ellisonbg/ipython/tree/jsonhandlers
I did that and followed the directions here:
https://github.com/ipython/jsplugins
To summarize:
I followed the instruction from
and jsplugins > d3graph > README.md
d3graph.py : copied to .ipython\extensions
d3graph.js and d3graph.css : copied to
.ipython\profile_default\static\jsplugins\d3graph
(Note: I am on ubuntu/linux 12.10
ipython-0.14.dev.egg-info)
run ipython notebook --pylab inline
open Visualizing Graphs with d3.ipynb
each cell was executed, but the graph did not show up.
But I can plot graph with:
pos=nx.spring_layout(G,iterations=100)
plt.subplot(221)
nx.draw(G,pos,font_size=8)
Is very strange because I can`t to use the plugin too.
can you probe to do the instructions in the .config/.ipython/profile_default folder?. because that is the real sesion path

Trying to install HTTP::Server::Brick on Strawberry Perl on Windows 7

Here's what I see when I run cpan to install it.
cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.
cpan> install HTTP::Server::Brick
Database was generated on Fri, 13 Jul 2012 03:26:42 GMT
Running install for module 'HTTP::Server::Brick'
Running make for A/AU/AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
Checksum for C:\strawberry\cpan\sources\authors\id\A\AU\AUFFLICK\HTTP-Server-Bri
ck-0.1.4.tar.gz ok
Scanning cache C:\strawberry\cpan\build for sizes
............................................................................DONE
CPAN.pm: Building A/AU/AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'HTTP-Server-Brick' version '0.1.4'
Building HTTP-Server-Brick
AUFFLICK/HTTP-Server-Brick-0.1.4.tar.gz
C:\strawberry\perl\bin\perl.exe ./Build -- OK
Running Build test
t\00.load.t ....... 1/1 # Testing HTTP::Server::Brick v0.1.4
t\00.load.t ....... ok
t\pod-coverage.t .. skipped: Test::Pod::Coverage 1.04 required for testing POD c
overage
t\pod.t ........... skipped: Test::Pod 1.14 required for testing POD
t\serving.t ....... 1/281 #
#
# Using port: 85432 and host: 127.0.0.1 for test server.
# If these are not suitable settings on your machine, set the environment
# variables HSB_TEST_PORT and HSB_TEST_HOST to something suitable.
#
# Configuring server
# Starting server
t\serving.t ....... 4/281
It's really quite simple... Why port 85432? It's outside the 16 bit unsigned integer range! I can't even enter localhost:85432 in any URL bars, Chrome just sends me straight to Google search.
That is pretty strange. I took a look at the source for the test in question, and it has this:
my $port = $ENV{HSB_TEST_PORT} || 85432;
No idea why the author chose that as the default port number, since as you know it's invalid. I guess there's zero chance of the port being in use, though!
My suggestion would be to set the environment variable HSB_TEST_PORT to something more reasonable and try to install again, and file a bug report in the meantime.

Resources