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
> db.photos.ensureIndex({"images.thumbnail.url": 1}); | |
{ | |
"createdCollectionAutomatically" : true, | |
"numIndexesBefore" : 1, | |
"numIndexesAfter" : 2, | |
"ok" : 1 | |
} |
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
gm montage -verbose -adjoin -tile 192x1080 +f +shadow +label \ | |
+adjoin -geometry '10x1+0+0<' @all_jpgs.txt %06d-hd-all-vancouver-2014.jpg |
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
gm convert -crop 1x1+0+0 0000001-top10.jpg +profile "*" 0000001-top-colour.png |
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
gm convert -crop 1x1+0+0 @top10jpgs.txt +profile "*" +adjoin TOPCOLOUR/%07d-top-colour.png |
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
# Bash | |
files=(/usr/include/*.h /usr/include/sys/*.h) | |
for ((i=0; i<${#files[*]}; i+=100)); do | |
grep foo "${files[@]:i:100}" /dev/null | |
done |
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
counts <- table(topcolour.ig.vancouver.2014$count) | |
barplot(counts, main="Colour Distribution", | |
+ xlab="Colour Counts") |
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
counts3 = head(topcolour.ig.vancouver.2014[,2], n=200) | |
barplot(counts3, main="Colour Distribution", | |
+ xlab="Top Colours", | |
+ ylab="Colour Counts") |
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
> nearColour <- function(r,g,b){ | |
+ ctable = col2rgb(colors()) | |
+ cdiff = ctable - c(r,g,b) | |
+ cdist = cdiff[1,]*cdiff[1,]+cdiff[2,]*cdiff[2,]+cdiff[3,]*cdiff[3,] | |
+ return(colors()[cdist == min(cdist)]) | |
+ } | |
> rgb2 = col2rgb("#FEFDFC") | |
> rgb2[[1,1]] | |
[1] 254 | |
> rgb2[[2,1]] |
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
> tc <-function(x) { | |
+ return (head(color.id(x),n=1)) | |
+ } | |
> tc("#fefefe") | |
[1] "white" | |
> tc("#fefeff") | |
[1] "white" | |
> tc("#fefe00") | |
[1] "yellow" | |
> lappy(h$count,tc) |
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
require("plotrix") | |
tc <- function(x) { | |
return (head(color.id(x),n=1)) | |
} | |
colour_list8000 = dt8000[,tc(colour),by=colour] | |
> head(colour_list8000, n=100 | |
+ ) | |
colour V1 | |
1: #FFFFFF white | |
2: #FEFEFE white |