- Giphy
- Manage Account
// How do I assert.throws this function? | |
describe("Test assert.throws", function() { | |
it("should throw when called with isThrow == true", function() { | |
function willThrow(isThrow) { | |
if (isThrow) { | |
throw new Error("Some error"); | |
} | |
} |
function load_data() { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve([1,2,3,4,5,6]); | |
}, 3000); | |
}); | |
} | |
function process_data_step1(item) { | |
return new Promise((resolve, reject) => { |
// NOTE | |
// npm install q | |
// Before proceeded | |
const Q = require("q"); | |
let MAX_FAIL = 1; | |
function talkingToDatabase() { | |
return Q.Promise((resolve, reject) => { |
#include <stdio.h> | |
#include <stdlib.h> | |
// or int *a | |
int binary_search(int a[], int x, int left, int right) { | |
if (left > right) return -1; | |
int mid = (left + right) / 2; | |
if (a[mid] == x) return mid; | |
if (x < a[mid]) return search(a, x, left, mid - 1); | |
else return search(a, x, mid + 1, right); | |
} |
// 1 | |
// requestBody.fundCode | |
IndividualApiValidator.validate(requestBody) | |
.then((requestBody) => { | |
// requestBody.fundId | |
// call save(); | |
}); | |
// 3 | |
let domain = covertToDomain(requestBody) |
class DB { | |
execute(sql, callback) { | |
// .. execute SQL | |
setTimeout(() => { | |
callback({ id: 1, name: 'Pongeng' }) | |
}, 2000) | |
} | |
} | |
class DBPromise { |
([]+![])[+!+[]+!+[]+!+[]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]][([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+![])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]]+([]+!![])[+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]]+([]+!![])[+!+[]]](([]+!![])[+!+[]]+([]+[][+[]])[+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+!![])[+!+[]+!+[]]+([]+!![])[+!+[]]+([]+[][+!+[]])[+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+(+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[])[([]+{})[+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+([]+{})[ |
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. |
Reviewed By Jerapong Nampetch
Math for working programmers - public 3
เป็นคลาสที่เปิดหูเปิดตาผมได้เยอะมาก ผมได้รู้ที่มาที่ไปของการ “programming” ที่เราทำๆกันอยู่ทุกเมื่อเชื่อวัน ว่ามันคืออะไร มีที่มายังไง ทำไมพอเราได้โจทย์ขึ้นมา เราก็เริ่มทำกันอย่างนี้
What Why เป็นสิ่งสำคัญที่เราควรรู้ ทั้งหมดมันมาเชื่อมโยงกันได้อย่างไร คลาสนี้บอกกระจ่างเลย
จนมาถึง “อนาคต” (ที่มาถึงแล้ว) ของ programming อย่าง fp คลาสนี้บอกที่มาที่ไปของมัน และสอนให้เราคิดแก้ปัญหา “ในทางของมันจริงๆ” ไม่ใช่การคิดแบบเดิมแค่ใช้ syntax ใหม่ จุดนี้คลิกผมมาก ทำให้ผมกลับมาย้อนคิดใหม่ว่า “กุใช้มันถูกรึยังวะ” รวมถึงการตอบคำถาม ปรับ mindset วิธีคิดต่อ fp ไปอย่างสิ้นเชิง