Skip to content

Instantly share code, notes, and snippets.

View sappho192's full-sized avatar
👨‍🎓
Graduate student

Taein KIM sappho192

👨‍🎓
Graduate student
View GitHub Profile
/* HTTP 요청 함수들 */
public string RequestWebPage(string url, string sendData, CookieContainer cook, Encoding encoding, string referer = "", string origin = "", string host = "")
{
var req = (HttpWebRequest)WebRequest.Create(url);
if (!host.Equals("")) { req.Host = host; }
req.Headers.Add(@"Cache-Control", @"max-age=0");
if (!origin.Equals("")) { req.Headers.Add(@"Origin", origin); }
req.Headers.Add(@"Accept-Encoding", @"gzip,deflate");
req.UserAgent = @"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36";
@sappho192
sappho192 / centerimg.md
Created January 23, 2016 15:25
How to center image both hor-ver

from http://stackoverflow.com/a/34914335

Basically, you just need a two containers and make sure your elements meet the following criteria.

The outher container :

  • should have display: table;

The inner container :

  • should have display: table-cell;
  • should have vertical-align: middle;
  • should have text-align: center;
Use "go help [topic]" for more information about that topic.
leafNui-MacBook-Pro:~ leafN$ brew install mono
==> Downloading https://homebrew.bintray.com/bottles/mono-4.2.2.30.el_capitan.bo
######################################################################## 100.0%
==> Pouring mono-4.2.2.30.el_capitan.bottle.tar.gz
==> Caveats
To use the assemblies from other formulae you need to set:
export MONO_GAC_PREFIX="/usr/local"
Note that the 'mono' formula now includes F#. If you have
@sappho192
sappho192 / ArrayStack.h
Created April 7, 2017 15:16
[C++] ArrayStack written in template
#pragma once
#ifndef ARRAYSTACK_H
#define ARRAYSTACK_H
#include "StackEmptyException.h"
template <typename Object>
class ArrayStack
{
public:
@sappho192
sappho192 / ffxiv.auto.translate.en.cs
Created August 26, 2019 19:35 — forked from 3735943886/ffxiv.auto.translate.en.cs
Ffxiv auto-translation dictionary
/* Version 4.06a */
using System.Collections.Generic;
namespace Ffxiv
{
static public partial class AutoTranslate
{
static public IReadOnlyDictionary<ulong, string> EnDict = new Dictionary<ulong, string>()
{
/* 【Languages】 */
// Extracts Auto Tranlate (상용구) from FFXIV chat data
public static List<byte[]> ExtractAutoTranslate(this byte[] rawMessage)
{
List<byte[]> result = new List<byte[]>();
/*
* \u0002 \002E \u0004 \u0002 \u00F0 \u00CF \u0003
* \u0002 \002E \u0003 \u0002 \u00CA \u0003
* \u0002 \002E \u0005 \u0004 \u00F2 \u0001 \u0095 \u0003
*/
@sappho192
sappho192 / Program.cs
Created May 20, 2020 07:35
[C#] Webpage crawler with HtmlAgilityPack
using HtmlAgilityPack;
using System;
using System.Net;
namespace WebCrawlerApp
{
class Program
{
static void Main(string[] args)
{
@sappho192
sappho192 / MainWindow.xaml
Created May 20, 2020 09:54
[WPF] WPF Webcam & Video player with OpenCVSharp4
<Window x:Class="WebcamCaptureApp.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:WebcamCaptureApp"
mc:Ignorable="d"
Title="MainWindow" Height="900" Width="1600">
<Grid>
<StackPanel Orientation="Vertical">
@sappho192
sappho192 / RunMission.java
Last active May 18, 2023 01:42
MAVSDK-Java example (Upload & Run mission)
/* I've changed official RunMission.java in MAVSDK-Java (v1.3.1) example a bit
* because the example is just uploading & downloading mission.
* The same example in C++ SDK demonstrates not only uploading but executing mission so I applied similar logic to this Java example code.
*/
package io.mavsdk.example;
import io.mavsdk.System;
import io.mavsdk.mission.Mission;
import io.mavsdk.telemetry.Telemetry;
@sappho192
sappho192 / Thrower.cs
Created May 8, 2023 05:36
Thrower pattern
// from https://forum.dotnetdev.kr/t/c-10-null-check-7/7069/2
public static class Thrower
{
public static Exception ThrowIfFailedValidation<T>(T target, Func<T, bool> validation)
{
if (validation(target) is false)
{
throw new ValidationFailedException();
}