Skip to content

Instantly share code, notes, and snippets.

View cihanyakar's full-sized avatar
💭
🐴

Cihan Yakar cihanyakar

💭
🐴
View GitHub Profile
import './App.css';
import {BrowserRouter, Route, Routes} from "react-router-dom";
import {MainPage} from "./pages/mainPage";
import {BookDetailsPage} from "./pages/bookDetailsPage";
import {AddBookPage} from "./pages/addBookPage";
function App() {
return (
<BrowserRouter>
var x =new[] { 1, 1, 4, 2, 5, 1, 1, 1, 1, 3, 5, 2, 7, 2, 5, 9, 9, 7, 4, 3, 4, 1, 3, 5, 7, 3 };
var y =new[] { 1, 2, 4, 1, 1, 2, 1, 2, 2, 5, 2, 2, 4, 7, 3, 1, 2, 7, 2, 8, 2, 2, 9, 2,1 };
public static double Entropi<T>(IEnumerable<T> data)
{
var sayac = new Dictionary<T, int>();
int i;
using (var sayici = data.GetEnumerator())
{
i = 0;
while (sayici.MoveNext())
{
if (sayac.ContainsKey(sayici.Current))
var a =new[] { "kırmızı" ,"mavi","sarı", "mor", "siyah", "gri" ,"beyaz","yeşil","yeşil", "yeşil", "yeşil", "yeşil",
"yeşil", "yeşil" , "yeşil", "yeşil", "yeşil", "yeşil", "yeşil", "yeşil"};
@cihanyakar
cihanyakar / entropi2.cs
Created February 7, 2019 18:59
Entropi 2
void Main()
{
var ornek = new[] { "yeşil", "kırmızı", "mavi","sarı", "siyah" };
var sonuc = GerekliBitSayisi(new System.Collections.Generic.HashSet<string>(ornek));
}
@cihanyakar
cihanyakar / entropi1.cs
Created February 7, 2019 18:56
entropi 1
public static int GerekliBitSayisi<T>(ISet<T> dizi)
{
return (int)Math.Ceiling(Math.Log(dizi.Count, 2));
}
@cihanyakar
cihanyakar / GoogleCloudPrintClient.cs
Created January 22, 2017 17:02
Gerekli Sınıflar
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Xamarin.Forms;
namespace CloudPrint.Clients
@cihanyakar
cihanyakar / ItemsControl.cs
Created January 5, 2017 20:04
Simple ItemsControl
using System;
using System.Collections;
using Xamarin.Forms;
namespace Palladium.UserControls
{
public class ItemsControl : StackLayout
{
public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(
"ItemTemplate",
Queue<string> TersCevir(Queue<string> kuyruk)
{
var stack = new Stack<string>();
while (kuyruk.Count > 0)
{
stack.Push(kuyruk.Dequeue());
}
var queue = new Queue<string>();
while (stack.Count > 0) {
queue.Enqueue(stack.Pop());
@cihanyakar
cihanyakar / CustomObjectReader.cs
Last active September 22, 2016 08:10
CustomObjectReader
public class ObjectDataReader<T> : IDataReader
{
private readonly IList<PropertyInfo> _properties;
private readonly IEnumerator _enumarator;
public ObjectDataReader(IEnumerable<T> data)
{
_enumarator = data.GetEnumerator();
Depth = 0;
IsClosed = false;