https://github.com/bitemyapp/learnhaskell/blob/master/guide-ru.md
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
/** | |
* @brief executeQueriesFromFile Read each line from a .sql QFile | |
* (assumed to not have been opened before this function), and when ; is reached, execute | |
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL | |
* statement is found. In other words, this function assumes each file is a single | |
* SQL transaction, ending with a COMMIT line. | |
*/ | |
void executeQueriesFromFile(QFile *file, QSqlQuery *query) | |
{ |
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
qDebug() << "Request:"; | |
for (auto header : reply->request().rawHeaderList()) { | |
qDebug() << header << ":" << reply->request().rawHeader(header); | |
} | |
qDebug() << "\nReply:"; | |
for (auto header : reply->rawHeaderPairs()) { | |
qDebug() << header.first << ":" << header.second; |
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
void GistManager::gistsReceive() | |
{ | |
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender()); | |
if (!reply) { | |
return; | |
} | |
QJsonParseError parser; | |
QJsonDocument jsonReply = QJsonDocument::fromJson(reply->readAll(), &parser); |
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
void Manager::gotoLocation(const QString &fileName, int line, int column) | |
{ | |
EditorManager::openEditorAt(fileName, line, column); | |
} |
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
#------------------------------------------------- | |
# | |
# Project created by QtCreator 2015-05-23T18:26:20 | |
# | |
#------------------------------------------------- | |
QT += core network | |
QT -= gui | |
CONFIG += c++11 |
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
def stripFileName(fileName): | |
pattern = re.compile(r'[\s/\\:*?"<>|]+') | |
fileName = "_".join(pattern.split(fileName)) | |
return fileName |
Строка называется палиндромом если она имеет абсолютно одинаковую последовательность символов с права на лево и слева на право, для примера:
- "kayak",
- "abcba",
- "neven".
Строка A называется анаграммой к строке B если A может быть получена из B путем перестановки символов. Для примера строки из этих пар являются анаграммами к друг другу:
OlderNewer