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 <cstdint> | |
#include <vector> | |
#include <cmath> | |
struct unique_factorization_element { | |
std::uint32_t prime; | |
std::uint8_t pow; | |
}; | |
std::ostream& operator<< (std::ostream& os, const unique_factorization_element& e) | |
{ |
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
#ifndef INFERIOR_ITERATOR_CONTIGUOUS_ITERATOR_HPP_ | |
#define INFERIOR_ITERATOR_CONTIGUOUS_ITERATOR_HPP_ | |
#include <inferior/no_min_max.h> | |
#include <cstddef> | |
#include <iterator> | |
#include <inferior/type_traits.hpp> | |
namespace inferior { | |
template<typename Container> | |
class contiguous_iterator { |
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
document.addEventListener("DOMContentLoaded", () => { | |
"use strict"; | |
Array.from(document.getElementsByClassName("math-render")) | |
.filter(e => !e.mathRendered) | |
.forEach(e => { | |
try { | |
katex.render(e.textContent, e, {displayMode: true }); | |
} catch (ex) { | |
e.textContent = ex.message; | |
} |
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 <iterator> | |
#include <vector> | |
#include <iostream> | |
#include <utility> | |
struct Vec2f{ | |
float x; float y; | |
}; | |
struct Circle { | |
Vec2f pos; | |
float size; |
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 <sstream> | |
#include <string> | |
int proc_main(std::istream& is, std::ostream& os) | |
{ | |
std::string pn; | |
if(!std::getline(is, pn)) return 1; | |
if("P2" != pn) return 2; | |
std::string tmp; | |
if(!std::getline(is, tmp)) return 3; |
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
<VirtualHost *:80> | |
ServerName netdata.irregular-at-tus.work | |
ServerAdmin https://qiitadon.com/@yumetodo | |
DocumentRoot /usr/share/netdata/web/ | |
Redirect permanent "/" "https://netdata.irregular-at-tus.work/" | |
ErrorLog /home/for_netdata/logs/netdata-error.log |
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
inline constexpr int get_u8_byte_count(char ch) { | |
if (0 <= uint8_t(ch) && uint8_t(ch) < 0x80) { | |
return 1; | |
} | |
if (0xC2 <= uint8_t(ch) && uint8_t(ch) < 0xE0) { | |
return 2; | |
} | |
if (0xE0 <= uint8_t(ch) && uint8_t(ch) < 0xF0) { | |
return 3; | |
} |
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
digraph G { | |
"_M_realloc_insert" -> "_M_check_len" | |
"_M_fill_insert" -> "_M_check_len" | |
"_M_default_append" -> "_M_check_len" | |
"_M_range_insert" -> "_M_check_len" | |
"emplace_back" -> "_M_realloc_insert" | |
"insert" -> "_M_realloc_insert" | |
"_M_insert_rval" -> "_M_realloc_insert" | |
"_M_emplace_aux" -> "_M_realloc_insert" | |
"push_back" -> "_M_realloc_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
私は長い間nullptrの型はvoid*と思い込んで居たのですが、実は違います。 | |
nullptrの型はstd::nullptr_tとおなじになります。 | |
std::nullptr_tは、cstddefヘッダでtypedefされている型で、decltype(nullptr)の別名となっています。内部的な型名は決まっていません。 | |
decltypeは(後日解説予定ですが)C++11で追加された重要機能で引数の「型」を返します。つまり、decltype(nullptr)はnullptrの「型」です。そのまんまですね。(笑) |