# mysql -u root -p
MariaDB [(none)]> show databases;
MariaDB [(none)]> create database zabbix;
MariaDB [(none)]> create user ‘zabbix’@‘%’ identified by ‘zabbixpass’; //ユーザー名とパスワードは一例
MariaDB [(none)]> select user,host from mysql.user;
MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'%';
MariaDB [(none)]> show grants for zabbix;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class Calc { | |
static sum(a, b) { | |
return a + b; | |
} | |
static multiply(a, b) { | |
return a * b; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello { | |
public static void main(String[] args) { | |
System.out.println("Hello Python!"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE emp2 AS SELECT * FROM EMP; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- リスト内の要素をすべて負の値に変換する(関数合成) | |
-- Haskellでは.で繋げる | |
Prelude> map (negate . abs) [1, -2, 3] --[-1, -2, -3] |
- なんらかの関数型の仕組みが取り入れられている
- ラムダ式の表現が何かしら取り入れられている
- 無名関数を簡単に書きやすくなった
- JSではラムダ式と言わずアロー関数という
(arg) => { statements };
- 引数を宣言する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigDecimal; | |
public class Calculator { | |
public static int calc (int price, price, int count) throws Exception { | |
if (count > 1) { | |
return price * count; | |
} | |
throw new Exception(); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook | |
# Recipie:: default | |
# | |
# Copyright:: 2018, The Authors, All Rights Reserved. | |
package "httpd" do | |
action :install | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.prod_category,p.prod_id,p.prod_name, | |
COUNT(s.quantity_sold),SUM(s.amount_sold) | |
FROM products p | |
JOIN sales s | |
ON p.prod_id = s.prod_id --products テーブル と sales テーブル を prod_id でJOIN | |
group by p.prod_category,p.prod_id,p.prod_name | |
ORDER BY p.prod_category,p.prod_id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>test page nv16.</title> | |
</head> | |
<body> | |
<h1>Hello AWS</h1> | |
</body> | |
</html> |