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
some_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] | |
if any("abc" in s for s in some_list): | |
# If you really want to get all the items containing abc, use | |
matching = [s for s in some_list if "abc" in s] |
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
import numpy as np | |
[s for s in dir(np) if "array" in s] |
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
UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='Table_name' |
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
PRAGMA foreign_keys = ON; |
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
//METODO 1: | |
//Using the class QTest | |
QTest::qSleep(100); // it block the event processing | |
QTest::qWait(100); // it does not block the event processing | |
//METODO 2: | |
//Using the classes QWaitCondition and QMutex | |
QWaitCondition waitCondition; | |
QMutex mutex; | |
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
var itsCommands = new List<Command>(); | |
while (itsCommands.Count > 0) | |
{ | |
Command c = (Command) itsCommands[0]; | |
c.Execute(); | |
itsCommands.RemoveAt(0); | |
} |
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
property bool isBusy: true | |
Connections { | |
target: targetItem | |
onIsBusyChanged: { | |
// function code | |
// ... | |
} | |
} |
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
function numberToLetter(number) | |
{ | |
return (number + 9).toString(36).toUpperCase(); | |
} |
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
-- Alter auto index count | |
set identity_insert table_name ON | |
insert into table_name (id, another_field) VALUES (1, NULL) | |
-- Restore auto index count | |
set identity_insert table_name OFF |
OlderNewer