Posts

ssl - Unable to Send Email Using PHP -

Image
preview: have been trying send email using moodle long time , decided test sending email using standard php mail() function test if mail working fine. but php not send email!! problem scenario: this code php: $to = "receiver@gmail.com"; $subject = "test mail"; $message = "hello! simple email message."; $from = "username150@gmail.com"; $headers = "from:" . $from; ini_set( "sendmail_from", "username@gmail.com" ); ini_set( "smtp", "smtp.gmail.com" ); ini_set( "smtp_port", "25" ); ini_set("username","username0@gmail.com"); ini_set("password","password"); mail($to,$subject,$message,$headers); echo "mail sent."; the error : warning: mail() [function.mail]: smtp server response: 530 5.7.0 must issue starttls command first. sz6sm10013088pab.5 - gsmtp in c:\program files (x86)\moodle\server\moodle\u...

javascript - How do I load Google Maps JS API in PhoneGap to use it multiple times? -

i'm developing phonegap application multiple pages , of them show map. now i'm trying load google maps api when page loads can access whenever need it. there several options: load script without callback parameter in url ...(url)&callback=functionname when page loads result: google.maps object created it's empty. functions missing. load script with callback parameter in url when page loads result: functions in google.maps available, when create map, empty <div style="overflow-x: hidden; overflow-y: hidden;"></div> inside container element. seems starts create map, rest missing. funny thing here is: works in desktop browsers, not in phonegap application - doesn't matter if android or ios. load script with callback, every time map should displayed result: seems work, error/a warning in console shows up, telling me there may occur unexpected problems if load maps api more once. plus creates unnecessary server requests slow d...

Read items into a file whose name contains some space from a batch script -

i need read items inside files batch script. name of items' file contains spaces. that, use file name parameter, surrounded double quotes in order take account file names spaces. read.bat /f %%a in ("%~1") echo %%a>>result.txt conf file.txt projectid: biew artifactid: sprint1 batch running 'read.bat conf file.txt'. instead having result.txt projectid: biew artifactid: sprint1 i "conf", first part of file name. helping me! you should use "delims=" , session protocol: >type read.bat @for /f "usebackqdelims=" %%a in ("%~1") @echo %%a >type "conf file.txt" 1 2 3 4 5 >read.bat "conf file.txt" 1 2 3 4 5

compilation - Confused about how Intellij compiles things and deals with resources -

i'm quite new intellij visual studio, , i'm quite confused how resource files work in intellij project. i'm read few questions & answers getting resources onto classpath, intellij docs, still confused. have few further questions: some questions mention maven, not. how maven projects differ normal modules in how compile things , deal resources? when run main method within intellij, run from? directly compiled .class files, or generated jar ? both exist in filesystem, , whats difference? if put .xml file somewhere in source tree, intellij default when compiling , running within intellij? how can change puts it? what classpath when running main function within intellij? how arbitary file included in jar file or alongside in compiled output? in maven project ide follows maven rules process resources consistent results between command line maven build , idea build. if maven copies resources classpath, idea same. from classpath of module , dependenc...

Javascript classes, compiler performance and memory allocation on new Klass() -

edit: ======================================================== please see revision 13 of test answers: http://jsperf.com/closure-prototype-static-performance/ ======================================================== i prefer declare klasses this, not big fan of object literal way: first way: private scoping function employees() { var persons = []; // [person, person] this.isemployed = function(_firstname, _lastname) { ( var = 0; < persons.length ; i++ ) { if ( persons[i].equals(_firstname, _lastname) ) { return true; } } return false; } } function person(_firstname, _lastname) { this.equals = function(firstname, lastname) { return _firstname == firstname && _lastname == lastname; } } second way: prototype alternat...

iphone - Coredata Remove and Read Relationship -

is possible remove , read relationship? i cannot post code here since huge project complex process. let's have tablea <-->> tableb tableb gets updated (i.e., tableb objects deleted , new obejcts (re)added). check if objects tablea had relationship tableb, have in array server object id. read data in tableb , readd relationship. relationship gets faulted , cannot accessed. after add or remove object save it. doing wrong? i feel misunderstanding intentions here give try , modify needed. first, entities should start capital letter, using tablea , tableb entities. tablea , tableb terrible names coredata entities. atrociously generic , if ever decide use them outside of tables confuse code. since "huge project complex process." this in essence believe seeking: // defined elsewhere nsmanagedobjectcontext *managedobjectcontext; // saving the object want connect later tablea *relationshiptoa = self.alltablebs.tablearelationship; // remove table...

php - Get div's HTML content via xpath -

this question has answer here: how innerhtml of domnode? 6 answers i need support on following issue, have website want product descriptions via xpath. below example html of content: <div id="description"> <span>some test</span> <img src="some src"> <p> content etc. </p> </div> and use below code: $result = $xpath->query('//div[@id="description"]'); but when i'm outputting result below line: echo "<pre>".$result->item( 0 )->nodevalue."</pre>"; // there 1 element what unformatted: "some testsome content etc." no spaces , other tags. know because xpath treats other tags nodes but... i there way div's content html ? hey did similar while , post helped me: php domdocument / xpath: html-text , surrounded...