.NET Queue is rotational.
This file contains hidden or 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
/* | |
* RateThrottleProgress.cs | |
* Copyright (C) 2018 Kefei Lu | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
This file contains hidden or 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
#lang racket | |
(define-struct/contract http-status | |
([version string?] | |
[code (and/c positive? exact-integer?)] | |
[message string?]) | |
#:transparent) | |
;; parse "HTTP/1.1 404 Not Found" into (http-status "HTTP/1.1" 404 "Not Found") | |
(define/contract (->http-status str) |
This file contains hidden or 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
#lang racket/base | |
(provide (all-defined-out)) | |
(struct node (parent rank data) #:prefab #:mutable) | |
(define (make-set data) | |
(define res (node #f 0 data)) | |
(set-node-parent! res res) | |
res) |
This file contains hidden or 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
################ Lispy: Scheme Interpreter in Python | |
## (c) Peter Norvig, 2010-14; See http://norvig.com/lispy.html | |
################ Types | |
from __future__ import division | |
Symbol = str # A Lisp Symbol is implemented as a Python str | |
List = list # A Lisp List is implemented as a Python list |
This file contains hidden or 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; | |
using System.Management; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication2 | |
{ | |
class Program |
This file contains hidden or 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
namespace Foo | |
{ | |
using System; | |
using System.Net; | |
using System.Threading; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Text; | |
using Newtonsoft.Json; |
This file contains hidden or 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
#| This script demos the use of command line library. Note the use | |
of parameters, and the effort of encapsulating them in the local | |
bound function variables. | |
|# | |
#lang racket | |
(define [file-to-compile argv] | |
(let ([verbose-mode (make-parameter #f)] | |
[profiling-on (make-parameter #f)] |
This file contains hidden or 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
let (?=) x y = System.String.Equals(x, y, StringComparison.InvariantCultureIgnoreCase) |
This file contains hidden or 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
q.Enqueue(4); |