group :development, :test do
gem 'rspec-rails', '~> 3.0.0'
gem 'factory_girl_rails'
gem 'capybara'
gem 'database_cleaner'
end
def solution(a, x, d)
k = a.size
position = 0
if position+d >= x
return 0;
end
(0..k).each do |i|
if (a[i] - position) <= d
# 1) If the elements of index i and (i+1) are equal then, double the value at index i
# and replace the element at index (i+1) with 0.
#
# 2) If the element at index i is 0, then ignore it.
#
# 3) Any number (element in an array) must be modified only once.
#
# 4) At the end, shift all the zeros (0s) to the right of the array and remaining
# nonzeros to the left of the array.
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
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 User < ApplicationRecord | |
has_many :posts | |
has_many :comments | |
# id :integer not null, primary key | |
# name :string(50) default("") | |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN3A4R4IpK9kVu9zf8Fh410FZJbTl8PZG6QgPi76jBINLoj3Vr1OAdfHEmopfIlaT4Ce4r3gk0SauTqkSwujCM9I+VzvejRBMOcUU9iW3tBVYpNfYeB856mHvB3DF3fVD6OtgufaKh6OkjPxfg7kU+xRWcana3X02631Z46/2ZY9gKqr4ao0WkLn+ylj9huKawJkwbvAzAb/ieG16ut0BwAmZUAF1tqtShfNY+1EbiJRWU7oP8h7YUM2p9x1zHw07NKhgf+HAZd8XAjbgup6qyegWhjeDWK/g3x4WyQMR2KNNA90iG2LiUHI/yiFcjWqDOrw9LJrXYqAYuSegN/NNJ ahmadhassan@ahmads-mbp |
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 'formula' | |
class Imagemagick < Formula | |
homepage 'http://www.imagemagick.org' | |
url 'http://www.imagemagick.org/download/releases/ImageMagick-6.7.7-10.tar.xz' | |
sha256 '85b0f9afe122c52a821001976a4f54ae011bb3d94a87b97e3112e515185731ad' | |
head 'https://www.imagemagick.org/subversion/ImageMagick/trunk', | |
:using => UnsafeSubversionDownloadStrategy |
OlderNewer