In linux, normally, it is impossible to "bind()" to the same TCP port twice. If you try to bind to the same port from second proces unix processes you'll see:
socket.error: [Errno 98] Address already in use
{- Implementation of BST (binary search tree) | |
Script is absolutly free/libre, but with no guarantee. | |
Author: Ondrej Profant -} | |
import qualified Data.List | |
{- DEF data structure -} | |
data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a) | |
deriving Show |
# store all solarized files in one place | |
mkdir ~/.solarized | |
cd ~/.solarized | |
# http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html | |
git clone https://github.com/seebi/dircolors-solarized.git | |
eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark` | |
ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors | |
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git |
A slightly updated version of this doc is here on my website.
I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.
The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x)
, where f()
is a function.
#include <thread> | |
#include <iostream> | |
#include <queue> | |
std::mutex mx; | |
std::condition_variable cv; | |
std::queue<int> q; | |
bool finished = false; |
case class ErrorMessage(message: String, cause: String) | |
object ErrorMessage { | |
import spray.json.DefaultJsonProtocol._ | |
implicit val errorFormat = jsonFormat2(ErrorMessage.apply) | |
} | |
import spray.httpx.SprayJsonSupport._ | |
implicit val jsonRejectionHandler = RejectionHandler { | |
case MalformedRequestContentRejection(msg, cause) :: Nil => | |
complete(StatusCodes.BadRequest, ErrorMessage("The request content was malformed", msg)) |
deprecated
for_window [class="^.*"] border pixel 1
new_window 1pixel
thanks to deviatorslegacy's comment
Document here:
https://i3wm.org/docs/userguide.html#_default_border_style_for_new_windows
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.
I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.
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
,