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
// как известно, | |
// основная задача проектирования при объектной декомпозиции - это выполнение двух условий. | |
// условия удачной объектной декомпозиции: | |
// - высокое сцепление (high cohesion): максимизация связей внутри классов | |
// - низкая связанность (low coupling): минимизация (ослабление, гибкость) связей между классами | |
// ДЗ на весенние каникулы: | |
// 1) отдохнуть, набраться сил :) | |
// 2) выполнить объектную декомпозицию по отношению к классу Student (код представлен ниже) |
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
class Student { | |
char* firstname; // имя студента | |
int firstname_length; // сколько символов в имени | |
char* surname; // фамилия студента | |
int surname_length; // сколько символов в фамилии | |
char* lastname; // отчество студента | |
int lastname_length; // сколько символов в отчестве | |
char* country; // страна | |
int country_length; | |
char* region; // область |
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
#include <iostream> | |
#include <curl/curl.h> | |
#include <string> | |
using namespace std; | |
/* | |
1) заходим на https://github.com/microsoft/vcpkg | |
2) качаем архив (code > download) | |
3) распаковываем архив, переносим файлы в C:\vcpkg | |
4) запускаем bootstrap-vcpkg.bat, в папке сформируется vcpkg.exe |
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
AndroidManifest.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
... | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
... |
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
/* вместо AsyncTask был использован Thread для выполнения операций в фоновом режиме в MainViewModel. | |
также, для обновления UI с использованием LiveData, был использован Handler для отправки сообщений в основной поток */ | |
MainActivity.java: | |
package com.sunmeat.async; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.widget.Button; |
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
AndroidManifest.xml: | |
... | |
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" /> | |
... | |
============================================================================================== | |
MainActivity.java: |
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
MainActivity.java: | |
package com.sunmeat.calendar; | |
import android.Manifest; | |
import android.content.ContentResolver; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.Build; |
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
MainActivity.java: | |
package com.sunmeat.services; | |
import android.content.pm.PackageManager; | |
import android.os.Bundle; | |
import android.telephony.SmsManager; | |
import android.widget.Toast; | |
import androidx.appcompat.app.AppCompatActivity; | |
import androidx.core.app.ActivityCompat; |
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
AndroidManifest.xml: | |
... | |
<uses-feature | |
android:name="android.hardware.telephony" | |
android:required="false" /> | |
<uses-permission android:name="android.permission.CALL_PHONE" /> | |
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | |
... |
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
-- 3. Показать названия и цены товаров, | |
-- доставленных на протяжении последнего месяца. | |
SELECT name, price | |
FROM Product | |
WHERE date_of_delivery >= DATEADD(MONTH, -1, GETDATE()) | |
-- 4. Показать на экран названия и цены товаров | |
-- с категорией "Кондитерские изделия", но только не торговой марки "Roshen" | |
SELECT name, price | |
FROM Product |
NewerOlder