Skip to content

Instantly share code, notes, and snippets.

View whoo24's full-sized avatar

Wooyeong Choe whoo24

  • Oslo, Norway
View GitHub Profile
@whoo24
whoo24 / Dijkstra.cs
Created November 8, 2016 09:14
Getting shortest path using Dijkstra algorithm on C#
using DijkstraAlgorithm.GraphController;
using System.Collections.Generic;
using System.Linq;
namespace DijkstraAlgorithm {
public class Dijkstra<T> {
readonly int kInfinity = int.MaxValue - 1;
public void dijkstra (Graph<T> G, Graph<T>.Node r, out Dictionary<Graph<T>.Node, Graph<T>.Node> result) {
List<Graph<T>.Node> S = new List<Graph<T>.Node>();
@whoo24
whoo24 / regex.cs
Created November 29, 2016 06:15
Get decimal string in (0.0, 1.0, 2.0) using Regex.
using System;
using System.Text.RegularExpressions;
namespace regex {
class Program {
static void Main (string[] args) {
FindDecimalNumber();
FindCapturedDeciaml();
}
@whoo24
whoo24 / Const.cpp
Created November 29, 2016 06:33
Study of const in c++
#include "stdafx.h"
class ClassA {
};
class ClassB {
int value_ = 0;
int* ptr_ = nullptr;
ClassA member_;
@whoo24
whoo24 / DataContractSerializerSample.cs
Created December 5, 2016 15:05
객체의 관계까지 Xml로 Serialization 해주는 DataContractSerializer 샘플
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
namespace DataContractSerializerSample {
[Serializable, KnownType(typeof(DerrivedSerializableModel))]
public class SerializableModel {
public SerializableModel node;
}
$TargetDir = ""
$TargetFile = "*.txt"
Get-ChildItem $TargetDir -Include $TargetFile -Recurse | ForEach ($_) { Remove-Item $_.fullname }
$BaseDir = ""
$TargetDirName = "Tmp"
Get-ChildItem $BaseDir -Include $TargetDirName -Recurse | ForEach ($_) { Remove-Item $_.fullname -Force -Recurse }
@whoo24
whoo24 / Program.cs
Created June 22, 2017 04:14
Prime Factoring
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PrimeFactoring {
class Program {
static void Main (string[] args) {
while (true) {
Solve(int.Parse(Console.ReadLine()));
// Algorism = not 'Algorithm'
/*
1 < N < 100,000
예)
입력 : abaccchhaa
결과 : b1a1c3h2a3
*/
#include "stdafx.h"
@whoo24
whoo24 / Get-Sdl2.ps1
Created October 5, 2018 01:45
Downloading sdl2 dev libs using powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest -Uri 'https://libsdl.org/release/SDL2-devel-2.0.8-VC.zip' -OutFile '.\SDL2-devel-2.0.8-VC.zip'