[[ 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); |
Find a quote preceded by a space. Capture one or more letters or spaces. Find another quote. Lookahead to find a character that is not a letter. If the character following the last quote were a letter, it would be a contraction. The replacement string should have a leading space because we do capture a space before the first quote.
First big new attempt, see detailed explanation at 675e6a1. Capture a whitespace character or opening brace (from an italics or bold LaTeX command). Match a quote. Capture one or more of any character, but the least amount possible. Match a quote. Capture a whitespace character or closing brace. Put it back together with the captured whitepsace or braces at the ends and captured text between new quotes.
> 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 |
import math | |
def roundUp(x,y): | |
return int(math.ceil(float(x)/y)) | |
d = input('Distance: ') #10 #distance of path betweem source and controller | |
SPAWN_ENERGY_CAPACITY = 300 | |
CONTROLLER_STRUCTURES = { "extension": { 3: 10 } } | |
STRUCTURE_EXTENSION = "extension" | |
EXTENSION_ENERGY_CAPACITY = { 3: 50 } |
# 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) |