Posts

Showing posts from March, 2011

How can I establish "shared" variables for all Bash instances on a machine? -

this question has answer here: setting environment variables in os x? 28 answers how can establish these shared variables forever on bash instances? export path=/developer/nvidia/cuda-5.5/bin:$path export dyld_library_path=/developer/nvidia/cuda-5.5/lib:$dyld_library_path from dyld_library_path seems using mac. can put these in ~/.bashrc . if current $shell bash each time open terminal should execute lines , available read/modify later. e.g. echo $dyld_library_path

selenium webdriver - I can't create an XML file in Eclipse -

in eclipse right click project "webdrivertest1" , "select wizard" window displayed. in "select wizard" window can type xml nothing displayed allow me select xml. an instructor on utube webdriver video create xml file allow webdrivertest incorporating testng modules executed had no option create xml file. have installed xml plugin eclipse? until install plugin, that's how it'll be. eclipse supports anything, few things "out of box". webtools platform: http://www.eclipse.org/webtools/sse/ xmlbuddy: http://download.cnet.com/xmlbuddy/3000-7241_4-10405546.html tut xmlbuddy: http://www.ibm.com/developerworks/library/os-ecxml/ vex: http://www.eclipse.org/vex/ rinzo: http://editorxml.sourceforge.net/

Process hanging -SIGALRM not delivered- Perl -

i have command i'm executing using open pipe, , want set timeout of 10 seconds , have sub process aborted if execution time exceeds this. however, code causes program hang- why alarm not getting delivered properly? my $pid = 0; $cmd = "somecommand"; print "running command # $num"; eval { local $sig{alrm} = sub { print "alarm \n"; kill 9, $pid; }; alarm 10; pid = open(my $fh, "$cmd|"); alarm 0; }; if($@) { die unless $@ eq "alarm \n"; } else { print $_ while(<$fh>); } edit: so answers below, have: my $pid = open(my $fh, qq(perl -e 'alarm 10; exec \@argv; die "exec: $!\n" ' $cmd |)); print $_ while(<$fh>); but print alarm clock console when alarm times out...whereas dont specify anywhere in code...how can rid of this, , put custom alarm event handler? thanks! i want set timeout of 10seconds , have sub

html - IE 10 in compatibility mode is messing with the inline-block code -

i have 6 pictures displayed in 2 columns of display: inline-block attribute. when test out page on ie10 compatibility mode pictures displayed in 1 column instead of two. html <div style="width:700px; margin-bottom: 15px;" > <img src="images/img_0021.jpg" alt="" style="width: 100%; margin-top: 20px; margin-left: 18px; margin-right:10px;"/> </div> <div style="width: 700px; float: right; height: 274px;"> <p>test para</p> <p>test para </p> </div> <div style=""> <div class="singleblock"> <div class="inline"> <img src="images/img_0013.jpg" alt="" style="" class="singlepic"/> </div> <div class="inline"> <p style="" class="text" ><strong>ryan</strong></p>

c# - Getting more than one Legend object in LegendCollection to stack vertically when chart renders -

Image
i'm trying learn mschart control. want create histogram chart has stat panel right displays statistics chart. tried doing creating legend object docked right. i boxes stack vertically right of chart. each box represents legend object in legendscollection. code: private void createstatpanel( chart chart ) { var legend = new legend { title = "basic stats", titlealignment = stringalignment.near, titlebackcolor = color.lightgray, docking = docking.right, bordercolor = color.lightgray, borderwidth = 1, borderdashstyle = chartdashstyle.solid, }; var item = new legenditem(); var column = new legendcell { celltype = legendcelltype.text, backcolor = color.white, forecolor = color.black, text = "54 data values ", alignm

ide - How to run Java code on Eclipse Juno -

Image
i'm learning java , using eclipse main ide right now, can't run java code (there no run or debug option in popup menu). and personally, don't use 2 difference version of eclipse. thanks edit : i'm using eclipse standard 4.3 , doesn't have run \ java application 's option. exists in eclipse ide java developers. this not same version of eclipse button identical.

