Kierownik banku zlecił swojemu podwładnemu stworzyć listę dziesięciu najbardziej zadłużonych osób, a anastęppnie poinformować ich o uregulowaniu. Poddany szefa wpadł na pomysł zrobienia listy osób z numerami telefonów i datą spłaty, a następnie informowania ich drogą telefoniczną o zbliżającym się okresie rozliczeniowym. Po wykonaniu całego zlecenia raport z danymi został dostarczony na biurko szefa.
Wykonać tabelę (imię, nazwisko, adres, numer telefonu, wysokość zadłużenia, data słaty) i wykonać pełny raport.
Baza danych - kolekcja danych zapisanych zgodnie z określonymi regułami.
Jeden wiersz tabeli to record, który składa się z pól o różnych typach (m.in. tekst (VARCHAR
), liczba dziesiętna (*INT
), data, godzina).
Każdy rekord tabeli zawiera informacje o jednym elemencie, np. o uczniu.
Rekord składa się z pól, takich jak "nazwisko", "imię", "średnia ocen", etc.
Kwerenda - zapytanie skierowane do tabeli lub innej kwerendy. W wyniku jej wykonania wyświetlone zostaną rekordy tabeli w liczbie i kolejności spełniającej wyniki jej wykonania. Kwerendy pozwalają na różne sosoby na różne sposoby oglądać, zmieniać i analizować dane.
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
[ | |
{ "keys": ["ctrl+alt+shift+l"], "command": "alignment" }, | |
{ "keys": ["ctrl+shift+d"], "command": "duplicate_lines" }, | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }, | |
{ "keys": ["ctrl+alt+f"], "command": "yapf"} | |
] |
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
#!/usr/bin/python3 | |
import sys | |
import itertools | |
def print_header(): | |
print('#include <stdio.h>') | |
print() | |
print() | |
print('int main() {') |
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
#!/usr/bin/env python3 | |
def options(opts): | |
opts.load('compiler_cxx') | |
def configure(conf): | |
conf.load('compiler_cxx') | |
conf.check(features='cxx cxxprogram', cxxflags=['-std=c++14', '-Wall', '-Wextra', '-O3', '-pedantic', '-pipe'], uselib_store='M') |
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
// The MIT License (MIT) | |
// Copyright (c) 2015 nabijaczleweli | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation | |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following conditions: |
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
if(const auto sys = envvar_or({"OS"}, nullptr)) | |
return sys; | |
throw runtime_error("the world is on fire"); // Something's *REALLY* wrong |
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 strip_line(string & line) { | |
static const vector<regex> regices = [&]() { | |
vector<regex> temp(3); | |
for(const auto reg : {"#.*", " +$", "^ +"}) // comment, start-of-line space, end-of-line space | |
temp.emplace_back(reg, regex_constants::optimize); | |
return temp; | |
}(); // <-- any better way of doing this? | |
for(const auto & rgx : regices) | |
line = regex_replace(line, rgx, ""); |
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
#!/usr/bin/awk -f | |
BEGIN { | |
place = 1 | |
} | |
/{/ { | |
sub(/[\[ ] { /, "") | |
sub(/ ]/, "") | |
gsub(/},/, "") |