libtbb.so.12 not found のときの対処
sudo apt-get install libtbb-dev
libtbb.so.12 not found のときの対処
sudo apt-get install libtbb-dev
Windows11 の WSL2 の Ubuntu を アップグレードして Ubunts 24.04 LTS にしたら WSL の起動が遅くなってしまった(数分かかる?).
systemd-analyze blame
すると起動時に時間がかかる順でサービスが表示される.
何故か systemd-networkd-wait-online.service に 2 min もかかっていることが判明.次のように無効化する
sudo systemctl disable systemd-networkd-wait-online.service
systemd-analyze critical-chain
で最も時間のかかっているサービス群を表示できる.
julia> >]
pkg> generate MyExample
すると MyExample ディレクトリと下記のサブディレクトリができる.
$cd MyExample
./
├── Project.toml
└── src
└── MyExample.jl
(pkg> add Documenter はすでにされている状態で)
MyExample プロジェクトのルートディレクトリで
pkg> activate docs/
例えば何らかのpythonコマンドの計算結果で2つの値 100, 99 が print で標準出力に 出てくるとする:
|
1 2 |
$python3 test.py > 100 99 |
これを bash スクリプト中で受け取って使うには,
|
1 2 3 |
rarr=('python3 test.py') echo "{$rarr[0]}" echo "{$rarr[1]}" |
|
1 |
`command` |
でコマンドの結果を受け取る.( )でくくると配列として受け取る
配列を使う時は {$rarr[0]} などとする
client.read() returns single byte.
https://www.arduino.cc/reference/en/libraries/ethernet/client.read/
A simple test sketch based on “Chat Server” example.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
/* based on Chat Server example */ #include <SPI.h> #include <Ethernet.h> byte mac[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // change to your own IPAddress ip(192, 168, 1, 177); EthernetServer server(23); // telnet defaults to port 23 bool alreadyConnected = false; // whether or not the client was connected previously int count = 0; void setup() { Ethernet.begin(mac, ip); Serial.begin(9600); if (Ethernet.hardwareStatus() == EthernetNoHardware) { Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :("); while (true) { delay(1); // do nothing, no point running without Ethernet hardware } } server.begin(); Serial.print("Chat server address:"); Serial.println(Ethernet.localIP()); } void loop() { EthernetClient client = server.available(); if (client) { if (!alreadyConnected) { // clear out the input buffer: client.flush(); Serial.println("We have a new client"); client.println("Hello, client!"); alreadyConnected = true; } if (client.available() > 0) { // read the bytes incoming from the client: char buf = client.read(); // echo the bytes back to the client: server.write(buf); server.write(count); // echo the bytes to the Serial monitor as well: Serial.println(buf); Serial.println(count); count += 1; } } } |
One gets following Serial monitor after sending a set of characters “ABCD” by, for example, socket.send(“ABCD”.encode(“utf-8”)) in a python script.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Chat server address:192.168.1.177 We have a new client A 0 B 1 C 2 D 3 4 |