This file contains hidden or 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
//go:build js && wasm | |
package main | |
import ( | |
"iter" | |
) | |
// func js.ValueOf(x any) js.Value | |
// ValueOf returns x as a JavaScript value: |
This file contains hidden or 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
package main | |
import "fmt" | |
func main() { | |
arr := []int{897, 265, 201, 86, 56, 657, 273, 25, 843, 625, 641, 332, 509, 463, 496, 97, 779, 241, 970, 665, 87, 765, 276, 442, 25, 311, 10, 765, 224, 465, 296, 415, 968, 40, 494, 151, 493, 159, 274, 444, 10, 792, 104, 200, 694, 193, 616, 126, 754, 3, 489, 415, 863, 589, 646, 264, 88, 733, 132, 922, 794, 149, 496, 135, 727, 355, 890, 102, 3, 668, 517, 852, 488, 445, 980, 964, 933, 754, 815, 496, 550, 2, 33, 191, 516, 455, 436, 41, 618, 596, 334, 10, 708, 348, 511, 752, 767, 129, 470, 698, 647, 604, 104, 811, 574, 52, 750, 319, 97, 45, 391, 42, 822, 712, 92, 664, 318, 702, 5, 303, 778, 799, 638, 430, 66, 944, 78, 40, 632, 919, 828, 851, 589, 75, 328, 774, 991, 305, 126, 996, 505, 463, 428, 972, 781, 697, 244, 98, 148, 670, 30, 328, 457, 673, 766, 69, 461, 44, 804, 986, 133, 169, 786, 950, 745, 63, 362, 857, 411, 12, 680, 9, 586, 827, 932, 54, 538, 509, 120, 287, 534, 866, 926, 351, 634, 842, 188, 57, 443, 296, 134, 254, 447, 350, 558, 418, 917, 492, 683, 702, 504, 96 |
This file contains hidden or 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
package main | |
import "fmt" | |
func sum(inputs <-chan int, outputs chan<- int, num int) { | |
for input := range inputs { | |
num += input | |
outputs <- num // something like function return in non-goroutine functions | |
} | |
} |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
namespace CodeAgha | |
{ | |
public static class ThemeColor | |
{ | |
public static Color PrimaryColor { get; set; } |
This file contains hidden or 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
double _progressCopy; | |
double _progressAll; | |
string primeFolderPath = Console.ReadLine(), | |
destFolderPath = Console.ReadLine(); | |
try |
This file contains hidden or 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
Euclidean algorithm for GCD in C# By CodeAgha | |
The parenthesis is the GCD (Greatest common factor) sign and the 'mod' symbol is equal to the remainder of the division. | |
In any case, we write the smaller number first and the larger number second | |
Proof from division theorem | |
a/b => a = bq + r | |
v != 0 | gcd(u, v) = gcd(v, u mod v) |
This file contains hidden or 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
// Receiving database files from clients via http request | |
[ParameterRoute(HttpMethod.PUT, "/server/uploadFile/{fileName}")] | |
public static async Task GetFile(HttpContext ctx) | |
{ | |
try | |
{ | |
// Url data | |
string fileName = ctx.Request.Url.Parameters["fileName"]; | |
// Variabels |
This file contains hidden or 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 | |
phonenumberValidateRegEx = r"((0?9)|(\+?989))((14)|(13)|(12)|(19)|(18)|(17)|(15)|(16)|(11)|(10)|(90)|(91)|(92)|(93)|(94)|(95)|(96)|(32)|(30)|(33)|(35)|(36)|(37)|(38)|(39)|(00)|(01)|(02)|(03)|(04)|(05)|(41)|(20)|(21)|(22)|(23)|(31)|(34)|(9910)|(9911)|(9913)|(9914)|(9999)|(999)|(990)|(9810)|(9811)|(9812)|(9813)|(9814)|(9815)|(9816)|(9817)|(998))\W?\d{3}\W?\d{4}" | |
# use this RegEx for encapsulate email field in contacts class | |
emailValidateRegEx = r"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$" | |
# OOP (Object oriented Programming) => Class : Polymorphysm : Inheritance : Encapsulation | |
# S.O.L.I.D |
This file contains hidden or 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
# CodeAgha 2023 - Advanced Python course of besat school - first code chalange | |
import re # import regex module | |
# regex for phone number validation | |
regex = r"((0?9)|(\+?989))((14)|(13)|(12)|(19)|(18)|(17)|(15)|(16)|(11)|(10)|(90)|(91)|(92)|(93)|(94)|(95)|(96)|(32)|(30)|(33)|(35)|(36)|(37)|(38)|(39)|(00)|(01)|(02)|(03)|(04)|(05)|(41)|(20)|(21)|(22)|(23)|(31)|(34)|(9910)|(9911)|(9913)|(9914)|(9999)|(999)|(990)|(9810)|(9811)|(9812)|(9813)|(9814)|(9815)|(9816)|(9817)|(998))\W?\d{3}\W?\d{4}" | |
contacts = { | |
"Ali": "+989123458965", | |
"Sara": "+989121068969", |
This file contains hidden or 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
int num1 = int.Parse(Console.ReadLine()); | |
int num2 = int.Parse(Console.ReadLine()); | |
Console.WriteLine(GCD(num1, num2)); | |
int GCD(int num1, int num2) | |
{ | |
int res = 0; |
NewerOlder