Skip to content

Instantly share code, notes, and snippets.

View anilkay's full-sized avatar
🏠
Working from home

Anıl Kaynar anilkay

🏠
Working from home
View GitHub Profile
// See https://aka.ms/new-console-template for more information
bool result=Contains(new uint[] { 1, 2, 3, 4, 5 }, 3); // true
Console.WriteLine(result);
//Contains(new uint[] { 1, 2, 3, 4, 5 }, -6); // false
//Contains(new uint[] { 1, 2, -5, 4, 5 }, 6); // false
int[] arr=new int[] { 1, 6, 3, 4, 5 };
//int[] arr=new int[] { 1, -6, 3, 4, 5 }; // throw exception
//string []arr3= new string[] { "1", "2", "3", "4", "5" }; types are not numeric
//ConvertAllMethod<string,uint>(arr3); // throw exception
using NanoidDotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace nanoiddeneme
{
internal class Utils
//Nice Url Builder for Dotnet.
using Flurl;
using System.Text;
string GetWeatherOfCityUrl(string cityName){
var weather = "https://wttr.in"
.AppendPathSegment(cityName)
.SetQueryParams(new
{
@anilkay
anilkay / splide_example.html
Created October 2, 2022 21:46
example of splide.js
<html>
<head>
<title>Splida.js Examples</title>
<!--https://splidejs.com-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/css/splide.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/css/themes/splide-skyblue.min.css">
<script src="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/js/splide.min.js"></script>
</head>
<body>
<h1>Hello World</h1>
public class Speed(){
public void Main(){
Example example=new Example();
example.SpeedValueChanged += delegate (int speed)
{
Console.WriteLine("Speed changed: " + speed);
};
example.SpeedValueChanged += (int speed)=>
<!DOCTYPE html>
<html>
<head>
<title> Deneme</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<h1>Evet</h1>
<div id="main_img"></div>
// See https://aka.ms/new-console-template for more information
int ?nullable = null;
//var a = (int)(nullable + nullable); NUllable object must have a value
nullable = 44;
var a = (int)(nullable + nullable); //Work fine but it's error prone.
async static Task SpeechSynthesis3(SpeechConfig speechConfig)
{
speechConfig.SpeechSynthesisLanguage = "tr-TR";
//speechConfig.SpeechSynthesisVoiceName = "tr-TR-EmelNeural";
var audioConfig=AudioConfig.FromWavFileOutput("uretilen.wav");
using var synthesizer = new SpeechSynthesizer(speechConfig,audioConfig);
while (true)
{
string speech = Console.ReadLine();
if (speech.ToLower().Contains("sentezi kapat")) break;
async static Task SpeechSynthesis(SpeechConfig speechConfig)
{
speechConfig.SpeechSynthesisLanguage = "tr-TR";
speechConfig.SpeechSynthesisVoiceName = "tr-TR-EmelNeural";
using var synthesizer = new SpeechSynthesizer(speechConfig);
while (true)
{
string speech = Console.ReadLine();
if (speech.ToLower().Contains("sentezi kapat")) break;
await synthesizer.SpeakTextAsync(speech);
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
using NAudio.CoreAudioApi;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
class Program
{