A simple method for comparing small, similar graphs. Two linked views are presented, showing differences as "phantom" nodes and links. The views share the same layout, ensuring comparability.
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 Date | |
| def step_by_month(to_date, step=1) | |
| date = self | |
| op = %w(- <= >=)[step <=> 0] | |
| while date.__send__(op, to_date) | |
| yield(date) | |
| date >>= step | |
| end | |
| 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
| require 'omniauth' | |
| require 'omniauth-saml' | |
| class MultiProviderSamlHandler | |
| UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ | |
| attr_reader :path_prefix, :provider_name | |
| def initialize(path_prefix: OmniAuth.config.path_prefix, provider_name: 'saml') | |
| @path_prefix = path_prefix |
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
| ## http://stackoverflow.com/questions/7145256 | |
| module FactoryGirl | |
| module Strategy | |
| class Find | |
| def association(runner) | |
| runner.run | |
| end | |
| def result(evaluation) | |
| build_class(evaluation).where(get_overrides(evaluation)).first |
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
| # encoding: UTF-8 | |
| utf8_resume = "Résumé" | |
| latin1_resume = utf8_resume.encode("ISO-8859-1") | |
| latin9_resume = utf8_resume.encode("ISO-8859-15") | |
| lower_spanish = "\u00E1 \u00E9 \u00ED \u00F3 \u00FA \u00F1".encode("UTF-8") | |
| puts lower_spanish | |
| upper_spanish = "\u00C1 \u00C9 \u00CD \u00D3 \u00DA \u00D1".encode("UTF-8") | |
| puts upper_spanish |
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
| activemq:activemq | |
| ant:ant-optional | |
| ant:ant-trax | |
| ant:optional | |
| aptconvert:aptconvert | |
| biz.neustar:browsermob-proxy | |
| bsh:bsh | |
| cactus:cactus | |
| cactus:cactus.core.framework.uberjar.javaEE.12 | |
| cactus:cactus.core.framework.uberjar.javaEE.13 |
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 'selenium-webdriver' | |
| require 'capybara' | |
| require 'rspec' | |
| require 'launchy' | |
| require 'active_support' | |
| require 'active_support/inflector' | |
| require 'headless' | |
| require 'ruby-debug' | |
| require 'webdriver-user-agent' | |
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 'rails_helper' | |
| require 'capybara/rspec' | |
| require 'selenium-webdriver' | |
| require 'site_prism' | |
| Capybara.server = :puma, { Silent: true } | |
| Capybara.server_host = `hostname`.strip.downcase | |
| Capybara.server_port = 3002 | |
| Capybara.default_max_wait_time = 5 |
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
| dataset = [18.562874251497007, 20.958083832335326, 18.562874251497007, 19.161676646706585, 22.75449101796407] | |
| diff = 100 - dataset.map(&:floor).reduce(&:+) | |
| rounded_percentages = dataset | |
| .sort_by { |x| x.floor - x} | |
| .map | |
| .with_index { |e, index| index < diff ? e.floor + 1 : e.floor } |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> | |
| void bubbleSort(int arr[], int count); | |
| void quicksort(int arr[], int left, int right); | |
| void insertionSort(int arr[], int count); | |
| void selectionSort(int arr[], int count); | |
| void shellSort(int arr[], int count); | |
| void heapSort(int arr[], int count); |