Skip to content

Instantly share code, notes, and snippets.

View Vibhu-Agarwal's full-sized avatar
🐍
Having fun with projies

Vibhu Agarwal Vibhu-Agarwal

🐍
Having fun with projies
View GitHub Profile

Libuv and libev, two I/O libraries with similar names, recently had the privilege to use both libraries to write something. Now let's talk about my own subjective expression of common and different points.

The topic of high-performance network programming has been discussed. Asynchronous, asynchronous, or asynchronous. Whether it is epoll or kqueue, it is always indispensable to the asynchronous topic.

Libuv is asynchronous, and libev is synchronous multiplexing IO multiplexing.

Libev is a simple encapsulation of system I/O reuse. Basically, it solves the problem of different APIs between epoll and kqueuq. Ensure that programs written using livev's API can run on most *nix platforms. However, the disadvantages of libev are also obvious. Because it basically just encapsulates the Event Library, it is inconvenient to use. For example, accept(3) requires manual setnonblocking after connection. EAGAIN, EWOULDBLOCK, and EINTER need to be detected when reading from a socket. This is a

@gitllermopalafox
gitllermopalafox / Django model dependent image size validation
Last active September 13, 2021 13:03
Django model dependent image size validation
# Model dependent image size validation
# forms.py
from django import forms
from .models import *
from django.core.files.images import get_image_dimensions
class ValidateImageForm(forms.ModelForm):
class Meta:
@aponxi
aponxi / sql-mongo_comparison.md
Last active February 21, 2024 11:56
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.