Posts

Featured post

c# - How to copy form fields with PdfWriter not PdfCopy in iTextSharp -

i merge 2 pdf files (only selected pages) , add custom headers , footers them. therefore not use pdfcopy copies page without altering it. use pdfwriter . the problem not know how copy acrofields, acroforms, annotations , else except content pdfwriter . do know how this? you want use getimportedpage method of pdfwriter class. copies pdfimportedpage can use. pdfreader pdfreader = new pdfreader(originalfile); pdfimportedpage importedpage = pdfwriter.getimportedpage(pdfreader, pagenumber); as example, can place previous code in onopendocument event of pdfpageeventhelper , in onendpage event can use directcontentunder object of pdfwriter place entire page underneath current page. pdfwriter.directcontentunder.addtemplate(importedpage, 0, 0);

xmlhttprequest - Make my jQuery Ajax script use CORS -

i built application reads data via ajax external website. works fine found out in question if want package blackberry 7, webworks or phonegap, may need use called cors . how can convert following script same thing except using 'cors'? <script type="text/javascript"> $("#page_all").live('pagebeforecreate', function() { $.get('http://mysite.com/mobile/data/data_all.php',function(data){ $('.content').empty(); $(data).find('market').each(function(){ var $market = $(this); var html = '<div class="data">'; html += '<div data-role="collapsible" data-collapsed="true" data-theme="b"><h3>' + $market.attr('date') + '</h3>'; html += '</div>'; $('#result').append(ht...

python - Paramiko change IP of remote machine -

i have change ip of remote machine running gentoo. use code looks like try: guest.connect("10.22.254.200", username='root',password='root') except sshexception detail: session.flash = detail.message else: sftp = guest.open_sftp() sftp.put('./scripts/change-ip', '/root/change-ip') sftp.close() guest.exec_command('chmod +x /root/change-ip') time.sleep(5) try: stdin,stdout,stderr = guest.exec_command('/root/change-ip 10.22.254.200 &') my change-ip script looks like set -x cp /etc/conf.d/net /etc/conf.d/net.bak sed "s/10.22.254.200/$1/g" /etc/conf.d/net.bak > /etc/conf.d/net /etc/init.d/net.eth0 restart i able ssh directly , execute script changing ip, reason cant in code. any appreciated restarting network on network dangerous thing. happens here after stopping network interface in command /etc/init.d/net.eth0 re...

iphone - When an iOS device rotates, how do I change the orientation only one element? -

i able handle orientation changes in current iphone application. problem don't want view of controller rotate or resize. when device orientation changes, want 1 ui element rotate 90 degrees on screen. apple's camera application perfect example of - when device orientation changes, of buttons rotate, view not rotate. i suppose resize view, move of elements around, , animate buttons, feel there must easier way it. thanks in advance. 1) can create 2 view hierarchies , change on screen in willrotatetointerfaceorientation: see question 2) or can handle rotations see question

jquery mobile - ajax json output parsing in jquerymobile -

public function actionajaxsearch() { $data_fetched=person::model()->findbyattributes (array('code'=>'cust0001')); echo cjson::encode($data_fetched); } $('#searchresult').live('pageshow', function(e,info) { $.post('?r=mobile/ajaxsearch',$('form').serialize(), function(res) { arrayvalue =res; $.each(arrayvalue, function(i, profile) { alert(i); alert(profile); }); } }); i getting output json encode one. in traversing alert getting value each character not key or value. help? adding datatype , contenttype solved problem. added complete code other's ref. public function actionajaxsearch() { $data_fetched=person::model()->findbyattributes (array('code'=>'cust0001')); echo cjson::encode($data_fetched); } $('#searchresult').live('pageshow', function(e,info) ...

javascript - Exporting HTML PHP webpage to image -

there google map in site , need export google map image , need store. can in script php or html or javascript how can it? as @sirko , @brendan have pointed out, should provide kind of code have work on. if looking starting point extend on @jbrtrnd's suggestion of using html5 canvas wrap google maps div in , write script convert image. luckily there js library created accomplishes task, have @ js library , find answer: http://www.nihilogic.dk/labs/canvas2image/

c# - Disabling Anonymous authentication for web application causes error -

i trying enable windows authentication , disable anonymous authentication intranet application. have enabled windows authentication , disabled anonymous in iis7, , set web.config use windows authentication. <system.web> <authentication mode="windows" /> <compilation debug="true" targetframework="4.0" /> </system.web> when deploy , run application, page header load. when navigate service.svc file in chrome or ie, following error: security settings service require 'anonymous' authentication not enabled iis application hosts service. system.notsupportedexception: security settings service require 'anonymous' authentication not enabled iis application hosts service. i assume problem web.config or service.svc.cs, cannot identify it. happens 1 service. enabling anonymous authentication in iis7 resolve issue, need disabled. in servicerefernces.clientconfig, have: <configuration> ...