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 scala.reflect.ClassTag | |
import scala.math._ | |
// A class to represent and to handle a quaternion. | |
// 四元数を扱うためのクラスを書いてみました。 | |
case class Quaternion(real: Double, _i: Double, _j: Double, _k: Double) { | |
override def toString(): String = real + (if (_i == 0.0) "" else ((if (_i>0.0)"+"else"-")+(if (_i>0.0)_i else -_i) + "i")) + (if (_j == 0.0) "" else ((if (_j>0.0)"+"else"-")+(if (_j>0.0)_j else -_j) + "j")) + (if (_k == 0.0) "" else ((if (_k>0.0)"+"else"-")+(if (_k>0.0)_k else -_k) + "k")) | |
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
class CopyrightLinkElement extends HTMLElement { | |
static get observedAttributes() { | |
return ['established']; | |
} | |
constructor() { | |
super(); | |
} | |
connectedCallback() { | |
} |
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 | |
# coding: utf-8 | |
# | |
# See https://pandanote.info/?p=29 for details. | |
# | |
import io | |
import sys | |
import re | |
import codecs |
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/sh | |
# See https://pandanote.info/?p=8118 for details. | |
chown -R nginx /etc/wordpress | |
chown -R nginx /var/lib/php/session | |
chown -R nginx /var/lib/php/wsdlcache/ | |
chown -R nginx /var/lib/php/opcache/ | |
chown -R nginx /usr/share/wordpress/wp-content/uploads/ | |
chown nginx:nginx /var/log/nginx |
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=9956 for details. | |
class Expense: | |
amount = 0 | |
reason = "" | |
remark = "" | |
def __init__(self, amount, reason, remark): | |
self.amount = amount | |
self.reason = reason | |
self.remark = remark |
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
// Inside a Vue instance... | |
dragOver(event) { | |
event.preventDefault(); | |
}, | |
dropFile(event) { | |
event.preventDefault(); dropFile() { | |
if (event.dataTransfer.files.length != 1) { | |
alert("Only one file can be dropped"); | |
return; | |
} |
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
// Inside a Vue instance... | |
dragOver(event) { | |
event.preventDefault(); | |
}, | |
dropFile(event) { | |
event.preventDefault(); | |
if (event.dataTransfer.files.length != 1) { | |
alert("Only one file can be dropped"); | |
return; | |
} |
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/python | |
# | |
# See https://sidestory.pandanote.info/datetime_in_iso8601.html | |
# | |
from datetime import datetime | |
print(datetime.now().astimezone().isoformat()) |
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/python | |
# | |
# See https://sidestory.pandanote.info/datetime_in_iso8601.html | |
# | |
import datetime | |
print(datetime.datetime.now().astimezone().isoformat()) |
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 { |
NewerOlder