Posts

Showing posts from March, 2012

smtp - Can an originating address (email) be tied to PHP / Swiftmailer? -

my error: uncaught exception 'swift_badresponseexception' message 'expected response code(s) [250] got response [550 sender rejected - mail must valid domain. could have tied sender-valid-domain 1 specific address? i've had swiftmailer configured nicely , performing many operations months now. have no idea happen, first hunch since last time used swiftmail , worked correctly, i've installed bugzilla on server. the server has many virtual servers, , such need multiple origination addresses. i remember skipping mail configuration during buzilla install, thinking come it. feb, , bugzilla has been used thoroughly since. out of bugs added, 1 added resulted in email being sent (as bugzilla should, if configured mail server, didn't puzzle me). so there way bugzilla install configured specific address server's send address , want use different domain im causing error? the fix in mx records...

SQL Selecting Records -

i confused in selecting cars availability table want list available vehicles in given branch have written query brain stuck carry on !? select model, make, start_date, termination_date vehicle_type, vehicle, hire_agreement vehicle_type.vehicle_type_ nun = vehicle. vehicle_type_no , vehicle.vehicle_reg_num = hire_agreement.vehicle_reg_no , ; i believe start_date , termination_date can cars availability how?? first, should join instead of old school stuff. best can suggest given information have provided. select vehicle.model, vehicle.make, hire_agreement.start_date, hire_agreement.termination_date vehicle natural inner join hire_agreement hire_agreement.terminationdate >= date() , hire_agreement.start_date <= date(); this can considering didnt give schema or flavor of sql.

wpf - Own CollectionView for paging, sorting and filtering -

i've implemented own collectionview bind collection of data datagrid in wpf. the main goal pagination, working quite well. i've written following c# code: public class schemescollectionview : collectionview { private readonly ilist<scheme> innerlist; private readonly int itemsperpage; private int currentpage = 1; public schemescollectionview(ilist<scheme> source, int itemsperpage) : base(source) { innerlist = source; this.itemsperpage = itemsperpage; } public override int count { { return itemsperpage; } } public int currentpage { { return currentpage; } set { currentpage = value; onpropertychanged(new propertychangedeventargs("currentpage")); onpropertychanged(new propertychangedeventargs("firstitemnumber")); onpropertychanged(new propertychangedeventargs("lastitemnumber"));

jquery - Check for Cookie, if it doesn not exist run script -

i'm struggling use of cookies on html page. have script check see if user has cookie, if not call script open model window <script type="text/javascript"> jquery(document).ready(function() { jquery("#mymodal").reveal(); }); </script the window contains "yes" , "no" buttons, if user selects "yes" save cookie modal doesn't open on future visits page, if user selects "no" direct them page. any appreciated!! 1) use jquery cookie library ease of use. https://github.com/carhartl/jquery-cookie 2) check if cookie exists , handle accordingly if ($j.cookie("nameofyourcookie") == null) { //do stuff if cookie doesn't exist set cookie value of 1 $j.cookie("nameofyourcookie", 1, {expires: 10, path:'/'}); } else { //they have cookie alert ('you have cookie name nameofyourcookie'); } * edit * thought might edit answer more appropriate question. <

java - Linked List, not adding values properly -

i'm working on assignment implement linkedlist data structure, have code finished except it's not working, input code i'm testing "1,2,3,4,5", "1" being outputted instead of of values. here's code: // main method functions private static linkedlist createlinkedlist(int[] values) { linkedlist list; list = new linkedlist(); (int = 0; < values.length; i++) { list.add(values[i]); } return list; } private static void printlist(linkedlist list) { node currentnode = list.gethead(); while(currentnode != null) { system.out.println(currentnode.getint()); currentnode = currentnode.getnextnode(); } } // linkedlist class functions public void add(int value) { node newnode = new node(value); node currentnode; if(head == null) { head = newnode; } else { currentnode = newnode; while(currentnode.getnextnode() != null) { currentnode = currentnod

svn - In subversive eclipse plugin how do you accept just my changes? -

