Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import os
import argparse
from lxml import etree
ELEM_TAG = 'tmk:MarkSignificantVerbalElementText'
ELEM_NAMESPACE = {'tmk': 'http://www.wipo.int/standards/XMLSchema/Trademark/1'}
@sorrat
sorrat / PKGBUILD
Created March 10, 2015 20:24
bmpanel2-themes.PKGBUILD
# Contributor mathieui <mathieui@mathieui.net>
# Contributor sorrat <yasorrat[at]gmail.com>
pkgname=bmpanel2-themes
pkgver=0.1
pkgrel=1
pkgdesc='Themes collection for bmpanel2'
url='http://code.google.com/p/bmpanel2/wiki/ThemeGallery'
license='GPL'
arch=('i686' 'x86_64')
@sorrat
sorrat / index.html
Last active November 17, 2016 15:48
Iframe with variable src
<!DOCTYPE html>
<html>
<head>
<title>Test iframe</title>
</head>
<body>
<script type="text/javascript">
function changeIframeSrc() {
var now = new Date();
var iframe = document.getElementById(iframeId);
@sorrat
sorrat / PKGBUILD
Last active August 5, 2017 06:15
liblinear
# Contributor: jiuren <qiuwei1987@gmail.com>
# Maintainer: Benoit Favre <benoit.favre@lif.univ-mrs.fr>
# Contributor: Kristof Marussy <kris7topher@gmail.com>
pkgname=liblinear
pkgver=211
pkgrel=1
pkgdesc="A Library for Large Linear Classification"
arch=('i686' 'x86_64')
url="http://www.csie.ntu.edu.tw/~cjlin/liblinear/"
license=('BSD')
"""Описание задачи:
На входе внешний файл html - там длинный текст.
Нужно показать список уникальных слов в этом тексте.
Так как слов много, то показываем только первые N по частоте встречаемости.
Нужно убрать html-теги и слова / словосочетания из стоп-списка (пример: а, как бы, да ну).
Имена формата "А. С. Пушкин" считаются одним словом.
Внешний файл html может быть любым.
"""
import re
import html
"""
Поиск минимальной подсети, содержащей заданный набор IP-адресов.
"""
import unittest
import struct
import socket
def ip_to_bin(ip) -> str:
ip_packed = socket.inet_aton(ip)
@sorrat
sorrat / nvidia_460.67_linux_5.14.patch
Created September 13, 2021 18:42
Fix NVIDIA 460.67 for Linux 5.14.2, based on https://gist.github.com/joanbm
--- common/inc/nv-time.h 2021-09-13 22:04:46.614497200 +0400
+++ common/inc/nv-time.h 2021-09-13 21:57:50.965477400 +0400
@@ -24,6 +24,7 @@
#define __NV_TIME_H__
#include "conftest.h"
+#include <linux/version.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/interrupt.h>