[[ http://imgur.com/rLEdNkQ | height = 100px ]]
[[ http://i.imgur.com/rLEdNkQ.mp4 | height = 100px ]]
var clickGetImg = (function() { | |
var count = 3; | |
return function(event) { | |
count--; | |
if(event.target.src) { | |
chrome.runtime.sendMessage({image: event.target.src}); | |
count = -1; | |
} | |
if(count <= 0){ |
[[ http://imgur.com/rLEdNkQ | height = 100px ]]
[[ http://i.imgur.com/rLEdNkQ.mp4 | height = 100px ]]
for(var n = 1; n <= fic_info['max_chapters']; n++) { | |
let n_ = n; | |
getChapter(fic_info['url']+n, function(page) { | |
(chrome.extension.getBackgroundPage()).addChapter(page, n_, fic_info['max_chapters']); | |
}); | |
} |
chaptersStringiness = [] | |
for(var i = 0; i < max_chapters; i++) | |
chaptersStringiness[i] = typeof(chapters[i])=="string"; | |
console.log(chaptersStringiness); |
> Game.creeps.Snowflake1.pos.findClosestByRange(FIND_SOURCES) | |
< [source #579fa8b80700be0674d2e2e8] | |
> Game.creeps.Snowflake1.room.find(FIND_SOURCES) | |
< [source #579fa8b80700be0674d2e2e8] | |
> Game.creeps.Snowflake1.room.find(FIND_SOURCES)[0].pos | |
< [room W53N6 pos 14,42] | |
> new RoomPosition(14, 42, 'W53N6') | |
< [room W53N6 pos 14,42] | |
> new RoomPosition(14, 42) // room required | |
//Error: invalid arguments in RoomPosition constructor |
> JSON.stringify(Game.spawns['Arendelle'].pos.findPathTo(Game.spawns['Arendelle'].room.find(FIND_SOURCES)[0]).length) | |
< 11 | |
> JSON.stringify(Game.spawns['Arendelle'].pos.getRangeTo(Game.spawns['Arendelle'].room.find(FIND_SOURCES)[0])) | |
< 12 | |
> JSON.stringify(Game.spawns['Arendelle'].pos.getRangeTo(Game.flags['AdjoiningRoomSource'])) | |
< null // should be path to exit | |
> PathFinder.search(Game.spawns['Arendelle'].pos, Game.flags['AdjoiningRoomSource'].pos).path.length | |
< 70 // valid, I counted about 68 | |
> PathFinder.search(Game.spawns['Arendelle'].pos, Game.spawns['Arendelle'].room.find(FIND_SOURCES)[0].pos).path.length |
#!/bin/bash | |
# update list of available packages | |
sudo apt-get -y update | |
# hostapd - This is the package that allows you to use the built in WiFi as an access point | |
# dnsmasq - This is a combined DHCP and DNS server that's very easy to configure | |
sudo apt-get -y install dnsmasq hostapd | |
echo -e "\ndenyinterfaces wlan0" >> /etc/dhcpcd.conf |
# trial and error | |
scrn.fillRect(x=293, y=180, width=13, height=20, fill=batteryFill, display=False) | |
scrn.fillRect(x=293+3, y=180-3, width=13-3*2, height= 3, fill=batteryFill, display=False) | |
scrn.drawAutoText("%.1f V" % (mindsensors_i2c(0x34 >> 1).readByte(0x6E)*.040), xpos+width+(scrn.PS_SCREENHEIGHT-(xpos+width))/2, y=initialYpos+height*4-16, size=16, display=False) | |
# substituting with how I got these numbers | |
scrn.fillRect(x=xpos+width+(scrn.PS_SCREENHEIGHT-(xpos+width)-13)/2, y=initialYpos+height*4-16-1-20-5, width=13, height=20, fill=batteryFill, display=False) | |
scrn.fillRect(x=xpos+width+(scrn.PS_SCREENHEIGHT-(xpos+width)-13)/2+3, y=initialYpos+height*4-16-1-20-5-3, width=13-3*2, height= 3, fill=batteryFill, display=False) | |
scrn.drawAutoText(("%1.1f V" if battVoltage < 10 else "%2.0f V") % battVoltage, xpos+width+6, y=initialYpos+height*4-16-1, size=16, display=False) |
for i in range(len(endpoints)/2): | |
actendpts.append(self.screenXFromImageCoords(endpoints[i*2],endpoints[i*2+1])) # actual x-coordinate | |
actendpts.append(self.screenYFromImageCoords(endpoints[i*2],endpoints[i*2+1])) # actual y-coordinate | |
for i in [x * 2 for x in range(len(endpoints)/2)]: # iterate over every other integer [0, 2, 4, ...] | |
actendpts.append(self.screenXFromImageCoords(endpoints[i],endpoints[i+1])) # actual x-coordinate | |
actendpts.append(self.screenYFromImageCoords(endpoints[i],endpoints[i+1])) # actual y-coordinate | |
for (x,y) in [(endpoints[i*2],endpoints[i*2+1]) for i in range(len(endpoints)/2)]: # iterate over each pair of integers | |
actendpts.append(self.screenXFromImageCoords(x,y)) # actual x-coordinate |
def drawPolyLine(*args, **kwargs): | |
width = kwargs.pop('width', 0) | |
fill = kwargs.pop('fill', (255,255,255)) | |
display = kwargs.pop('display', True) | |
print "width: %s\nfill: %s\ndisplay: %s" % (width, fill, display) | |
for arg in args: | |
print arg |