Tips
このページにはいろいろなTipsを書きます。
sudo apt install apache2
sudo ufw allow 'Apache' sudo ufw enable sudo systemctl status apache2
sudo apt install mysql-server sudo mysql_secure_installation
sudo apt install php libapache2-mod-php php-mysql php-mbstring sudo systemctl restart apache2
<?php phpinfo(); ?>
sudo apt update
sudo apt list --upgradable
sudo apt upgrade
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'int'>"})jp.archive.ubuntu.com:http へ接続できません: [IP: 160.26.2.187 80]
sudo apt-get install python3-pip
pip3 install tensorflow pip3 install keras pip3 install pandas sklearn
Traceback (most recent call last):
File "janken-test.py", line 20, in <module>
tf.keras.utils.plot_model(model,to_file='janken-model.png')
File "/home/kisa021/.local/lib/python3.8/site-packages/tensorflow/python/keras/utils/vis_utils.py", line 301, in plot_model
dot = model_to_dot(model,
File "/home/kisa021/.local/lib/python3.8/site-packages/tensorflow/python/keras/utils/vis_utils.py", line 114, in model_to_dot
raise ImportError(message)
ImportError: ('Failed to import pydot. You must `pip install pydot` and install graphviz (https://graphviz.gitlab.io/download/), ', 'for `pydotprint` to work.')$ pip3 install pydot graphviz
Collecting pydot
Downloading pydot-1.4.1-py2.py3-none-any.whl (19 kB)
Collecting graphviz
Downloading graphviz-0.16-py2.py3-none-any.whl (19 kB)
Collecting pyparsing>=2.1.4
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 2.2 MB/s
Installing collected packages: pyparsing, pydot, graphviz
Successfully installed graphviz-0.16 pydot-1.4.1 pyparsing-2.4.7$ sudo apt install graphviz
import cv2
cap=cv2.VideoCapture(0)
if cap.isOpened()==False:
print("cannot open")
exit(1)
while(True):
_,img=cap.read()
cv2.imshow('image',img)
key=cv2.waitKey(1)
if key==27:
breakJs Test DriverはGoogleが提供しているJavaScript用のテスト環境である。
単体でサーバになって、ブラウザ上でのテストを可能にする。
さらに、NetBeans Connectorを使えれば、デバッグでもできるらしい。
詳しい設定方法等はここにある。
ここでは、具体的な手順を中心に説明する。
展開する必要はない。
HTML5プロジェクト"Test1"を、なにもオプションを指定せずに作成した場合について述べる。
var TestClass=function(){
this.add=function(a,b){
return a+b;
};
};TestCase('Test1',{
setUp:function(){
this.test_class=new TestClass();
},
'test Test1-1':function(){
assertEquals(this.test_class.add(2,3),5);
},
'test Test1-2':function(){
assertEquals(this.test_class.add(1,2),5);
}
});server: http://localhost:42442 load: - test/lib/jasmine/jasmine.js - test/lib/jasmine-jstd-adapter/JasmineAdapter.js - public_html/js/my.js - test/unit/*.js exclude:
ブラウザ画面全体に広がっているアプリを作ろうとすると、ベースとして全画面のdivタグがほしい。
が、以下のCSSでhtmlとbodyを全画面に広げると、なぜか横にスクロールバーが登場する。
html,body{
width:100%;
height:100%;
}
div#all_area{
width:100%;
height:100%;
background-color:yellow;
}<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>All Screen</title>
<link rel="stylesheet" href="AllScreen.css"></link>
</head>
<body>
<div id="all_area">
this is all_area.
</div>
</body>
</html>上記のコードを実行すると、div領域の周りに白い枠が出て、スクロールバーも表示される。
これは、bodyにmarginとして8が設定されていることが原因である。(ChromeとIE11では8だった)
したがって、CSSを下記のように修正すれば、ブラウザ全体のdiv領域を得ることができる。
html,body{
margin:0px;
width:100%;
height:100%;
}
div#all_area{
width:100%;
height:100%;
background-color:yellow;
}これでブラウザ画面全体が黄色のdiv領域となり、スクロールバーは表示されなくなる。
Javaセミナー2014ではTomcat7を使っているが、最新のTomcat8を入れたら、挙動がだいぶ違う。
request.setCharacterEncoding("UTF-8");<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1" useBodyEncodingForURI="true" />
</Service>
</Server>