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 string ToAgeString(DateTime dob) | |
{ | |
DateTime today = DateTime.Today; | |
int months = today.Month - dob.Month; | |
int years = today.Year - dob.Year; | |
if (today.Day < dob.Day) | |
{ | |
months--; |
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 string ToAgeString(DateTime dob) | |
{ | |
DateTime today = DateTime.Today; | |
int months = today.Month - dob.Month; | |
int years = today.Year - dob.Year; | |
if (today.Day < dob.Day) | |
{ | |
months--; |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Xaml; | |
//Created by Mshwf, Jan 2019 | |
namespace OudAuction.Controls | |
{ | |
[XamlCompilation(XamlCompilationOptions.Compile)] | |
public class TextSwitch : Grid |
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 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |
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
using ConsoleTest.Repos; | |
using Goodreads; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.Remoting.Messaging; | |
using System.Runtime.Remoting.Proxies; | |
using System.Security.Principal; | |
using System.Text; |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var img = Image.FromFile(@"C:\Users\Mohamed.Elshawaf\Desktop\imageTests\original.png"); | |
var ratio = .75; | |
var height = img.Height; | |
var width = img.Width; | |
int newHeight = (int)(height * ratio); | |
int newWidth = (int)(width * ratio); |
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
List<Kmer> kmers = new List<Kmer>(); | |
string message = "gjhcebfu71uevkkvhjv,yjvykku71jrbirbgerngtgntteu71agg6g79htu718eay8hibioay+8eru71ohob8vy89egyhoih89vu71oyhbigr89yhrrvoaeoghau71e8ryg98ergh.oaeryl9g7rv7g7iytg643483gi@$#t32@#2R23r213ri4tyg2ti.88oichu71tp9hg"; | |
for (int i = 0; i <= message.Length - 3; i++) | |
{ | |
string substring = message.Substring(i, 3); | |
int occurences = Regex.Matches(message, Regex.Escape(substring)).Count; | |
kmers.Add(new Kmer { Text = substring, Occ = occurences }); | |
} |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
namespace ExtendedCollection | |
{ | |
[DebuggerDisplay("{Value}")] | |
public class SNode<T> | |
{ |
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 class BaseViewModel : INotifyPropertyChanged | |
{ | |
public INavigation Navigation { get; set; } | |
bool isBusy = false; | |
public bool IsBusy | |
{ | |
get { return isBusy; } | |
set { SetProperty(ref isBusy, value); } | |
} |
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
//Some files downloaded from Pluralsight using youtube-dl tool have GUIDs appended to their names, | |
//e.g.: Course Overview-13acb659-b860-4dac-b284-64fc18a2ece1.mp4, this C# function removes them | |
static void Main() | |
{ | |
RemoveGuidsFromFilesIn(@"D:\C#\CourseFolder"); | |
} | |
private static void RemoveGuidsFromFilesIn(string path) | |
{ |