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
# ---------------------------------------------------------------------------------------------------------- | |
# PowerShell as LINQ | |
# * When I created this snippet, the blog written by NyaRuRu-san was very helpful. | |
# I would like to thank him for his article: | |
# - PowerShell で LINQ - NyaRuRuの日記: http://d.hatena.ne.jp/NyaRuRu/20080112/p2 | |
# | |
# Change History | |
# * 2012/06/20 07:23:24: Fix the bug that occurs unintended pipeline breaking. | |
# The keyword 'return' is reserved, so I use the function name 'run' instead of it. | |
# * 2012/06/23 22:26:47: Fix the bug that function 'run' doesn't stop enumeration. |
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
$script = { | |
($InputObject, $2to1Ready, $1to2Ready, $2to1End, $1to2End) = $($input) | |
$InputObject_ = $InputObject.GetNewClosure() | |
try { | |
do { | |
& $InputObject_ | | |
ForEach-Object { | |
$_ | |
[Void]$2to1Ready.Set() | |
[Void]$1to2Ready.WaitOne() |
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
#pragma once | |
#ifndef URASANDESU_SWATHE_METADATA_BASECLASSPIMPL_BASETYPEMETADATAPIMPL_HPP | |
#define URASANDESU_SWATHE_METADATA_BASECLASSPIMPL_BASETYPEMETADATAPIMPL_HPP | |
#ifndef URASANDESU_SWATHE_METADATA_BASECLASSPIMPL_BASETYPEMETADATAPIMPL_H | |
#include <Urasandesu/Swathe/Metadata/BaseClassPimpl/BaseTypeMetadataPimpl.h> | |
#endif | |
namespace Urasandesu { namespace Swathe { namespace Metadata { namespace BaseClassPimpl { |
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
#include "stdafx.h" | |
#ifndef URASANDESU_SWATHE_METADATA_SIGNATURE_H | |
#include <Urasandesu/Swathe/Metadata/Signature.h> | |
#endif | |
#ifndef URASANDESU_SWATHE_METADATA_IMETHOD_H | |
#include <Urasandesu/Swathe/Metadata/IMethod.h> | |
#endif |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using Mono.Cecil; | |
using Mono.Cecil.Cil; | |
namespace ConsoleApplication9 | |
{ |
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
# +実行には、事前に PSAnonym(https://github.com/urasandesu/PSAnonym) のインストールが必要。 | |
# +また、PSAnonym は PowerShell v2 でしか動作しないため、このコード片を実行するには、 | |
# PS C:\> powershell -version 2 | |
# する等して、プロンプトの実行環境を合わせてやる必要がある。 | |
Import-Module Urasandesu.PSAnonym | |
# ----------------------------------------------------------------------------------------------- | |
# | |
# テンプレートエンジンを構成するプロトタイプ群 | |
# |
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.IO; | |
namespace mscorlib.Prig | |
{ | |
public class EHClass | |
{ | |
public void ReadFile(string path, int index) | |
{ | |
var file = default(StreamReader); |
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.Collections.Generic; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
namespace EHTrial | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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
#include "stdafx.h" | |
#include <Urasandesu/Swathe/Swathe.h> | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
using namespace Urasandesu::Swathe; | |
using namespace Urasandesu::Swathe::Hosting; | |
using namespace Urasandesu::Swathe::Metadata; | |
using namespace Urasandesu::Swathe::StrongNaming; | |
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
... | |
STDMETHODIMP CWeaverImpl::JITCompilationStartedCore( | |
/* [in] */ FunctionID functionId, | |
/* [in] */ BOOL fIsSafeToBlock) | |
{ | |
using boost::lexical_cast; | |
using boost::filesystem::path; | |
using std::vector; | |
using Urasandesu::CppAnonym::Utilities::AnyPtr; |
OlderNewer