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
Index: ext/readline/readline.c | |
=================================================================== | |
--- ext/readline/readline.c (revision 45224) | |
+++ ext/readline/readline.c (revision 45225) | |
@@ -1974,7 +1974,7 @@ | |
rl_attempted_completion_function = readline_attempted_completion_function; | |
#if defined(HAVE_RL_PRE_INPUT_HOOK) | |
- rl_pre_input_hook = (Function *)readline_pre_input_hook; | |
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook; |
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 'spec_helper' | |
module GEDCOMParser | |
describe Parser do | |
let(:output) { double('output').as_null_object } | |
let(:parser) { Parser.new(output) } | |
describe '#open_ged_file' do | |
it "complains and stops whine when run without a filename" do |
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 unittest | |
from StringIO import StringIO | |
import rpn_calc | |
class RPNTest(unittest.TestCase): | |
def setUp(self): | |
self.rpn = rpn_calc.RPN() |
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
(defpackage :verbquiz | |
(:use :common-lisp)) | |
(in-package :verbquiz) | |
(defparameter *dictionary* (make-hash-table :test #'equal)) | |
(defun save-dictionary (&key (filename "dictionary.db")) | |
"Save the program *dictionary* in utf-8 format." | |
(with-open-file (out filename |
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 Parser | |
def initialize(output) | |
@output = output | |
end | |
def open_ged_file(file) | |
if file.strip.empty? | |
@output.puts "Can't parse without a GEDCOM file name" | |
exit | |
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
# app/models/user.rb | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, :confirmable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :password, :password_confirmation, :remember_me |
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
# sieve of eratosthenes | |
import math | |
import time | |
class Sieve(object): | |
def find_primes_to_max(self, n): | |
n += 1 | |
primes_filter = [0] * n |
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 sys | |
class RPN(object): | |
def __init__(self): | |
self._stack = [] | |
self._expr = '' | |
self._operators = '+-*/' | |
def read_expr(self, out=sys.stdout): |
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
#ifndef __LIST_H | |
#define __LIST_H | |
/* This file is from Linux Kernel (include/linux/list.h) | |
* and modified by simply removing hardware prefetching of list items. | |
* Here by copyright, credits attributed to wherever they belong. | |
* Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu) | |
*/ | |
/* |
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
/* GLIB - Library of useful routines for C programming | |
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public | |
* License as published by the Free Software Foundation; either | |
* version 2 of the License, or (at your option) any later version. | |
* | |
* This library is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
NewerOlder