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 info.pandanote.test; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.Set; | |
public class CountElement { |
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/bin/env python3 | |
# | |
# See https://pandanote.info/?p=7456 | |
# | |
import bpy | |
import bmesh | |
import math | |
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
{ | |
"key1": ["a1","a2","a3"], | |
"key2": ["b1","b2","b3","b4"], | |
"key3": ["c1","c2","c3","c4","c5"], | |
"key4": ["d1","d2","d3","d4","d5","d6"], | |
"key5": ["e1","e2","e3"], | |
"key6": ["f1","f2","f3"], | |
"key7": ["a1","a2","a3"], | |
"key8": ["b1","b2","b3","b4"], | |
"key9": ["c1","c2","c3","c4","c5"], |
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 | |
# | |
# See https://pandanote.info/?p=7259 for details. | |
# | |
MODE="start" | |
SERVER="192.168.11.11" | |
if [ -n "$1" ]; then | |
MODE="stop" | |
fi |
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
[Unit] | |
Description=Growi | |
After=network-online.target mongod.service mariadb.service openvpn-client@client.service | |
[Service] | |
WorkingDirectory=/opt/wiki/growi | |
EnvironmentFile=/etc/sysconfig/growi | |
ExecStart=/bin/bash /opt/wiki/startgrowi.sh | |
ExecStop=/bin/bash /opt/wiki/startgrowi.sh stop | |
[Install] | |
WantedBy=multi-user.target |
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/bin/perl | |
# See https://pandanote.info/?p=7242 for details. | |
package ServerStatus; | |
use strict; | |
use warnings; | |
use DBI; | |
sub getStatus { | |
my $dbh = DBI->connect('DBI:MariaDB:database=serverstatus;host=localhost', |
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
-- See https://pandanote.info/?p=7242 for details. | |
drop database if exists serverstatus; | |
create database serverstatus; | |
grant all privileges on serverstatus.* to 'serverstatus'@'%' identified by 'Some password to store the status of the remote server.'; | |
grant all privileges on serverstatus.* to 'serverstatus'@'localhost' identified by 'Some password to store the status of the remote server.'; | |
use serverstatus; | |
drop table if exists serverstatus; | |
create table serverstatus ( | |
id int not null auto_increment, | |
status int not null, |
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/bin/python3 | |
# | |
# See https://pandanote.info/?p=7224 for details. | |
# | |
import io | |
import sys | |
import os | |
import argparse | |
import openpyxl |
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/bin/python3 | |
# | |
# See https://pandanote.info/?p=6970 for details. | |
# | |
import datetime | |
import math | |
import json | |
import numpy as np | |
from scipy.sparse import lil_matrix | |
import io, sys |
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
;; See https://pandanote.info/?p=6871 for details. | |
(defun insert-timestamp-for-githubpages () | |
"Insert time stamp into the line starting from \"update: \"." | |
(interactive) | |
(goto-char 0) | |
(if (re-search-forward "^update:.*$" nil t) | |
(replace-match (concat "update: " (current-time-string) " " (format-time-string "%z")))) | |
) | |
(defun insert-timestamp-for-githubpages-for-markdown () |