// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ConstructorHelpers.h: Constructor helper templates
=============================================================================*/
#pragma once
#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "UObject/Package.h"
namespace ConstructorHelpersInternal
{
template<typename T>
inline T* FindOrLoadObject( FString& PathName )
{
// If there is no dot, add a dot and repeat the object name.
int32 PackageDelimPos = INDEX_NONE;
PathName.FindChar( TCHAR('.'), PackageDelimPos );
if( PackageDelimPos == INDEX_NONE )
{
int32 ObjectNameStart = INDEX_NONE;
PathName.FindLastChar( TCHAR('/'), ObjectNameStart );
if( ObjectNameStart != INDEX_NONE )
{
const FString ObjectName = PathName.Mid( ObjectNameStart+1 );
PathName += TCHAR('.');
PathName += ObjectName;
}
}
UClass* Class = T::StaticClass();
Class->GetDefaultObject(); // force the CDO to be created if it hasn't already
T* ObjectPtr = LoadObject<T>(NULL, *PathName);
if (ObjectPtr)
{
ObjectPtr->AddToRoot();
}
return ObjectPtr;
}
template<>
inline UPackage* FindOrLoadObject<UPackage>( FString& PathName )
{
// If there is a dot, remove it.
int32 PackageDelimPos = INDEX_NONE;
PathName.FindChar( TCHAR('.'), PackageDelimPos );
if( PackageDelimPos != INDEX_NONE )
{
PathName.RemoveAt(PackageDelimPos,1,false);
}
// Find the package in memory.
UPackage* PackagePtr = FindPackage( nullptr, *PathName );
if( !PackagePtr )
{
// If it is not in memory, try to load it.
PackagePtr = LoadPackage( nullptr, *PathName, LOAD_None );
}
if (PackagePtr)
{
PackagePtr->AddToRoot();
}
return PackagePtr;
}
inline UClass* FindOrLoadClass(FString& PathName, UClass* BaseClass)
{
// If there is no dot, add ".<object_name>_C"
int32 PackageDelimPos = INDEX_NONE;
PathName.FindChar(TCHAR('.'), PackageDelimPos);
if (PackageDelimPos == INDEX_NONE)
{
int32 ObjectNameStart = INDEX_NONE;
PathName.FindLastChar(TCHAR('/'), ObjectNameStart);
if (ObjectNameStart != INDEX_NONE)
{
const FString ObjectName = PathName.Mid(ObjectNameStart + 1);
PathName += TCHAR('.');
PathName += ObjectName;
PathName += TCHAR('_');
PathName += TCHAR('C');
}
}
UClass* LoadedClass = StaticLoadClass(BaseClass, NULL, *PathName);
if (LoadedClass)
{
LoadedClass->AddToRoot();
}
return LoadedClass;
}
}
struct COREUOBJECT_API ConstructorHelpers
{
public:
template<class T>
struct FObjectFinder
{
T* Object;
FObjectFinder(const TCHAR* ObjectToFind)
{
CheckIfIsInConstructor(ObjectToFind);
FString PathName(ObjectToFind);
StripObjectClass(PathName,true);
Object = ConstructorHelpersInternal::FindOrLoadObject<T>(PathName);
ValidateObject( Object, PathName, ObjectToFind );
}
bool Succeeded() const
{
return !!Object;
}
};
template<class T>
struct FObjectFinderOptional
{
private:
T* Object;
const TCHAR* ObjectToFind;
public:
FObjectFinderOptional(const TCHAR* InObjectToFind)
: Object(nullptr)
, ObjectToFind(InObjectToFind)
{
}
T* Get()
{
if (!Object && ObjectToFind)
{
CheckIfIsInConstructor(ObjectToFind);
FString PathName(ObjectToFind);
StripObjectClass(PathName,true);
Object = ConstructorHelpersInternal::FindOrLoadObject<T>(PathName);
ValidateObject( Object, PathName, ObjectToFind );
ObjectToFind = nullptr; // don't try to look again
}
return Object;
}
bool Succeeded()
{
return !!Get();
}
};
template<class T>
struct FClassFinder
{
TSubclassOf<T> Class;
FClassFinder(const TCHAR* ClassToFind)
{
CheckIfIsInConstructor(ClassToFind);
FString PathName(ClassToFind);
StripObjectClass(PathName, true);
Class = ConstructorHelpersInternal::FindOrLoadClass(PathName, T::StaticClass());
ValidateObject(*Class, PathName, *PathName);
}
bool Succeeded()
{
return !!*Class;
}
};
public:
/** If there is an object class, strips it off. */
static void StripObjectClass( FString& PathName, bool bAssertOnBadPath = false );
private:
static void ValidateObject(UObject *Object, const FString& PathName, const TCHAR* ObjectToFind)
{
if (!Object)
{
FailedToFind(ObjectToFind);
}
#if UE_BUILD_DEBUG
else
{
CheckFoundViaRedirect(Object, PathName, ObjectToFind);
}
#endif
}
static void FailedToFind(const TCHAR* ObjectToFind);
static void CheckFoundViaRedirect(UObject *Object, const FString& PathName, const TCHAR* ObjectToFind);
static void CheckIfIsInConstructor(const TCHAR* ObjectToFind);
};
INSERT INTO `pages` (`id`, `file`, `url`, `name`, `title`, `description`, `keywords`, `kind`, `image`, `robots`, `privacy`, `type`, `active`, `module`, `page`, `class`) VALUES
('', 'modules_extra/vip_key_ws/base/index.php', 'vip_key', 'vip_key', 'Покупка VIP', 'Покупка VIP', 'Покупка, VIP', 1, 'files/miniatures/standart.jpg', 2, 2, 1, 1, 1, 0, 0),
('', 'modules_extra/vip_key_ws/base/admin/servers.php', 'admin/vk_servers', 'admin_vk_servers', 'Настройка серверов модуля vip_key_ws', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 1, 0, 0),
('', 'modules_extra/vip_key_ws/base/admin/services.php', 'admin/vk_services', 'admin_vk_services', 'Настройка услуг модуля vip_key_ws', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 1, 0, 0),
('', 'modules_extra/sortition/base/index.php', 'sortition', 'sortition', 'Розыгрыш', 'Розыгрыш', 'Розыгрыш', 1, 'modules_extra/sortition/templates/image.jpg', 1, 2, 1, 1, 5, 0, 0),
('', 'modules_extra/sortition/base/admin/index.php', 'admin/sortition', 'admin_sortition', 'Настройка розыгрыша', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 5, 0, 0),
('', 'modules_extra/cases/base/index.php', 'cases', 'cases', 'Магазин кейсов', 'Магазин кейсов', 'Магазин кейсов', 1, 'modules_extra/cases/templates/image.jpg', 1, 2, 1, 1, 6, 0, 0),
('', 'modules_extra/cases/base/case.php', 'case', 'case', 'Кейс {value}', 'Кейс {value}', 'Кейс {value}', 1, 'modules_extra/cases/templates/image.jpg', 1, 2, 1, 1, 6, 0, 0),
('', 'modules_extra/cases/base/admin/index.php', 'admin/cases', 'admin_cases', 'Настройка кейсов', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 6, 0, 0),
('', 'modules_extra/cases/base/admin/case.php', 'admin/case', 'admin_case', 'Настройка кейса', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 6, 0, 0),
('', 'modules_extra/cases/base/admin/open_cases.php', 'admin/open_cases', 'admin_open_cases', 'Список открытий кейсов', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 6, 0, 0),
('', 'modules_extra/aes_plugin/base/index.php', 'aes_list', 'aes_list', 'Статистика AES', 'Статистика AES', 'Статистика, AES', 1, 'files/miniatures/standart.jpg', 1, 1, 1, 1, 7, 0, 0),
('', 'modules_extra/aes_plugin/base/admin/settings.php', 'admin/aes_settings', 'admin_aes_settings', 'Настройка серверов модуля AES', 'none', 'none', 1, 'files/miniatures/standart.jpg', 0, 0, 2, 1, 7, 0, 0);
#include "pch.h"
#include <iostream>
#include <math.h>
using namespace std;
const double eps = 0.00001;
double _pow(double a, double b) {
double c = 1;
for (int i = 0; i < abs(b); i++) c *= a;
if (b < 0) c = 1 / c;
return c;
}
double _fact(double x) {
if (x < 0) return 0;
if (x == 0) return 1;
else return x * _fact(x - 1);
}
double _sin(double x) {
double a = x, s = x;
int n2 = 1;
while (fabs(a) > eps){
a = ((-a)*x*x) / ((n2 + 1)*(n2 + 2));
s += a;
n2 += 2;
}
return s;
}
double _cos(double x) {
double a=1.0, s=0.0;
int p = (int)s;
while (fabs(a) > eps) {
s += a;
p++;
a = ((-a)*x*x) / ((2 * p - 1)*(2 * p));
}
return s;
}
double _tan(double x) {
return (_sin(x) / _cos(x));
}
double proverka(double x1,double x2) {
int b=0, c=0;
if (x1 + x2 != -b && x1*x2 != c) cout << NULL << endl;
else cout << "1" << endl;
return x1,x2;
}
int main() {
cout << "Vvedite zadachu kotoruyu nado proverit :" << endl;
int h;
cout << "2ZADACHA-1" << endl; cout << "1ZADACHA-2" << endl;
cin >> h;
switch (h) {
case 1: {
cout << "Enter A, B, C:\n";
int a = 0, b = 0, c = 0;
cin >> a >> b >> c;
double x1, x2;
int discriminant = 0;
discriminant = ((int)_pow(b, 2)) - 4 * a * c;
if (discriminant > 0 && a != 0) {
x1 = ((-b - sqrt(discriminant)) / 2 * a);
x2 = ((-b + sqrt(discriminant)) / 2 * a);
cout << x1 << x2 << endl;
}
else if (discriminant = 0 && a != 0) cout << "" << endl;
else cout << "korney net" << endl;
proverka(x1, x2);
break;
}
case 2: {
double x, a, b;
int swtch;
cout << "Vvedite chislo dlya vibora" << endl;
cout << "SIN-1" << endl; cout << "COS-2" << endl; cout << "POW-3" << endl; cout << "TAN-4" << endl; cout << "FACT-5" << endl;
cin >> swtch;
switch (swtch)
{
case 1: {
cout << "Vvedite x:" << endl; cin >> x;
cout << "sin " << x << " = " << _sin(x);
break;
}
case 2: {
cout << "Vvedite x:" << endl; cin >> x;
cout << "cos " << x << " = " << _cos(x);
break;
}
case 3: {
cout << "Vvedite a:" << endl; cin >> a;
cout << "Vvedite stepen:" << endl; cin >> b;
cout << "pow " << a << " s stepenyu" << b << " = " << _pow(a, b);
break;
}
case 4: {
cout << "Vvedite x:" << endl; cin >> x;
cout << "tan " << x << " = " << _tan(x);
break;
}
case 5: {
cout << "Vvedite x:" << endl; cin >> x;
cout << "FACT! " << x << " = " << _fact(x);
break;
}
default:break;
}
default:break; }
}
}