Skip to content

Instantly share code, notes, and snippets.

View SnowyPainter's full-sized avatar
🎯
Focusing

Minwoo Yu SnowyPainter

🎯
Focusing
View GitHub Profile
@SnowyPainter
SnowyPainter / UpDown.rs
Created October 28, 2019 08:33
It's my first rust project.
use std::io;
use std::io::Write;
fn guessingMachine(guessValue: u16) {
loop {
let mut valueOfGuessStr = String::new();
print!("You Guess : ");
io::stdout().flush();
io::stdin()
.read_line(&mut valueOfGuessStr)
@SnowyPainter
SnowyPainter / AudioRecord.cs
Created March 20, 2020 16:01
[C# NAudio] Record and return audio stream. get the float maximum value to show the progress
using NAudio.Utils;
using NAudio.Wave;
using System;
using System.IO;
namespace IDONTKNOW
{
public class AudioRecord
{
private void waveMaxSample(WaveInEventArgs e, Action<float> handler)
import numpy as np
import matplotlib.pylab as plt
def step(x):
return np.array(x > 0, dtype=np.int)
def sigmoid(x):
return 1/(1+1/np.exp(x))
def relu(x):
window.addEventListener("load", () => {
window.onscroll = (event) => {
const objs = document.getElementsByClassName("scroll-fadein")
for (let i = 0; i < objs.length; i++) {
const bottomObj = objs[i].offsetTop + objs[i].scrollHeight;
const bottomWindow = window.scrollY + window.outerHeight;
if (bottomWindow > bottomObj) {
objs[i].style.opacity = "1"
}
}
package main
/*
//CREATE TABLE
db.CreateTable("account", true, map[string]string{
"email": "TEXT",
"date": "TEXT",
"amount": "INTEGER",
})
//INSERT
package main
import (
"errors"
"html/template"
"io"
"io/ioutil"
"github.com/labstack/echo"
)
<UserControl x:Class="ColorPicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ColorPicker"
mc:Ignorable="d" Height="269" Width="400">
<StackPanel x:Name="PickerPanel" Orientation="Vertical" Background="White">
<Grid HorizontalAlignment="Stretch" Height="210" MouseDown="RgbGradient_MouseDown">
<Grid.Background>
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
namespace ColorPicker
{
/// <summary>
import os
import time
from selenium import webdriver
from collections import defaultdict
def getOptions(select):
return select.find_elements_by_tag_name("option")
def getOptgroups(select):
return select.find_elements_by_tag_name("optgroup")
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace wpf_control_to_image.Extensions
{
public static class UIElementExtension
{
public static RenderTargetBitmap ToBitmap(this FrameworkElement element)
{