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
| classDeps | | |
classDeps := [:cls | | |
(cls methodDict values gather: [:cm | | |
(((1 to: cm numLiterals) collect: [:i | cm literalAt: i]) | |
select: [:lit | lit isVariableBinding and: [lit value isBehavior]]) | |
collect: #value]) asSet difference: {cls}]. | |
classDeps value: TextComposer |
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
| allDeps toDigraph | | |
toDigraph := [:hash | | s | | |
s := WriteStream on: String new. | |
s nextPutAll: 'digraph {'; lf. | |
hash keysAndValuesDo: [:pkg :pkgDeps | | |
pkgDeps do: [:dep | | |
(pkg includesSubString: 'Test') | |
ifTrue: [s nextPutAll: ' "'; nextPutAll: pkg; nextPutAll: '" [color="gray"]'; lf]. | |
s nextPutAll: ' "'; nextPutAll: pkg; nextPutAll: '" -> "'; nextPutAll: dep; nextPutAll: '"'. | |
(pkg includesSubString: 'Test') ifTrue: [s nextPutAll: ' [color="gray"]']. |
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
(ns battleships.demo) | |
;; This is an example of how to create a player to submit to the server. | |
;; The entire namespace is submitted to the server. | |
;; You submit the file using the submit function in the client namespace. | |
(defn- random-coord | |
"Generates a random valid coordinate." | |
[] | |
(let [rows ["A" "B" "C" "D" "E" "F" "G" "H" "I" "J"] |
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
"===== Set up Squeak's compiler correctly =====" | |
Scanner prefAllowUnderscoreSelectors: true. | |
Scanner allowUnderscoreAsAssignment: false. | |
"===== Things that Squeak needs from Pharo =====" | |
Installer cache | |
addPackage: 'Pharo-Compatibility-fbs.1'; | |
addPackage: 'VB-Regex-AdrianLienhard.48'; | |
install. |
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
public HttpContextBase FakeHttpContext() { | |
var context = new Mock<HttpContextBase>(); | |
var files = new Mock<HttpFileCollectionBase>(); | |
var request = new Mock<HttpRequestBase>(); | |
var response = new Mock<HttpResponseBase>(); | |
var session = new Mock<HttpSessionStateBase>(); | |
var server = new Mock<HttpServerUtilityBase>(); | |
var user = new Mock<IPrincipal>(); | |
var identity = new Mock<IIdentity>(); | |
request.Setup(req => req.ApplicationPath).Returns("~/"); |