gcc -O3 -funroll-loops pascal.c && time ./a.out
| [user] | |
| # be sure to replace this | |
| email = [email protected] | |
| name = Ikechi Michael | |
| [alias] | |
| squash = !git reset $(git merge-base develop $(git rev-parse --abbrev-ref HEAD)) | |
| current-branch = !git rev-parse --abbrev-ref HEAD | |
| publish = !git push --set-upstream origin $(git current-branch) | |
| ignore = !curl https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore -O && mv Node.gitignore .gitignore | |
| license-mit = !curl https://raw.githubusercontent.com/angular/angular.js/master/LICENSE -O |
| // See https://github.com/bportaluri/WiFiEsp | |
| // See blog post https://medium.com/@mykeels/connect-to-wifi-with-arduino-9eee4b02d904 | |
| #include <WiFiEsp.h> | |
| #ifndef HAVE_HWSERIAL1 | |
| #include <SoftwareSerial.h> | |
| SoftwareSerial wSerial(6, 7); | |
| #endif | |
| void setup() { |
| /** | |
| copy & paste into the browser console | |
| on https://boards.greenhouse.io/andela | |
| */ | |
| (() => { | |
| // create display box | |
| if (!$('#count-popover').length) { | |
| $('#footer').append(`<div style="position:fixed;height:200px;width:200px;left:calc(50% - 100px);top: calc(50% - 100px);border:2px solid black;background-color: white;font-size: 50px;text-align: center;line-height: 200px;" id="count-popover">0</div>`) | |
| } |
Write a Fork Bomb in Browser JavaScript that keeps opening browser windows.
| #!/bin/bash | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | |
| INTEROP_FOLDER="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static" | |
| BACKUP_FILE="$DIR/backup/ssb-interop.js" | |
| if [ -f "$BACKUP_FILE" ] | |
| then | |
| cp "$BACKUP_FILE" "$INTEROP_FOLDER" |
| document.addEventListener('DOMContentLoaded', function() { | |
| $.ajax({ | |
| url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css', | |
| success: function(css) { | |
| let overrides = ` | |
| code { background-color: #535353; color: #85c5ff; } /* Change color: to whatever font color you want */ | |
| .c-mrkdwn__pre, .c-mrkdwn__quote { background: #535353 !important; background-color: #535353 !important; } | |
| ` | |
| $("<style></style>").appendTo('head').html(css + overrides); | |
| } |
| { | |
| "Vue Template": { | |
| "prefix": "VueTemplate", | |
| "body": [ | |
| "<template>", | |
| "\t$0", | |
| "</template>", | |
| "", | |
| "<script>", | |
| "\texport default {", |
The car manufacturer Honda holds their distribution system in the form of a tree (not necessarily binary). The root is the company itself, and every node in the tree represents a car distributor that receives cars from the parent node and ships them to its children nodes. The leaf nodes are car dealerships that sell cars direct to consumers. In addition, every node holds an integer that is the cost of shipping a car to it.
Take for example the tree below:
See SampleTree.json
A path from Honda's factory to a car dealership, which is a path from the root to a leaf in the tree, is called a Sales Path. The cost of a Sales Path is the sum of the costs for every node in the path. For example, in the tree above one Sales Path is 0→3→0→10, and its cost is 13 (0+3+0+10).
