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
| add $s0 , $s1 , $s2 | |
| //เอา $s1 + $s2 | |
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
| add $s0 , $s1 , $s2 | |
| //เอา $s1 + $s2 | |
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
| 1 2,3,4 | |
| | 1 = คำสั่งนี้ทำงานอะไร | |
| | 2 = ใช้เก็บผลลัพธ์ | |
| | 3 = ตัวแปรที่ 1 | |
| | 4 = ตัวแปรที่ 2 |
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
| $ 16 - $ 23 => $s0 - $s7 | |
| "ทำหน้าที่เป็นตัวแปร (variable)" | |
| $ 8 - $ 15 => $t0 - $t7 | |
| "ทำหน้าที่เป็นตัวแปรชั่วคราว (temporary variable)" |
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
| sudo rm /var/lib/apt/lists/lock |
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
| <?php | |
| ?> |
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
| var express = require("express"); | |
| var app = express(); | |
| const mongoose = require("mongoose"); | |
| /////////////////////////////////// เพิ่มส่วนนี้ //////////////////////////////////// | |
| const connect = `mongodb://${process.env.DATABASE_USER}:${ | |
| process.env.DATABASE_PASSWORD | |
| }@${process.env.DATABASE_HOST}:27017/shoppers?authSource=admin`; | |
| mongoose.connect(connect, { useNewUrlParser: true }); |
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
| db.createCollection("student"); | |
| db.student.insert({ | |
| id: 1, | |
| Name: "สมชาย", | |
| Surname: "เข็มกลัด", | |
| thumbnail: "/images/student/somchai.jpg" | |
| }); | |
| db.student.insert({ | |
| id: 2, | |
| Name: "วิชชุดา", |
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
| FROM mongo:3.4.7 | |
| #FROM : อ้างอิงถึง parent image ชื่อ mongo ติด tag version 3.4.7 | |
| ENV MONGO_INITDB_ROOT_USERNAME admin | |
| ENV MONGO_INITDB_ROOT_PASSWORD 1234 | |
| ENV MONGO_INITDB_DATABASE shoppers | |
| # กำหนด ENV ให้มัน | |
| #กรณีที่ต้องการ Set initial db ให้มัน | |
| ADD ./data/datastudent.js /docker-entrypoint-initdb.d |
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
| docker run -p 2000:4000 apitestserver:1.0 |