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
defmodule Stats.Repo.Migrations.AddFeatureImageClickEventTrigger do | |
use Ecto.Migration | |
def up do | |
execute "DROP FUNCTION IF EXISTS ad_unit_current_reports_update() CASCADE;" | |
execute """ | |
CREATE OR REPLACE FUNCTION ad_unit_current_reports_update() returns trigger as $$ | |
declare | |
category varchar(20); |
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
''' | |
Problem 1 | |
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17 | |
Find the sum of all the primes below 2 million. | |
Problem 2 | |
Which prime, below one million, can be written as the sum of the | |
most consecutive primes? | |
''' |
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
str = gets.chomp # Take text input from console | |
# scan the text to remove punctuations and split | |
str = str.scan(/[\w']+/) | |
# create a Hash for storing the word count | |
words = Hash[str.uniq.map{ |i| [i, str.count(i)] }] | |
# print the number of times each word has been shown | |
for word, count in words | |
puts("#{word} = #{count}") | |
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
# I/O file location | |
file_path = "/home/emu/RubyProjects/Bumbung/words.txt" # words.txt file downloaded from the question link | |
output_path = "/home/emu/RubyProjects/Bumbung/palindrome.txt" | |
# read words from file | |
File.open(file_path, "r") do |f| | |
f.each_line do |line| | |
# remove punctuations from word, then downcase word to ignore case | |
str = line.gsub(/[^a-zA-Z0-9\-]/,"").downcase |
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
{ | |
"name": "median-client", | |
"version": "0.0.0", | |
"license": "MIT", | |
"angular-cli": {}, | |
"scripts": { | |
"start": "http-server", | |
"lint": "tslint \"src/**/*.ts\"", | |
"test": "ng test", | |
"pree2e": "webdriver-manager update", |
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
{ | |
"name": "median-client", | |
"version": "0.0.0", | |
"license": "MIT", | |
"angular-cli": {}, | |
"scripts": { | |
"start": "http-server", | |
"lint": "tslint \"src/**/*.ts\"", | |
"test": "ng test", | |
"pree2e": "webdriver-manager update", |
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
Folder sturcture: | |
- Datapanel | |
- datapanel.component.ts | |
- datapanel.html | |
- datapanel.module.ts | |
- DataConnector | |
- dataconnector.component.ts | |
- database-information.service.ts | |
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
group :development, :test do | |
gem 'capistrano', '~> 3.2.1' | |
gem 'capistrano-ext', '~> 1.2.1' | |
gem 'capistrano-rails', '~> 1.1.2' | |
gem 'rvm1-capistrano3', require: false | |
gem 'capistrano-file-permissions', '~> 0.1.0' | |
end |
NewerOlder