Posts

pdo - PHP Catchable fatal error: Object of class could not be converted to string -

i lost here... after validating input create instance of message class , attempt insert data database: // send message $message = $this->model->build('message', true); $message->insertmessage($uid, $user->user_id, $title, $message); the method insertion straight-forward: // insert new message public function insertmessage($to_id, $from_id, $title, $body) { $sql = "insert messages (to_id, from_id, title, body, create_date) values (:to_id, :from_id, :title, :body, now())"; $sth = $this->db->prepare($sql); return $sth->execute([':to_id' => $to_id, ':from_id' => $from_id, ':title' => $title, ':body' => $body]); } however, upon submission end blank page , apache error log says: [tue jul 30 22:34:44 2013] [error] [client 127.0.0.1] php catchable fatal error: object of class framework\models\message not converted string in /var/www/p-lug/p-lu...

string - jQuery isotope sort price -

i'm not having luck in getting correct sorts pricing belive $ sign interfering cannot replace function work. my html <span class="field-content price">$486.15</span> my jquery function price : function( $elem ) { return parsefloat( $elem.find('.price').text().replace($, '') ); } for reason not seem removing $ sign. missing in function? im not sure if decimal point causing problems sort thanks in advance demo enclose $ in in quotes '$' price : function( $elem ) { return parsefloat( $elem.find('.price').text().replace('$', '') ); } demo function x ($elem) { return parsefloat($elem.replace('$', '')); } $('.price').each(function(){ $(this).text(x($(this).text())); });

iphone - IOS :Get UIImage Orientation inside a UIImageview with exif data? -

i rotating uiimageview , uiimage inside of it. want orientation of uiimage after rotating uiimageview . you can use myimage.imageorientation , give uiimageorientation. or if used uiimagepickerviewcontroller use delegate method "imagepickercontroller:didfinishpickingmediawithinfo:" in method can access info dictionary nslog(@"%d", [info objectforkey:@"orientation"]);

sql - Oracle PLSQL script for string concatenation -

i have database of sql queries, procedures etc. now have following sql statement concatenation operators. 'insert test_table(id, name)' || 'select id, name ' || ' my_table' i want when sql return insert test_table(id, name) select id, name my_table this sql example want remove concatenations , return simple sql. thanks if got question right looking eval make oracle evaluate string concatenation marks. try declare concatenetaed_sql varchar2(32000); result_sql varchar2(32000); begin concatenetaed_sql := '''insert test_table(id, name)'' || ''select id, name '' || '' my_table'''; execute immediate 'select ' || concatenetaed_sql || ' dual' result_sql; dbms_output.put_line(result_sql); end; and result insert test_table(id, name)select id, name my_table pl/sql procedure completed.

visual studio 2010 - How can I find out what debugger is attached to w3p.exe -

i'm trying setup debugging on class asp project in vs 2010, , in doing trying attach it's debugger w3p.exe. i'm using windows 7 64-bit , iis 7.5. i've used method few times before on machine. however, i'm finding time unable attach debugger. it's saying: unable attach process. debugger attached. but can't figure out might be. how can determine this? or else? i've rebooted pc , can't yet see signs of running looks debugger. setup in case helps, here's steps used setup environment, documented previous successful attempts: created new empty visual basic .net web (best create in c:\inetpub\wwwroot\, otherwise have security/acl issues when loading site). copied contents of site folder project folder. in solution explorer, selected show files not in project. selected files , right click , select: "include in project". under project properties -> web -> set use iis , start url http://mysite.local in hosts file point...

jQuery UI Draggable issue with containment option -

i'm trying have image inside div of same width draggable in limit of div. it's difficult explain 1 side of image (top or bottom) can leave div cannot have gap between edge of image , border of div. to resume image has same width of parent div height bigger part of image hidden. well here want do: http://jsfiddle.net/maxwell2022/derna/165/ it's working perfectly... because there nothing above div. if there gap between document , div, it's not working anymore. think draggable taking document reference top of image. start dragging image, image move , stuck top edge top of document: http://jsfiddle.net/maxwell2022/derna/164/ i don't know how can achieve containment option. cheers, maxime update another attempt relative positioning no luck: http://jsfiddle.net/maxwell2022/derna/166/ i found solution fix getting top position of parent div using offset() , add containment boundary. i'm not sure it's best solution looks it's work...

c++ - Calculate_CRC32 function. How do I convert it to calculating bytes and not bits -

i helping out friend of mine bit stuck , own c++ skills rusty. interest , curiosity quite picked this. shall try , explain best can. note 32 bit check. uint32_t crc32::calculate_crc32(const uint32_t* pldata, uint32_t llength, uint32_t previouscrc32) { uint32_t lcount; const uint32_t lpolynomial = 0x04c11db7; uint32_t lcrc = previouscrc32; unsigned char* plcurrent = (unsigned char*) pldata; lcrc ^= *plcurrent++; while (llength-- != 0) { (lcount = 0 ; lcount < llength; lcount++) { if (lcrc & 1) lcrc = (lcrc >> 8) ^ lpolynomial; else lcrc = lcrc >> 8; } } return lcrc; } now ilength number of bytes packet contains. pldata packet data needs checked. is, function works. works bit bit. needs improved work byte byte. genius c++ developers out there far surpasses knowledge. ideas helpful. in advance guys. read ross williams excellent tutorial on crcs , s...