Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg
{ | |
"api1":[ | |
{"consumer_key": "", | |
"consumer_secret": "", | |
"access_token": "", | |
"access_token_secret": ""}, | |
{"consumer_key": "", | |
"consumer_secret": "", | |
"access_token": "", | |
"access_token_secret": ""} |
我崇敬挑戰龍而失敗的勇士,而不是皇帝。 | |
我期待的是一種平衡,一種可以維持永久的,自然而包容萬物的平衡,將世界置於其中,然後,把發現者燒死。 | |
我願意為機器賦予智慧,把所有人類的骸骨,變作空氣,把他們剩下的東西——如果有的話,完全消除。 | |
我熱愛的統一已不在遠處,我來了,我來了,我會把整個世界,壓縮入一個原子之中,讓不存在的東西,歸於混沌。 | |
我帶來的是劍,獻給我崇敬的挑戰龍的勇士。 |
Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg
//First, we'll require the 'http' library to use later for calling a 3rd party webservice | |
var http = require("http"); | |
//Getting parameters from the request body. For a nested json, we only want the first one. | |
try { | |
var parameters = JSON.parse(request.rawBody); | |
parameters = parameters[0] | |
var ip = parameters.ip; | |
var email = parameters.email; |
net.core.wmem_max = 12582912 | |
net.core.rmem_max = 12582912 | |
net.ipv4.tcp_rmem = 10240 87380 12582912 | |
net.ipv4.tcp_wmem = 10240 87380 12582912 | |
net.ipv4.ip_local_port_range = 18000 65535 | |
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1 | |
net.ipv4.tcp_window_scaling = 1 | |
net.ipv4.tcp_max_syn_backlog = 3240000 | |
net.core.somaxconn = 3240000 | |
net.ipv4.tcp_max_tw_buckets = 1440000 |
In response to this reddit post about failing to understand the Pipes library after a couple of hours. I wanted to show how an experienced haskeller does it, but I'm afraid it also took me quite a few hours, which is why the following list of steps goes on and on.
After all those hours, my opinion is that Pipes
is not at all an easy library. I don't know if Conduit is any easier, but otherwise I side with your friend in advising to use something else (perhaps ordinary lazy IO?) instead of Pipes.
Anyway, here is the full brain dump of my steps as I tried to get your three snippets to fit together.
parseUrl
, withManager
, etc. No results.haskell runEffect
, find that it's a method from Pipes.Core
,{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeFamilyDependencies #-} | |
-- Example of interpreting using continuation monad instead of the free monad. | |
module Main where |
[0, 0, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 0, 65535, 0, 0, 18520, 0, 0, 0, 0, 1668, 184, 4166, 0, 2184, 184, 4181, 0, 2600, 184, 8021, 0, 2852, 184, 2374, 0, 2732, 184, 15591, 0, 2772, 14064, 24375, 0, 3168, 3304, 24359, 0, 3720, 184, 18566, 0, 3716, 184, 15591, 0, 4180, 21036, 13910, 0, 4364, 184, 20967, 0, 4892, 184, 16713, 0, 5448, 23720, 16713, |
; source: http://okmij.org/ftp/Scheme/sokuza-kanren.scm | |
; Quick miniKanren-like code | |
; | |
; written at the meeting of a Functional Programming Group | |
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic | |
; programming. The code is really quite trivial and unsophisticated: | |
; it was written without any preparation whatsoever. The present file | |
; adds comments and makes minor adjustments. |
class API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |