Skip to content

Instantly share code, notes, and snippets.

View naruoga's full-sized avatar

Naruhiko Ogasawara naruoga

View GitHub Profile
@naruoga
naruoga / openapi-trial.ipynb
Created April 30, 2023 10:36
OpenAPI Trial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@naruoga
naruoga / docker-compose.redmine.yml
Created July 14, 2020 12:43
試用には困らないけどメールとか送りたいならもちょっと詰めないと
version: '3.1'
services:
redmine:
image: redmine
restart: always
ports:
- 8080:3000
volumes:
@naruoga
naruoga / zformat.cxx
Created May 11, 2020 11:49
zformat refactoring
static std::map<LanguageType, std::vector<sal_uInt8>> tblDbNumToNatNum= {
{ primary(LANGUAGE_CHINESE), { 4, 5, 6, 0 } },
{ primary(LANGUAGE_JAPANESE), { 4, 5, 3, 0 } },
{ primary(LANGUAGE_KOREAN), { 1, 2, 3, 9 } }
};
// static
sal_uInt8 SvNumberNatNum::MapDBNumToNatNum( sal_uInt8 nDBNum, LanguageType eLang, bool bDate )
{
sal_uInt8 nNatNum = 0;
# 無理くりワンライナーで書いたのが以下
# awk '/^#/ { l=$0; if (l ~ /Rows_query/) f=1; else if (l ~ /at/) f=0; else if (f==1) sub(/^#[ ]*/, "", l); print l } !/^#.*/ '
/^#/ { # 先頭が # で始まる行の場合
l=$0
if (l ~ /Rows_query/) # Rows_query があったらフラグON
f=1
else if (l ~ /at/) # at があったらフラグOFF
f=0
else if (f==1) # どっちでもなくて、フラグONの状態ならdecommentしたい行
@naruoga
naruoga / writersample.xml
Created January 26, 2020 02:47
ODF write document sample
<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-f
Book1.ods: Info: ODF version of root document: 1.2
internal:/schema/odf1.2/OpenDocument-v1.2-os-manifest-schema.rng: Info: parsed.
Book1.ods/META-INF/manifest.xml[2,88]: Error: element "manifest:manifest" is missing "version" attribute
es:tc:opendocument:xmlns:manifest:1.0"><manifest:file-entry manifest:full-path= ----^ Book1.ods/META-INF/manifest.xml: Info: 1 errors, no warnings
Book1.ods/mimetype: Info: no errors, no warnings
Book1.ods: Info: Media Type: application/vnd.oasis.opendocument.spreadsheet
internal:/schema/odf1.2/OpenDocument-v1.2-os-schema.rng: Info: parsed.
Book1.ods/meta.xml: Info: Generator: MicrosoftOffice/16.0 MicrosoftExcel/CalculationVersion-11208
Book1.ods/meta.xml: Info: no errors, no warnings
Book1.ods/styles.xml: Info: no errors, no warnings
this is test
/**
* 引数に含まれたすべての文字が含まれるspan要素の1階層上の要素を示すXPath文字列を生成します。
*
* @param chars 文字の列。例えば「次 へ」の場合は "次", "へ"
* @return XPath文字列
*/
String createXpath(String... chars) {
List<String> containsList = Arrays.asList(chars)
.stream()
.map((s) -> { return String.format("contains(text(), '%s')", s); })
@naruoga
naruoga / sidetoselenide.go
Last active September 8, 2018 02:32
Goの練習として書いた超適当なSelenium IDEの*.side ー> Javaコード変換
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
)
@naruoga
naruoga / gist:ca0bf03a3652677c8c2cd2362cdd8278
Created March 13, 2018 14:01
Selenide.open() TimeoutException Stack Trace
org.openqa.selenium.TimeoutException: timeout
(Session info: chrome=61.0.3163.100)
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 3.10.0-693.11.6.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'dvavx9900201', ip: 'Unknown', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-693.11.6.el7.x86_64', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.chrome.ChromeDriver
selenide.url: http://our-sut-absolute-url
Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=LINUX, acceptSslCerts=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=LINUX, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverV