Posts

PHP Symfony request stack not found on bundle extension load -

i'm trying create reusable logging bundle can have custom formatter log messages. formatter set in main app's config file that: custom_logger: formatter: appbundle\services\messageformatter then in loggerbundle/dependencyinjection/customloggerextension.php after receive configuration i'm trying logger service , set formatter class customloggerextension extends configurableextension { public function loadinternal(array $mergedconfig, containerbuilder $container) { $loader = new yamlfileloader($container, new filelocator(__dir__ . '/../resources/config')); $loader->load('services.yml'); $class = $mergedconfig['formatter']; $obj = new $class; $container->get('custom.logger')->setformatter($obj); but problem logger uses request stack services: custom.logger: class: loggerbundle\services\logger arguments: ['@request_stack'] and when try servi...

In PhantomJS how can I pass URI parameters to an HTML file loaded with the file:// protocol? -

i using phantomjs 2.1.1. i'd open html file on local file system in phantom, , pass uri parameters. if open page without uri parameters, e.g: page.open("product.html"); then page opens fine if pass in uri parameters path: page.open("product.html?id=cheese"); then error "product.html?id=cheese: no such file or directory" (in phantomjs debugging environment product.html), if phantom including uri parameters part of file name. supported examining network requests in phantom debugger. i've experienced after upgrading past phantomjs 2.0. using phantomjs 1.9, , able pass uri parameters in manner , worked fine. there new phantom api passing uri parameters?

css - Chrome: SVG container not rescaling responsively -

i have svg being used 'mask'; it's displayed on top of div background image image peeks through unfilled areas of svg. svg responsive height of document (rather width). works fine far. however, i've been made aware if resize (chrome) browser, background image overflows out of bounds of masking svg; however, if refresh resized page, appears expected - only occurs on resize, , in chrome (oh, , opera too, apparently). works expected in ff , safari. i've included demo here (and jsfiddle ) inline svg, doesn't seem matter if it's inline or <img /> tag - results same. it seems somehow related containing element; if open inspector , set containing element's padding 0 after goes screwy, seems figure out , appear expected; if include rule in loaded css makes no difference. tried triggering similar css properties on page resize via javascript, hasn't made difference. am missing something, or have stumbled across bug? #splash { pos...

sql - Left Join table giving uncessary extra rows -

good day. i writing query against 2 tables, table , table b. table has 57 rows. resultant should same row count table a. table b has 44 rows. script ;with ss (select distinct * tablea), ss2 (select distinct * tableb) select distinct a.lotid, a.name, b.machine_id ss left join ss2 b on b.recipe_id = a.id b.machine_id = 1 table a id lotid name 62 fr 3 2000w - 200w/ms 63 fr 3 2000w - 180w/ms 85 fr 2 2000w - 173w/ms 87 fr 2 1200w - 173w/ms 197 fr 2 1100w - 185w/ms 200 fr 2 2000w - 185w/ms 204 fr 2 1200w - 41w/ms 218 fr 5 kst / test 220 fr 5 2000w - 29w/ms 221 fr 4 2000w - 185w/ms 222 fr 5 2000w - 185w/ms 223 fr 2 n2000w - 200w/ms 224 fr 3 2000w - 185w/ms ...

python - How to send photo on telegram bot -

i'm implementing simple bot should send photos , videos chat_id . well, i'm using python, script import sys import time import random import datetime import telepot def handle(msg): chat_id = msg['chat']['id'] command = msg['text'] print 'got command: %s' % command if command == 'command1': bot.sendmessage(chat_id, *******) elif command == 'command2': bot.sendmessage(chat_id, ******) elif command == 'photo': bot.sendphoto(...) bot = telepot.bot('*** insert token ***') bot.message_loop(handle) print 'i listening ...' while 1: time.sleep(10) in line bot.sendphoto insert path , chat_id of image nothing happens. where wrong? thanks you need pass 2 params bot.sendphoto(chat_id, 'url')

java - How long does it take for an android application to be placed in "standby" mode in M? -

does know timing this? alternatively know part of aosp source code concerns app standby? i found equivalent timing doze (30 minutes, btw) perusing source code deviceidlecontroller.java , looking same standby. what "standby" mode? afaik, app can either active,background or dead(killed). how describe state think "standby"?

Group objects by a series of common IDs and select a grouping based on the sum of a different key in LINQ -

so have bit of academic question. able solve using brute force approach, believe solvable more elegantly in linq - however, can't find way so. solution can c# or vb, it's linq giving me trouble. i have following object: public class foo { public int fooid {get; set; } public int bar {get; set; } /// <summary> /// contains list of fooid /// </summary> public int[] stackability } what need find possible groupings of foo s based on stackability (i.e.: common fooid in stackability list), select grouping has highest sum of bar . so, example: have foos ids of 1, 2 , 3. +-------+-----+--------------+ | fooid | bar | stackability | +-------+-----+--------------+ | 1 | 5 | 2, 3 | +-------+-----+--------------+ | 2 | 2 | 1, 3 | +-------+-----+--------------+ | 3 | 6 | 1 | +-------+-----+--------------+ foo 1's stackability contains values of 2 , 3 , has bar of 5. f...