This file contains hidden or 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
# encoding: SJIS | |
begin | |
1/0 | |
rescue ZeroDivisionError => e | |
p e.backtrace | |
end |
This file contains hidden or 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
# encoding: SJIS | |
1/0 rescue p 1 |
This file contains hidden or 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
# encoding: SJIS | |
begin # run | |
p 1 | |
rescue # Do not run , because of no-execption occurs. | |
p 0 | |
else # run , because of no-execption occurs. | |
p 2 | |
ensure # run always at last. | |
p 3 |
This file contains hidden or 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
# encoding: SJIS | |
def foo | |
-1 / 0 | |
rescue | |
p 1 | |
end | |
foo | |
# => 1 |
This file contains hidden or 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
This | |
is | |
a | |
pen |
This file contains hidden or 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
using System; | |
using System.Linq; | |
namespace ParseInt | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Success |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
.DESCRIPTION | |
.PARAMETER base_path | |
.PARAMETER max_depth | |
.PARAMETER depth | |
.EXAMPLE | |
Get-FolderHierarchy "C:\Windows" | |
.EXAMPLE |
This file contains hidden or 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 bool XmlValidTest( string path_xml , string path_schema ) | |
{ | |
using (XmlTester tester = new XmlTester()) | |
{ | |
if( tester.Test(path_schema, path_xml) ) | |
{ | |
return true; | |
} | |
} | |
return false; |
This file contains hidden or 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
XElement po = XElement.Load(path_xml); | |
// <Substrates> | |
// <Substrate SubstrateType = "Strip" SubstrateId = "@@@"> | |
var elems = po.Elements().Descendants() | |
.Where(node => node.Name.LocalName == "Substrate" | |
&& (string)node.Attribute("SubstrateType") == "Strip" | |
&& node.Attribute("SubstrateId") != null | |
) | |
.Select(elem => elem.Attribute("SubstrateId").Value); |
This file contains hidden or 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
function Write-ErrorLog { | |
param( $file_name , $message ) | |
Write-Error $message 2>&1 | Tee-Object -FilePath $file_name -Append | |
} |