enumerator

    1熱度

    1回答

    對不起,如果我不以正確的方式問我的問題。 試圖讓這一點的Ruby代碼工作。我不明白的是如何讓底部的點擊操作調用yield函數(這是一個交通燈),以便點擊將循環訪問yield選項。真實的,錯誤的,錯誤的將意味着光是紅色的,因爲它在頂部,而底部的是錯誤的。我也很難在統計員和收益率之間纏繞我的頭腦。 class TrafficLight include Enumerable incl

    0熱度

    1回答

    如何返回IEnumerator的SortedDictionary(Of Integer, MyClass) 我有這個。 Dim dictionaryTest As New SortedDictionary(Of Integer, MyClass) Dim enumerator As IEnumerator(Of Integer, MyClass) = dictionaryTest.GetEnum

    2熱度

    1回答

    Enum#feed 設置由內e。如果 值未設置的下一產量返回的值,收益回報nil.This值 正在產生後清零。 我試過一個例子,但它不是我認爲理解 #feed方法的那個例子。 a = [1,2,3,4].to_enum p a.next #=> 1 a.feed 'foo' p a.next #=> 2 , I expected here 'foo' 誰能給我一個很好的例子,瞭解如何#f

    0熱度

    1回答

    我必須使用枚舉器將傳入構造函數的float轉換爲基於浮點值(稱爲R)的字符串。它看起來是這樣的: static void Main(string[] args) { float R = 1; <name of class> <object> = new <name of class> (R); } public class <name of clas

    3熱度

    1回答

    我繼承Enumerator這樣的: class CuadraticPrimeGenerator < Enumerator def initialize(a=1,b=49) super do |y| x = 1 loop do y << x**2 + a*x + b x += 1 end end en

    2熱度

    1回答

    當我這樣做時,它按預期工作: enum = [1,2,3,4,5].each #=> #<Enumerator: [1, 2, 3, 4, 5]:each> enum.next #=> 1 如果我嘗試在Ruby 1.8.7上使用backports的情況下,發生以下事情: require "backports" enum = [1,2,3,4,5].each #=> #<Enumera

    1熱度

    2回答

    得到一個枚舉我有這樣的對象: class Animation { //[...] private SortedList<int,Frame> frames = new SortedList<int,Frame>(); private IDictionaryEnumerator frameEnumerator = null; //[...]

    0熱度

    1回答

    的GetEnumerator強制轉換爲接口失敗 沒有編譯器錯誤 與郵件索引無窮運行故障 如果我使用結構Word1252直接與無界面它的工作原理 namespace WordEnumerable { public partial class MainWindow : Window { public MainWindow() { Initia

    5熱度

    3回答

    我正在嘗試使用scalaz iteratee軟件包處理恆定空間中的大型壓縮文件。我需要對zip文件中的每個文件執行一個長時間運行的過程。這些進程可以(也應該)並行運行。 我創建了一個EnumeratorT,它將每個ZipEntry都膨脹爲File對象。簽名是這樣的: def enumZipFile(f:File):EnumeratorT[IoExceptionOr[IO[File]], IO]

    1熱度

    1回答

    我已經寫了與阿卡-IO一個簡單的socket客戶端,從一個套接字服務器消耗的字符串服務器發送的事件廣播從演員的消息(發送由\ n分隔的字符串): class SocketClient(endpoint: InetSocketAddress) extends Actor { override def preStart() { IOManager(context.system).c