Skip to content

Instantly share code, notes, and snippets.

# 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
<?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">
@Hasstrup
Hasstrup / Dockerfile
Created April 12, 2021 09:05 — forked from hopsoft/Dockerfile
Dockerize your Rails app
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
htop \
less \
libsass \
@Hasstrup
Hasstrup / password_strength.rb
Created November 2, 2020 03:08 — forked from lucasdavila/password_strength.rb
Password strength with regex in Ruby
# 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,}$/]
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,
{
"questions": {
"Onset Symptoms": [
{
"question": "Do you have a fever or a history of fever?",
"options": [
"Yes",
"No",
"Unknown"
],
// 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)
// 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)" })
AllCops:
Exclude:
- "vendor/**/*"
- "db/**/*"
- "bin/**/*"
- "config/**/*"
- "app/assets/**/*"
- "Rakefile"
- "spec/spec_helper.rb"
- "spec/rails_helper.rb"
package main
import (
"context"
"flag"
"fmt"
"log"
"time"
"github.com/mongodb/mongo-go-driver/bson"