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
<script> | |
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful | |
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it. | |
// The following will allow remote autocompletes *without* modifying any officially released core code. | |
// If others find ways to improve this, please share. | |
<!-- Typeahead by Charles Lawrence https://gist.github.com/1848558--> | |
<script type="text/javascript"> | |
var autocomplete = $('#stops').typeahead() | |
.on('keyup', function(ev){ |
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
public void paintComponent(Graphics page){ | |
//Drawing vertical lines | |
super.paintComponent(page); | |
for (int i = 1; i <= WIDTH/JUMP; i++){ | |
//X is reduced by 1 to accommodate snake body size of 11x11. Recall outer shell of snake body is 12x12 | |
page.drawLine(JUMP*i-1, JUMP*3, JUMP*i-1, WIDTH); | |
//Drawing horizontal lines | |
//Y is reduced by 1 to accommodate snake body size of 11x11. | |
if (i >= 3){ | |
page.drawLine(0,JUMP*i-1,WIDTH,JUMP*i-1); |
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
/** | |
* @author Jane Ullah | |
* @purpose Problem 9 - Project Euler | |
* @date 12/29/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem9 { | |
public static void main(String[] args) { | |
boolean matchFound = false; |
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
public static int parseString(String digits) { | |
int product = 1; | |
//Strips out non-word characters | |
digits = digits.replaceAll("\\W",""); | |
for (int i = 0; i < digits.length(); i++){ | |
product *= Integer.parseInt(digits.substring(i,(i+1))); | |
} | |
return (digits.length() > 0) ? product:0; | |
/* |
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
/** | |
* @author Jane Ullah | |
* @purpose Problem 8 - Project Euler | |
* @date 12/28/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem8 { | |
public static void main(String[] args) { | |
String digits = "73167176531330624919225119674426574742355349194934" |
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
/** | |
* @author Jane Ullah | |
* @purpose Problem 7 - Project Euler | |
* @date 12/27/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem7 { | |
public static void main(String[] args) { | |
int primeNum = 0, index = 0; |
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
/** | |
* @author Jane Ullah | |
* @purpose Problem 6 - Project Euler | |
* @date 12/26/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem6 { | |
public static void main(String[] args) { |
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
/** | |
* @author Jane Ullah | |
* @purpose Problem 5 - Project Euler | |
* @date 12/26/2011 | |
* @site http://janetalkscode.com | |
*/ | |
public class Problem5 { | |
public static void main(String[] args) { | |
int sum = 1, primeNum = 0; |
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
/** | |
* | |
* @author Jane Ullah | |
* @date 12/19/2011 | |
* @purpose Solving Problem 4 from ProjectEuler.net | |
* | |
*/ | |
public static void main(String[] args) { | |
/*if (isPalindrome(1222321)) { | |
System.out.println("Yes."); |
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
/** | |
* | |
* @author Jane Ullah | |
* @purpose Problem 3 - Project Euler | |
* @date 12/19/2011 | |
* | |
*/ | |
public static void main(String[] args) { |