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
#include <stdio.h> | |
#include <stdlib.h> | |
int str_len (char* myStr) | |
{ | |
int length = 0; | |
while (1) | |
{ | |
if (myStr[length] == '\0') | |
break; |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement () { | |
if (this.get('isFocused')) | |
this.$('input').focus() | |
} | |
}); |
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
{ | |
"data": [ | |
{ | |
"_id": "ember-frost-navigation@5.0.3", | |
"type": "repository", | |
"attributes": { | |
"name": "ember-frost-navigation", | |
"source": "GitHub", | |
"user": "", | |
"version": "5.0.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
let Point = function (x, y) { | |
this.x = x | |
this.y = y | |
} | |
let Triangle = function (p1, p2, p3) { | |
this.p1 = p1 | |
this.p2 = p2 | |
this.p3 = p3 | |
} |
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
#!/bin/bash | |
set -ev | |
# Blow up current dist | |
rm -rf dist; | |
# Build it | |
ember build --prod; | |
# Initialize dist as it's own repo | |
URL=$(git remote get-url origin); | |
cd dist; | |
git init; |
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
Array.prototype.equals = function (array) { | |
// if the other array is a falsy value, return | |
if (!array) | |
return false; | |
// compare lengths - can save a lot of time | |
if (this.length != array.length) | |
return false; | |
for (var i = 0, l=this.length; i < l; i++) { |
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
#!/usr/bin/env node | |
/** | |
* Suppose you want to place gasoline stations at various locations along a highway. | |
* For simplicity, let us model the highway as the X-axis. | |
* You have a list of potential locations for the gas stations x1 , x2 , . . . , xn . | |
* For each location, you have an estimated revenue r1 , r2 , . . . , rn . | |
* However, for environmental reasons, the distance between two gas stations must be at least 20 kilometers, | |
* that is for two consecutive gas stations xi and xj, we must have xj − xi ≥ 20. | |
* Design a placement algorithm that will optimize your estimated revenue. | |
* For example, if your possible station locations are (2, 17, 24, 32, 48), |
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
Given | |
G = (V,E) | |
s = some arbitrary starting vertex v in V | |
wt = function that returns the weight of e given edge | |
d = {} | |
S = {} -> Result set | |
Q = V | |
for each v in V | |
d[v] = Infinity |
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
A graph is said to be 2 connected if from every pair of vertices (u,v), there exists a vertex disjoint path from u to v. | |
That is to say that for every vertex x in V(G), G - x is still connected. | |
Theorem 1 (Whitney, 1927) | |
A connected graph G with at least | |
three vertices is 2-connected iff for every two vertices x, y ∈ | |
V (G), there is a cycle containing both. | |
If every two vertices belong to |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
OlderNewer