- Deck
- Card
- Answer
I want to select the cards for a given deck that have been answered the longest ago.
--(jadams@viggyviggy)-(23/pts/1)-(1124/23-Apr-12)-- | |
--($:~/projects/USPTO_dir_api)(master)-- | |
$ mvn clean install | |
[INFO] Scanning for projects... | |
Downloading: http://repo.maven.apache.org/maven2/com/o19s/uspto/solr/solr_service_pom/1.0/solr_service_pom-1.0.pom | |
[ERROR] The build could not read 3 projects -> [Help 1] | |
[ERROR] | |
[ERROR] The project com.o19s.uspto.solr:solr_service:1.0 (/home/jadams/projects/USPTO_dir_api/ejb/pom.xml) has 1 error | |
[ERROR] Non-resolvable parent POM: Could not find artifact com.o19s.uspto.solr:solr_service_pom:pom:1.0 in central (http://repo.maven.apache.org/maven2) and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2] | |
[ERROR] |
#I'm implementing a flashcard learning system. I have cards and answers. I want a SQL query that will return the card that has been answered longest ago (so if you've not answered a card in a long time, you should be more likely to see it) | |
SELECT DISTINCT "cards".id FROM "cards" LEFT OUTER JOIN "answers" ON "answers"."card_id" = "cards"."id" LEFT OUTER JOIN "decks" ON "decks"."id" = "cards"."deck_id" WHERE (deck_id = 1) ORDER BY answers.created_at ASC LIMIT 1 |
#require './config/environment' # FIXME REMOVE | |
require 'grit' | |
require 'fileutils' | |
namespace :git_repos do | |
desc "Clone or update git repos for all projects" | |
task :create => :environment do | |
workspace_dir = File.join(Rails.root, "tmp", "xrono_git_workspace") | |
puts "Creating workspace directory at #{workspace_dir}" | |
FileUtils.rm_rf File.join(workspace_dir) if Dir.exists?(workspace_dir) | |
Dir.mkdir( workspace_dir ) |
When /^I select classification "([^"]*)"$/ do |classification| | |
facet_link(classification).click | |
end | |
When /^I expand classification "([^"]*)"$/ do |classification| | |
facet_hitarea_element(classification).click | |
end | |
Then /^I should have classification "([^"]*)" applied$/ do |classification| | |
classification_filter(classification).text.should_not == "" |
# Generates the link to determine where the site bar switch button returns to. | |
def site_bar_switch_link(html_options = {}) | |
admin? ? admin_switch_link(html_options) : frontend_switch_link(html_options) | |
end | |
def admin_switch_link(html_options = {}) | |
link_to t('.switch_to_your_website', site_bar_translate_locale_args), | |
session[:website_return_to] || refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)), | |
html_options | |
end |
# Generates the link to determine where the site bar switch button returns to. | |
def site_bar_switch_link | |
link_to_if(admin?, t('.switch_to_your_website', site_bar_translate_locale_args), | |
#(if session.keys.map(&:to_sym).include?(:website_return_to) and session[:website_return_to].present? | |
#session[:website_return_to] | |
#else | |
#refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)) | |
#end)) do | |
session[:website_return_to] || refinery.root_path(:locale => (Refinery::I18n.default_frontend_locale if Refinery.i18n_enabled?)) |
clear Lock | |
keycode 0x42 = Escape |
nested_vendored_plugins = Dir["./vendor/plugins/mapto/vendor/plugins/**"] | |
nested_vendored_plugins = Dir["./vendor/plugins/mapto/vendor/cms/vendor/plugins/**"] + nested_vendored_plugins | |
# THIS DOES NEAT STUFF DON'T REMOVE | |
inject_nested_plugin = Proc.new do |plugin| | |
eval <<-EOF | |
config.plugin_locators.unshift( | |
Class.new(Rails::Plugin::Locator) do | |
def plugins | |
[Rails::Plugin.new(File.expand_path("#{plugin}"))] | |
end |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
export HISTCONTROL=ignoredups | |
export EDITOR=vim | |
# Amazon's Web Services | |
export EC2_HOME=~/software/ec2 |