Skip to content

Instantly share code, notes, and snippets.

@fornext1119
fornext1119 / gist:2359450
Created April 11, 2012 13:55
Python で Excel のシート名一覧を出力
# coding: cp932
import win32api, win32con, win32com, win32com.client, os, time, sys
excelApp = win32com.client.Dispatch("Excel.Application")
excelApp.Visible = True
excelApp.DisplayAlerts = False #警告メッセージをOFF
#ブックを読み取り専用で開く
book = excelApp.workbooks.open(sys.argv[1], False, True)
for sheet in book.Worksheets:
@fornext1119
fornext1119 / gist:2849484
Created June 1, 2012 06:18
VBScriptでフォルダ内のSQLを読んで実行結果をTAB区切りファイルに出力する
Option Explicit
Private fs
Private conn
'結果出力
Private Sub writeResult(rs, sqlFile)
'上書きか、追加書き込みか
Dim mode: mode = "2" '2:ForWriting
If WScript.Arguments.Count > 2 Then
@fornext1119
fornext1119 / gist:2848325
Created June 1, 2012 03:01
VBScriptでフォルダ内のSQLを読んで実行結果をExcelに出力する
Option Explicit
Private fs
Private conn
Private excelApp
Private excelBook
Private excelSheet
'出力シートの準備
Private Sub openSheet(iSheet, sqlFile)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fornext1119
fornext1119 / 0_reuse_code.js
Created March 5, 2016 04:06
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

ヤコビの反復法

use constant N => 3;

my @a = ([9,2,1,1],[2,8,-2,1],[-1,-2,7,-2],[1,-1,-2,6]);
my @b = (20,16,8,17);
my @c = (0,0,0,0);

# ヤコビ反復法
jacobi(\@a, \@b, \@c);
@fornext1119
fornext1119 / DeleteNames.bas
Created September 9, 2013 02:10
Excel の 名前定義 を 一括削除
Public Sub DeleteNames()
For Each nm In ActiveWorkbook.Names
Debug.Print nm.Name
nm.Delete
Next
End Sub