View with-js.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
function onChangeCheck(c, cls) { | |
const found = document.getElementsByClassName(cls); | |
for (const elem of found) { | |
if (c.checked) { | |
elem.classList.add('highlighted'); | |
} else { |
View alloc_error.zen
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
const std = @import("std"); | |
const heap = std.heap; | |
var buffer: [4096]u8 = undefined; | |
var allocator = heap.FixedBufferAllocator{ .buffer = &buffer }; | |
fn Node(comptime T: type) type { | |
return struct { | |
next: ?*Node(T), | |
data: T, |
View Bf.kt
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 java.io.IOException | |
class Bf(private val program: BfProgram, memorySize: Int) { | |
private val memory = Array<Byte>(memorySize, {0}) | |
private var pointer = 0 | |
private var data | |
get() = memory[pointer] | |
set(value) { memory[pointer] = value } | |
fun execute(): BfResult<Unit> { |
View lf_count.c
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
size_t simple_count(const char buf[], size_t n) | |
{ | |
size_t count = 0; | |
for(size_t i = 0; i < n; i++) | |
{ | |
if(buf[i] == '\n') | |
{ | |
++count; | |
} | |
} |
View cdsh.c
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 <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
const char *get_dir(int argc, char *argv[]) | |
{ | |
if(argc <= 1) | |
{ | |
const char *home = getenv("HOME"); | |
return (home == NULL) ? "/" : home; |
View hello-endless.c
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 <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]) | |
{ | |
puts("Hello, World!"); | |
if(fork() == 0) | |
{ | |
execlp(argv[0], argv[0], (const char *)NULL); | |
} |
View 9799-base64-2
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
/Td6WFoAAATm1rRGAgAhARYAAAB0L+WjAe1v/Td6WFoAAATm1rRGAgAhARYAAAB0L+WjAe1W/Td6 | |
WFoAAATm1rRGAgAhARYAAAB0L+WjAe0+/Td6WFoAAATm1rRGAgAhARYAAAB0L+WjAe0m/Td6WFoA | |
AATm1rRGAgAhARYAAAB0L+WjAe0P/Td6WFoAAATm1rRGAgAhARYAAAB0L+WjAez2/Td6WFoAAATm | |
1rRGAgAhARYAAAB0L+WjAeze/Td6WFoAAATm1rRGAgAhARYAAAB0L+WjAezG/Td6WFoAAATm1rRG | |
AgAhARYAAAB0L+WjAeyy/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4PAK7/5dAH6Ny0WC5oM4+eHt | |
0vlHXxXkfZoM64Er1xnsSbNSZHKWALPjEkBQGqInILobCwkTFanzaaIZ632Nr+4+xVrHZDiVzoEh | |
JY+LSU9dQ3umjlt2fy6zmUkbX8pMf7kZk8RWEF4wwka/RcaPLOV8zOUSQcvKX5gJJcgAEPywXc6o | |
xQEVs4qkuMr+i0z5BHlCSBldbcNrOws2hrZgIqTdIJHcF4uBlIAhOfbeiMBecRuUx5lg932Y0Mu0 | |
6Xv8aTIZABa2XEy6qWG/ok350wxDVh130NFjBLW4CCpEAexnOv05D4nyx8J3lYvbPCd14C7SlPV5 | |
vVnHyXn+THQJRbwzYaMQ7eNdYRqqGVoKOI23l3ZMx8RDpbYfqBBVRYokO3n0EFDDfW/W6fxDaYgK |
View hoge.rs
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 std::ops::{Index, IndexMut}; | |
use std::thread; | |
use std::sync::Arc; | |
use std::sync::atomic::{AtomicUsize, Ordering}; | |
// 適当行列クラス | |
pub struct Matrix { | |
nr_cols: usize, | |
v: Vec<f64>, // len = nr_cols * (暗黙の nr_rows) | |
} |
View hoge.sh
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
#!/bin/bash | |
readonly infile=hoge.txt | |
iconv -l | while read enc; do | |
if iconv -f $enc -t utf-8 < $infile > tmp.txt 2>/dev/null; then | |
cat tmp.txt | |
echo -- | |
echo $enc | |
echo ========================== |
View fizzbuzz.cpp
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> | |
// リスト | |
template<typename... TS> struct L | |
{ | |
template<typename T> | |
using cons = L<T, TS...>; |
NewerOlder