This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Frame { | |
public byte opcode; | |
public boolean fin; | |
public boolean masked; | |
public byte[] payload; | |
// for generating bitmask | |
private static final Random random = new Random(); | |
public Frame() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net.Sockets; | |
using System.Net.Security; | |
using System.Threading.Tasks; | |
namespace Protty | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
typedef struct Frame { | |
unsigned fin : 1; // 0 or 1 (bool) if frame fin | |
unsigned masked : 1; // 0 or 1 (bool) if frame masked | |
unsigned char opcode; // 0 - 10 (int) frame opcode | |
// reserved bit values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
gcc -g -Wall -fPIC http.c main.c -o app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <iostream> | |
void _QSort(int *array, int begin, int end) { | |
if (begin >= end) return; | |
int i, pivot; | |
pivot = begin; | |
for (i = begin + 1; i < end + 1; i++) { | |
if (array[i] <= array[begin]) { | |
pivot++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Command bit flags | |
const KSM_FREG = 1; | |
const KSM_SREG = 2; | |
const KSM_FSYM = 4; | |
const KSM_SSYM = 8; | |
// Byte size constants | |
const KSM_MX_SM = 2; | |
const KSM_MX_CM = 8; | |
const KSM_VER_S = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const crypto = require('crypto'); | |
const XVIS = 'TEI939AFFIAGAYQZ'; | |
const HOST = 'http://www.cleverbot.com'; | |
const BASE = `${HOST}/webservicemin`; | |
const UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'; | |
class OrderedParams extends Array { | |
constructor(...args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from hashlib import md5 | |
from collections import deque | |
from aiohttp import ClientSession | |
from collections import OrderedDict | |
from urllib.parse import quote as qs | |
# try to use uvloop if possible | |
try: | |
import uvloop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
from collections import deque | |
class Token: | |
__slots__ = ('op','args','lineno','text','next') | |
def __init__(self, **kwargs): | |
self.op = self.args = self.lineno = self.text = self.next = None | |
self.set(**kwargs) | |
def set(self, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.protto.erlpack; | |
import java.nio.charset.Charset; | |
import java.util.Arrays; | |
public class Buffer { | |
private byte[] buf; | |
private int length; | |
private int alloc_size; |
OlderNewer