Posts

python - Scrapy not working as expected -

this scrapy spider. i'm trying scrape data web. don't know how force scrapy follow links recursively. mistake? import re scrapy.selector import htmlxpathselector scrapy.contrib.spiders import crawlspider, rule scrapy.contrib.linkextractors.sgml import sgmllinkextractor scrapy.selector import selector yellowpagesofmoldova.items import yellowpagesofmoldovaitem scrapy.item import item class yellowspider(crawlspider): name = 'yellow' allowed_domains = ['yellowpages.md'] start_urls = [ 'http://www.yellowpages.md/eng/companies/info/8939-arc-publishing-house'] rules = ( rule(sgmllinkextractor(allow=('eng.+')), follow=true), ) def parse(self, response): sel = selector(response) = yellowpagesofmoldovaitem() i['url'] = response.url i['locality'] = sel.xpath("//tr[3]/td/p[1]/span[1]/text()").extract() i['title'] ...

c# - Button click highlight list box item WP8 -

i have list box 4 items a,b,c , d. i have button in application bar,onclick of button need highlight or change background color of list item , b green. how achieve ? if want in xaml, add following lines inside tag <listbox.resources> <solidcolorbrush x:key="{x:static systemcolors.highlightbrushkey}" color="red"/> <solidcolorbrush x:key="{x:static systemcolors.controlbrushkey}" color="red"/> </listbox.resources>

javascript - Masonry doesnt display correctly on Safari -

i using masonry display images , on firefox loads fine on safari doesnt load correctly displays scattered. js im using. no clue doing wrong? var $container = $('.main_containera'); $container.imagesloaded(function(){ $container.masonry({ itemselector: '.item1', columnwidth: function(containerwidth){ return containerwidth / 12; } }); $('.item1 img').removeclass('lazy-load'); $('.item1 img').addclass('not-loaded'); $('.item1 img.not-loaded').lazyload({ effect: 'fadein', load: function() { // disable trigger on image $(this).removeclass("not-loaded"); $container.masonry('reload'); } }); $('.item1 img.not-loaded').trigger('scroll'); });

android - GetFile Cordova 3.4.0 err.code 1000 -

i try getfile cordova 3.4.0 : filemanager.prototype.readastextfromfile = function (filename, readdatacallback) { var = this; try { window.requestfilesystem(localfilesystem.persistent, 0, function (filesystem) { filesystem.root.getfile(filename, {create: false}, function (fileentry) { fileentry.file( function (file){ var reader = new filereader(); reader.onloadend = readdatacallback; reader.readastext(file); } , function(err){alert('readfile' + " fail: " + err.code);}); } , function(err){alert('getfile' + " fail: " + err.code);}); }, function(err){alert('filesystem' + " fail: " + err.code);}); } catch (e) { logerror(...

Java - Best way(main criteria is perfomance) to get part of a string before a given substring? -

i have string: this string-tro:jjj me i want string this string- i know can use method string#split colleagues said not best way because harm performance. is there way doing that? yes, can use string#substring method that: string s = "this string-tro:jjj me"; system.out.println(s.substring(0,s.indexof("-")+1)); output: this string-

datasource - Grails with multiple data sources and Hibernate Envers -

i'm running grails 2.2.4 application multiple data sources. 1 requirement provide auditing hibernate envers. did following: domain classes annotated org.hibernate.envers.audited org.hibernate:hibernate-envers:3.6.10.final in classpath hibernate event listeners defined follows. should work defined data sources. beans { auditeventlistener(auditeventlistener) hibernateeventlisteners(hibernateeventlisteners) { listenermap = [ 'post-insert': auditeventlistener, 'post-update': auditeventlistener, 'post-delete': auditeventlistener, 'pre-collection-update': auditeventlistener, 'pre-collection-remove': auditeventlistener, 'post-collection-recreate': auditeventlistener ] } } however, no audit entries inserted revision tables. has hint how fix this? still issue latest grails version? invest effort upgrade. note, using hibernate envers. not use grails plugin. ther...

jquery - width and height of a swf based on screen resolution -

my swf effect appears on div if press button. problem div has size in %, need swf have same width , height. here code tried( show code swf size, because jquery code appear on button press works): <div id="be2"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="border-effect2" align="middle"> <param name="movie" value="img/border-effect.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="transparent" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="wmode" value="transparent" /> <param name="scale" value="showall" /> <param name="men...