when conflict, can *override , update, inorder incoming changes how accept changes , ignore incoming ones ? "override , commit" tries commit, don't want @ moment. with svn commandline client above straightforward choose mark merged on files want use local version.

php - Getting the project root -

i keep getting confused when trying include files have different paths in local environment vs production. for example, have in usercontroller.php file: require_once(__dir__ . '/config.php'); on local host, usercontroller.php located in www/myproject/inc/ , config.php in www/myproject/ (the project root directory) this fails. all want way define projects root. i.e on localhost it's www/projectname , in productions it's / since files located inside projectname directory on localhost, it's causing issues on production server. what best way define base path , build require_once that? i.e. require_once($basepath . 'inc/filename.php' most projects use config.inc.php file located in common place these things can defined. config.inc.php define('root_folder', '/'); define('application_link', 'http://www.example.com/mysite'); script.php require ('../config.inc.php'); echo '<a

java - editing the default section and making an array of buttons -

as drag , drop button in netbeans,code generator generates code : private javax.swing.jbutton jbutton1; private javax.swing.jbutton jbutton2; private javax.swing.jbutton jbutton3; what if want array of these buttons ? how edit in netbeans ? like : private javax.swing.jbutton buttonarray[] = new jbutton[3]; note: using netbeans 7.3 simply jbutton[] buttonarray = {jbutton1, jbutton2, jbutton3}; would work. but having said that, far better off @ stage not use netbeans generated code @ , instead code swing applications hand. netbeans code generator can save time if understand swing well, if you're new swing , java, while can create easy gui's, can become impossible bear if want stretch envelope little bit.

iphone - How to replicate the iOS Chrome tabs effect with a UICollectionView -

Image
i'm creating app in 1 of views uicollectionview inside uiview. i'm trying replicate chrome ios effect when active tabs in view, this: does has idea on how accomplish uicollectionview o has link tutorial or help? i have couple of links may help! sample code #1 sample code #2

Google Maps API v3 *broken* in Safari 6.0.2 -

i have straightforward google maps implementation running in chrome on mac. yet - not working on mobile implementation cross-browser fixes, , have discovered map not displaying / functioning, let alone markers , infowindows should showing up. native zoom tool never displays , can't click anywhere on map or drag it. i've been googling , googling not turning up. hints or appreciated (while realizing not code question - yet). i discovered prob on own app, tested using google's 'hello world' maps api, , it's same issue: <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps

javascript - Call backbone model function in view -

i have simple function in model should return true if priority 100 class app.models.publication extends backbone.model urlroot: '/api/publications' isincredible: -> @get('priority') 100 in view wanna call function, can't class app.views.publicationshow extends backbone.view tagname: 'article' classname: 'offer' template: jst['publications/show'] render: => if @model.isincredible() $(@el).addclass('incredible').html(@template(publication: @model)) else $(@el).html(@template(publication: @model)) @modalevent() i get: typeerror: this.model.isincredible not function just note i'm using coffescript you need initialize model in view either 1) setting in initialize function of view class app.views.publicationshow extends backbone.view tagname: 'article' classname: 'offer' template: jst['publications/show'] initialize: ->

Send android local HTML forms via ajax to remote php server -

