Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
ãã®æ稿ã¯ãC# Advent Calendar 2014 ã®14æ¥ç®ã®è¨äºã§ãã IEnumerableã«ã¾ã¤ããã¢ã¬ãã¢ã¬ ããã«ã¡ã¯ï¼ ãã¤ãã¯Asyncã¨LINQã®äºãããã¹ã£ããæ¸ããããã¦ãã¾ãããåæå¯è½ããå®å ¨ãªãã¢ãã¾ã§ â IEnumerableã®æ¢ç´¢ãã¨ãããé¡ã§æ¸ãã¦ã¿ããã¨æãã¾ãã .NETã§ã¯ãLINQã«ã¾ã¤ããã¤ã³ã¿ã¼ãã§ã¤ã¹ãããªãå¤ãå«ã¾ãã¦ãã¾ãããã®ä¸ã§ããIEnumerableã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ç¶æ¿ã°ã©ãã«åå¨ããæ§ã ãªã¤ã³ã¿ã¼ãã§ã¤ã¹ããã©ã®ããã«ä½¿ãåããã¹ãããã¨è¨ãã®ãåããã«ããããç¥ãã¾ããã沢山ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®ç¾©ããã¦ããã®ã¯ãæ´å²çãªäºæ ãããã¾ãã LINQ to ObjectãLINQ to Entitiesãªã©ãä¸è¬çã«ä½¿ç¨ããã¦ããLINQã®èæ¯ã«ã¯ããåæå¯è½ã§ãããã¨ããæ§è³ªãããã¾ãããã®äºã¯ã以åã«LINQã®å
Unityã§ãLINQã¯æ´»ç¨ããã¦ããããã§ããã¦ããªãããã§ãåºæ¬çã«ã¯ãã¾ãããã¦ããªãæ°é ãé常ã«æãã¾ãããã£ãããªãï¼ã¨ãããããããªããã§ããã以åã«ç§ã®å¤åå ã¨å¥ã®ä¼ç¤¾ããã¨ã§åå¼·ä¼/交æµä¼ããã®ã§ãããããã§ä½ã£ãã¹ã©ã¤ããããã®ã§ï¼è¥å¹²æç´ããããã®ãï¼å ¬éãã¾ããLINQã«ã¤ãã¦å ¨ãã®åå¿è ã®äººåãã«LINQã®è¯ãã説æãããã¼ãã¿ãããªæãã§ããã§ãã¡ãã³ã£ã¨ã ãè¸ã¿è¾¼ãã å 容ãããã¿ãããªãåå¼·ä¼èªä½ã¯5æãããã«ãã£ãã®ã§ãããã¶ãã¨å ¬éã¾ã§éãã¦ãã¾ã£ãâ¦â¦ã ãã®ç§ã®å¤åå ï¼ã¾ã©ãã£ãããè¨ãæ¹ã â¦â¦ï¼ã°ã©ãã§ã¯ä¼ç¤¾éã§ã®åå¼·ä¼ã¯å¤§æè¿ãªã®ã§ããããããããï¼ã¨ãã人ãããã£ãããã¾ãããæ¯éæ¯éç§ã®ã»ãã¾ã§ã¼ããªãã£ã¹ã¯å æ¬æ¨ã«ããã®ã§ãã®å¨å²ã»ãkmãããã¾ã§ãªãåºå¼µãã¾ãã§ãï¼ä»ã®ãªãã£ã¹ãè¦ã¦ã¿ããéæ¬¡é¦¬æ ¹æ§ï¼ãç§ã®æã¡ãã¿ã¨ãã¦ã¯C#, LINQ,
ã¨ããããã®ãä½ãã¾ãããBigQueryã¯Googleã®ããã°ãã¼ã¿ãµã¼ãã¹ã§ãæè¿é常ã«èå ãæµ´ã³ã¦ãã¦ãä½åº¦ãã»ã£ã¦ãã¨ããTwitterã«ä¸ãã£ã¦ããããã¦ã¾ããã詳細ã¯Google BigQuery ã®è©±ã¨ãGoogleã®èã®åãBigQueryããFluentdã¦ã¼ã¶ã¼ã使ããªãçç±ããªããªã£ãçç±ããããããããªãè¶ ã§ãããã¼ã¿ãGoogleãã¯ã¼ã§æ°åå°ã®ãµã¼ãã¼ä¸¦ã¹ã¦ãã«ã¹ãã£ã³ãããããè¶ éãã¦æå¼·ããã¨ãã話ãã§ãå®éåããè¶ åãããããå¬ããã®ãæéããããªã¨ããã§ãæåAmazon RedShiftãæ¤è¨ãã¦è©¦ãã¦ããã®ã§ãããåå§ç¸®ã¨ã³ã³ã¼ãã¨ãèããã®ãã£ãã大å¤ã ãã容éããã¯ã¼ãã¤ã³ã¹ã¿ã³ã¹ã¿ã¤ãã¨ç¨ãã£ãããå¿ è¦ãããããããBigQueryã ã¨å®¹éã¯æ ¼å®ã ãã大éã«æ ¼ç´ã§ããããã¥ã¼ãã³ã°è¨å®ããªãããã®æ軽ãï¼ãã¾ãã«ã¦ã§ãã¤ã³ã¿ã¼ãã§ã¤ã¹ãä¸ã åªã
1. An Internal of LINQ to Objects 2013/12/14 Yoshifumi Kawai - @neuecc 2. Self Introduction @ä»äº æ ªå¼ä¼ç¤¾ã°ã©ã åç· å½¹CTO C# 5.0 + .NET Framework 4.5 + ASP.NET MVC 5 æå 端C#ã«ãããã¤ããã©ã¼ãã³ã¹Webã¢ããªã±ã¼ã·ã§ã³ @å人活å Microsoft MVP for Visual C# Web http://neue.cc/ Twitter @neuecc LINQãã²ããã¼ã«å¥½ãã趣å³ã¯ã©ã¤ãã©ãªä½æ 3. As Librarian NuGetå ¬éããã±ã¼ã¸æ°30çªç ´ https://www.nuget.org/profiles/neuecc/ linq.js JavaScriptã«LINQ to Objectsã移æ¤ããã©ã¤ãã©ãª http
ããæ¥åã®å¸³ç¥¨ãä½ãæã¯ãExcel ã®é ãã·ã¼ãã使ã£ã¦ãå°å·ç»é¢ãã¨ããã¼ã¿ç»é¢ããåãã¦ä½ãã¾ãã ç´æ¥å¸³ç¥¨ããã¼ã¿ãã¼ã¹ããæ¸ãè¾¼ãã§ãããã®ã§ããã ã»ã«ã®ååä»ãã®ä¸æ´åãªã©ããããããã è¡åãæå®ããã¨ããªãããããªã大å¤ã ã¨ãããã¨ããã£ã¦ãå¥ã«ãã¼ã¿ç¨ã®ã·ã¼ããç¨æãã¦ããã¦ãã»ã«åç §ããããã§ãããããã ããã®ãã¿ã¼ã³ã£ã¦ãè¡æ°ãå¢ãããããªã¬ãã¼ãã®å ´åã¯ãã¾ããããªãã¦ãçµå±ã®ã¨ããã³ã¼ãã®ã»ãï¼C#/VBï¼ã§ãããããã¨è¡åãä½ãè¾¼ãã ããã¾ãã ãã¦ãæ¬æ¥ã¯ãã¼ã¿ã®æ¸ãè¾¼ã¿ãç´¹ä»ãããã¨ãããªã®ã§ãããOleDb ãããã¤ãã£ã¦ entity data model ã«å¯¾å¿ãã¦ããªãããããã¨ãããã¨ã§ã¡ãã£ã¨ãããªãâ¦ã©ããããã®ãã¨æã£ã¦ããã¨ãããçµæ§ç°¡åã« linq å®è£ ãåºæ¥ãããªã½ã¼ã¹ãè¦ã¤ãã¾ããã Using Linq with Excel s
LINQåå¼·ä¼ã§çºè¡¨ãã¦ãã¾ããã 2æéã®ãã³ãºãªã³ã ã£ããã§ããããã ãã ç²ããã ãããã¯ã¼ã¯ç°å¢ããªãã£ãã®ã§ãçµæ§è¦ãªãã移ãã¦ãããç¶æ³ãå¤ãã£ãã®ãã¡ãã£ã¨æ®å¿µã§ããããããã°ã£ããã 以ä¸è³æã§ãã ãªããã½ã¼ã¹ã³ã¼ãã¯GitHubã«ããã¦ã¾ãã ãã³ãºãªã³ã®é åºã§ã³ããããã¦ãã®ã§éå»ãããã°ãåç §ãã¦ããã ããã°ã¨æãã¾ãã
ãã¦ãC#ã§é¢æ°åã£ã½ããã¨ããã£ã¦éãã§ã¿ãããã§ãããæ¥ãããããªã£ã¦ç«ã®åçã«ç½®ãæãã¾ããã C#ã§å®éã«ä½¿ãã®ã¯ãLINQã§ãã ã¨ãããã¨ã§ãLINQã®ä½¿ãæ¹ãã²ã¨ã¨ããè¦ã¦ã¿ã¾ãã åºæ¬ LINQã®ä¸æ ¸ã¨ãªãã®ã¯IEnumerable<T>ã¤ã³ã¿ãã§ã¼ã¹ã§ãããããJava8ã®Streamã«ç¸å½ãã¾ãã ãã¦ãIEnumerable<T>ã¤ã³ã¿ãã§ã¼ã¹ã«ã¯ForEachæ¡å¼µã¡ã½ãããç¨æããã¦ãã¾ãããããã¯FAQã§ãæå³çã«å ¥ãã¦ããªãã¨ãããã¨ã§ãã LINQã¨ã¯ãºã¬ã¾ãããList<T>ã¯ã©ã¹ã«ã¯ForEachã¡ã½ãããããã¾ãããããã£ã¡ã使ãã¾ãããããããã¯ã©ã¹ã§ããã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ã¯ããã¾ããã var names = new[] {"hoge hoge", "foo bar", "naoki", "kishida"}.ToList(); names.ForE
ã¨ãé¡ãã¾ãã¦ç¬¬1å æ¥éä¸å¿ä¼è° .NETæè¡ã®ææ¨é¢ã§è©±ãã¦ãã¾ããã岩永ãããæ¦å¿µçãªãã®ããç§ãC#ã¨ã©ã¤ãã©ãªã«ãã©ã¼ã«ã¹ãã¦å ·ä½çãªãã®ããããã«ãã£ã¹ã«ãã·ã§ã³ã§ãã¬ã¼ã ã¯ã¼ã¯å¨ãã®è©±ããçãªåæ ã ã£ãã§ããããã Modernãã¨ãã£ã¦ããããããæå 端ã§å°ã£ãæãï¼ã§ã¯ãªãã¦ãæ¬æ¥ã¯ä»ããã«å½ããåã®ããã«ããããæ¹ããã¡ããã¨é¸æãã¦ããããã¨ãã£ããããªå 容ã§ãã対象ãã©ã®è¾ºã«ç½®ããããªããã¨ãã£ãã¨ããã§ããã£ã±@ITã§ããã®ã§ã¼ã«ã¤ã ã¨ãã©ã ãç¦æ¢ã¨ã.NET 2.0ãå¼·ãããã¦ãããã ãã¨ããããã人ãå°ãªããªãã®ã ããã¨æã£ãã®ã§ããã®è¾ºããæä½ã©ã¤ã³ã«æ·ãã¦ä¸èº«ãçµã¿ã¾ããã ã¤ã¾ãLINQ使ãã£ã¦ãã¨ã§ããï¼ã¨ããããããç»å ´ãã5å¹´ãçµã¨ãã¨ãã¦ããã®ã«ãæªã ã«LINQ使ãã¹ãã ãï¼ã¨è¨ã£ã¦åããªããã°ãªããªãäºå®ãæ²ããããããã¡ãªã¿ã«ä»ã®è¨èªã«ãLI
2011å¹´ã«ããã¥ã¼ããç¦å²¡ã®ã¿ãªããå ¨å½ã§æ´»èºãã¿ã¯ã¼ã¬ã³ã¼ãã®ã¢ã¤ãã«ã¬ã¼ãã«ãT-Palette2011å¹´ã«ããã¥ã¼ããç¦å²¡ã®ã¿ãªããå ¨å½ã§æ´»èºãã¿ã¯ã¼ã¬ã³ã¼ãã®ã¢ã¤ãã«ã¬ã¼ãã«ãT-Palette Recordsãã«æå±ããLinQã®åå¹´ã¶ãã®æ°ã·ã³ã°ã«ãCHIKU-TAKUï¼ã´ã¼ã¤ã³ã° ã㤠ã¦ã§ã¤!ãï¼ä¸¡Aé¢ï¼ã2013å¹´1æ30æ¥ã«ãªãªã¼ã¹ããã¾ãã çåã¿ãã¬ã¸ã³ç·¨éé¨ã§ã¯ã2013å¹´1æ6æ¥ã«éå¬ããã第220åå ¬æ¼ï¼å±±æ¨å½©ä¹ãã¼ã¹ãã¼å ¬æ¼ï¼ãæè¦ããã®ã§ãããä¸å¹´ã¶ãã«è¦³ã天ç¥ãã¹ãé»å¨ãã¼ã«ã§ã®èªä¿¡ã«æºã¡ãå§åçãªããã©ã¼ãã³ã¹ãããã¦çæ¬åºèº«å±±æ¨å½©ä¹ããã®ç¾ããã«ã¯ãã ãã ããæ¯ãã¤ãã°ããã§ãããå±±æ¨ããã¯ãCHIKU-TAKUãã®MVã«ãåå ããã¼ãæã®ãã¥ã¼ããªããã姿ãè¦ããã¨ãã§ãã¾ãã åé²æ¥½æ²ãCHIKU-TAKUããã¥ã¼ã¸ãã¯ãã㪠çæ¬ç山鹿åºèº«ã®
ä¸è¨è¡¨ã®ã¨ããå®è£ ããã¨ãããNextGenerationã¡ã½ããå é¨ã§ããããããªæãã«ãªãã¾ããã ãããLINQã£ã½ãã public static World NextGeneration(this World world) { var lifes = world.SelectMany(life => from x in Enumerable.Range(-1, 3) from y in Enumerable.Range(-1, 3) select new { X = life.X + x, Y = life.Y + y, Score = x == 0 && y == 0 ? 0.5 : 1 }) .GroupBy(s => new { s.X, s.Y }) .Select(g => new { X = g.Key.X, Y = g.Key.Y, Score = g.Sum(a
ãã®è¨äºã§ã¯ãå¿åã¡ã½ããã¨ã©ã ãå¼ã®æå³ã®éãã«ã¤ãã¦èãã¦ã¿ããã â åãããã«ä½¿ããå¿åã¡ã½ããã¨ã©ã ãå¼ å¿åã¡ã½ããã¨ã©ã ãå¼ã¯ãåãããã«ä½¿ããã¨ãã§ããå ´é¢ãå¤ãã ä¾ãã°ã以ä¸ã®ãããªããªã²ã¼ããå¼æ°ã«ã¨ãã¡ã½ããããã£ãã¨ãã¦ã using System; using System.Collections.Generic; static class Enumerable { // è¿°èªã«åºã¥ãã¦å¤ã®ã·ã¼ã±ã³ã¹ããã£ã«ã¿ã¼å¦ç public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { foreach (var item in source) { if (predicate(item)) yield
以åã«Reactive Extensions + asyncã«ããC#5.0ã®éåæå¦çã§ã¯ãåä½ã®å¤ã§ãã£ããasyncãè¤æ°ã®å¤ã§ãã£ããIObservable<T>ã使ãåããã¨ãããã¨ãã¨è¨ã£ã¦ã¾ããããæ¬å½ã«ãããªã®ï¼ãããã¯ãããããè¤æ°ã®å¤ã®ã·ãã¥ã¨ã¼ã·ã§ã³ã£ã¦åãããããªåãããªããããªãªã®ã ãã©ï¼ãªã©ãªã©ã¨æã£ããããæ¨ä»ãå¦ä½æ§ã«ãéããã§ãããããã¨ããããã§ãä»åã¯ã°ãã¨ãã®é¨åã«æ·±ãè¿«ã£ã¦ã¿ã¾ãããã åæçãªã·ãã¥ã¨ã¼ã·ã§ã³ ãã¦ãä¾ããªã®ã§ãããã©ããã¼ã¿ãã¼ã¹ã§è¡ãã¾ããããçDataReaderã転ããã¦ã¾ãã // æ¥ç¶æååã« Asynchronous Processing=true ã¯éåæã§ãããªãæ¬ ãããã« const string ConnectionString = @"Data Source=.;Initial Catalog=Advent
ãã㯠Scala ããã°ã©ãã®ããã® C# LINQ æ©è½ã®è¦ãæ¸ãã ããéã¨ãã¦ã使ããã¯ãã åæ¨è« C# ã«ã¯åæ¨è«ããããå人çã«ããã¼ã«ã«å¤æ°ã§ã¯ã§ããã ã var ã使ãããã«ãã¦ããã
註ï¼ãã®è¨äºã¯ãããã¯ãã¯ãããLINQã¯ã¢ãããã¨èãããã¨ããããã©ãã¢ããã£ã¦ä½ãªã®ãã¯ç¹ã«ç¥ããããªããã§ãLINQãã¢ããã ã¨ä½ãã§ããã®ãã¯ã¡ãã£ã¨ã ãç¥ããããã¨ããå¥ç¹ãªäººåãã«ããç°¡åãªãã¼ãµã¼ãå®è£ ãããã¨ãããé¡ã§ã³ã¼ããè¦ã¦ã¿ããã¨ãããã¾ã£ããPVã®ä¼¸ã³ãªããããªè¨äºã§ãã ãªã®ã§ã以ä¸ã®ãã¼ãã¯å¯¾è±¡å¤ã ã¢ãããå¦ã³ããâHaskellãåå¼·ãããã Maybeã¢ãã/OptionåãC#/LINQã§âãã¡ãã§ã©ãããhttp://d.hatena.ne.jp/liner_lock/20111012/1318428588 å®ç¨çãªãã¼ãµã¼/ãã¼ãµã¸ã§ãã¬ã¼ã¿ã欲ããâåãæ å ±ãæã£ã¦ã¾ããã å®è£ ãããã®ã¯ãã¼ã以ä¸ã®æ´æ°ãå ç®è¨å·(+)ãä¹ç®è¨å·(*)ãéãã£ããéãã£ãããæ§æãããæ°å¼ãæååã§ä¸ããããã¨ãã«ããã¼ã¹ãã¦çµæãè¨ç®ããintãè¿ãã¡ã½ãã
1. C#次ä¸ä»£éåæå¦çæ¦è¦³ Task vs Reactive Extensions 2012/3/10 #riaarch Yoshifumi Kawai @neuecc 2. Profile ï Name => Yoshifumi Kawai ï¬ ä»äºã¯è¿é ã¯ASP.NETã§ããã¾ãRIAãããªãã£ãã ï¬ ã¾ããHTML5ãRIAã§ããï¼ ï Twitter => @neuecc ï HN => neuecc ï¬ èªãã¨ãã¯âã®ããâã¨èªã¾ãã¦ã¾ã ï¬ ãµã¤ãã®ãã¡ã¤ã³ï¼ç¹ã«æå³ã¯ãªãï¼ãç¹ãã ã ã ã§ãèå¥åã«ãªãã°ããã ãã§ããã¨æã£ã¦çºé³è ãã¦ãªãã£ãã®ã§å²ã¨ã¢ã¬ ï¬ Microsoft MVP for Visual C#(2011/4-)
Whereé£æãã¦ãã¾ããï¼ããã¨ãããã©ã¼ãã³ã¹ã®æªåãå¿é ãã¦&&é£çµã«ãã¦ãã¾ããï¼LINQã®ä»çµã¿ï¼é 延è©ä¾¡ã®æ£ããåºç¤ç¥è ï¼ ï¼ ITã§ã¯Where+Selectã«å¯¾ã㦠ãWhereSelectEnumerableIteratorãã¨ãªã£ã¦ãã¦ãååã®ã¨ãããWhereã¨Selectãçµ±åããã¦ãããã¨ã§ããããã¯ããWhereã->ãSelectããé »åºãã¿ã¼ã³ãªã®ã§ãããããçµ±åãããã¨ã§ããã©ã¼ãã³ã¹ãåä¸ãããããã§ãããã ã¨æ¸ãã¾ããããã§ã¯é£æã®å ´åã¯ã©ããªã£ã¦ããã§ãããããè¦ã¦ã¿ã¾ãããã var seq1 = Enumerable.Range(1, 10) .Where(x => x % 2 == 0) .Where(x => x % 3 == 0); // ã©ãã§ããããã§ãããããã¯Visual Studio 11 Betaã§ããVS11æé«ã§ããï¼ @
ãã®è¨äºã¯ F# Advent Calendar 2011 ã®13åç®ã§ãã âåå [twitter:@furuya02] ãããF#ã«ãããã±ããã¢ãã¿ã®ä½æ(WinPcap)ã â次å [twitter:@jsakamoto] ãã ãF# ã§æ£è¦è¡¨ç¾ãã¶ã¤ã ASP.NET MVC ã¢ããªãä½æããã ã¯ããã« ä»å¹´ã® Advent Calendar åãã«ããF# 㧠iPhone åãã²ã¼ã ãä½æãããã¨ããè¨äºãæ¸ããã¨å¥®éãã¦ãã¾ããããã²ã¼ã (ã¨ãããã 3D)ã®éçºç¥èãåãããããæ®æ¥ã®çã«å°ãããããã¦éã«åããªããªã£ã¦ãã¾ãã¾ãããæè¿ãä»äºã®åéã« LINQ ã®å¾©ç¿ããã¦ããã®ã§ãF# 3.0 ãããµãã¼ããããäºå®ã®ãQuery expressionsãã«ã¤ãã¦ãããµãã«æ¸ãã¦ãããã¨æãã¾ãã 注æ Developer Preview ã® F# ã使ç¨ãã¦ã
WEB+DB PRESS Vol.64 ã¨ãããã¨ã§ãããã¾ã©ãã®.NETéçºãé£è¼ç¬¬2åç®ã¯ âçµ±åè¨èªã¯ã¨ãªLINQã®ç解ã¨æ´»ç¨â ã¨é¡ãã¦LINQã«ã¤ãã¦è¨äºãæ¸ãã¾ããã ä¸è¬çãªèª¬æã¨ãããããç§ãã©ãã¨ããã¦ããããã¨ãã話ãã¾ã¨ãã¦ãã¾ãã 8æ24æ¥ã«çºå£²ããã¾ãã®ã§ããã²ãèªã¿ããã ãã¦ææ³ããããã¦ããã ããã¨ãããããã§ãã ææ³ã¯ãã®Blogã twitter㧠@onos ãã¦ã«ãé¡ããã¾ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}