return String.Format("{0}/{1}", this.numerator, this.denumerator);
if (numerator < 0 && denumerator < 0)
{
numerator = Math.Abs(numerator);
denumerator = Math.Abs(denumerator);
}
if (denumerator < 0 && denumerator > 0 || denumerator > 0 && numerator < 0)
{
numerator = -Math.Abs(numerator);
denumerator = Math.Abs(denumerator);
}
if (numerator < 0 && denumerator < 0)
{
this.numerator = Math.Abs(numerator);
this.denumerator = Math.Abs(denumerator);
}
if (denumerator < 0 && denumerator > 0 || denumerator > 0 && numerator < 0)
{
this.numerator = -Math.Abs(numerator);
this.denumerator = Math.Abs(denumerator);
}
In cases where you are accessing single rows randomly within a table, the actual order of the data in the table is unimportant. However, if you tend to access some data more than others, and there is an index that groups them together, you will benefit from using CLUSTER. If you are requesting a range of indexed values from a table, or a single indexed value that has multiple rows that match, CLUSTER will help because once the index identifies the table page for the first row that matches, all other rows that match are probably already on the same table page, and so you save disk accesses and speed up the query.
class Program
{
static void Main()
{
var container = new SimpleInjector.Container();
container.Register<IDbService, DbService>();
container.RegisterSingleton<IEntityCacheService, EntityCacheService>();
container.Register<IAuthenticationImpl, AuthenticationImpl>();
container.Verify();
var instance = container.GetInstance<IAuthenticationImpl>();
Console.WriteLine(instance.GetType());
}
}
internal class AuthenticationImpl : IAuthenticationImpl
{
private IDbService dbService;
private IEntityCacheService entityCache;
public AuthenticationImpl(IDbService dbService, IEntityCacheService entityCache)
{
this.dbService = dbService;
this.entityCache = entityCache;
}
}
internal interface IAuthenticationImpl{}
internal class EntityCacheService : IEntityCacheService{}
internal interface IEntityCacheService{}
internal class DbService : IDbService{}
internal interface IDbService{}
function swit {
$choice = Read-Host 'Введите номер'
if ($choice -eq 9) {
Write-Host 'Выход'
}
elseif ($choice -ge 1 -and $choice -le 8) {
for ($i = 1; $i -lt 9; $i++) {
if ($i -eq $choice) {
Write-Host "$i.Нажали $i" -ForegroundColor Green
}
else {
Write-Host "$i.Нажали $i" -ForegroundColor Red
}
}
swit
}
else {
Write-Host 'Неверное значение, попробуйте еще раз.' -ForegroundColor Magenta
swit
}
}
swit