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
| defmodule Spawner do | |
| def process() do | |
| receive do | |
| after | |
| 1_000 -> | |
| IO.puts "1 seconds elapsed" | |
| for i <- 0..40, i > 0 do | |
| Task.start(ModuleName, :func_name, [[key: value]]) | |
| 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
| int main() | |
| { | |
| // Variable declaration | |
| int choice; | |
| // Print the main menu | |
| cout << "CMPT 126 - Assignment 1\n"; | |
| cout << "\nPlease select one of the followings:\n"; | |
| cout << "1\tQuadratic equation solver.\n"; | |
| cout << "2\tReverse an integer and sum its digits.\n"; |
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
| const NotificationHoC = function(Component) { | |
| return React.createClass({ | |
| componentDidMount() { | |
| const success = (notifications) => { | |
| this.setState({ | |
| notifications: notifications, | |
| }); | |
| }; | |
| $.ajax({ |
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
| const Container = React.createClass({ | |
| componentDidMount() { | |
| const success = (notifications) => { | |
| this.setState({ | |
| notifications: notifications, | |
| }); | |
| }; | |
| $.ajax({ | |
| url: '/notifications', |
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
| const Container = React.createClass({ | |
| componentDidMount() { | |
| const success = (notifications) => { | |
| this.setState({ | |
| notifications: notifications, | |
| }); | |
| }; | |
| $.ajax({ | |
| url: '/notifications', |
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
| const Container = React.createClass({ | |
| componentDidMount() { | |
| const success = (notifications) => { | |
| this.setState({ | |
| notifications: notifications, | |
| }); | |
| }; | |
| $.ajax({ | |
| url: '/notifications', |
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
| function fullName(firstName, lastName) { | |
| return `${firstName} ${lastName}`; | |
| } | |
| function createEl(el) { | |
| return document.createElement(el); | |
| } | |
| function wrapContentWithEl(el, content) { | |
| return el.innerHTML = content; |
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
| function f(x) { | |
| return x * 10; | |
| } | |
| function g(x) { | |
| return x + 2; | |
| } | |
| f(g(2)); // 40 |
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
| const notifications = [ | |
| { | |
| date: "Nov 10, 2015 8:00:00", | |
| message: "Tagged in a photo", | |
| }, | |
| { | |
| date: "Nov 10, 2015 9:00:00", | |
| message: "Mentioned in a post", | |
| }, | |
| ]; |
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
| const notifications = [ | |
| { | |
| date: "Nov 10, 2015 8:00:00", | |
| message: "Tagged in a photo", | |
| }, | |
| { | |
| date: "Nov 10, 2015 9:00:00", | |
| message: "Mentioned in a post", | |
| }, | |
| ]; |
NewerOlder