「Oracle入門」DBMS_LOCK.SLEEPを利用する方法
SQL構文
DECLARE -- LOCAL VARIABLES HERE I INTEGER;BEGIN -- TEST STATEMENTS HERE DBMS_OUTPUT.PUT_LINE(TO_CHAR(SYSDATE ...「VBScript入門」Replace 関数で一部文字列を置換するサンプル
説明
Replace(strString, strFind, strRep )
strString:置換元文字列
strFind:検索文字列
strRep:置換先文字列
posStart:開始位 ...
PythonのStringIOモジュールでファイルのように文字列を読み書き
1.ファイル操作のPythonコード:
import string, os, sys
import StringIO
def writedata(fd, msg):
fd.write(msg) ...
Pythonでサーバー情報を取得
サンプルコード:
sUrl = ‘
sock = urllib2.urlopen(sUrl)
sock.headers.values()
「Python」複数のファイルを一括リネームするスクリプト
Pythonのコード下記:
#!/usr/bin/env python
#coding=utf-8
import os,os.path
import shutil,string
dir = ...
Python 簡単なファイルバックアップスクリプト
スクリプトのコード:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# backup.py
”’ バックアップしたいファ ...
Pythonのhashlibモジュールの使い方
Pythonコード:
#-*- encoding:utf-8-*-
import hashlib
a = “都議会、ヤジ自粛の動き”
print hashlib.md5(a) ...
Python バブルソートアルゴリズムのサンプルコード
サンプルコード下記:
def bubble(list):
flag=1
tail=len(list)-1
while(flag):
flag=0
for i in range(tail) ...
Pythonでurldecodeの使い方プログラム
サンプルコード:
import urllib
def urldecode(query):
d = {}
a = query.split(‘&’)
for ...
Lightning 3.5a1 をダウンロード
ダウンロード
提供元サイトからダウンロード
Pythonにuuidを生成する方法
サンプルコード:
#-*- encoding: utf-8 -*-
import uuid
print uuid.uuid1()
print uuid.uuid3(uuid.NAMESPACE_ ...
「ES6」テンプレート文字列に式を埋め込む
構文
console.log(` ${式1} test
message ${式2}.`);
使用例
<script>let x = 3;let y = 4;alert('通常の文字列の計算 ...Pythonでシンプルなプロキシサーバーを実現するプログラム
Pythonコード:
#/bin/env python
#coding:utf-8
import socket,select,sys,time
import thread
s_list ...
pythonでディレクトリをコピー操作
Pythonコード:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
sourceDir = ...
Pythonでテキストファイルを結合する方法
Pythonコード:
import sys,os,msvcrt
def join(in_filenames, out_filename):
out_file = open(out_filename, ...
Pythonでunicodeのファイルを読み込み
サンプルコード:
#coding=utf-8
import os
import codecs
def writefile(fn, v_ls):
f = codecs.open(fn, ...
Pythonのzipfileモジュールの利用方法メモ
Pythonコード
1.方法1:
import zipfile
z = zipfile.ZipFile(filename, ‘r’) #第二パラメータにrでzipファイルを読み取 ...
Pythonで大量ランダムmd5を生成する
サンプルコード:
import string, random
look_set = string.ascii_letters + string.digits
md5_len = 32
tmp_md5_l ...