Skip to content

Instantly share code, notes, and snippets.

View Redouane64's full-sized avatar

Redhouane Sobaihi Redouane64

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
namespace FunctionalProgramming
{
class Program
{
static void Main(string[] args)
{
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
@Redouane64
Redouane64 / AdjacencyMatrixGraphImp.cpp
Created December 29, 2018 15:07 — forked from arrayed/AdjacencyMatrixGraphImp.cpp
Adjacency Matrix Graph Implementation in C++
//============================================================================
// Name : AdjacencyMatrixGraphImp.cpp
// Author : Amritpal Singh
// Copyright : arrayed.net
// Description : Array based Adjacency Matrix Graph Implimentation
//============================================================================
#include <iostream>
#include <vector>
#include <string>
@Redouane64
Redouane64 / WPF-BaseViewModel-Implementation.cs
Created August 24, 2018 18:04
A basic base view model implementation for WPF.
/// <summary>
/// Represents the base implementation of view-models.
/// </summary>
public abstract class ViewModelBase : INotifyPropertyChanged , INotifyDataErrorInfo
{
private readonly Dictionary<string, IEnumerable<string>> _errors;
protected ViewModelBase()
{
_errors = new Dictionary<string, IEnumerable<string>>();
@Redouane64
Redouane64 / compiling_building_c_cpp_notes.md
Created May 15, 2018 15:32 — forked from gubatron/compiling_building_c_cpp_notes.md
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015.

Include Paths

On the compilation phase, you will usually need to specify the different include paths so that the interfaces (.h, .hpp) which define structs, classes, constans, and functions can be found.

With gcc and llvm include paths are passed with -I/path/to/includes, you can pass as many -I as you need.

In Windows, cl.exe takes include paths with the following syntax: /I"c:\path\to\includes\ you can also pass as many as you need.

using System;
public class Program
{
public static void Main()
{
//
int[] arr = { 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 };
int numberToFind = 64;
@Redouane64
Redouane64 / countbits.cs
Created April 24, 2018 10:22
count ones bits.
static int CountBits(int x) {
int result = 0;
do
result += x & 1;
while ((x = x >> 1) != 0);
return result;
}
@Redouane64
Redouane64 / enable_bitstream_compression.xdc
Created April 19, 2018 14:04 — forked from imrickysu/enable_bitstream_compression.xdc
Vivado enable bitstream compression
# From UG908
# Add the following command to xdc can make it take effect
set_property BITSTREAM.GENERAL.COMPRESS True [current_design]
@Redouane64
Redouane64 / singleinstanceapp.cs
Last active September 28, 2017 22:35
WPF Single-Instance application model
// Gist created by o-red@outlook.com on 28/09/2017.
// 1) Create a wrapper class for your single instance application that inherit from 'WindowsFormApplicationBase.WindowsFormApplicationBase' class.
public class SingleInstanceApplication : WindowsFormApplicationBase
{
}
// 2) Add constructor.