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
// returns true if mattern appears in string | |
public static boolean iregex(String pattern, String string) { | |
Pattern p = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE); | |
Matcher m = p.matcher(string); | |
return m.find(); | |
} |
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
require 'lib/scrubyt' | |
@extractor = Scrubyt::Extractor.new do | |
fetch "http://www.google.com/search?&q=ruby" | |
books "ul.results li" do | |
title "//h2" | |
author "p.author" | |
book_detail "h2 a" do | |
name "//title" | |
summary "//p[1]" | |
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
var HijaxDefaultAnimations = new Class({ | |
initAnimations: function(hijaxMaster) { | |
this.hijaxMaster = hijaxMaster; | |
this.initOutAnimations(); | |
}, | |
hijaxMaster: undefined, | |
initOutAnimations: function() { | |
this.hijaxMaster.addEvent('animateOut', function() { | |
contents = $('content').getChildren(); | |
// "this" here is not evaluated until inside the event handler -----------v |
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
I have indices on orfs.contig_id and contigs.assembly_id. It only seems to be using the latter for some reason. |
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
4. Integrate Project D (replace Goldberg pieces and upgrade Rails) | |
5. Integrate and update Cucumber test framework | |
6. Finish up my work on reputation integration | |
7. Fix bugs assigned to me | |
8. Integrate other projects from last semester | |
9. Fix bugs from the issue tracker |
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 the college board schools | |
imported_schools = import_from(dat_file) | |
# Find schools matching CBIDs, combine ones with the same CBID, and update that school's data | |
for each college_board_school in imported_schools: | |
matching_robertson_schools = find_schools_by_cbid(college_board_school.cbid) # There are sometimes several that match a CBID | |
keeper_school = matching_robertson_schools.first | |
keeper_school.update_info_using(college_board_school) | |
duplicate_schools = matching_robertson_schools[1..-1] | |
for each duplicate in duplicate_schools: |
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
class TreeNode | |
constructor: (@tree, @id, @name, @data={}, @children=[]) -> | |
@set_color() unless @data.$color | |
@name = @id if !@name? or @name.blank() | |
@create_root: (tree) -> # acts as a TreeNode class method. Called like TreeNode.create_root(tree) | |
new this tree, 'root' | |
# "new this" is incorrect and does not work. | |
# I want to call the equivalent of "new VariationTreeNode(...)" or "new ProfileTreeNode(...)", |
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
# No need to require aquarium; adding aquarium to the Gemfile takes care of that | |
class ActionController::Base | |
include Aquarium::DSL | |
around :methods => :all do |join_point, object, *args| | |
logger.info "[info] Entering: #{join_point.target_type.name}##{join_point.method_name}: object = #{object}, args = #{args}" | |
result = join_point.proceed | |
logger.info "[info] Leaving: #{join_point.target_type.name}##{join_point.method_name}: object = #{object}, args = #{args}" | |
result # block needs to return the result of the "proceed"! | |
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
/!\ FAILSAFE /!\ 10/31/2011 09:59 AM | |
Status: 500 Internal Server Error | |
private method `split' called for nil:NilClass | |
vfs:/home/edwarda/torquebox/robertson_scholars/vendor/plugins/feedback_notifier/lib/feedback_notification/feedback_notifiable.rb:56:in `post_data' | |
vfs:/home/edwarda/torquebox/robertson_scholars/vendor/plugins/feedback_notifier/lib/feedback_notification/feedback_notifiable.rb:51:in `post_data_from_exception' | |
vfs:/home/edwarda/torquebox/robertson_scholars/vendor/plugins/feedback_notifier/lib/feedback_notification/feedback_notifiable.rb:9:in `rescue_action_in_public' | |
/home/edwarda/.rvm/gems/jruby-1.6.5@robertson_scholars/gems/actionpack-2.3.14/lib/action_controller/rescue.rb:154:in `rescue_action_without_handler' | |
/home/edwarda/.rvm/gems/jruby-1.6.5@robertson_scholars/gems/actionpack-2.3.14/lib/action_controller/rescue.rb:73:in `rescue_action' | |
org/jruby/RubyKernel.java:2097:in `send' | |
/home/edwarda/.rvm/gems/jruby-1.6.5@robertson_scholars/gems/actionpack-2.3.14/lib/ |
OlderNewer