Chrome not loading map markers due to tab -

i have google map page, works fine in every browser chrome. when chrome loads it, thinks add tab trying add browser tab instead of tab in infobox. ideas? in advance. here code snippet in question. // open info bubbles google.maps.event.addlistener(marker, 'click', function () { infobubble.open(map, marker); infobubble.removetab(4); infobubble.removetab(3); infobubble.removetab(2); infobubble.removetab(1); infobubble.removetab(0); if (category == "kml") { window.open("" + url); } //if (!category == "kml") { infobubble.addtab('details', contentstring_detail); //} if (!notes_tab == "") { infobubble.addtab('notes', contentstring_notes); }

python - migrating an existing app via south -

i have following model - class todo(models.model): todo_title = models.charfield(null=true, blank=true, max_length=200) todo_status = models.integerfield(choices=task_status, null=true, blank=true) assigned_to = models.manytomanyfield(orgstaff, null=true, blank=true, related_name='assigned_to') assigned_by = models.manytomanyfield(orgstaff, null=true, blank=true, related_name='assigned_by') assigned_time = models.datetimefield(auto_now_add=true) completed_time = models.datetimefield(null=true, blank=true) i run python manage.py convert_to_south todoapp todoapp name of app. run python manage.py migrate todoapp. once done, add field in above model - class todo(models.model): todo_title = models.charfield(null=true, blank=true, max_length=200) todo_slug = models.slugfield(null=true, blank=true) todo_status = models.integerfield(choices=task_status, null=true, blank=true) assigned_to = models.manytomanyfield(orgstaff

c++ - One-to-one relation in STL terms -

as know there no biunivocal mapping datastruct/adt in c++ (stl) , c++1y. need sorted associative container allows me map key set value set , vice versa. what best approach or existant solution? my proposal is: #!/usr/bin/env bash -vex # cls ; bash self.bash 2>&1 | tee self.log | less warn="-w -wall -wextra -werror" g++ -x c++ - -std=gnu++1y $warn -ofast -o <<__eof && ./a && echo -e "\e[1;32msucceeded\e[0m" || echo -e "\e[1;31mfailed\e[0m" #include <list> #include <tuple> #include <map> #include <functional> #include <string> #include <cstdlib> #include <cassert> template< typename a, typename b > class bijection { using data_type = std::list< std::tuple< const, b const > >; public : using iterator = typename data_type::iterator; using const_iterator = typename data_type::const_iterator; private : using direct_mapping_type = std::map<

asp.net - JQuery Post URL -

i have following jquery function function refreshthegrid(mydata, ceduledatefrom, ceduledateto, paramorderno) { var mydata2 = { ceduledatefrom: ceduledatefrom, ceduledateto: ceduledateto, paramorderno: paramorderno }; var theurl = "updatecheckbox"; var theurl2 = ""; $.ajax({ type: "post", url: theurl, data: mydata, datatype: "text", success: function (data) { $.ajax({ type: "post", url: theurl2, data: mydata2, datatype: "text", success: function (data) { $('#monbouton').click(); } }) } }) popup.hide(); void (0); } my application http://localhost/jprmvc/ when post method called following capture fiddler2 post /jprmvc/ceduleglobale/updatecheckbox http/1.1 and po

url rewriting - URL Re-writes and Google Indexing -

i asked perform url re-writes new site numerous dynamic pages , has worked fine. however when @ urls google has indexed, has indexed 'non-rewrite' url, '?', '&' etc being used. what have force google index re-written urls? i assumed automatically , never expected issue. all gratefully appreciated. thanks. steps 1) make sure expired pages no longer publicly accessible 2) not wish bots crawl should flagged appropriate "nofollow" meta tags 3) submit new sitemap google web developer account 4) make sure website throws 404 error when page isn't found. idea make splash page 404 error links home page. (this accomplished different ways across different server-side languages) google automatically remove indexed pages if no longer exist.. patient.

