Skip to content

Instantly share code, notes, and snippets.

View noborus's full-sized avatar

Noboru Saito noborus

View GitHub Profile
@noborus
noborus / gist:4e3103f75a60903a8b2049aa33c05f85
Created May 18, 2024 04:09
PostgreSQL 16.0共通化対象文
# PostgreSQL 16.0共通化対象文
| no | count | en | ja |
|----|-------|----------------------------------------------------------------------------------------------------------------------------------------
アーカイバ
アーカイバプロセス
アーカイビング
アーカイブ
アーカイブコマンド
アーカイブサポート
アーカイブシステム
アーカイブステータスディレクトリ
アーカイブセグメント
アーカイブツール
# Features of ov
Column selection is possible in wrap mode.
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func main() {
@noborus
noborus / temporary_table.md
Last active May 7, 2024 09:36
TEMPORARY TABLE(一時テーブル)を探る

TEMPORARY TABLE(一時テーブル)を探る

TEMPORARY TABLE(一時テーブル)を探る

PostgreSQLのTEMPORARY TABLE(一時テーブル)について主に速度面について探っていきます。 ここで書かれていることはPostgreSQL 10を対象としています。

はじめに

PostgreSQLのTEMPORARY TABLE(一時テーブル)は接続したセッションの間にしか生存できないテーブルです。このテーブルは他のセッションからはアクセスすることができません。

@noborus
noborus / 0_reuse_code.js
Created March 20, 2014 04:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
SELECT e.euc,convert(e.euc,'EUC_JIS_2004','UTF-8') as utf8, convert_from(convert(e.euc,'EUC_JIS_2004','UTF-8'),'UTF-8') as chr FROM (SELECT decode('8f'||to_hex('xa1a1'::bit(16)::int+generate_series(0,93)),'hex') as euc ) as e;
euc | utf8 | chr
----------+------------+-----
\x8fa1a1 | \xf0a08289 | 𠂉
\x8fa1a2 | \xe4b882 | 丂
\x8fa1a3 | \xe4b88f | 丏
\x8fa1a4 | \xe4b892 | 丒
\x8fa1a5 | \xe4b8a9 | 丩
SELECT '0x' ||
encode(substr(s.word::text,generate_series(1,length(s.word::text),1),1)::bytea, 'hex') AS code,
substr(s.word::text,generate_series(1,length(s.word::text),1),1) AS char
FROM
(SELECT '漢字' AS word) AS s;
code | char
----------+------
0xe6bca2 | 漢
0xe5ad97 | 字
SELECT COUNT (char) AS frequency, char
FROM
(SELECT substr (column_name, generate_series (1, LENGTH (column_name)), 1) AS char
FROM table_name) AS d
GROUP BY char
ORDER BY frequency DESC;
@noborus
noborus / akemasite.rb
Created December 31, 2013 15:10
IBusをONにして自動で入力正月バージョン
#! /usr/bin/ruby
# -*- coding: utf-8 -*-
require 'dbus'
INPUT_TEXT="akemasiteomedetougozaimasu"
IBUS_SERVICE="org.freedesktop.IBus"
IBUS_PATH_IBUS="/org/freedesktop/IBus"
IBUS_INTERFACE_IBUS="org.freedesktop.IBus"