- なんらかの関数型の仕組みが取り入れられている
- ラムダ式の表現が何かしら取り入れられている
- 無名関数を簡単に書きやすくなった
- JSではラムダ式と言わずアロー関数という
(arg) => { statements };
- 引数を宣言する
(arg) => { statements };
-- リスト内の要素をすべて負の値に変換する(関数合成) | |
-- Haskellでは.で繋げる | |
Prelude> map (negate . abs) [1, -2, 3] --[-1, -2, -3] |
CREATE TABLE emp2 AS SELECT * FROM EMP; |
# 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;
class Hello { | |
public static void main(String[] args) { | |
System.out.println("Hello Python!"); | |
} | |
} |
module.exports = class Calc { | |
static sum(a, b) { | |
return a + b; | |
} | |
static multiply(a, b) { | |
return a * b; | |
} | |
} |
package composing_methods.replace_temp_with_query.after; | |
public class Example { | |
private int quantity; | |
private int itemPrice; | |
public double getPrice() { | |
return basePrice() * discountFactor(); |
package composing_methods.extract_method.after; | |
import java.util.Arrays; | |
public class Example { | |
public static void main(String[] args) { | |
int[] sampleData = {9, 2, 7, 3, 6, 1, 5, 4, 8}; |
public class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("hello, world"); | |
} | |
} |
import java.util.List; | |
import java.util.ArrayList; | |
// 抽象的な工場(食事のセット)の定義 | |
abstract class MealFactory { | |
// 主食と汁物のセットを生成する | |
public abstract StapleFood createStapleFood(); | |
public abstract Soup createSoup(); | |
} |