PyQt5
pip install PyQt5
{ | |
"configurations": [ | |
{ | |
"name": "Mac", | |
"includePath": [ | |
"/usr/include", | |
"/usr/local/include", | |
"${workspaceRoot}" | |
], | |
"defines": [], |
std::vector<std::string> SplitLine(const std::string &line) | |
{ | |
std::vector<std::string> tokens; | |
std::stringstream ss(line); | |
copy(std::istream_iterator<std::string>(ss), | |
std::istream_iterator<std::string>(), | |
back_inserter(tokens)); | |
return tokens; | |
} |
import QtQuick 2.0 | |
import QtQuick.Controls 2.1 | |
import QtQuick.Controls.Material 2.1 | |
ApplicationWindow { | |
visible: true | |
Material.theme: Material.Dark | |
Material.accent: Material.Purple |
%{ | |
#include <iostream> | |
#include <string> | |
%} | |
integer_in_ipv4 0|1([0-9][0-9]?)?|2([5-9]|[0-4][0-9]?|5[0-5]?)?|[3-9][0-9]? | |
ipv4 {integer_in_ipv4}\.{integer_in_ipv4}\.{integer_in_ipv4}\.{integer_in_ipv4} | |
%% |
#!/bin/bash | |
if (("$#" < 2)) || (("$#" > 3)); then | |
echo "Illegal number of arguments" | |
exit 1 | |
fi | |
bison -v -d -o "y.tab.c" $2 | |
gcc -c -g -I.. "y.tab.c" | |
flex -o lex.yy.c $1 | |
gcc -c -g -I.. lex.yy.c | |
if [ "$#" -eq 2 ]; then |
#!/bin/bash | |
if (("$#" < 2)) || (("$#" > 3)); then | |
echo "Illegal number of arguments" | |
exit 1 | |
fi | |
bison -v -d -o "y.tab.c" $2 | |
gcc -c -g -I.. "y.tab.c" | |
flex -o lex.yy.c $1 | |
gcc -c -g -I.. lex.yy.c | |
if [ "$#" -eq 2 ]; then |
#!/usr/bin/env python3 | |
import collections | |
def flatten(t): | |
""" | |
Generator flattening the structure | |
>>> list(flatten([2, [2, "test", (4, 5, [7], [2, [6, 2, 6, [6], 4]], 6)]])) | |
[2, 2, "test", 4, 5, 7, 2, 6, 2, 6, 6, 4, 6] | |
""" |
import scrapy | |
class ArticlesListSpider(scrapy.Spider): | |
name = "articles_list" | |
page_counter = 0 | |
def start_requests(self): | |
urls = [ | |
r'https://zh.wikipedia.org/wiki/Special:%E6%89%80%E6%9C%89%E9%A1%B5%E9%9D%A2' |
import sys | |
from PyQt5.QtCore import QThread | |
from PyQt5.QtWidgets import (QApplication, QMainWindow, QPushButton, | |
QComboBox, QWidget, QVBoxLayout) | |
class Task(QThread): | |
def run(self): | |
print('task started') |