Skip to content

Instantly share code, notes, and snippets.

View danker's full-sized avatar

Eric Danker danker

  • Breo Media LLC
  • St. Louis
View GitHub Profile
#include <stdio.h>
/*
* If you pay $4.00 for a latte that costs
* $3.10, how much change do you get?
*/
int main() {
long change = 400 - 310;
printf("change = $%ld.%02ld\n", change/100, change%100);
return 0;
(1..100).each { num ->
out = ((num % 3) == 0) ? 'Fizz' : ''
if ((num % 5) == 0) out += 'Buzz'
if (out.length() == 0) out = num
println out
}
100.times {
displayNum = ++it
def matched = false
if ((displayNum % 3) == 0) {
print "FIZZ"
matched = true
}
// Required jars (I know, I know...I should investigate Grape)
// nekohtml.jar
// xercesimpl.jar
// Define the pages which contain links to products - our "seeds" in crawl parlance.
def seeds = ["http://www.foodnetwork.com/shows/guys-diners-drive-ins-and-dives/index.html"]
// Load the NekoHTML parser with Xerces - this lets us parse the HTML.
slurper = new XmlSlurper(new org.cyberneko.html.parsers.SAXParser())