import Data.List (nub, permutations)
let a = [ [a, b, c] | a <- [1..9], b <- [1..9], c <- [1..9], a <= b, b <= c, a + b + c == 21]
let comb = nub $ concatMap permutations a
forM_ comb (\[a,b,c] -> putStrLn $ "(" <> show a <> ", " <> show b <> " ," <> show c <> ")\\")
forM_ a (\[a,b,c] -> putStrLn $ "(" <> show a <> ", " <> show b <> " ," <> show c <> ")\\")
length comb
28
length a
7
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
[] |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.17; | |
/** | |
* @dev Interface of the ERC20 standard as defined in the EIP. | |
*/ | |
interface IERC20 { | |
/** | |
* @dev Emitted when `value` tokens are moved from one account (`from`) to | |
* another (`to`). |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"region": "旧北区", | |
"category": "タテハチョウ科", | |
"img_src": "pa-sp/nymph/ooitimoji.jpg", | |
"pdf_src": "butterfly_pdf/p_arc/p_arc-ny 4.pdf", | |
"img_path": "./assets/old_north/images/ooitimoji.jpg", | |
"pdf_path": "./assets/old_north/pdf/p_arc-ny%204.pdf", | |
"jp_name": "オオイチモンジ", | |
"eng_name": "Limenitis_populi", |
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
extern crate hex; // 0.4.0 | |
extern crate reqwest; // 0.9.20 | |
extern crate serde_json; // 1.0 | |
use reqwest::{StatusCode, Url}; | |
use serde_json::{json, Value}; | |
use std::fmt; | |
use std::fs; | |
fn main() { |
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
extern crate hex; // 0.4.0 | |
extern crate reqwest; // 0.9.20 | |
extern crate serde_json; // 1.0 | |
use reqwest::{StatusCode, Url}; | |
use serde_json::{json, Value}; | |
use std::fmt; | |
use std::fs; | |
pub fn get_dominant_colors(image_url: &Url) -> Result<Vec<Color>, Box<dyn std::error::Error>> { |
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
extern crate hex; // 0.4.0 | |
extern crate reqwest; // 0.9.20 | |
extern crate serde_json; // 1.0 | |
use reqwest::{StatusCode, Url}; | |
use serde_json::{json, Value}; | |
use std::fmt; | |
use std::fs; | |
pub fn get_dominant_colors(image_url: &Url) -> Result<Vec<Color>, Box<dyn std::error::Error>> { |
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 #-} | |
module Lib where | |
import RIO hiding (lines) | |
import qualified RIO.Text as T | |
import Data.Aeson (FromJSON (..), ToJSON (..), object, withObject, | |
(.:), (.=)) | |
import Data.Aeson.Encode.Pretty (encodePretty) |
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
PROJECT_NAME = <enter your project name here> | |
help: ## Print documentation | |
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | |
stylish-haskell: ## Apply stylish-haskell on all *.hs files | |
@find . -type f -name "*.hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i | |
ghci: ## Run repl | |
@stack ghci $(PROJECT_NAME):lib --haddock-deps --ghci-options=-fobject-code |
NewerOlder