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
SELECT TOP 100 | |
total_elapsed_time / execution_count / 1000.0 AS [平均実行時間(ミリ秒)] | |
, total_worker_time / execution_count / 1000.0 AS [平均 CPU 時間(ミリ秒)] | |
, total_physical_reads / execution_count AS [平均物理I/O 数] | |
, (total_logical_reads + total_logical_writes) | |
/ execution_count AS [平均論理I/O 数] | |
, SUBSTRING(text, (statement_start_offset / 2) + 1, | |
((CASE statement_end_offset | |
WHEN -1 THEN DATALENGTH(text) | |
ELSE statement_end_offset |
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
class Emacsable | |
def self.readline(prompt) | |
print prompt | |
(gets || '').chomp | |
end | |
end | |
Pry.config.input = Emacsable | |
Pry.config.pager = 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
@ruby -x "%~f0" %* & exit /b | |
#!ruby | |
# list recent startup and shutdown time | |
require 'tempfile' | |
require 'csv' | |
require 'date' | |
file = Tempfile.new('event') | |
CMD = "Get-EventLog System -After (Get-Date).AddMonths(-2) | Where-Object { $_.InstanceId -eq 12 -or $_.InstanceId -eq 13 } | Sort-Object TimeGenerated | Export-CSV #{file.path} -notype " |
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
require 'minitest/autorun' | |
class TestMyClass < Minitest::Test | |
def setup | |
@orig_stdin = $stdin | |
@in = StringIO.new | |
$stdin = @in | |
end |
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
require File.expand_path(File.dirname(__FILE__) + '/neo') | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points | |
# |
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
Sub Macro1() | |
Dim i As Long | |
For i = 1 To Selection.Count | |
If Not IsEmpty(Selection(i)) Then | |
If Selection(i).Value = "(NULL)" Or _ | |
Asc(Selection(i)) = -31871 Or _ | |
Asc(Selection(i)) = 63 Then | |
Selection(i).ClearContents | |
End If | |
End If |
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
Public Sub VisibleNames() | |
Dim name As Object | |
For Each name In Names | |
If name.Visible = False Then | |
name.Visible = True | |
End If | |
Next | |
MsgBox "すべての名前の定義を表示しました。", vbOKOnly | |
End Sub |
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
// fibonacci number | |
alert( | |
(function(n) // nameless function 1 | |
{ // nameless function1 body | |
return "1," + (f = function(a, b, n) // nameless function 2 | |
{ // nameless function2 body | |
if (n == 0 ) | |
{ | |
return ""; | |
} |
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
for /F "tokens=1,2,3" %%a in (abc.txt) do ( | |
echo %%b %%a %%c | |
) |
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
select to_char(123.12342145, 'TM9'), to_char(123784927348923.0010000, 'TM9') from dual |