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
function Test-Number([int]$In) { | |
if ($In -eq 3) { | |
continue | |
} else { | |
return (($In % 2) -eq 0) | |
} | |
} | |
foreach ($test in @(1,2,3,4,5)) { | |
Write-Host "checking $test" |
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
void Main() | |
{ | |
XmlSchemaSet schemaSet = new XmlSchemaSet(); | |
schemaSet.Add("http://rookie.ru/schema", "D:\\test.xsd"); | |
schemaset.Compile();//throws | |
var schemas = new XmlSchemas(); | |
foreach (XmlSchema schema in schemaSet.Schemas()) | |
{ |
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
foreach ( $file in gci -Path .\ -Filter "*.dll" -Recurse) { | |
$assembly = [System.Reflection.Assembly]::LoadFrom($file.FullName) | |
$attributes = $assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $false); | |
if ($attributes.Length -gt 0) { | |
[System.Diagnostics.DebuggableAttribute]$debuggable = $attributes[0]; | |
if ($debuggable -ne $null -and $debuggable.DebuggingFlags.HasFlag([System.Diagnostics.DebuggableAttribute+DebuggingModes]::Default)) { | |
$file.FullName | |
$debuggable.DebuggingFlags | |
} | |
} |
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
$debugRegex = 'Debug' | |
$releaseRegex = 'Release' | |
$path = 'g:\Projects\' | |
$f = "*.*proj" | |
foreach ( $file in gci -Path $path -Filter $f -Recurse) { | |
$file.FullName | |
foreach($line in [System.IO.File]::ReadLines($file.FullName) | Where-Object {$_ -match $debugRegex}) | |
{ | |
if( $line -match $releaseRegex) { |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"sync" | |
"time" | |
) | |
type Pool interface { |
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
package singleton | |
var Instance *_Singleton | |
type _Singleton struct { | |
SharedResource int | |
} | |
func _Load() { | |
Instance = &_Singleton{SharedResource: 1} |