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 void main(int argc, char const *argv[]) | |
{ | |
// To identify the current configuration: | |
UINT32 PathArraySize = 0; | |
UINT32 ModeArraySize = 0; | |
DISPLAYCONFIG_PATH_INFO* PathArray; | |
DISPLAYCONFIG_MODE_INFO* ModeArray; | |
DISPLAYCONFIG_TOPOLOGY_ID CurrentTopology; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
// Allocate memory for the array like this: | |
int** array; | |
array = malloc(n * sizeof(*array)); /* Assuming `n` is the number of rows */ |
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.ComponentModel; | |
using System.Threading; | |
using System.Windows; | |
namespace WPFProgressBar | |
{ | |
/// <summary> | |
/// Interaction logic for MainWindow.xaml | |
/// </summary> |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MVVMMessenger | |
{ | |
public class Messenger |
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.Drawing; | |
using System.Windows.Forms; | |
namespace CustomControls | |
{ | |
public class NodeControl : Control | |
{ | |
private Graphics G = null; |
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.Linq; | |
using System.Windows; | |
using System.Windows.Controls; | |
namespace PrisonersDilemma.Utility | |
{ | |
/// <summary> | |
/// Taken from: https://rachel53461.wordpress.com/2011/09/17/wpf-grids-rowcolumn-count-properties/ | |
/// </summary> | |
public class GridHelpers |
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
<Window x:Class="ColorLibrary.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:ColorLibrary" | |
mc:Ignorable="d" | |
Loaded="Window_Loaded" | |
Title="MainWindow" Height="500" Width="400"> | |
<Window.Resources> |
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
// Typed version | |
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>(); | |
// Helper function | |
public static class EnumUtil { | |
public static IEnumerable<T> GetValues<T>() { | |
return Enum.GetValues(typeof(T)).Cast<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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
// SO Link 1 : https://stackoverflow.com/a/263416/302248 | |
// SO Link 2 : https://stackoverflow.com/q/45601078/302248 | |
namespace ComparerGetHashCode | |
{ | |
public class NumberClass | |
{ |
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.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace StackOverflow | |
{ | |
class Program | |
{ |
NewerOlder