This file contains 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
# Implement the sections of code marked TODO above. | |
# Rules for bidding: | |
# Agents always bid in sequence, e.g. agent 1 bids first, then agent 2, etc. | |
# The bidding starts with the first agent deciding on their initial bid (which will be returned by `get_bid_increase`). The amount can also be 0. | |
# The next agent (e.g. agent 2) must then increase their bid so that their bid is as much as any other agent's bid (which so far is only agent 1), or be forced to withdraw from the bidding completely. (if the agent has withdrawn, they will be skipped from here onwards). They may also decide to bid more, in which case the next agent has to match that higher bid (or withdraw). | |
# The bidding will come around to agent 1 again if their current bid does not match the highest bid. The agent must increase their bid (by returning the value they want to increase it by from `getBidIncrease`) so that their bid will match the highest bid that any other agent has put in so far, or withdraw from the bidding. They can als |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<mjml> | |
<mj-head> | |
<mj-include path="../../shared/head.mjml" /> | |
<mj-attributes> | |
<mj-class name="outer-border-empty-top" padding="0 1px 1px 1px" border-radius="6px" background-color="#E7E7ED" /> | |
</mj-attributes> | |
</mj-head> | |
<mj-body background-color="#f2f2f6"> | |
<mj-wrapper text-align="center" padding-top="0" padding-bottom="0"> |
This file contains 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 ruby:3.0-alpine | |
RUN apk add --no-cache --update \ | |
ack \ | |
bash \ | |
build-base \ | |
curl \ | |
htop \ | |
less \ | |
libsass \ |
This file contains 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
# example of using lookahead assertion to test password strength | |
# test if a given string contains at least a lowercase letter, a uppercase, a digit, a special char and 8+ chars | |
strong = "123ABCabc-" | |
strong[/^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\W]).{8,}$/] | |
# test if a given string contains at least a lowercase letter, a uppercase, a digit and 8+ chars | |
medium = "123ABCabc" | |
medium[/^(?=.*[a-zA-Z])(?=.*[0-9]).{8,}$/] |
This file contains 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 React, { PureComponent } from "react"; | |
// treating this as a parent component that has explicit knowledge of the presentation and behavior of it's | |
// children | |
class Dropdown extends PureComponent { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isOpen: false, |
This file contains 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
{ | |
"questions": { | |
"Onset Symptoms": [ | |
{ | |
"question": "Do you have a fever or a history of fever?", | |
"options": [ | |
"Yes", | |
"No", | |
"Unknown" | |
], |
This file contains 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
// we can use this as an example in video 3 | |
const mapFunction = () => { | |
// this function will be called with the context of | |
// this locked to the record in iteration | |
emit(this.user_name, this.price) | |
} | |
// Video 3 | |
const reduceFunction = (key, values) => { | |
return values.reduce((a, b) => a + b) |
This file contains 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
// assuming something we had a collection called movies and movies has two categories, action, comedy, | |
// and comedy has three sections (kevin hart, mike epps, chris rock) and action has three sections (chuck norris, jet li, jackie chan). | |
// if we were going to insert a document (movie) into the movies collection. | |
let movieOne = { _id: "Jolade's movie log", path: null } // the path null marks this as a root node | |
const m = db.movies.insert(movieOne) | |
//to declare a node to the category | |
const a = db.movies.insert({ path: `,${m._id},`, _id: "Jolade's movie log (action)" }) |
This file contains 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
AllCops: | |
Exclude: | |
- "vendor/**/*" | |
- "db/**/*" | |
- "bin/**/*" | |
- "config/**/*" | |
- "app/assets/**/*" | |
- "Rakefile" | |
- "spec/spec_helper.rb" | |
- "spec/rails_helper.rb" |
This file contains 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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"time" | |
"github.com/mongodb/mongo-go-driver/bson" |
NewerOlder