using System;
using System.Linq; namespace Linq101
{
class Generation
{
/// <summary>
/// This sample uses Range to generate a sequence of numbers from 100 to 149 that is used to find which numbers in that range are odd and even.
/// </summary>
public void Linq65()
{
var numbers = from n in Enumerable.Range(, )
select new { Number = n, OddEven = n % == ? "odd" : "even" }; foreach (var n in numbers)
{
Console.WriteLine("The number {0} is {1}.", n.Number, n.OddEven);
}
} /// <summary>
/// This sample uses Repeat to generate a sequence that contains the number 7 ten times.
/// </summary>
public void Linq66()
{
var numbers = Enumerable.Repeat(, ); foreach (var n in numbers)
{
Console.WriteLine(n);
}
}
}
}

Linq101-Generation的更多相关文章

  1. 论文阅读(Zhuoyao Zhong——【aixiv2016】DeepText A Unified Framework for Text Proposal Generation and Text Detection in Natural Images)

    Zhuoyao Zhong--[aixiv2016]DeepText A Unified Framework for Text Proposal Generation and Text Detecti ...

  2. Task set generation

    Task set generation for uni- and multiprocessors: “Unifying Fixed- and Dynamic-Priority Scheduling b ...

  3. 使用-MM生成include指令和依赖生成(make include directive and dependency generation with -MM)

    I want a build rule to be triggered by an include directive if the target of the include is out of d ...

  4. PHPNG (next generation)

    PHPNG (next generation) This page gives short information about development state of a new PHP branc ...

  5. test generation和MBIST

    The problem of test generation Random test generation Deterministic algorithm for test generation fo ...

  6. 关于conversation generation的论文笔记

    对话模型此前的研究大致有三个方向:基于规则.基于信息检索.基于机器翻译.基于规则的对话系统,顾名思义,依赖于人们周密设计的规则,对话内容限制在特定领域下,实际应用如智能客服,智能场馆预定系统.基于信息 ...

  7. 1094. The Largest Generation (25)

    A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level bel ...

  8. Case Study: Random Number Generation(翻译教材)

    很荣幸,经过三天的努力.终于把自己翻译的教材做完了,现在把它贴出来,希望能指出其中的不足.   Case Study: Random Number Generation Fig. 6.7  C++ 标 ...

  9. Index Generation

    Index Generation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 230   Accepted: 89 Des ...

  10. PowerDesigner15(16)在生成SQL时报错Generation aborted due to errors detected during the verification of the mod

    1.用PowerDesigner15建模,在Database—>Generate Database (或者用Ctrl+G快捷键)来生产sql语句,却提示“Generation aborted d ...

随机推荐

  1. oracle常见sql积累

    select lower('HELLO') from dual;select lpad(100, 5, '*') from dual;select sysdate + 1 / 24 from dual ...

  2. 访问Github过慢解决

    在这个地址查找响应最快的地址:http://tool.chinaz.com/dns?type=1&host=assets-cdn.github.com&ip= 查找:assets-cd ...

  3. Windows环境下安装PHPUnit

    Windows环境下安装PHPUnit,在此整理一下,以便大家参考. 本人测试安装环境:Windows7(win32) + Apache(2.2.13) + PHP(5.3.6) 1.    以管理员 ...

  4. Node.js流

    什么是流? 流是可以从一个源读取或写入数据到连续的目标对象.在Node.js,有四种类型的数据流. Readable - 其是用于读操作. Writable - 用在写操作. Duplex - 其可以 ...

  5. MyEclipse右键new菜单项的设置 及 Eclipse中各种文件不能保存中文的问题

    有时候,myeclipse右键new的时候经常出现一些ejb等文件你懂的,很是恶心~~ Window --> Customize Perspective --> Submenus --&g ...

  6. 1.AJAX简介

    没有AJAX会怎么样?普通的ASP.Net每次执行服务端方法的时候都要刷新当前页面,比如实现显示服务器时间.每次都要刷新页面的坏处:页面刷新打断用户操作.速度慢.增加服务器的流量压力.如果没有AJAX ...

  7. 【转】 Linux/Unix 进程间通信的各种方式及其比较

    http://blog.csdn.net/guopengzhang/article/details/5528260 进程间通信就是在不同进程之间传播或交换信息,那么不同进程之间存在着什么双方都可以访问 ...

  8. 付出半个小时的笔误级BUG

    一开始,我为了偷懒将所有的任务全都压在了一个浮动指针上: for (; CCPtr->S != NULL; CCPtr->S = CCPtr->S->next) // for ...

  9. Chapter 1. OpenGL基础回顾 - Review of OpenGL Basics

    译自<OpenGL® Shading Language, Second Edition> 本章主要回顾OpenGL应用编程接口,为后续章节中的材质铺垫基础.这并不是详尽的回顾.如果你已经 ...

  10. App抓包数据包之Paros的安装及使用

    1.在应用程序开发过程中,会遇到很多网络访问问题,自己没有能力提供后台服务,这时就可以抓取网络上的数据包,获取数据接口,应用在程序中.下面介绍使用paros抓取网络数据包得步骤. 2.要使用paros ...