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
# Generate your list of dates | |
mydays <- seq.Date( as.Date('2015-01-01'), as.Date('2015-03-09'), by="day") | |
# Write function to sum the number of open dates that occur in sourceData at least 31 days prior to given date. | |
numOpenDates <- function( givenDate ){ | |
retValue <- sum( (givenDate - sourceDate$openDate) > 30 ) | |
retValue | |
} | |
# Apply function to each date in your list of dates(mydays) |
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
# Simple ActiveFedora9 (Fedora4) Example | |
# Make sure hyda-jetty, using the fedora-4/edge branch, is running (rake jetty:start) | |
require "active_fedora" | |
class Dum < ActiveFedora::Base | |
# The Hydra convention is to minimally have descriptive and rights metadata. | |
# The Fedora4 paradigm is to define properties directly on the object as opposed to the datastreams of Fedora3 | |
property :title, predicate: ::RDF::DC.title |
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 'nokogiri' | |
# The following illustrates unexpected behavior of the Nokogiri::XML::Document.add_child method. | |
# When called from a new document, the behavior is different depending on if the argument | |
# is a newly created node or duplicate node. | |
# String of XML for Nokogiri to parse. | |
dummy_xml = '<?xml version="1.0" encoding="UTF-8"?> | |
<root> | |
<Dummy>Text1</Dummy> |
NewerOlder