Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<div class="main-wrapper"> | |
<div class="header"><h1>Vue Shopping Cart</h1></div> | |
<div id="vue"> | |
<cart :cart="cart" :cart-sub-total="cartSubTotal" :tax="tax" :cart-total="cartTotal" :checkout-bool="checkoutBool"></cart> | |
<products :cart="cart" :cart-sub-total="cartSubTotal" :tax="tax" :cart-total="cartTotal" :products-data="productsData"></products> | |
<checkout-area v-if="checkoutBool" :cart="cart" :tax="tax" :cart-sub-total="cartSubTotal" :cart-total="cartTotal" :products-data="productsData" :total-with-tax="totalWithTax"></checkout-area> | |
</div> | |
</div> |
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 that checks if 5 cards build a two-pairs hand | |
# A card is a number between 0 and 51. | |
# The value of a card is its number modulo 13. | |
# The suit of a card is its number div 4. | |
def is_two_pairs(c1, c2, c3, c4, c5): | |
assert len({c1, c2, c3, c4, c5}) == 5 | |
counts = dict() | |
for i in (c1, c2, c3, c4, c5): | |
counts[i % 13] = counts.get(i % 13 , 0) + 1 | |
return len(counts) == 3 and sorted(counts.values())[-1] == 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
use std::collections::HashMap; | |
fn is_two_pairs(c1: u32, c2: u32, c3: u32, c4: u32, c5: u32) -> bool { | |
let mut hand: HashMap<u32, u32> = HashMap::new(); | |
*hand.entry(c1 % 13).or_insert(0) += 1; | |
*hand.entry(c2 % 13).or_insert(0) += 1; | |
*hand.entry(c3 % 13).or_insert(0) += 1; | |
*hand.entry(c4 % 13).or_insert(0) += 1; | |
*hand.entry(c5 % 13).or_insert(0) += 1; | |
if (hand.len() != 3) { |
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
mkdir -p /home/vagrant/.ssh | |
rm /home/vagrant/.ssh/* | |
wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys | |
chmod 0700 /home/vagrant/.ssh | |
chmod 0600 /home/vagrant/.ssh/authorized_keys | |
chown -R vagrant /home/vagrant/.ssh |
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
# We define our solver. | |
solver = pywraplp.Solver('StudentProjectGridCBC', pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING) | |
# We define the set of assignments that represent a solution; each cell is either 0 or 1. | |
matches = {} | |
for student in STUDENTS: | |
for project in PROJECTS: | |
matches[student, project] = solver.IntVar(0, 1, 'matches[%s,%s]' % (student, project)) | |
# We define the objective function we want to minimize. |
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
Verifying that +sahuguet is my Bitcoin username. You can send me #bitcoin here: https://onename.io/sahuguet |