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
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) |
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 NAudio.Utils; | |
using NAudio.Wave; | |
using System; | |
using System.IO; | |
namespace IDONTKNOW | |
{ | |
public class AudioRecord | |
{ | |
private void waveMaxSample(WaveInEventArgs e, Action<float> handler) |
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
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): |
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.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" | |
} | |
} |
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
package main | |
/* | |
//CREATE TABLE | |
db.CreateTable("account", true, map[string]string{ | |
"email": "TEXT", | |
"date": "TEXT", | |
"amount": "INTEGER", | |
}) | |
//INSERT |
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
package main | |
import ( | |
"errors" | |
"html/template" | |
"io" | |
"io/ioutil" | |
"github.com/labstack/echo" | |
) |
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
<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> |
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.Diagnostics; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; | |
using System.Windows.Shapes; | |
namespace ColorPicker | |
{ | |
/// <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
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") |
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.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) | |
{ |
OlderNewer