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 python | |
import io | |
import os | |
import sys | |
import json | |
import subprocess | |
import codecs | |
import re | |
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
MariaDB [(none)]> show engines; | |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+ | |
| Engine | Support | Comment | Transactions | XA | Savepoints | | |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+ | |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | |
| CSV | YES | CSV storage engine | NO | NO | NO | | |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES | | |
| MyISAM | YES | MyISAM storage engine |
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._ | |
package info.pandanote.test | |
import scala.reflect.ClassTag | |
import scala.math._ | |
// BreezeのComplexクラスを元にして複素数を扱うためのクラスを書いてみました。 |
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 | |
// Scalaで複素数を扱うためのテスト用のコード例です。 | |
// このコードは無保証であり、使用したことよって得られる結果については一切保証いたしません。 | |
// 詳細は以下のURLを参照いただけると幸いです。 | |
// https://pandanote.info/?p=1849 | |
object ComplexNumberTest { | |
def main(args: Array[String]): Unit = { | |
val a = ComplexNumber(-2,4) |
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
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5" | |
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test" | |
logBuffered in Test := false |
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 org.scalatest.Assertions | |
import org.scalatest._ | |
class ComplexNumberTest extends FlatSpec with Matchers { | |
"a" should "123" in { | |
val a = "123" | |
a should be("123") | |
} |
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
RewriteEngine on | |
# その他の設定 | |
# Redirection for "catchphrase". | |
RewriteRule ^/catchphrase[^/]*$ /index.php?page_id=1874 [L,QSA] | |
<LocationMatch /catchphrase> | |
Require all granted | |
</LocationMatch> | |
<Location /> |
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
# Redirection for "catchphrase". | |
RewriteCond %{QUERY_STRING} ^((?:[^&]*&)*)page_id=1874&?(.*)$ | |
RewriteRule ^.*$ /catchphrase?%1%2 [R=301,L] |
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
function add_this_script_footer(){ | |
if (is_mobile() && preg_match("#^/recolog#",$_SERVER['REQUEST_URI'])) { | |
?> | |
// ここにMobile Popoverのコードを挿入。 | |
<?php | |
} | |
} | |
add_action('wp_footer', 'add_this_script_footer',999); |
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")) | |