Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐴

Cihan Yakar cihanyakar

💭
🐴
View GitHub Profile
View entropi5.cs
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 };
View entropi4.cs
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))
View entropi3.cs
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"};
View entropi2.cs
void Main()
{
var ornek = new[] { "yeşil", "kırmızı", "mavi","sarı", "siyah" };
var sonuc = GerekliBitSayisi(new System.Collections.Generic.HashSet<string>(ornek));
}
View entropi1.cs
public static int GerekliBitSayisi<T>(ISet<T> dizi)
{
return (int)Math.Ceiling(Math.Log(dizi.Count, 2));
}
View GoogleCloudPrintClient.cs
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
View ItemsControl.cs
using System;
using System.Collections;
using Xamarin.Forms;
namespace Palladium.UserControls
{
public class ItemsControl : StackLayout
{
public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(
"ItemTemplate",
View gist:541b0cf05c9161c52b91aa4c2e024b8a
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());
View CustomObjectReader.cs
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;