This file contains hidden or 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
| #define WIN32_LEAN_AND_MEAN | |
| #include <iostream> | |
| #include <ws2tcpip.h> | |
| using namespace std; | |
| #pragma comment (lib, "Ws2_32.lib") | |
| #pragma comment (lib, "Mswsock.lib") // AcceptEx(), ConnectEx(), WSASendMsg() тощо | |
| #pragma comment (lib, "AdvApi32.lib") // Security API, Registry API, Service Control Manager тощо |
This file contains hidden or 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
| #include <iostream> | |
| #include <string> | |
| #include <curl/curl.h> | |
| using namespace std; | |
| size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) { | |
| return fwrite(ptr, size, nmemb, stream); | |
| } |
This file contains hidden or 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
| #include <iostream> | |
| #include <string> | |
| #include <cstring> | |
| #include <sys/socket.h> | |
| #include <netdb.h> | |
| #include <unistd.h> | |
| using namespace std; | |
| int main() { | |
| string url = "google.com"; |
This file contains hidden or 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
| build.gradle.kts (Project): | |
| plugins { | |
| alias(libs.plugins.android.application) apply false | |
| kotlin("plugin.compose") version "2.0.21" apply false // !!! | |
| } | |
| ================================================================================================================== | |
| build.gradle.kts (Module:app): |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <androidx.coordinatorlayout.widget.CoordinatorLayout | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:background="#0A0A0F"> | |
| <!-- Декоративне коло вгорі --> | |
| <View |
This file contains hidden or 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
| SERVER SIDE: | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <cstring> |
This file contains hidden or 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
| CLIENT SIDE: | |
| #include <iostream> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <unistd.h> | |
| #include <arpa/inet.h> | |
| #include <sys/socket.h> | |
| using namespace std; |
This file contains hidden or 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
| from datetime import datetime | |
| from django.shortcuts import render | |
| from django.http import HttpRequest | |
| from django.db.models import Avg, Count, Sum, Max, Min, F, Q | |
| from app.models import Author, Book | |
| # ============================================================================= | |
| # CRUD ДЛЯ AUTHOR (це було вже :) | |
| # ============================================================================= |
This file contains hidden or 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 author_filter_advanced(request): | |
| """filter з різними умовами""" | |
| # lte / gte - менше або рівно / більше або рівно | |
| authors = Author.objects.filter(rating__gte=8.0) # rating >= 8.0 | |
| authors = Author.objects.filter(rating__lte=5.0) # rating <= 5.0 |
This file contains hidden or 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
| from datetime import datetime | |
| from django.shortcuts import render | |
| from django.http import HttpRequest | |
| from app.models import Author | |
| # ── CREATE ──────────────────────────────────────────────────────────────────── | |
| def author_create_method1(request): | |
| """Вставка автора через objects.create() - один рядок, одразу зберігає в БД""" |