Posts

Featured post

c# - Store DBContext Log in other EF table -

i want store logs in db table (imported ef code). my code looks this: public pmcontext() : base("myentities") { configuration.proxycreationenabled = false; configuration.lazyloadingenabled = false; this.database.log = s => logstore(s); } private void logstore(string message) { tlog log = new tlog(); log.description = message; log.insertdate = datetime.now; logs.add(log); savechanges(); } public virtual dbset<tlog> logs { get; set; } i cannot use savechanges() (get error "sqlconnection not support parallel transactions") , if remove line nothing stored in db table. how can fix this? i think happens during savechanges call anywhere in app, because sql generated call logged, triggers nested savechanges call tries start own transaction. and there thing: savechanges call in logstore method trigger logging itself, you'd end starting infin

python - Scrapy spider memory leak -

Image
my spider have serious memory leak.. after 15 min of run memory 5gb , scrapy tells (using prefs() ) there 900k requests objects , thats all. can reason high number of living requests objects? request goes , doesnt goes down. other objects close zero. my spider looks this: class externallinkspider(crawlspider): name = 'external_link_spider' allowed_domains = [''] start_urls = [''] rules = (rule(lxmllinkextractor(allow=()), callback='parse_obj', follow=true),) def parse_obj(self, response): if not isinstance(response, htmlresponse): return link in lxmllinkextractor(allow=(), deny=self.allowed_domains).extract_links(response): if not link.nofollow: yield linkcrawlitem(domain=link.url) here output of prefs() htmlresponse 2 oldest: 0s ago externallinkspider 1 oldest: 3285s ago linkcrawlitem 2 oldest: 0s ago request

c# - SetBinding not registering for PropertyChanged event -

in application i'm working on, programmatically create several frameworkelements differing data sources. unfortunately, data binding failing. i managed distill problem following program: using system.collections.generic; using system.componentmodel; using system.runtime.compilerservices; using windows.ui.xaml; using windows.ui.xaml.controls; using windows.ui.xaml.data; namespace testbinding { public class bindingsource : inotifypropertychanged { public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged(string propertyname) { propertychangedeventhandler handler = propertychanged; if (handler != null) handler(this, new propertychangedeventargs(propertyname)); } protected bool setfield<t>(ref t field, t value, [callermembername] string propertyname = null) { if (equalitycomparer<t>.default.equals(field, value)) return false;

java - Creating signature with HMAC_SHA1 - Secret key expected exception -

i want create digital signature of signaturemethod.hmac_sha1, referred below program package com.sampel.test; import javax.crypto.mac; import javax.crypto.spec.secretkeyspec; import javax.xml.crypto.*; import javax.xml.crypto.dsig.*; import javax.xml.crypto.dom.*; import javax.xml.crypto.dsig.dom.domsigncontext; import javax.xml.crypto.dsig.keyinfo.*; import javax.xml.crypto.dsig.spec.*; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.outputstream; import java.security.*; import java.util.collections; import java.util.formatter; import java.util.iterator; import javax.xml.parsers.documentbuilderfactory; import javax.xml.transform.*; import javax.xml.transform.dom.domsource; import javax.xml.transform.stream.streamresult; import org.w3c.dom.document; /** * simple example of generating enveloped xml * signature using jsr 105 api. resulting signature * (key , signature values different): * * <pre><code> *<envelope xmlns="ur

php - How can I access an array/object? -

i have following array , when print_r(array_values($get_user)); , get: array ( [0] => 10499478683521864 [1] => 07/22/1983 [2] => email@saya.com [3] => alan [4] => male [5] => malmsteen [6] => https://www.facebook.com app_scoped_user_id/1049213468352864/ [7] => stdclass object ( [id] => 102173722491792 [name] => jakarta, indonesia ) [8] => id_id [9] => el-nino [10] => alan el-nino malmsteen [11] => 7 [12] => 2015-05-28t04:09:50+0000 [13] => 1 ) i tried access array followed: echo $get_user[0]; but displays me: undefined 0 note: i array facebook sdk 4 , don't know original array strucutre. how can access example value email@saya.com array? to access array or object how use 2 different operators. arrays to access

Android Google Analytics - App version reporting -

we integrated libgoogleanalyticsservices.jar in our app , working fine. default includes 'version_code' buildconfig.java when sending messages google analytics service. i'd include 'version_name' instead of 'version_code'. 1. there way project libgoogleanalyticsservices.jar? 2. there way configure libgoogleanalyticsservices class send version_name instead of version_code?

How to make an Webview based IOS app and being able to publish it -

i have website responsive. built app on android webview loads website. i same on ios know fact there lot of restrictions publishing web-view based application on app store. what can add webview in order gain approval sure ? i'm looking extremly lazy on this, there alternative may think of ? to answer or comments why bothering creating app if website enough. answer : commercial reason , user friendliness reasons add native controls or small features site doesn't have. add in native social sharing options, native navigation controls, etc. uber hybrid app , of instagram believe. however review process comes down reviewer, lax , not.