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
{ | |
"url": "https://t.me/smartdeer_test_bot/mine", | |
"name": "SmartDeer Test", | |
"iconUrl": "https://global-image.smartdeer.work/p/images/0x9db20f8d5ecf4d2db0ddb8789d1c45f4.svg" | |
} |
#include <stdio.h> | |
#include <stdlib.h> | |
int BLACK = 0; | |
int RED = 1; | |
struct node { | |
struct node *left; | |
struct node *right; | |
struct node *parent; |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the _run() method | |
""" |
#include <stdio.h> | |
#include <stdlib.h> | |
struct node { | |
node *left; | |
node *right; | |
node *parent; | |
int value; | |
}; |
import sys | |
def calculate(params, tm): | |
ex_stack = [] | |
tmp = [] | |
mutil = [] | |
for p in params: | |
if (not p): | |
continue |
"""Implementation of pycurl's "easy" interface that uses pycurl's multi interface + gevent. | |
""" | |
# parts of code from Tornado's curl_httpclient.py | |
import logging | |
import gevent | |
assert gevent.version_info[:2] >= (0, 14), 'Gevent 0.14 or older required. Your version is %s' % gevent.__version__ | |
from gevent.core import EVENTS, READ, WRITE | |
from gevent.hub import Waiter | |
from BeautifulSoup import BeautifulSoup | |
VALID_TAGS = [ | |
'div', | |
'span', | |
'a', | |
'p', | |
'br', |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef int heap_elem_t; | |
typedef struct heap_t | |
{ | |
int size; | |
int capacity; |
package com.winse.activiti.util; | |
import java.awt.BasicStroke; | |
import java.awt.Color; | |
import java.awt.Graphics2D; | |
import java.awt.Paint; | |
import java.awt.Stroke; | |
import java.awt.geom.RoundRectangle2D; | |
import java.awt.image.BufferedImage; | |
import java.io.ByteArrayInputStream; |