Posts

android - Cannot set both FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP in one intent? -

i'm using flag flag_activity_single_top , flag_activity_clear_top go previous "standard" activity. use flag_activity_single_top prevent re-creating new instance. found flag flag_activity_single_top neglected , activity finished , re-created. here found in docs. flag_activity_clear_top : says can add flag_activity_single_top when using flag_activity_clear_top prevent "finish - recreate". here doc. flag_activity_clear_top : note: if launch mode of designated activity "standard", removed stack , new instance launched in place handle incoming intent. that's because new instance created new intent when launch mode "standard". did misunderstand first doc? the documentation suggests flag_activity_clear_top need set. have set both prevent activity being created again. this did trick in case: (main being activity wanted return to) intent tabintent = new intent(this, main.class); tabintent.setflags(intent.f...

java - Ireports and barcode -

i doing report contains barcodes, when compile it, gives me error compilation exceptions: com.jaspersoft.ireport.designer.compiler.errorscollector@eed1de net.sf.jasperreports.engine.jrexception: errors encountered when compiling report expressions class file: 1. it.businesslogic.ireport.barcode.bcimage cannot resolved type value = (java.awt.image)(it.businesslogic.ireport.barcode.bcimage.getbarcodeimage(26,"*"+((java.lang.string)field_nridentsns.getvalue())+"*",false,false,null,0,0)); //$jr_expr_id=9$ <--------------------------------------> 2. it.businesslogic.ireport.barcode.bcimage cannot resolved type value = (java.awt.image)(it.businesslogic.ireport.barcode.bcimage.getbarcodeimage(26,"*"+((java.lang.string)field_nridentsns.getvalue())+"*",false,false,null,0,0)); //$jr_expr_id=13$ <----------...

c# - Suggestions on ways to compare two files and show differences, maybe by rehosting a version comparion tool? -

i'm trying find way have version comparison between 2 files (.docx files), files compared , differences highlighted. ability output report. i thinking maybe it's possible rehost comparison tool used team foundation server or similar. documents hundreds of pages long. can u use 3rd party? have used beyond compare 3 has file compare xml stuff. api in sense run batch scripts , dump output in format want

java - Modify JSTL import tag to show gzipped text in JSP -

in jsps using jstl show contents of simple text files reside on server follows: c:import url="http://www.mysite.com/texts/name_id.txt" charencoding="utf-8"/> these text files can quite long , there many of them want compress them , serve compressed version import tag. can give me suggestions on how modify jstl import tag, or create own tag achieves same result when text file compressed? suspect should use apache commons codec, or java.util.zip enough? for reference, source jstl 1.2 import tag can seen at: http://grepcode.com/file/repo1.maven.org/maven2/javax.servlet/jstl/1.2/org/apache/taglibs/standard/tag/rt/core/importtag.java http://grepcode.com/file/repo1.maven.org/maven2/javax.servlet/jstl/1.2/org/apache/taglibs/standard/tag/common/core/importsupport.java#importsupport regards create servlet mapped on url pattern of /texts/* , following job in doget() . string path = request.getrequesturi().substring(request.getcontextpath().lengt...

Attaching file to an email in python leads to a blank file name? -

the following snipit of code works fine, except fact resulting attachment file name blank in email (the file opens 'noname' in gmail). doing wrong? file_name = recordingurl.split("/")[-1] file_name=file_name+ ".wav" urlretrieve(recordingurl, file_name) # create container (outer) email message. msg = mimemultipart() msg['subject'] = 'new feedback %s (%a:%a)' % ( from, int(recordingduration) / 60, int(recordingduration) % 60) msg['from'] = "noreply@example.info" msg['to'] = 'user@gmail.com' msg.preamble = msg['subject'] file = open(file_name, 'rb') audio = mimeaudio(file.read()) file.close() msg.attach(audio) # send email via our own smtp server. s = smtplib.smtp() s.connect() s.sen...

c++ - Sort array/vector of string -

how can sort array/vector repetition of elements? example input leo mike eric leo leo output _ _ _ or leo leo leo eric leo mike eric mike i recommend processing data in 3 passes: use std::sort repeated elements adjacent each other. iterate on sorted range recording length , position of each equal_range. now can resort sequence based on data you've recovered in step 2. may consider using stable_search in phase if secondary search key alphabetical.

Slow postgresql query if where clause matches no rows -

i have simple table in postgresql 9.0.3 database holds data polled wind turbine controller. each row represents value of particular sensor @ particular time. table has around 90m rows: wtdata=> \d integer_data table "public.integer_data" column | type | modifiers --------+--------------------------+----------- date | timestamp time zone | not null name | character varying(64) | not null value | integer | not null indexes: "integer_data_pkey" primary key, btree (date, name) "integer_data_date_idx" btree (date) "integer_data_name_idx" btree (name) one query need find last time variable updated: select max(date) integer_data name = '<name of variable>'; this query works fine when searching variable exists in table: wtdata=> select max(date) integer_data name = 'status_of_outputs_uint16'; max -----------------------...