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
using System; | |
using System.CodeDom; | |
using System.CodeDom.Compiler; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; |
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
IEnumerable<string> Words() | |
{ | |
var count = 0; | |
for(;;) | |
{ | |
var isZ = Guid.NewGuid().GetHashCode()%2 == 0 ? true : false; | |
if(isZ) | |
{ | |
count ++; | |
} |
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
IEnumerable<string> Words() | |
{ | |
var words = new String(' ',5); | |
for(;;) | |
{ | |
var word = Guid.NewGuid().GetHashCode()%2 == 0 ? "0" : "1"; | |
words = (words + word).Substring(1,5); | |
if(words == "00001") | |
{ |
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
bool kiyoshing = true; | |
IEnumerable<string> Words(){ | |
for(;kiyoshing;) | |
yield return Guid.NewGuid().GetHashCode()%2 == 0 ? "ズン" : "ドコ"; | |
} | |
void Main() | |
{ | |
Words().Aggregate( | |
new List<string>(), | |
(seq,word) => { |
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
bool kiyoshing = true; | |
IEnumerable<string> Words(){ | |
for(;kiyoshing;) | |
yield return Guid.NewGuid().GetHashCode()%2 == 0 ? "ズン" : "ドコ"; | |
} | |
void Main() | |
{ | |
List<string> words = new List<string>(); | |
foreach(var word in Words()) | |
{ |
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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using RazorEngine.Configuration; | |
using RazorEngine.Roslyn; | |
using RazorEngine.Templating; | |
namespace RoslynPerformance | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace LinqGetType | |
{ | |
public class Category | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } |
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
using System; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Runtime.ConstrainedExecution; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
using System.Security.Principal; | |
using System.Web.Mvc; | |
using Microsoft.Win32.SafeHandles; |
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
// http://blog.jnito.com/entry/2014/06/06/104420 | |
// 相変わらずLINQPadで。Languageを"c# program"にしてコピペ。 | |
// ToScaleがダサくてすいませんね。 | |
class KaraokeMachine | |
{ | |
private static string[] _scales = new[]{"C","C#","D","D#","E","F","F#","G","G#","A","A#","B"}; | |
private string _melody; | |
public KaraokeMachine(string melody) | |
{ |
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
int CountNumber(int number,int target = 7) | |
{ | |
var count = 0; | |
var numberParts = 0; | |
var numberChars = number.ToString().Select(c => int.Parse(c + "")).Reverse().ToArray(); | |
for (int i = 0; i < numberChars.Count(); i++) | |
{ | |
count += numberChars[i] * (i * (int)Math.Pow(10, i - 1)); | |
if (numberChars[i] > target) |
NewerOlder