Posts

Spring Scheduled Tasks: Fixed Rate and Cron -

Spring Scheduled Tasks: Fixed Rate and Cron - i implementing scheduled tasks using spring. have fixed rate task runs every 30 minutes. configure run every 30 min during 9 - 5, mon - fri. please suggest me way this. simple. fixed rate: import org.springframework.scheduling.annotation.scheduled; import static org.apache.commons.lang.time.dateutils.millis_per_minute; @scheduled(fixedrate = 30 * millis_per_minute) cron look (not tested, please prepare if incorrect): @scheduled(cron = "* 0,30 9-17 * * mon-fri") see also: 25.5.1 @scheduled annotation spring spring-mvc scheduled-tasks

java - I am missing a return statement -

java - I am missing a return statement - i building dao mill project this class: package dao; import interfaces.idaoproject; import datapackage.dbobject; import java.util.arraylist; import type.programma.oefening; public class daoproject extends dbobject implements idaoproject { @override public arraylist<oefening> load(oefening o) { try{ string sql = "load oefeningen set code = " + o.getcode() + " code = " + o.getcode(); openconnection(); stmt = conn.createstatement(); rs = stmt.executequery(sql); } catch(exception e){ system.out.println(e.getmessage());} } } now gives error @ public class daoproject extends dbobject implements idaoproject { missing homecoming statement how can prepare this? you have declared method public arraylist<oefening> load(oefening o) shouldn't returning arraylist ? java

linux - How to download the created PDF file in python? -

linux - How to download the created PDF file in python? - i able convert html pdf , store on local directory. point how download same file after beeing created progamatically using python? this code: filename = "test.pdf" body= fromstring( u"<div>" + tostring( fromstring( str(self.request.post['content']).decode('utf-8') ).body ) + u"</div>" ) tx = tostring(body).encode('utf-8') pisa.createpdf(tx, file(filename, 'wb')) hi there founded solution: fh = open('path_to_file','r') self._response.data = fh.read() fh.close() self._response.headers.add('content-type', 'application/pdf') self._response.headers.add('content-disposition', 'attachment') so able download created file... python linux

streaming - How to use BulkOutputFormat to stream the data to the Cassandra from Hadoop Map function? -

streaming - How to use BulkOutputFormat to stream the data to the Cassandra from Hadoop Map function? - 1) have row-key, column , value in map of hadoop job , came know can stream straight cassandra using bulkoutputformat. 2) have gone through code quite hard understand how utilize it. how can utilize bulkoutputformat api stream info cassandra? as more documentation not yet available on request cassandra experts guide me through this. little code snippet helpful. planning test current development version. by looking cassandra source code , cassandra jira have figured out way utilize bulkoutputformat , described here:using bulkoutputformat load info cassandra hadoop streaming hadoop mapreduce cassandra

sql server 2008 - MDX query creating verbose xml style field names in dataset in SSRS -

sql server 2008 - MDX query creating verbose xml style field names in dataset in SSRS - i pasted query (which works in ssms) new dataset in vs.net/bids however, field/column names returned showing values like: id__xml_version__1_0__encoding__utf_8____field_xmlns_xsi__http___www_w3_org_2001_xmlschema_instance__xmlns_xsd__http___www_w3_org_2001_xmlschema__xsi_type__level__uniquename___... what causing , how can prepare it? this way ssas produces xmla. imhu no real way prepare it. sql-server-2008 reporting-services ssas mdx xmla

c# - Using custom settings for WebBrowser Control -

c# - Using custom settings for WebBrowser Control - i'm trying build c# application uses webbrowser command for, obviouly, webbrowsing. enhance security of system, i'd set own security settings. these 2 of settings set through software: disable download file-extensions (*.exe) disable cookies i found, webbrowser class straight uses settings net explorer. there way utilize own settings specific webbrower or overide these settings (maybe temporarely)? i think question may similar this: overriding ie settings when embedding webbrowser command using ie9 (but i'm not sure... :) edit: if alter cookie-settings net explorer, used webbrowser-control, right? possible alter these global settings via c#? maybe easy solution problem... unfortunately, doesn't can disable cookies, though can clear them; however, when so, clearing cookies all ie instances on pc (for particular account). here stackoverflow more detail. as far controlling files may downloa...

sql - Auto-increment subquery in tsql select statement -

sql - Auto-increment subquery in tsql select statement - i have t-sql select statement , want auto-increment column in (that doesn't exist in database) select dbo.a, dbo.b, dbo.c, select @d:=1; @increment:=@increment+1 d is possible? assuming you're using sql 2005 or later: select dbo.a, dbo.b, dbo.c, row_number() over(order getdate()) d to order rows returned form db. if want specify order can so: select dbo.a, dbo.b, dbo.c, row_number() over(order dbo.a) d for sql 2000 , before need unique value order by: select dbo.a, dbo.b, dbo.c, (select count(*) dbo d2 d2.a <= dbo.a) d dbo or if don't need single select: select identity(int,1,1) id, dbo.a, dbo.b, dbo.c #temp dbo select * #temp sql sql-server tsql sql-server-2000