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
[user] | |
name = Dave Lyon | |
email = [email protected] | |
[diff] | |
external = "mate" | |
[core] | |
editor = "mate -wl1" | |
excludes = "/Users/dlyon/.gitignore" |
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
# More ruby fun! | |
def power(base) | |
Proc.new {|x| base ** x } | |
end | |
base2 = power(2) # => #<Proc:0x00000001001569d0@-:4> | |
base2.call(8) # => 256 |
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
require 'image' | |
require 'movie' | |
require 'event_registry' | |
class HelioEvent | |
EVENT_STARTTIME_KEY = "event_starttime" | |
EVENT_ENDTIME_KEY = "event_endtime" | |
EVENT_ARCHIVEDATE_KEY = "kb_archivdate" | |
EVENT_UID_KEY = "kb_archivid" | |
EVENT_BBOX_KEY = "hpc_bbox" |
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
# Define an image as below, you can call it anything, and you can have several -- e.g. ActiveRegion_AIA171, ActiveRegion_AIA090 | |
class ActiveRegionImage < Image | |
layer :id => 1, :visible => :true, :opacity => 100 | |
types ["mobile","web"] | |
scale 2.63 | |
end | |
class ActiveRegionMovie < Movie | |
layer :id => 1, :visible => :true, :opacity => 100 | |
types ["mobile","web"] |
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
class Book | |
attr_accessor :title | |
attr_reader :isbn | |
attr_writer :owner | |
end | |
# This is identical to | |
class Book | |
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
require 'pathname' | |
require 'fileutils' | |
# @a = "/Users/dave/Desktop/hq-feeder/test-dirs/" | |
# @b = "/Users/dave/Desktop/hq-feeder/test-dirs2/" | |
# EXPORT_DIR = "/Users/dave/Desktop/hq-feeder/test-export-dirs/" | |
class ImageLoader | |
attr_reader :files |
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
SYSTEM_DEPENDENCIES = ["ruby", "rake", "gem"] | |
GEM_DEPENDENCIES = ["redis", "resque"] | |
def dependency_check(who) | |
if(system("which #{who}")) | |
puts "#{who} installed." | |
else | |
puts "#{who} missing." | |
end | |
end |
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
# | |
# Describing An Event: | |
# | |
# Define the image and movie classes: | |
class EventNameMovieAIA094_AIA131 < Movie | |
# Add up to 3 layers | |
# | |
# Parameters: | |
# id - the source id from Helioviewer of the image layer you'd like to add. See http://helioviewer.org/api/index.php?action=getDataSources for listing |
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
package client; | |
import java.awt.Point; | |
import java.util.Enumeration; | |
import java.util.Vector; | |
import client.BattleCharacter.CHARACTER_TYPE; | |
public class GoTeamVenture_AI extends AI{ |
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 void changeTargetIfNeeded() { | |
if ( targetEnemy == null || targetEnemy.isDead() ) | |
targetEnemy = getBestEnemyToAttack(); | |
} | |
public BattleCharacter getBestEnemyToAttack() { | |
BattleCharacter temp = null; | |
for(int i=0; i<enemyTeam.length; i++) { | |
if( temp == null || getValue(enemyTeam[i].getCharacterType().toString()) < getValue(temp.getCharacterType().toString())) | |
if(!enemyTeam[i].isDead()) |