python - Django-Grappelli: Reverse for 'grp_related_lookup' with arguments '()' and keyword arguments '{}' not found -

i use django-grappelli create orderable inlines on admin site. (not reproducibly - 50% of time, particularly weird), django throws following exception when try save ordering inline: exception type: noreversematch exception value: reverse 'grp_related_lookup' arguments '()' , keyword arguments '{}' not found. exception location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 424 the offending line this: $("#id_" + this).grp_related_fk({lookup_url:"{% url 'grp_related_lookup' %}"}); as per advice given in this related thread , i've tried testing in shell, seems work fine: >>> django.core.urlresolvers import reverse >>> print reverse('grp_related_lookup') /grappelli/lookup/related/ i'm @ loss. has made similar experience? django version 1.5.1. you forgot add grappelli urls urls.py (at least case me) url(r'^grappelli/', includ

hashmap - Java retrieving a custom key object from a map -

this may not best data structure, wondering if possible this: have set of tools, each unique id , bunch or attributes. each tool has collection of chambers contain attributes. hoping use tool key hashmap , list of chambers value. after of chamber information database, want key object (tool) toolid can add each chamber appropriate tool. over-rode equals method , hash method use toolid. other bringing keys , iterating on them see if equal toolid, there way key object here code far: public class toolbean { private string toolid; private string toolname; private string toolowner; public toolbean(string toolid){ this.toolid = toolid; } @override public boolean equals(object obj) { if (this == obj) return true; if (obj == null) return false; if (getclass() != obj.getclass()) return false; toolbean other = (toolbean) obj; if (toolid == null) { if (other

ios - Put Xcode files into new folder. Since then, I encounter the following errors when building project in simulator -

i encounter following errors ld: warning: directory not found option '- l/users/andrecowardjr/desktop/parley/parley/google analytics ld: library not found -lgoogleanalytics clang: error: linker command failed exit code 1 (use -v see invocation) cant find out error is. needed. go project settings, check out field 'library search paths', , edit reflects moved code/libraries. error you're running here linker can't find google analytics library app set link against (because moved it).

c# - EF 5 Connection Management -

is possible ef5 not close connections when using dbcontext like public void updatecategory(models.category catdata) { if (catdata == null) return; using (var cntx = new datacontext()) { //in line below connection opened close???? var cat = cntx.set<category>().firstordefault(c => c.categoryid == catdata.categoryid); if (cat == null) return; if (!cat.lastchanged.matches(catdata.lastchanged)) throw new concurrencyexception(cat.gettype().tostring()); cat.categoryname = catdata.categoryname; cntx.dbcontext.entry<category>(cat).state = system.data.entitystate.modified; //after next line have 2 connections opened? or connection opened first query closed already? cntx.savechanges(); catdata.lastchanged = cat.lastchanged; } } are there scenerios\bugs same context creates\opens 2 connections, leaving 1

excel - issues with Run time error 9 on vba code -

i need debugging weird bug found on 1 of workbooks. wrote vba code excel file , somehow calling different workbook. ill give example lets have excel file called "test1", file has references workbook called "test2" following code applies workbook "test1" lastrow = cells(rows.count, 1).end(xlup).row ' last row msgbox (lastrow) 'wrote debugging purposes worksheets("salescontest").range("a3:a" & lastrow).clear i have code can clear contents row in "test1" file problem comes when randomly open "test2" , somehow runs code above on "test2" though suppose run on "test1" when open "test2" there messagebox says number of rows in "test2" , gives me following error message "run time error 9" subscript out of range" there way can fix doesnt call "test2" "test1" you can use thisworkbook.worksheets("salescontest&qu

postgresql - Resetting sequential scan position for repeated SPI calls -

i'm using spi postgres cursor fetch data. looks this: spi_connect(); snprintf(sql, sizeof(sql), "select * %s;", datatablename); cursorplan = spi_prepare(sql, 0, null); cursorportal = spi_cursor_open(null, cursorplan, null, null, 1); spi_cursor_fetch(cursorportal, direction, cursor_buffer_size); before fetching execute select * coords4_1 limit 5; and get x | y -------------------+------------------- -138.272695243359 | -185.774616431445 -170.132300350815 | 35.1918349042535 148.739065974951 | 213.159712031484 105.91473756358 | -375.821752008051 418.450653553009 | -69.8341866955161 then start fetching. table big interrupt fetching reasons. i execute select * coords4_1 limit 5; again , get 231.340305414051 -443.616589065641 65.2282955124974 412.122126668692 434.384567663074 63.0593989044428 -19.7921730577946 -223.832104355097 -122.094649355859 467.992015648633 this query returns same result in psql , in progr

Grails database migration fails with LiquibaseException -

i'm using grails database migration plugin . this configuration: grails.plugin.databasemigration.updateonstart = true grails.plugin.databasemigration.updateonstartfilenames = 'changelog.groovy' when start app exception: | error 2013-08-20 08:55:47,356 [localhost-startstop-1] error context.grailscontextloader - error initializing application: liquibase.exception.liquibaseexception: cannot find parser supports c message: liquibase.exception.liquibaseexception: cannot find parser supports c line | method ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused liquibaseexception: cannot find parser supports c ->> 61 | getparser in liqu

sql server - How to turn separate year, month and day columns into a single date? -

i have year column contains things 2013, 2012, etc. month column displays 1-12, , day column contains 1-31. need run select concatenates them , casts them actual date, unsure how go this. can provide input? for sql server 2008+: select convert(date,cast([year] varchar(4))+'-'+ cast([month] varchar(2))+'-'+ cast([day] varchar(2))) for sql server 2005: select convert(datetime,cast([year] varchar(4))+ right('00'+cast([month] varchar(2)),2)+ right('00'+cast([day] varchar(2)),2))

ios - Why can't I retrieve my plist file? -

Image
i have plist file created of strings; looks this: this code i'm using create path file: nserror *error; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); // create list of paths nsstring *documentsdirectory = [paths objectatindex:0]; // path documents directory list nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"nailservices.plist"]; // create full file path nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if (![filemanager fileexistsatpath: path]) { // check if file exists // path plist created before in bundle directory (by xcode) nsstring *bundle = [[nsbundle mainbundle] pathforresource: @"nailservices" oftype: @"plist"]; [filemanager copyitematpath:bundle topath: path error:&error]; // copy plist documents directory } this code i'm using examine data (to make sure working)... i'm getting (null) nslog statement) //load di

paypal - REST Api integration - how to force payment page's language? -

i integrated paypal api , have problem payment page displayed in polish (which native language), not english. i'd force payment pages display in english because whole site in english. how can that? there no setting in merchant's account :/ i know there hacks force language, works paypal's buttons, not api interfaces :/ have tried changing locale/language , input settings on browser. locale affects language etc presented visitors of paypal. however if want force locale, there couple of ways (depending on product using): wp: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-pro/integration-guide/wpcustomizing/#id0864a0q60y4 ec: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/integration-guide/ecbuttonintegration/#id089tgk09030

Getting current date with javascript with HTTP Date format -

i'm looking way current date , time in http date format example "tue, 15 nov 1994 08:12:31 gmt". javascript. tried with: new date().tostring() but gives me different format like: "tue aug 20 2013 00:19:28 gmt+0200". need invert month day , put coma between day of week , day of month. how can format? the http date format mention rfc-1123 timestamp . toutcstring function on date object supposed return compatible value . you can validate this sample fiddle .

html - Why isn't this anchor tag taking up 100% of the available space of its parent div? -

my understanding leads me believe putting <a> display:block; css property inside of <div> supposed cause entire div "become" link (ie anywhere hover in div, considered link, because link takes 100% height , width). that behavior doesn't seem working in example below. if you'd rather inspect element , poke around live code, can view site @: http://shayla.phasesolutions.ca/ . see nav @ top of page issue i'm describing. html: <header> <div class="logo"><a href="#"></a></div> <div class="nav-homepage"><a href="#"></a></div> <div class="nav-webdesign"><a href="#"></a></div> <div class="nav-graphicdesign"><a href="#"></a></div> <div class="nav-miscartwork"><a href="#"></a></div>

printing array out of bounds java -

i have array of objects looking this: 1: [volvo, 200] , [jaguar, 900] 2: [bmw, 300] 3: [skoda, 100] , [(no input)] , [(no input)] this method print areas value (with formating inside not issue). out of bound error... need do? thank you! public static void printmat(car[][] carmat){ int row = 0; int column = 0; while ((carmat[row][column] != null)){ system.out.printf("( %-8s : %,9d )", carmat[row][column].getname(), carmat[row][column].getprice()); if (column == carmat[row].length - 1){ system.out.print("\n"); row++; column = 0; } else { column++; } } } you have checked if going off end of current row, good, haven't checked if have run out of rows. after row++ , add in check see if row has gone off end of carmat array. if (row >= carmat.length) break; that ass

ios - How to pass these parameters into an NSString nsuserdefault -

i have 14 nsuserdefualt save keys , instead of adding 14 of them created loop handle this. getting error says many arguments. having brain fart , forgot something. tips or suggestions appreciated. edit: trying read saved data. (int n=0; n==14; n++ ) { nsstring *emailbody=[nsstring stringwithformat:@"enhancers: %@", [[nsuserdefaults standarduserdefaults] stringforkey:@"enhancer%i",n]]; } you had argument in format string "n" should have been placed in different format stringforkey:. should clear things up: for (int n=0; n==14; n++ ) { nsstring *stringfromdefaults = [[nsuserdefaults standarduserdefaults] stringforkey:[nsstring stringwithformat:@"%d",n]]; nsstring *emailbody=[nsstring stringwithformat:@"enhancers: %@",stringfromdefaults]; }

How to get user country and timezone information from Google OAuth2 PHP Client -

i'm using php google api client library retrieve user information google account using oauth2. however, despite google's documentation states , can not seem access user's country or timezone information though token returned , other information can obtained userinfo.profile scope. i used example code provided int heir library here , if var_dump($user) on line 49 of file following output ( with redaction privacy concerns ): array(10) { ["id"]=> string(21) "123" /* redacted */ ["email"]=> string(13) "xxx@gmail.com" /* redacted */ ["verified_email"]=> bool(true) ["name"]=> string(14) "sherif ramadan" ["given_name"]=> string(6) "sherif" ["family_name"]=> string(7) "ramadan" ["link"]=> string(27) "https://plus.google.com/xxx" /* redacted */ ["picture"]=> string(0) "

ruby on rails - How to make object accessible from non-google users -

i trying use google cloud storage service store data. , succeed upload data. but not find how share users not have google account. , how can unique url of object in bucket? or else, how download object ruby-api-client? thank you. you can use signed urls grant access non-google user.

linux - Ghostscript Combine PDfs and Multithread/Core -

) i know there couple of questions , threads out similar stuff none work me. i'm trying combine ~1000 pdf files in one. tried couple tools gs (ghostscript) proper compression. problem is multi threads not working/ i've got 24cores , use e.g. 8 task, top shows me uses still one. command: gs -q -dnopause -dnoprompt -q -dbatch -dnumrenderingthreads=8 -dbandheight=100 -dbandbufferspace=500000000 -sbandliststorage=memory -dbufferspace=1000000000 -sdevice=pdfwrite -soutputfile=combined_gs.pdf sourcefiles/*.pdf i have speed bit takes round 60 seconds , need on fly. suggestions? the pdfwrite device doesn't use threading (it difficult so). clue in name 'numrenderingthreads', pdfwrite doesn't render . since isn't rendering bandheight, bandbufferspace, bandliststorage , bufferspace have no effect. (you've specified -q twice) please aware ghostscript , pdfwrite device not 'manipulate' pdf input, not combine, concatenate or similar. in

php - Mega Menu CSS layout not working when variables added to clean url -

i have been working on site past 5 years , added mega menu development pages (eg. sandbox pages) the mega menu being used can seen here: http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-kick-butt-css3-mega-drop-down-menu/ the menu works superb template pages, when actual urls used, , when clean urls used no variables. when variables used css/css3 doesn't seem load. i tried menu 2 separate files (one within tags , 1 tags. made no impact on particular situation. the abnormal alterations have been done menu has been made php file , added pages of sandbox using "include". i have tried figure out, @ loss. deduction .htaccess mask when adding variables , menu conflicting, not sure conflict it. "mask" clean urls has been in place 4 years , first time have had level of conflict this, leaves me issue of menu. if prefer me put sample code can that, didn't think needed seems centered on menu itself, visible in link above. to read

c# - Clicking WPF window created on 2nd thread causes it to stop responding -

in current project i'm creating wpf based progress window in second thread. see previous post details on how i'm doing this. my delegate method open progress window on second thread looks this: void showprogresswindow() { this.progresswindow = new progresswindow(); progresswindow.show(); //causes dispatcher shutdown when window closed progresswindow.closed += (s, e) => dispatcher.currentdispatcher.begininvokeshutdown(dispatcherpriority.background); //notifies other thread progress window open when dispatcher starts system.windows.threading.dispatcher.currentdispatcher.begininvoke(new func<bool>(_progresswindowwaithandle.set)); //starts dispatcher system.windows.threading.dispatcher.run(); //forces worker cancel work workerinstance.requestcancel(); } so if user closes window while process still running, dispatcher shutdown, code continue dispatcher.run() next line work canceled. after progress window thread exit.

java - App crash when receiving data size 30 MB is loaded about 50% from bluetooth -

i new android dev , app developing send data format byte array via bluetooth , have use bluetooth library here .it easy use , lite weigth. ,app running fine when size of data <= 15 mb.but app crash happen when receiving data size 30 mb loaded in progress bar 50 % . don't know why , how fix it. another question, have implement recieved data activity service.but when service start allocate memory 20 mb , alway increase allocate ram when reciveing data .finally app crash again there limit on memory allocated java code. max allocated size depends on android version , device vendor.

composer now throwing an error after attempting to setup IronMQ -

i ran composer self-update then added in composer.json "iron-io/iron_mq": "*" the ran composer update and composer install but no matter i'm getting error c:\project>composer install loading composer repositories package information installing dependencies (including require-dev) lock file warning: lock file not date latest changes in composer.json. may getting outdated dependencies. run update update them. nothing install or update generating autoload files fatal error: class 'ironcore' not found in c:\project\vendor\iron-io\iron_mq\ironmq.class.php on line 118 script php artisan optimize handling post-install-cmd event returned error [runtimeexception] error output: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] did corrupted what's going on? tried remove line in composer error stuc

mongodb - multiple tasks in nodeunit with mongo fail -

i've taken how asynchronous result node unit , mongoose? , modified simpler show failure. var mongoose = require('mongoose'); var db; module.exports = { setup: function(callback) { try { //db.connection.on('open', function() { mongoose.connection.on('open', function() { console.log('opened connection'); callback(); }); db = mongoose.connect('mongodb://localhost/test_1'); console.log('started connection, waiting open'); } catch (err) { console.log('setting failed:', err.message); test.done(); callback(err); } }, teardown: function(callback) { console.log('in teardown'); try { console.log('closing connection'); db.disconnect(); callback(); } catch (err) { console.log(&#

Javascript works inline but not in a file -

i new javascript , assuming answer simple , right under nose, can't seem find proverbial dog that's going bite me. anyway, works inline: <script language="javascript"> function foo(){ alert("boo!") } </script> <body onload=foo()>... but if do: <script type="text\javascript" scr="js/blah.js"> </script> <body onload=foo()> blah.js contains: function foo(){ alert("boo!") } that doesn't work. why? the correct syntax is: <body onload="foo();">

xml - When using setParameter with a node-set, it raises exception "Invalid conversion from java.lang.String to node-set" -

i trying transform xml invoking xslt java code. facing issue in passing xml string parameter xslt. causes exception: invalid conversion 'java.lang.string' 'node-set'. this method invoke xslt: transformer l_transformer =transformerfactory.newinstance().newtransformer(xslt_file_path); l_transformer.setoutputproperty(outputkeys.encoding, "iso-8859-1"); l_transformer.setparameter("collateraldoc", param_xmlstring); stringwriter l_writer = new stringwriter(); stringreader l_reader = new stringreader(inputxml); source l_in = new streamsource(l_reader); result l_out = new streamresult(l_writer); l_transformer.transform(l_in, l_out); after searching solutions tried creating document object param xml string , passed document object setparameter object. got exception: invalid conversion 'com.sun.org.apache.xerces.internal.dom.deferreddocumentimpl' 'node-set'. the xslt code processes input xml param , line throws exception: <x

java - Hide Birt Report Cross Tab cell -

i new birt tool, i need show/hide summary field of cross tab on basis of parameters can pass manually. used properties-->visibility --> show/hide element hide data of cell , blank cell still showing , need disable cell on basis of parameter. i tried applying scripting on onprepare event failed. kindly give me suggestions... thanks in advance.....

How to compare two given dates with date coming from datetime field in sql server -

i have got user entered datetime fields createdon , createdend , these having datetime formats (29-02-2013) , (12-04-2013) (these sample values only) i have got 1 column in sql server createddatetime , values 2013-09-03 , 2013-02-03 (these sample values only) need check whether createddatetime field in between createdon , createdend 2 given dates... how can compare date coming database these 2 values.. comparison need done in sql server only would 1 suggest ideas , solutions .. many in advance.. edit : declare @return_value int exec @return_value = [dbo].[tp_selecttransactionhistorysearch] @offsetrowno = 1, @fetchrowno = 1, @statusselection = n's', @isreviewed = null, @projectcasenumber = null, @costpagenumber = null, @transactiontypechange = null, @descriptionchange = null, @trasactioncreateonbegindate = n'19-03-2013', @transactioncreatedonenddate = n'20-03

Android EditText : How to apply Foreground color span as you type? -

i'm trying apply font color text in edittext type text. however, inconsistent, meaning if type space, text preceding space go default black color. or if put cursor in middle of word , start typing entire word changes color , not text i'm typing. bold, italic , underline seem work though. how can guarantee text i'm typing affected regards font color? see "size , color" comment below... contentedit.addtextchangedlistener(new textwatcher() { public void aftertextchanged(editable s) { //add style user types if toggle button enabled togglebutton boldbutton = (togglebutton) findviewbyid(r.id.bold); togglebutton embutton = (togglebutton) findviewbyid(r.id.italic); togglebutton underlinebutton = (togglebutton) findviewbyid(r.id.underline); int position = selection.getselectionstart(contentedit.gettext()); try{ if (position <

http - How to post to Google Measurement protocol using Python? -

measurement protocol guide i need example of how post using python. something this, working. import httplib, urllib conn = httplib.httpconnection("www.google-analytics.com") conn.request("post", "v=1&tid=ua-xxxxxx-y&cid=666&t=event&ec=game&ea=start&ev=0") response = conn.getresponse() print response.status, response.reason data = response.read() conn.close() you needed url: conn.request("post", "/collect", "v=1&tid=ua-xxxxxx-y&cid=666&t=event&ec=game&ea=start&ev=0") or dictionary: import httplib, urllib params = urllib.urlencode({ 'v': 1, 'tid': 'ua-xxxxxx-y', 'cid': '666', 't': 'event', 'ec': 'game', 'ea': 'start', 'ev': 0 }) connection = httplib.httpconnection('www.google-analytics.com') connection.request('post'

ajax - wysihtml5 - setting a value won't work, because 'sandbox iframe isn't loaded yet' -

i'm working on little webservice. therefore using ajax call , append data table on website. here can read , update existing entries or write new entries. works fine. i want have possibility update existing wysihtml5 editor. integrated editor on website , can use on new entries. works, too. but there's problem existing data. when comes form update data, want existing data being displayed value. works fine on inputs, wysihtml5 don't work. i know there's iframe , that's why can't set value of textarea. searched solution , found following code (last line): var editor = new wysihtml5.editor("textareaid", { // id of textarea element toolbar: "wysihtml5-toolbar", // id of toolbar element parserrules: wysihtml5parserrules, // defined in parser rules set }); editor.setvalue('here's content', true); usually should work, no content appears , console tells me: error: wysihtml5.sandbox: sandbox iframe isn't

iphone - How to implement dynamic chat application in Ios using php, Something related to Skype like application -

i trying implement chat application in ios . in general use 2 php files 1 posting message(sender) retrieving message(receiver). i want accomplish following: consider a (sender) , b (receiver). a sent message b . , a waiting b 's reply. need call post-api.php sending message , @ receivers side( b ) need retrieve using getapi.php when b reply a must automatically appear in inbox (live chatbox) of a, without calling getapi.php . know scenario not possible. there solution or method chat application works skype or facebookchat . there multiple way implement chat functionality. polling: send request server , process response server in timely fashion after particular time interval using nstimer(but remember cause battery drain). using apns: using official apple push notification implementation, whenever there new entry in chat table on server side send notification particular device using push notification , handle notification using delegate methods (although

android - Recoring Audio using bluetooth headset in GingerBread -

in application use audiorecord api recording. application has option connect , record via bluetooth device. my app records , playback audio via bluetooth headset in devices android 4.0 , later , while in android 2.3 audio can played can't record audio via bluetooth input. does gingerbread support recording audio via bluetooth headset? this code use set bluetooth device: maudiomanager = (audiomanager) getsystemservice(context.audio_service); maudiomanager.setbluetoothscoon(true); maudiomanager.startbluetoothsco(); maudiomanager.setmode(audiomanager.mode_in_call);

perl - Ignore lines in a file till match and process lines after that -

i looping on lines in file , when matched particular line, want process lines after current (matched) line. can :- open $fh, '<', "abc" or die "cannot open!!"; while (my $line = <$fh>){ next if($line !~ m/important lines below line/); last; } while (my $line = <$fh>){ print $line; } is there better way (code needs part of bigger perl script) ? i'd use flip-flop operator : while(<data>) { next if 1 .. /important/; print $_; } __data__ skip skip important lines below line keep keep output: keep keep

java - Getting TransportDisposedIOException : Peer (vm://ipaddress#3) disposed. in active MQ -

i used sample code implement active mq http://www.tomcatexpert.com/blog/2010/12/20/integrating-activemq-tomcat-using-global-jndi#ex-tomcat-server-xml . able send , receive message tomcat server. now required implement shared file system master slave. have followed steps below change activemq.xml configuration added networkconnector , transportconnector in activemq.xml <networkconnectors> <networkconnector name="my queue" uri="static://(tcp://172.16.121.144:61616,tcp://172.16.121.146:61616)" /> </networkconnectors> <transportconnectors> <transportconnector name="openwire" uri="tcp://172.16.121.144:61616"/> </transportconnectors> activemq.xml <?xml version="1.0"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/xmlschem