Posts

python - Using Mercurial to separate three versions: official/development/testing/ -

i'm working on deploying python module composed of several dozen files , folders; use mercurial managing software changes. i want keep same module in 3 branches: official 1 (which team uses), development 1 (this may more 1 development branch), , testing branch (not testing of official branch, collection of test related third party module used module - regression testing when third party module makes new releases). how can accomplish in mercurial? name 3 branches in same folder or cloning 1 version 3 places maintain them separately? any insight on how manage in general appreciated. thank you. the "official" way cloning repo in many branch need. but named branches within repo acceptable, if don't need work simultaneously on different development efforts (each associated respective branch) i find " guide branching model in mercurial " instructive on kind of choice. other information on mercurial branches in question well .

c# - Calculating Day, Month, Year -

how calculate day, month, year exactly? means.. from 2th jan 1990 9th may 2009 is.. xxx days, xxx months, xxx years. any idea how that? i tried timespan , tick().. both failed so.. you cannot through direct calculation (i.e. there's no "totalmonths" or "totalyears" property of timespan , because numbers not make sense arbitrary intervals of time). instead, can count number in loop, so: var dt1 = new datetime(1990, 1, 2); var dt2 = new datetime(2009, 5, 9); int years = 0; while (dt1.addyears(1) < dt2) { years ++; dt1 = dt1.addyears(1); } int months = 0; while (dt1.addmonths(1) < dt2) { months ++; dt1 = dt1.addmonths(1); } int days = (int) math.floor(dt2.subtract(dt1).totaldays); i haven't tested this, there might off-by-one errors or whatever, that's basic idea.

c++ - SSDP Get Shared folder list using M-SEARCH? -

i using ssdp send discover request using m-search list of services present. requirement want list of share folders present in server. currently , sending request in format : "m-search * http/1.1\r\n" "host: 239.255.255.250:1900\r\n" "man: \"ssdp:discover\"\r\n" "st:upnp:rootdevice\r\n" "mx:3\r\n" "\r\n"; and response these parameters : st:upnp:rootdevice usn:uuid:122261ae-7c37-4234-9366-ed5286752f2b::upnp:rootdevice location:http://172.24.17.221:2869/upnphost cache-control:: max-age = 900 server:: linux i want have shared folder list present on server. how can ? additional parameter need specify ? code snippet or ideas welcome. as far know not possible shared folders ssdp only. ssdp gives list of services turn connect service , "ask" shared folders. in example need connect to: location:http://172.24.17.221:2869/upnphost that give device configuration includ...

java - Stack in android -

it's first time me use java need use stack in android funcions if define stack out of function give me error (should parametrized) , application crashes public class televideo extends activity{ stack pila = new stack(); @override public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.main); pila.push(mystring); } @override public boolean onoptionsitemselected(menuitem item){ mystring = pila.peek(); } } how can use stack through class functions in java? parametrising means tell class (in case stack) type of objects instance (in case pila) contain. try code instead of yours: stack<string> pila = new stack<string>() however, should not error warning far know.

cocoa - Trap click event on dock icon using Qt on Mac -

i trying dock click event on dock icon on mac os x. using qt-cocoa. highly appreciated. thanks, rahul i've done open-source project. see code here: https://github.com/kdab/charm/blob/master/charm/macapplicationcore.mm

php - Acrobat and/or Reader Error ".tmp" when using fdf -

i'm populating pdf's via fdf (& php) , part works fine users getting either "acrobat cannot open "acrxyz.tmp" (or "reader cannot open "xyz.tmp", in cases). i've found info possible causes surrounding: apache "mod-deflate", ie cache , volatile memory & "fdf_close" among other things.. some config info: it's on apache 2 (the mod_deflate module), don't have fdftk installed can't fdf_close. fdf called include. , these through https ssl users on ie anywhere ie 6 ie 8 using acrobat 8 or reader 8.x or 9.2 most users pdf without problem but.... suggestions narrow search server setting user-config etc. or solutions helpful? here's header info if helps // header required explorer send file acrobat viewer header ("content-type: application/vnd.fdf"); // prevent caching header("cache-control: post-check=0, pre-check=0", false); header("pragma: public...

How can I calculate the height of an element cross-browser using jQuery? -

i created plugin bottom-align element. in it's simplest form did this: get height of outerelement (div) get height of current element result = outerheight - height of current element sett css attribute 'top' = result. and works... in firefox , ie8, not in opera or google chrome. i'm guessing has borders, padding , margin. have in order make work cross-browser? update code has been revised , working now. (function($){ $.fn.alignbottom = function() { var defaults = { outerhight: 0, elementheight: 0 }; var options = $.extend(defaults, options); var bpheight = 0; // border + padding return this.each(function() { options.outerhight = $(this).parent().outerheight(); bpheight = options.outerhight - $(this).parent().height(); options.elementheight = $(this).outerheight(true) + bpheight; $(this).css({'position':...