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
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
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 static IEnumerable<IEnumerable<T>> GeneratePermutations<T>(IEnumerable<T> source) | |
{ | |
var c = source.Count(); | |
if (c == 1) | |
yield return source; | |
else | |
for (int i = 0; i < c; i++) | |
foreach (var shorter_permuttaion in GeneratePermutations<T>(source.Take(i).Concat(source.Skip(i + 1)))) | |
yield return source.Skip(i).Take(1).Concat(shorter_permuttaion); | |
} |
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
def permutations(array): | |
if len(array) < 2: | |
yield array | |
else: | |
for shorter_permutation in permutations(array[1:]): | |
for i in range(len(array)): | |
yield shorter_permutation[:i] + array[0:1] + shorter_permutation[i:] |
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
[System.Reflection.Assembly]::LoadFrom( “C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll” ) | |
$mgr = New-Object Microsoft.Web.Administration.ServerManager | |
$mgr.ApplicationPools | % { $pm = $_.ChildElements[“processModel”]; Write-Host $_.Name $pm.Attributes[“userName”].Value$pm.Attributes[“password”].Value } | |
# Or, if you do not appreciate the brevity: | |
[System.Reflection.Assembly]::LoadFrom( “C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll” ) | |
$mgr = New-Object Microsoft.Web.Administration.ServerManager | |
$pools = $mgr.ApplicationPools | |
foreach ($pool in $pools) |
NewerOlder