Skip to content

Instantly share code, notes, and snippets.

@kernel0
kernel0 / hisenbug.cs
Created February 9, 2017 11:05
hisenbug
int cnt = 0;
var list = from i in new int[] { 1, 2, }
select i + (++cnt);
Console.WriteLine("BP!"); // <-- breakpoint at this line
// watch 'results view' of "list" variable!
list.ToList().ForEach(x => Console.WriteLine(x));
@kernel0
kernel0 / client.py
Last active August 29, 2015 14:17
issue : sock_accept of ProactorEventLoop missed OSError 64 (ERROR_NETNAME_DELETED)
# dummy client
import asyncio
import logging
import socket
ip = "127.0.0.1"
@asyncio.coroutine
def test_conn(loop):
try:
@kernel0
kernel0 / asyncio_redis.pool.py
Last active August 29, 2015 14:16
issue : pool reallocates non-free connection whenever use multi method
def _get_free_connection(self):
"""
Return the next protocol instance that's not in use.
(A protocol in pubsub mode or doing a blocking request is considered busy,
and can't be used for anything else.)
"""
self._shuffle_connections()
for c in self._connections:
if c.protocol.is_connected and not c.protocol.in_use:
Verifying that +kernel is my openname (Bitcoin username). https://onename.com/kernel