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
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
-- https://en.wikipedia.org/wiki/Okapi_BM25 | |
module OkapiBM25 | |
( Database | |
, mkDatabase | |
, query | |
) where |
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 psycopg2 | |
dsn = "postgresql://user:password@localhost:5432/" | |
db_name = "test_db" | |
conn = psycopg2.connect(dsn) | |
try: | |
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
with conn.cursor() as cur: |
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 Control.Monad | |
import Turtle | |
main :: IO () | |
main = sh $ | |
forM_ [(1::Int)..2] $ \i -> do | |
j <- select [(1::Int)..3] | |
liftIO $ print (i, j) | |
{- |
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 ConstraintKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
module QueryInterface where | |
-- Maybe (GHC.Exts.DictBox a) | |
data QueryIntefaceResult a where |
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
{-# OPTIONS_GHC -Wall #-} | |
----------------------------------------------------------------------------- | |
-- | | |
-- Module : RWLock | |
-- Copyright : (c) Masahiro Sakai 2023 | |
-- License : BSD-3-Clause | |
-- | |
-- Simple implement of various variants of RWLocks. | |
-- |
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
{-# OPTIONS_GHC -Wall #-} | |
----------------------------------------------------------------------------- | |
-- | | |
-- Module : FairLock | |
-- Copyright : (c) Masahiro Sakai 2023 | |
-- License : BSD-3-Clause | |
-- | |
-- Simple Lock implemented using STM. | |
-- When multiple threads are blocked on a Lock, they are woken up in FIFO order. |
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 | |
{- | |
https://www.rco.recruit.co.jp/career/engineer/entry/pastexam | |
例題:1 「相手の思考を推理する」過程をプログラムで表現してください。 | |
※こちらは回答例がございません。予めご了承ください。 | |
問題内容 | |
A,B,Cの3人が1〜5の5枚のカードを使ってインディアンポーカーをします。 |
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 (main) where | |
import Control.Concurrent.Async | |
import Control.Concurrent | |
import Control.Exception | |
import Control.Monad | |
import Data.IORef | |
import Foreign.C | |
import System.Random.MWC |
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
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
-- translated from https://github.com/chokkan/liblbfgs | |
module LineSearch | |
( Params (..) | |
, defaultParams | |
, lineSearch | |
, lineSearchMoreThuente | |
) where |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder