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 <iostream> | |
#include "NeuralNetwork.h" | |
using namespace std; | |
using namespace Eigen; | |
NeuralNetwork::NeuralNetwork(vector<int> nodes, double learning_rate) | |
: nodes{ nodes }, learning_rate{ learning_rate }, layers { nodes.size() } | |
{ | |
// Initialize weights |
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 | |
from scipy.special import expit as sigmoid | |
class neural_network: | |
def __init__(self, nodes, learning_rate): | |
self.nodes = nodes | |
self.layers = len(nodes) | |
self.lr = learning_rate |
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 ConnectFour | |
{ | |
enum Tile { Empty, X, O }; |
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 PigDice | |
{ | |
class Dice | |
{ |
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
{-# LANGUAGE OverloadedStrings #-} | |
import GHC.Exts ( IsString(..) ) | |
newtype Vowels = Vowels String deriving Show | |
instance IsString Vowels where | |
fromString = Vowels . filter (`elem` "aeiou") |
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
module System.Directory.Tree where | |
import System.Directory ( doesFileExist, getDirectoryContents ) | |
data DirTree = Directory String [DirTree] | |
| File String | |
deriving (Show, Eq) | |
getDirTree :: FilePath -> IO [DirTree] | |
getDirTree path = getDirectoryContents path |
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
module Main where | |
import Network.HTTP (simpleHTTP, getRequest, getResponseBody) | |
import Text.HTML.TagSoup | |
import Data.List (isInfixOf, isPrefixOf) | |
type Link = String | |
type UserID = String | |
hostname = "http://chat.stackoverflow.com" |
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
function getNextChar (char) { | |
if (char == 'z') return 'A'; | |
if (char == 'Z') return 'a'; | |
return String.fromCharCode(char.charCodeAt(0) + 1); | |
} | |
function getNextString (str) { |
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
-- Format src.txt so that it gives us a list of words and correspondig syllabes | |
-- divided by 1 space | |
import System.IO | |
import System.Directory | |
import System.Environment | |
import Data.List | |
main = do | |
-- Open input and output files |
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 strict"; | |
let x = 101; | |
// a^2 + b^2 + c^2 + d^2 = 101 | |
// Loop a | |
for (let a = 0; a < x; ++a) { | |
// Loop b | |
for (let b = 0; b < a; ++b) { | |
// Loop c |
NewerOlder