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 sys | |
def add_nums(nums): | |
return sum(nums) | |
args = sys.argv[1:] | |
nums = [float(arg) for arg in args] | |
result = add_nums(nums) | |
print(result) |
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
public class Foo : IFoo | |
{ | |
private IBar _bar; | |
public Foo() | |
{ | |
_bar = new Bar(); | |
} | |
// ... | |
} |
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
public class Foo : IFoo | |
{ | |
private IBar _bar; | |
public Foo() | |
{ | |
_bar = IocContainer.Resolve<IBar>(); | |
} | |
// ... | |
} |
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
public class Foo : IFoo | |
{ | |
private IBar _bar; | |
public Foo(IBar bar) | |
{ | |
_bar = bar; | |
} | |
// ... | |
} |
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
export class AppComponent { | |
constructor(dataService: DataService) { | |
} | |
} |
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
<html> | |
<!-- header --> | |
<body> | |
<div class="container"> | |
<div class="jumbotron"> | |
<h1>Boggle Dictionary</h1> | |
<p class="lead"> Find your Boggle word</p> | |
<div class="input-group input-group-lg"> | |
<input type="text" id="lookup" class="form-control" placeholder="Search"> | |
<span class="input-group-btn"> |
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
var dictionary = { | |
"aa": ["AA n pl. -S rough, cindery lava"], | |
"aah": ["AAH v -ED, -ING, -S to exclaim in amazement, joy, or surprise"], | |
"aahed": ["AAH v -ED, -ING, -S to exclaim in amazement, joy, or surprise"], | |
"aahing": ["AAH v -ED, -ING, -S to exclaim in amazement, joy, or surprise"], | |
"aahs": ["AAH v -ED, -ING, -S to exclaim in amazement, joy, or surprise"], | |
"aal": ["AAL n pl. -S an East Indian shrub"], | |
"aalii": ["AALII n pl. -S a tropical tree"], | |
"aaliis": ["AALII n pl. -S a tropical tree"], | |
"aals": ["AAL n pl. -S an East Indian shrub"], |
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
$(document).ready(function() { | |
$('#lookup') | |
.focus(function() { | |
$(this).select(); | |
}) | |
.keypress(function(e) { | |
if (e.which == 13) { | |
$("#submit") | |
.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
function lookup(search_term) { | |
var results = {}; | |
search_term = search_term.trim(); | |
var pattern = new RegExp('^' + search_term + '$', 'i'); | |
pattern.compile(pattern); | |
for (var word in dictionary) { | |
if (pattern.test(word)) { | |
results[word] = dictionary[word]; | |
} | |
} |
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
<script id="results-template" type="text/x-handlebars-template"> | |
<div class="match_count"> | |
Matches found for | |
<span class="search-term">"{{search_term}}"</span> | |
<span class="badge">{{num_results}}</span> | |
</div> | |
{{#if has_results}} {{#each results}} | |
<ul class="list-group"> | |
<li class="list-group-item list-group-item-success definition-header">{{@key}}</li> |
OlderNewer