is there way send android local html forms via ajax remote php server? (local means files in device) scenario this: in app, have html files in android device , loaded in webview, have javascript file in device. want send html forms data remote server. in current situation, not sending data, i've check javascript , php , code fine, , it's working on ios version of app. i've tried other workarounds , i've observed that, when load html file in webview using local files (e.g. webview.loadurl("file://"+ environment.getexternalstoragedirectory()+"/android_asset/list.html"), android looking other related files (e.g. formsprocessor.php) locally, though in javascript/ajax necessary arguments in it's functions supplied properly. errors i've encountered are: filenotfound: content://packagename.com/formsprocessor.php & unknown chronium error: -6. there way or best way this? thanks, clint. this solve problem: used javascripthandler, , i

html - Unable to navigate unorderlist menu via keyboard tab -

Image
i trying work out why can not navigate our menu uses multiple unordered lists via keyboard. does have tips? have feeling more of css issue html. related css: /* menu */ #cssmenu{ border:none; border:0px; margin:0px; padding:0px; font: 67.5% 'lucida sans unicode', 'bitstream vera sans', 'trebuchet unicode ms', 'lucida grande', verdana, helvetica, sans-serif; font-size:11px; font-weight:bold; } #cssmenu ul{ background:#333333; height:39px; list-style:none; margin:0; padding:0; display: table; width: 100%; } #cssmenu li{ padding:0px; display: table-cell; width: 115px; } #cssmenu li a{ background:#333333 url('../images/seperator.gif') bottom right no-repeat; color:#fff; display:block; font-weight:normal; line-height:39px; margin:0px; padding:0px 0px; text-align:center; text-decoration:none; width: 115px; } #

html - Grails render tag and message.properties -

i using g:render grails tag avoid repeat common part of html in app repeated. need in of them pass properties, such title of sections, through message.properties file can translated. make work i'm using structure: <g:set var="title" value="${g.message (code: 'completed.thanks')}" /> <g:render template="thankyou" contextpath="/completed/" model="[title:title,other:other]" /> but wondering if there better solution provide string in model of render tag itself. if properties passed many approach can not best. in case suggest reate custo implementation of g:message using customtaglib. custom gmessage can example convention looking properties prefixed model parameter. in render of gsp can set prefix string in model. <g:render template="thankyou" contextpath="/completed/" model="[prefix: 'pagex']" /> in template gsp: ... <custom:message code="

Wrap C++ function using Boost Reflect or another C++ reflection library -

i posted this question . spongebobfan said answer reflection. found boost.reflect , wondering how heck can pull off using library or c++ reflection library. please explain answer, cannot glance @ code , figure out what's going on. question this: ok, have question. have code: int myfunc(int arg-a, int arg-b); int mywrapperfunc(obj a, obj b); mywrapperfunc supposed wrap myfunc . mywrapperfunc discards first argument , takes second, array. uses array items parameters. don't know how many parameters myfunc takes, nor know how many items in array-type object ( b ). how programatically call myfunc correct number of args? number of args handed on same number of items in array-type object. edit: arg-a , arg-b supposed come array-type object. split object args. edit: ok, ok, i'm trying wrap python c api sense involved, hiding background jobs. have looked @ reflex ? tool uses gcc-xml create reflection library similar 1 in java. here's initial t

highcharts - Is there a way to scale the custom marker of a high charts scatter chart? -

we using custom markers high charts scatter chart. the marker.radius property used increase size of point markers. however when using custom images radius setting not increase size of custom marker. is possible in high charts or need create images every possible marker size ? here code tried : $(function () { $('#container').highcharts({ chart: { }, xaxis: { categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 316.4, 294.1, 195.6, 154.4], marker: { symbol: 'triangle', radius: 15 } }, { data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5], marker: {

How to get and Insert data in JSON Parsing in IOS6 -

how , insert data in json parsing in ios6 i trying insert data in json link , retrieve data json link using jsonparser. how can use json parser without adding json frame work in ios6. first need import json files you'll here then if using post method following : nsstring *myrequeststring = [nsstring stringwithformat:@"u=%@&p= %@",struname,strpassword]; myrequeststring=[myrequeststring stringbyreplacingoccurrencesofstring:@" " withstring:@""]; nsdata *myrequestdata = [nsdata datawithbytes:[myrequeststring utf8string] length:[myrequeststring length]]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring: @"your webservice url"]]; [request sethttpmethod:@"post"]; [request sethttpbody:myrequestdata]; nsdata *returndata = nil; returndata = [nsurlconnection sendsynchronousrequest:request returningresponse:nil error:nil]; [request setvalue:@"application/x-www-form-urle

url rewriting - URL Rewrite for joomla -

i wanted change joomla link http://www.asbhtechsolutions.com/component/search/?searchphrase=all&searchword=simple%20program%20for%20java to http://www.asbhtechsolutions.com/search/simple-program-for-java how can this? if don't want write own router search component, simplest way add redirect .htaccess file.

Jython Remote debugging Intellij Idea, using Pycharm plugin -

before marking duplicate please read full thread os - windows xp primary language - java scripting language - jython ide - intellij idea python plugin - pycharm i trying remote debug application runs in java , uses jython scripting language. followed steps mentioned in below link http://www.jetbrains.com/pycharm/webhelp/run-debug-configuration-python-remote-debug.html#commentssection i can start debugger when application starts up, able connect debugger however getting below critical warning - pydev debugger: critical warning: version of python seems incorrectly compiled (internal generated filenames not absolute) pydev debugger: debugger may still function, work slower , may miss breakpoints pydev debugger: related bug: http://bugs.python.org/issue1666807 the problem debugger doesn't stop @ break points. i have searched lot of forums possible solutions - delete *.pyc files reinstall python version extract

travis ci - Github pull request "Good to merge" -

Image
on github, i've noticed pull requests they're "good merge" because have passed travis build passed. have used travis little bit, how integrate pull requests on github? here's screenshot of i'm talking about: once you've set travis , tell branch need tested, it'll automatically run build on each pull request targetting 1 of branches (and every commit pushed these branches). note travis notification on github appears after build/test on (roughly 15min).

visual c++ - List all occurences of outlook recurring appointments -

ms outlook provides mapi access outlook calendar items. calendar items can find recurring , non-recurring appointments of outlook. in case of recurring appointments occurences of recurring appointments can found using getoccurence function of recurrencepattern of appointmentitem. getoccurence function take date , time return occurence on date. if occurence exists, return otherwise give exception. if occurences of recurring appointment have same starttime , endtime providing starttime input getoccurence, works fine. if 1 particular occurence starttime , endtime modified getoccurence not return occurence. other way check occurence every 30 minute interval on every day. approach seems not efficient. anyone have better idea this? _applicationptr olapp("outlook.application"); _namespaceptr olmapi; olmapi = olapp->getnamespace("mapi"); hr = olmapi->logon("","",false,false); mapifolderptr olcalendarfolder = olmapi->getdefaultfolder(ol

html - Float an element to the right within containing parent with variable width in IE<=7 -

i have container-div no set width, contains table of variable width, , button below table. i'd button float on right right edge lines right edge of table. doing following seems work fine in browsers ie<=7. how done correctly? <head> <style> #tablecontainer { float: left; } #btn { float: right; } </style> </head> <body> <div id="tablecontainer"> <table> <tr> <td>a b c</td> <td>a b c</td> <td>a b c</td> <td>a b c</td> </tr> </table> <button id="btn">buttontext</button> </div> </body> </html> here's illustration of want: __________________ | | | table | |________________| |btn| ‾‾

html - How to get div and full inner content in javascript? -

i want div inner content in javascript ex: <div id="content" style="height: 20px; overflow: hidden"> content<br>content<br>content<br> </div> this html code. know div id (content). want retrieved main div , inner content via javascript like.. <div id="content" style="height: 20px; overflow: hidden"> content<br>content<br>content<br> </div> also want retrieved content div attribute style, class name etc. use getelementbyid() element , innerhtml tht content document.getelementbyid('content').innerhtml; live demo innerhtml to content of whole tag , use outerhtml document.getelementbyid('content').outerhtml; live demo outerhtml

ios - Sharekit (Facebook) integration issue in ObjectiveC? -

Image
i have tried implement sharekit sdk in objectivec. refer link develop http://amandeepsinghmaan.blogspot.in/2012/04/share-kit-is-widely-used-in-ios.html finally have run application in simulator (xcode 4.3.2) , ipod device ios 5.1, both have same error found it, how fix this?, please me. thanks in advance screen shot reference: install error found here

How to Pass ArryList or Array of Objects From C# to Javascript? -

Image
i creating list using linq in c# following way , works fine. lst = (from n in dbentity.popup_notes select n).tolist(); now, want use list client side array of objects . when user clicks on links, display specific notes descriptions per name selection. edit i want this.. i think need convert list json , return client-side. @ client, can use knockout.js bind data control, way easier binding manually.

android - LAYER_TYPE_SOFTWARE not disables HW acceleration on some devices in some time -

i use clippath clip round canvas , drive: @override protected void ondraw(canvas canvas) { float radius = ((float) getwidth()) / 2; clippath.reset(); clippath.addcircle(radius, radius, radius, path.direction.cw); canvas.clippath(clippath); super.ondraw(canvas); } of couse, set view.layer_type_software view in constructor , in xml. but on devices (android 3): lenovo k1 acer a501 samsung gt-p6200 zte v9s throwns exception when try draw clipped canvas: java.lang.unsupportedoperationexception @ android.view.gles20canvas.clippath(gles20canvas.java:303) @ com.myapp.ui.roundedcornerimageview.ondraw(roundedcornerimageview.java:35) @ android.view.view.draw(view.java:9292) @ android.view.view.getdisplaylist(view.java:8755) @ android.view.viewgroup.dispatchgetdisplaylist(viewgroup.java:2296) @ android.view.view.getdisplaylist(view.java:8719) @ android.view.viewgroup.drawchild(viewgroup.java:2554) @ android.view.viewgroup.dispatchdraw(viewgroup.java:2189) @

javascript - Is there a fixed format for json for using it in collapsible tree layout? -

i using d3.js visualizing data in collapsible tree layout.its working fine flare.json data seems have problems other json files work.my json file valid. the error getting follows uncaught typeerror: cannot read property 'children' of undefined , json here { "name":"dummy", "children": [ { "date": "20040309", "name": "us", "id": "27", "kind": "s1", "application_type": "not found", "children": [ {"length": 27, "type": "us", "id": "28", "kind": "s", "name": "mewdows", "date": "19730700", "main_classification": "d 2907" }, {"length": 27, "type": "us&q

javascript - How to reinitialize jquery Datatable -

how reinitialize jquery datatable? tried remove table element. still table displaying. code this: function removeexistingdatatablereference(tableid) { if(otable !=null) { otable.fndestroy(); } if(document.getelementbyid(tableid)){ document.getelementbyid(tableid).innerhtml=""; } otable=null; try { if(otable !=null) { //otable.fndestroy(); alert("error in fndestroy"); } otable=null; if(document.getelementbyid(tableid)){ document.getelementbyid(tableid).innerhtml=""; } if(document.getelementbyid("ftable")) { removeelement(document.getelementbyid("ftable")); } } catch(e) { alert("error happend:"+e.message); } } function removeelement(element) { try { var elem = document.getelementbyid('ftable');

html5 - Error with Alligning Divs -

how make 4 of 'row' classes line right next each other? i'm having lot of trouble this... formatting , spacing gets extremely strange when edit of margins. http://jsfiddle.net/busterroni/wbcwc/ .rowone{ height:100px; width:100px; background-color:blue; } .rowtwo{ position:relative; margin-bottom:500px; margin-left:100px; margin-top:-500px; height:100px; width:100px; background-color:green; } .rowthree{ position:relative; margin-bottom:0px; margin-left:200px; margin-top:px; height:100px; width:100px; background-color:yellow; } .rowfour{ position:relative; margin-bottom:0px; margin-left:200px; margin-top:px; height:100px; width:100px; background-color:orange; } .rowfive{ position:relative; margin-bottom:0px; margin-left:200px; margin-top:px; height:100px; width:100px; background-color:red; } div { background-color:transparent; position: relative; width: 100px; height:100px; } div:hover { -webkit-transition: .5s ease-in-out; -moz-transition: .5s ease-in-ou

objective c - Sorting two NSArrays together side by side -

i have several arrays need sorted side side. for example, first array has names: @[@"joe", @"anna", @"michael", @"kim"] , , and other array holds addresses: @[@"hollywood bld", @"some street 3", @"that other street", @"country road"] , arrays' indexes go together. "joe" lives @ "hollywood bld" , on. i sort names array alphabetically, , have address array sorted alongside still go together, "hollywood bld" having same index "joe". know how sort 1 array alphabetical nssortdescriptor *sort=[nssortdescriptor sortdescriptorwithkey:@"name" ascending:no]; [myarray sortusingdescriptors:[nsarray arraywithobject:sort]]; but there easy way of getting second array sorted using appropriate order? create permutation array, set p[i]=i sort permutation according name key of first array use permutation re-order both arrays example: let's f

ios - Popover controller not dismiss when click on other bar button but dismiss when click other button(or outside popover) -

i show popover using - "presentpopoverfrombarbuttonitem" - after popover not dismiss when click on other bar button item in right navigation bar buttons. but dismiss popover when click elsewhere. issue not there when show popover using - " presentpopoverfromrect: inview: " - strange?. since don't frame uibarbuttonitem how can show popover correctly barbutton. thanks, answering own question one, // presenting barbutton not dismiss popover when click on other bar button. // [self.popovercontroller presentpopoverfrombarbuttonitem:self.barbutton permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; nsmutablearray* buttons = [[nsmutablearray alloc] init]; (uiview *subview in self.navigationcontroller.navigationbar.subviews) { if ([subview iskindofclass:[uicontrol class]]) { [buttons addobject:subview]; } } uiview *view = [buttons objectatindex:1]; // '1' index bar item in array of .items cgrect barbuttonf

svn - P symbol on outgoing changes in Synchronize view eclipse -

Image
i did changes files on file system , did sync svn eclipse workspace , noticed 'p' symbol on outgoing changes. never seen before , confused means , when shown. did google search not find anything. intend know means , in scenarios occurs. any info appreciated. i know way after fact, looking answer today well. i found answer here . a properties change icon means, properties of local or repository's resource changed.

xml - PHP convert empty array to string -

i have function xml2array parses xml file array. when have empty value in xml file function converts array( ) empty array. so < test >< /test > becomes [test]=>array() , want empty string "". does know how edit function below: <?php function xml2array($contents, $get_attributes = 1, $priority = 'tag') { $parser = xml_parser_create(''); xml_parser_set_option($parser, xml_option_target_encoding, "utf-8"); xml_parser_set_option($parser, xml_option_case_folding, 0); xml_parser_set_option($parser, xml_option_skip_white, 1); xml_parse_into_struct($parser, trim($contents), $xml_values); xml_parser_free($parser); if (!$xml_values) return; //hmm... $xml_array = array (); $parents = array (); $opened_tags = array (); $arr = array (); $current = & $xml_array; $repeated_tag_index = array (); foreach ($xml_values $data) { unset ($attributes, $value);

SQL Server 2008: how to write query for multiple columns in select and in group by only 1 column -

my requirement how write query multiple columns in select , in group 1 column. in multiple columns of select, first column have used distinct. want group 1 column 3rd column. please tell me one. i getting result this: d2a08528-ffba-492d-af51-50d6cc10c5a4 b.vithoban@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 6110e173-419b-4c1b-8524-6d9ef39d27e7 bonthapally123@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 52d7da02-9415-447f-9df4-8d327e599347 rama6452@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 9fcc3c51-3bb7-4a18-a1e5-9b4c6b657ab2 krishna.rama718@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 eb79fc72-5144-445e-8ee7-d3a195902210 venkatanarasaiahmannam@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 c04ea2ef-8311-4194-b67d-d88c1cda912d ramakrishna2526@gmail.com e0f127ed-da67-45f4-a2c5-c0e89cb5e1b4 5 40d24f2e-7d3a-48a8-adcf-208e2f463c81 sivaputta123@gmail.com c83583d4-c08a-4aff-93fb-5fb91654d320 2 de42d201-751

java - image not retrieving when submitting form using servlet -

i have image in sql , want retrieve in web page have developed servlet. when hit submit button calls servlet image not displayed in browser if if writing localhost:8080/y/testimageservlet image displayed. imagetestservlet.java import java.sql.*; import db.databaseconnection; import java.io.ioexception; import java.io.inputstream; import javax.servlet.servletexception; import javax.servlet.servletoutputstream; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; /** * servlet implementation class imagetestservlet */ @webservlet("/imagetestservlet") public class imagetestservlet extends httpservlet { private static final long serialversionuid = 1l; /** * @see httpservlet#httpservlet() */ public imagetestservlet() { super(); // todo auto-generated constructor stub } /** * @see httpservlet#doge

javascript - Client-side website reachability test -

i building facebook application runs through apps.facebook.com system. question not facebook apps (so don't stop reading if not familiar these) you'll see why important shortly. whenever user wishes use app, go firstly standard website (with more memorable address, let's use example xyz.com) automatically redirect facebook application. however, there 2 possible redirection destinations: to standard facebook application page (e.g. apps.facebook.com/xyz). should occur if client can reach page. importantly, reason client may not able reach page if on network running content filter (e.g. schools, universities, workplaces) blocks facebook. if client cannot reach facebook application page should redirected page on main website (e.g. xyz.com/nofacebook_login.html). as can see, redirection decision needs based upon whether client can reach facebook application page, or not. therefore, testing need occur on client-side (presumably) using javascript, jquery, or similar.

ios - auto adjusting UI elements for iphone4S and iphone5 -

after long search how display ui elements correctly on both iphone4s , iphone5.i confused whats best way display ui elements in xib.should use autoresizing feature in size inspector or should use auto layout?if use autoresizing, image gets distorted. ,i have seen people doing below nsstring *filename = @"image.png"; cgrect screenrect = [[uiscreen mainscreen] bounds]; if (screenrect.size.height == 568.0f) filename = [filename stringbyreplacingoccurrencesofstring:@".png" withstring:@"-568h.png"]; self.imageview.image = [uiimage imagenamed:filename]; can assist me how should proceed problem? i think method right code more cleaner way put this. nsstring *filename; cgrect screenbounds = [[uiscreen mainscreen] bounds]; if (screenbounds.size.height == 568) { filename = @"image.png"; self.imageview.frame = cgrectmake(0,0,400,300); } else { self.imageview.frame = cgrectmake(0,0,300,30

Function for download file links with php -

i want add function download files uploaded other day. not handy php dont know how add function , generate link listed files @ time. here php code:- // destination folder downloaded files $date = date('m.d.y'); mkdir("uploads/" . $date, 0777, true); $upload_folder = 'uploads/' . $date; // if browser supports sendasbinary () can use array $ _files if(count($_files)>0) { if( move_uploaded_file( $_files['upload']['tmp_name'] , $upload_folder.'/'.$_files['upload']['name'] ) ) { echo 'done'; } exit(); } else if(isset($_get['up'])) { // if browser not support sendasbinary () if(isset($_get['base64'])) { $content = base64_decode(file_get_contents('php://input')); } else { $content = file_get_contents('php://input'); } $headers = getallheaders(); $headers = array_change_key_case($headers, case_upper); if(file

java - return value without modifiying -

i using setter getter method in app. class contains setter&getter is: public class product { private arraylist<integer> id=new arraylist<integer>(); public arraylist<integer> getid() { return id; } public void setid(arraylist<integer> id) { this.id = id; } } public class check extends activity { arraylist<integer> passedid=new arraylist<integer>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_checkout_page); intent checkoutintent=getintent(); intent shopcart=getintent(); product prodobj=new product(); passedid=prodobj.getid(); new longrunninggetio().execute(); } } when want use getid() method object of product class, returning every time null value. there way return id value stored in setid() method.thanks in advance. i

ios - How make background image in tableViewCell -

i have tableview. have problem image in tableviewcell. background color displayed in left , right corner in middle color background tableview. when changed background color in table changed color in middle of tableviewcell... my cod add image in tableviewcell: when push... cell.backgroundview = [[[uiimageview alloc] initwithimage:[ [uiimage imagenamed:@"noselected.png"]stretchableimagewithleftcapwidth:0.0 topcapheight:5.0] ]autorelease]; and pushed. pushed displayed okey. cell.selectedbackgroundview = [ [[uiimageview alloc] initwithimage:[ [uiimage imagenamed:@"yesselected.png"] stretchableimagewithleftcapwidth:0.0 topcapheight:5.0] ]autorelease]; also: tried uicolour clearecolor nothing. try this... if want display 1 image each cell. cell.backgroundview = [[uiimageview alloc]initwithimage:[uiimage imagenamed:@"name_of_the_image_and_no_need_to write_extension"]]; if want display different image different cell first create