This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
test_text = """<xml bla bla hebele | |
hübele | |
cart curt""" | |
pattern = r'(https?://soz\.lk/[^:\s]+)' | |
matches = re.findall(pattern, test_text) | |
for url in matches: | |
print(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsValidTCK(long tck) | |
{ | |
byte[] digits = (tck + "").Select(x => byte.Parse(x + "")).ToArray(); | |
//11 Basamak ve ilk Basamak 0 olamaz | |
if ((digits.Length == 11) && (digits[0] > 0)) | |
{ | |
//Tek basamakları topla (1,3,5,7,9) | |
int sumOdds = digits[0] + digits[2] + digits[4] + digits[6] + digits[8]; | |
//Çift basamakları topla (2,4,6,8) | |
int sumEvens = digits[1] + digits[3] + digits[5] + digits[7]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Application xmlns="https://github.com/avaloniaui" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:AvaloniaTest" | |
xmlns:v="using:AvaloniaTest.Views" | |
x:Class="AvaloniaTest.App"> | |
<Application.DataTemplates> | |
<local:ViewLocator/> | |
</Application.DataTemplates> | |
<Application.Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//C# Interactive code. Select all and press (Ctrl + E, Ctrl + E) | |
/// <summary> | |
/// Tries each action until success | |
/// </summary> | |
/// <param name="onException">Action on each exception</param> | |
/// <param name="acts">Actions which is will try</param> | |
/// <returns></returns> | |
int MultiTryCatchUntil(Action<Exception> onException, params Action[] acts) | |
{ | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//C# Interactive code. (Ctrl + E, Ctrl + E) | |
using System.Threading; | |
volatile bool stop = false; | |
Thread thread = new Thread(() => { | |
while (stop == false) | |
{ | |
Thread.Sleep(500); | |
Console.WriteLine(DateTime.Now); | |
} | |
Console.WriteLine("Finished"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isNull() { | |
for (var i = 0; i < arguments.length; i++) { | |
if ( | |
typeof arguments[i] !== 'undefined' | |
&& arguments[i] !== undefined | |
&& arguments[i] != null | |
&& arguments[i] != NaN | |
&& arguments[i] | |
) return arguments[i]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GeneratePagination(total, perPage, current, visible, prefix) { | |
var r = ""; | |
total = parseInt(total || 0); | |
perPage = parseInt(perPage || 0); | |
current = parseInt(current || 1); | |
visible = parseInt(visible || 0); | |
prefix = prefix || ''; | |
if (total <= 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<!--<meta charset="utf-8">--> | |
<title>Hafıza Oyunu</title> | |
<script src="game.js"></script> | |
</head> | |
<body> | |
<h1>JavaScript Hafıza Oyunu</h1> |