We've learned that each device connected to a network is assigned an IP address. This includes your mobile phones and computers, and if you have a toaster that's hooked up to the Internet then your toaster, too.
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
#include <iostream> | |
using namespace std; | |
int FirstFactorial(int num) { | |
// set the limit to the number provided | |
int limit = num; | |
for (int i = 1; i < limit; ++i) { | |
num = num * i; | |
} | |
return num; |
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 turtle | |
def drawSquare(my_turtle): | |
my_turtle.color("red") | |
for i in range(4): | |
my_turtle.forward(100) | |
my_turtle.right(90) | |
def drawSomethingCool(my_turtle): | |
my_turtle.color("yellow") |
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
/* | |
time: O(log n) | |
space: O(1) | |
*/ | |
function binarySearch(value, array) { | |
let start = 0 | |
let end = array.length |
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
/* | |
time: O(m + n) | |
space: O(n) // whichever is smaller | |
arr1 = [ 1, 2, 3, 5, 6, 7 ] | |
^ | |
arr2 = [ 3, 6, 7, 8, 20 ] | |
^ | |
arr3 = [ 3, 6, 7 ] |
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
function hasDuplicateValue(array) { | |
let counter = 0 | |
for (let i = 0; i < array.length; i++) { | |
for (let j = 0; j < array.length; j++) { | |
counter++ | |
if (i !== j && array[i] === array[j]) { | |
return true | |
} | |
} | |
} |
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
class Payment { | |
constructor() { | |
this.paymentMethod = '' | |
} | |
setPaymentMethod(paymentMethod) { | |
this.paymentMethod = paymentMethod | |
} | |
pay(amount) { |
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
{ | |
"11111" : "a", | |
"11112" : "a&p", | |
"11113" : "a's", | |
"11114" : "aa", | |
"11115" : "aaa", | |
"11116" : "aaaa", | |
"11121" : "aaron", | |
"11122" : "ab", | |
"11123" : "aba", |
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
open -a safari https://youtu.be/X2W3aG8uizA | |
osascript -e 'set volume output volume 100' |
9 steps to better software design today, by Jeff Bay
- http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf
- http://www.pragprog.com/titles/twa/thoughtworks-anthology
We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from our old procedural code, allowing us to write software incrementally, reusing as we go along. But sometimes it seems like we’re just chasing down the
NewerOlder