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
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dy) | |
for y := range pic { | |
pic[y] = make([]uint8, dx) | |
for x := range pic[y] { | |
pic[y][x] = uint8(x*y) |
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
func Pow(x, n int) int { | |
return int(math.Pow(float64(x), float64(n))) | |
} | |
func Permutations(array []int) [][]int { | |
size := len(array) | |
total := Pow(2, size) | |
permutations := make([][]int, 0, total) | |
for i := 0; i < total; i++ { |
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
func AllUniqueCombinations_Recursive(combination, array []int, result [][]int) [][]int { | |
if len(array) > 0 { | |
for i := range array { | |
c := make([]int, 0, len(combination)) | |
c = append(c, combination...) | |
c = append(c, array[i]) | |
a := make([]int, 0, len(array)-1) | |
a = append(a, array[0:i]...) | |
a = append(a, array[i+1:]...) | |
result = AllUniqueCombinations_Recursive(c, a, result) |
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
import Color exposing (..) | |
import Graphics.Collage exposing (..) | |
import Graphics.Element exposing (..) | |
import Window | |
main : Signal Element | |
main = | |
Signal.map render Window.dimensions | |
renderGridLine : Int -> Int -> Int -> Int -> Form |
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
diff --git a/src/Native/VirtualDom.js b/src/Native/VirtualDom.js | |
index efb9ce7..45ec52e 100644 | |
--- a/src/Native/VirtualDom.js | |
+++ b/src/Native/VirtualDom.js | |
@@ -1407,13 +1407,18 @@ Elm.Native.VirtualDom.make = function(elm) | |
return newNode; | |
} | |
+ function predicate(a, b) | |
+ { |
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
PROGRAM QUINE | |
IMPLICIT NONE | |
INTEGER :: i | |
CHARACTER(LEN=80), DIMENSION(10) :: Source | |
Source(1) = "PROGRAM QUINE" | |
Source(2) = " IMPLICIT NONE" | |
Source(3) = " INTEGER :: i" | |
Source(4) = " DO i=1, 3" | |
Source(5) = " DO i=1, 5" | |
Source(6) = " END DO" |
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
#!/usr/bin/python | |
quote = chr(34) | |
source = [ | |
"#!/usr/bin/python", | |
"", | |
"quote = chr(34)", | |
"source = [", | |
" ]", | |
"", |
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
PROGRAM QUINE | |
CHARACTER(LEN=*), PARAMETER :: Quote = Char(39) | |
CHARACTER(LEN=86), DIMENSION(11) :: Source | |
INTEGER :: i ; CHARACTER(LEN=2) :: Line | |
Source( 1) = 'PROGRAM QUINE' | |
Source( 2) = ' CHARACTER(LEN=*), PARAMETER :: Quote = Char(39)' | |
Source( 3) = ' CHARACTER(LEN=86), DIMENSION(11) :: Source' | |
Source( 4) = ' INTEGER :: i ; CHARACTER(LEN=2) :: Line' | |
Source( 5) = ' DO i=1, 4 ; WRITE(*,*) TRIM(Source(i)) ; END DO' | |
Source( 6) = ' DO i=1, 11' |
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
PROGRAM QUINE | |
IMPLICIT NONE | |
WRITE(*, '(A)') '#!/usr/bin/python' | |
WRITE(*, '(A)') '' | |
WRITE(*, '(A)') 'sq = chr(39) ; dq = chr(34)' | |
WRITE(*, '(A)') 'ind = lambda str: '' '' + str' | |
WRITE(*, '(A)') 'sqe = lambda str: sq + str + sq' | |
WRITE(*, '(A)') 'dqe = lambda str: dq + str + dq' | |
WRITE(*, '(A)') '' |
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
curl -o quine.py 'https://gist.githubusercontent.com/GlenDC/5ec5528c7fcac5468715/raw/' \ | |
&& python quine.py | python | python |
OlderNewer