Skip to content

Instantly share code, notes, and snippets.

View vlad-shatskyi's full-sized avatar

Volodymyr Shatskyi vlad-shatskyi

View GitHub Profile
calculatePadding :: Int -> Int
calculatePadding = ceiling . log . fromIntegral
Defaulting the following constraint(s) to type ‘Double’
(RealFrac b0)
arising from a use of ‘ceiling’ at src/Cat/Decorators.hs:21:22-28
(Num b0)
arising from a use of ‘fromIntegral’
at src/Cat/Decorators.hs:21:38-49
module Main where
import System.Environment
import System.IO (hFlush, stdout)
ask :: (Show a, Read b) => a -> IO b
ask question = do
putStr $ show question
hFlush stdout
answer <- getLine
module Scraper::BookingCom
class RoomBot < BotBase
include Scraper::ScrapingCommon
HTTP_RESPONSE_VALIDATORS = [
:nil_response, :status_404, :status_200, :html,
->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") }
]
def scrape
module Scraper::BookingCom
class RoomBot < BotBase
include Scraper::ScrapingCommon
HTTP_RESPONSE_VALIDATORS = [
:nil_response, :status_404, :status_200, :html,
->(url, resp) { raise(CustomExceptions::InvalidUrlError, url) if resp.uri.path.include?("searchresults") }
]
def scrape
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
total = 0
next_order = 10
length = 1
while True:
result_of_power = 0
base = 1
list_of_powers = []
while result_of_power < next_order:
result_of_power = base**length
list_of_powers.append(result_of_power)
@vlad-shatskyi
vlad-shatskyi / e75.cpp
Created August 10, 2012 14:55
Problem 75
#include <iostream>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include <algorithm>
#include <iomanip>
using namespace std;
const long limit = 1500000;
@vlad-shatskyi
vlad-shatskyi / e75.cpp
Created August 10, 2012 15:30
Problem 75, rev.2
#include <iostream>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include <algorithm>
#include <iomanip>
using namespace std;
const long limit = 1500000;