Сопоставление с образцом (pattern matching) — сильный механизм языков программирования, который, к сожалению, встречается не так часто. Причём, как в коде разработчиков, так и в поддержке со стороны самого языка.
Разработчики на функциональных языках используют этот механизм довольно часто, потому что у них вообще многое определяется статически через правильный подход к системе типов. Разработчики же на императивных языках очень любят огромные многоуровневые ветвления. Есть даже такое понятие «Спагетти-код» — раньше его применяли к коду, перегруженному операторами перехода, но в современном виде это скорее об избытке операторов условия.
Pattern matching позволяет накладывать на объекты некоторый трафарет и смотреть, попадают ли они под него. Это не только выглядит лаконичнее и короче, чем дерево условий, но ещё и понятнее с точки зрения восприятия человеком: вот у нас заказ содержит более 10 элементов и при этом стоит более 1000 долларов, значит делаем на него скидку 10 центов. При этом трафарет работает как сортировщик монеток: самая маленькая проваливается в первый паз, следующая по размеру в следующий итд, применение условий идёт сверху вниз. Есть и неявный плюс: такой подход автоматически провоцирует разработчиков проводить проверку на null. Ведь null не может подходить под трафарет «содержит более 10 товаров».
К счастью, в C# этот механизм в последних версиях активно развивают и совершенствуют. И это одно из многочисленных преимуществ C# над Java.
#dev
https://github.com/Monadical-SAS/django-channels-router
django-channels-router
A Python library for routing and handling #websocket messages using #django-channels.
Routing socket messages in the view
Routing socket messages using a handler
#React
https://www.fullstackpython.com/websockets.html
A #WebSocket is a standard protocol for two-way data transfer between a #client and #server. The WebSockets protocol does not run over #HTTP, instead it is a separate implementation on top of #TCP.
#AJAX
#javascript#approval_process#cms#crm#ehr#erp#hr#layui#mysql#oa#privileges#redis#skyeye#springboot#springboot2#springcloud_vue#websocket
This platform uses Springboot, Layui, UNI-APP, and Ant Design Vue to create a low-code system for intelligent manufacturing. It includes over 30 application modules and more than 50 electronic workflows, covering CRM, ERP, MES, and more. This system streamlines business processes from customer relations to production and after-sales service, improving efficiency and data transparency. It also manages employee operations, providing a comprehensive solution for businesses. The benefits include faster development, reduced redundancy, and enhanced data management, making it ideal for companies seeking digital transformation.
https://github.com/dromara/skyeye
#cplusplus#c_plus_plus#cpp#datachannel#libdatachannel#libnice#p2p#peer_to_peer#peerconnection#rfc_8831#rfc_8834#rtcdatachannel#rtcpeerconnection#sctp#webrtc#webrtc_datachannel#webrtc_video#websocket
libdatachannel is a lightweight, easy-to-use C/C++ library that lets you add real-time peer-to-peer data, media, and WebSocket communication to your apps across many platforms like Linux, Windows, macOS, Android, and iOS. It simplifies WebRTC by providing a smaller, simpler alternative to Google's library, with compatibility for browsers like Firefox and Chrome. You can use it to connect native apps directly to web browsers with minimal dependencies, supporting secure connections via GnuTLS, Mbed TLS, or OpenSSL. It also supports compiling to WebAssembly for browser use, making it flexible for cross-platform real-time communication development[1][4]. This helps you build fast, efficient apps for video, audio, or data sharing without heavy libraries.
https://github.com/paullouisageneau/libdatachannel
#go#coolq#cqhttp#cqhttp_mirai#go#go_cqhttp#golang#group_manager#mirai#mirai_bot#nonebot#onebot#onebot_plugin#onebot_sdk#plugin#qq#qq_bot#qqbot#qqrobot#websocket#zerobot
ZeroBot-Plugin is a comprehensive utility plugin collection for the ZeroBot chatbot framework, offering over 100 features across entertainment, management, and productivity categories. The system provides high-priority functions like chat management, sleep tracking, and group administration, alongside mid-tier features such as image generation, music streaming, and game simulations. Users benefit from flexible plugin control—enabling or disabling specific features per group—and dynamic loading capabilities that reduce program size. The platform supports multiple deployment methods, from pre-compiled releases to local compilation, making it accessible whether you prefer ready-to-use binaries or customized builds. With extensive command options, scheduled task triggers, and AI integration, ZeroBot-Plugin transforms group chat management into an automated, entertaining experience while maintaining user control over which features activate in specific communities.
https://github.com/FloatTech/ZeroBot-Plugin