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
/** | |
* Write a description of class Account here. | |
* | |
* @author Tate Johnson | |
* @version 2008-08-07 | |
*/ | |
public class Account { | |
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
/** | |
* Write a description of class AccountTester here. | |
* | |
* @author Tate Johnson | |
* @version 2008-07-08 | |
*/ | |
public class AccountTester { | |
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 Tate Johnson | |
* @version 2008-08-20 | |
*/ | |
public class Lab5 { | |
// Instance variable | |
private double[] data; | |
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 java.util.Random; | |
/** | |
* Class GameBoard for Lab7 | |
* | |
* @author Tate Johnson | |
* @version 2008-09-02 | |
*/ | |
public class GameBoard { |
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
# Ruby implementation of Lab 7 for 1005ICT (Java Programming) at Griffith Univeristy. | |
# Why? To practice learning Ruby | |
class GameBoard | |
attr_accessor :board | |
def initialize(row, col) | |
@board = Array.new(row) { |row| Array.new(col, 0) } | |
end |
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
def get_response_from_remote(url, retry_count, timeout_in_seconds) | |
begin | |
url = URI.parse(url) | |
timeout(timeout_in_seconds) do | |
Net::HTTP.start(url.host) do |session| | |
if url.query | |
response = session.get(url.path + "?" + url.query) | |
else | |
response = session.get(url.path) | |
end |
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
/** | |
* Charges annual fee on all accounts if an annual fee is applicable. Returns | |
* total amount of revenue collected by summing the rates of all annual fees charged | |
* | |
* @return Sum of annual fees charged | |
*/ | |
public int chargeAnnualFees() | |
{ | |
int totalAnnualFees = 0; | |
for (Account account : accounts) |
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
# Now playing script for Irssi which retrieves your currently listened to song from the Last.fm API | |
# | |
# 1) Define your last.fm username and api account key | |
# 2) Load script in to Irssi "/script load lastfm" (Assuming you've placed the script in .irssi/scripts) | |
# 3) Execute script from witin Irssi "/np" | |
my $user = "<USERNAME>"; | |
my $api_key = "<API_KEY>"; | |
##### DO NOT EDIT BELOW THIS LINE ##### |
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
// Enhanced for loop (For each) | |
public int sum(int[] nums) | |
{ | |
int sum = 0; | |
for (int num : nums) | |
{ | |
sum += num * num | |
} | |
return sum; | |
} |
OlderNewer