Skip to content

Instantly share code, notes, and snippets.

Avatar

Volodymyr Shatskyi vlad-shatskyi

View GitHub Profile
View gist:0c2f7e825bb71e4274d2
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
View ask
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
View gist:21cb6e526d8e397c4da4
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
View gist:bcd5fdacc740435f704c
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
View simplepastiefile.m
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
View simplepastiefile.m
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> text;
string word;
while (cin >> word) {
View gist:3156936
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)
View e75.cpp
#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 Aug 10, 2012
Problem 75, rev.2
View e75.cpp
#include <iostream>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include <algorithm>
#include <iomanip>
using namespace std;
const long limit = 1500000;