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 Shape where | |
import Data.List (nub) | |
data Circle = Circle { radius :: Float } | |
data Triangle = Triangle { a :: Float, b :: Float, c :: Float } | |
class Dimensions shape where | |
name :: shape -> String |
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 Even where | |
import Prelude | |
import Data.Foldable (product) | |
import Data.Array (concatMap, null, sort, filter, length, (..)) | |
import Data.Array.Partial (head, tail) | |
import Partial.Unsafe (unsafePartial) | |
import Control.MonadZero (guard) |
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
-- lazy vs non-lazy folds | |
-- works on infinite lists | |
take 5 $ foldr (:) [] [1..] | |
-- infinite loop | |
cons' = flip (:) -- acc is first arg to foldl | |
take 5 $ foldl cons' [] [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
Optimization terminated successfully. | |
Current function value: 0.375376 | |
Iterations: 6 | |
Function evaluations: 6339 | |
Logit Regression Results | |
============================================================================== | |
Dep. Variable: agency No. Observations: 31414 | |
Model: Logit Df Residuals: 31315 | |
Method: MLE Df Model: 98 | |
Date: Thu, 19 Apr 2018 Pseudo R-squ.: 0.4584 |
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
Optimization terminated successfully. | |
Current function value: 0.272877 | |
Iterations: 8 | |
Function evaluations: 8498 | |
Logit Regression Results | |
============================================================================== | |
Dep. Variable: agency No. Observations: 31414 | |
Model: Logit Df Residuals: 31313 | |
Method: MLE Df Model: 100 | |
Date: Thu, 19 Apr 2018 Pseudo R-squ.: 0.6063 |
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
/usr/local/lib/python2.7/site-packages/statsmodels/compat/pandas.py:56: FutureWarning: The pandas.core.datetools module is deprecated and will be removed in a future version. Please use the pandas.tseries module instead. | |
from pandas.core import datetools | |
/usr/local/lib/python2.7/site-packages/statsmodels/discrete/discrete_model.py:1214: RuntimeWarning: overflow encountered in exp | |
return 1/(1+np.exp(-X)) | |
/usr/local/lib/python2.7/site-packages/statsmodels/discrete/discrete_model.py:1264: RuntimeWarning: divide by zero encountered in log | |
return np.sum(np.log(self.cdf(q*np.dot(X,params)))) | |
Warning: Maximum number of iterations has been exceeded. | |
Current function value: inf | |
Iterations: 35 | |
Traceback (most recent call last): |
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 Set | |
import Text.Pretty.Simple (pPrint) | |
c1 = Card { shape = Pill, color = Red, shade = Clear, count = One } | |
c2 = Card { shape = Squiggle, color = Purple, shade = Clear, count = Two } | |
c3 = Card { shape = Diamond, color = Green, shade = Clear, count = Three } | |
c4 = Card { shape = Squiggle, color = Purple, shade = Solid, count = Two } | |
c5 = Card { shape = Diamond, color = Green, shade = Solid, count = One } |
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 Set | |
( findSets | |
, Shape (..) | |
, Color (..) | |
, Shade (..) | |
, Card (..) | |
, Count (..) | |
) where | |
import Data.List (nub, sort, tails) |
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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" | |
) |
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 Data.Char (isSpace) | |
import qualified Data.List as D | |
import qualified Data.List.Split as S | |
import qualified Data.Map.Strict as M | |
import Data.Maybe (fromMaybe) | |
import qualified Text.Read as TR | |
data Score = Score |