Skip to content

Instantly share code, notes, and snippets.

public abstract class FileSystemBase
{
protected Dictionary<string, File> _cachedFiles;
protected FileSystemBase()
{
_cachedFiles = new Dictionary<string, File>();
}
public abstract File CreateFile(string filename);
namespace Data
{
public class Point
{
public double x { get; set; }
public double y { get; set; }
}
public static class Drawings
{
public class Circle
{
private readonly Func<SKImageInfo, SKPoint> _centerfunc;
public Circle(float redius, Func<SKImageInfo,SKPoint> centerfunc)
{
_centerfunc = centerfunc;
Redius = redius;
}
public SKPoint Center { get; set; }
public partial class CircularProgressbarView: ContentView
{
private ProgressDrawer _ProgressDrawer;
public static readonly BindableProperty ProgressProperty = BindableProperty.Create(
"Progress", typeof(double), typeof(CircularProgressbarView),propertyChanged:OnProgressChanged);
public double Progress
{
get { return (double) GetValue(ProgressProperty); }
using System;
using System.Collections.Generic;
namespace TimeTable.Core.Models
{
public class Entity
{
public string Id { get; set; }
}
using Microsoft.EntityFrameworkCore;
using TimeTable.Core.Models;
namespace TimeTableServer.Context
{
public class DataContext : DbContext
{
public DbSet<StudentCourse> StudentCourse { get; set; }
public DbSet<Student> Students { get; set; }
struct TimeSlotChromosome
{
public TimeSpan StartAt { get; set; }
public TimeSpan EndAt => StartAt.Add(TimeSpan.FromHours(3));
public string CourseId { get; set; }
public string PlaceId { get; set; }
public string TeacherId { get; set; }
public List<string> Students { get; set; }
public int Day { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using Accord.Genetic;
using Microsoft.EntityFrameworkCore;
namespace TimeTable.Builder
{
class TimeTableChromosome:ChromosomeBase
{
class Program
{
static void Main(string[] args)
{
using (var dataContext = new DataContext())
{
Population population = new Population(1000, new TimeTableChromosome(dataContext),
new TimeTableChromosome.FitnessFunction(), new EliteSelection());
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using TimeTable.Core.Models;
using TimeTableServer.Context;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860