Posts

php - cURL+redirect with cookie -

php - cURL+redirect with cookie - how can redirect user web site cookie? im using code <?php $fields_string = 'client_login=jadro&client_pass=jadro&client_remember=on&action=client_login'; $options = array( curlopt_returntransfer => true, curlopt_header => true, curlopt_followlocation => true, curlopt_useragent => "mozilla/5.0 (windows; u; windows nt 6.1; ru; rv:1.9.1.7) gecko/20091221 firefox/3.5.7 firephp/0.3", curlopt_autoreferer => false, curlopt_connecttimeout => 120, curlopt_timeout => 120, curlopt_maxredirs => 10, ); $ch = curl_init(); curl_setopt_array( $ch, $options ); curl_setopt($ch,curlopt_url,'http://orion10.ru'); //curl_setopt($ch,curlopt_post,count(explode('&',$fields))); curl_setopt($ch,curlopt_postfields,$fields_string); //curl_setopt($ch,curlopt_cookiejar, 'cooc.txt...

arrays - PHP Error "Trying to get property of non-object" -

arrays - PHP Error "Trying to get property of non-object" - ok, have been having problem week error, , i've found think understand when alter it doesn't work. if help me understand little improve , tell me why not working. the rundown- trying display list of different product families on table. ok. here class <?php class mclean { public $product_id, $catalog_number, $model_code, $caterogry, $product_family, $product_sub_family, $product_name, $img; function __construct($caterogry){ // $db defined in config.inc.php global $db; // sanitize input $caterogry = $db->real_escape_string($caterogry); // sql query $sql = "select * mclean_products_info caterogry = '". $caterogry . "'"; // if there result... if($result = $db->query($sql)){ // $row contains object $row = $result->fetch_object(); // set class attributes $this->prod...

struts2 - Struts 2.3.16.3 upgrade - modal dialog (popup) not opening -

struts2 - Struts 2.3.16.3 upgrade - modal dialog (popup) not opening - i upgraded struts 2.3.15.3 2.3.16.3. struts jquery plugin - 3.7.1 struts jquery tree plugin - 3.7.1 java servlet api - 2.4 jquery-ui.js - 1.10.4 i have done above changes! css working , jquery working fine. none of modal dialogs (popups) opening up. have missed anything? can help me in this? i utilize tiles in app. modallayout not working.. how open popup <s:url var="editurl" action="edit" namespace="/app/edit" method="load" escapeamp="false"/> <td onclick="openedit('<s:property value="#editurl"/>','<s:property value="id" escape="false"/>')"> <sj:a id="editcplink" button="true" href="#" > edit </sj:a> </td> function openedit(modalurl,id) { var options_modaldialog = {}; winopen(options_modaldialog); options_modaldia...

android - SQLite query using CursorLoader -

android - SQLite query using CursorLoader - i trying unique column values in loader. code :- public loader oncreateloader(int id, bundle args) { if (mselectedspinneroption == 1) { homecoming new cursorloader(this, suggestion.content_uri, suggestion.projection, badbehaviourcolumns.packagename="distinct", null, badbehaviourcolumns.timestamp + " asc "); } } i want values distinct bundle name values. how accomplish using above code? i writing reply because faced exact same issue while querying cursorloader , got answers related database.query(). there simple trick can used on lines of sql injection. instead of using distinct, here grouping has been used works faster unless low on memory (ref: huge performance difference when using grouping vs distinct). following query have execute distinct column1 items table_name. select column1 table_name grouping column1; with technique query end executing. se...

image - Python Imaging Library fails to grab whole screen -

image - Python Imaging Library fails to grab whole screen - i using pil grab screen shot, capturing part of screen. here screen shot of desktop and programme captures as can see, screen has amount of space chopped off on side , along bottom. tried right adjusting size of capture zone, resulted in areas filled black i'm thinking there limit maximum resolution library can capture, cant find documentation saying so. below code import imagegrab import os import time def screengrab(): box = (0, 0, 1920, 1080) im = imagegrab.grab(box) im.save(os.getcwd() + '\\screenshot_' + str(int(time.time())) + '.png', 'png') def main(): screengrab() if __name__ == '__main__': main() dose know how prepare issue or know why happening? i having problem before today. script capture pixels 0,0 - 1536,864. switched windows 8 , noticed programs seemed displayed @ wrong resolution. after searching found fix. go pytho...

Issue in comparison different list in Scala -

Issue in comparison different list in Scala - i'm looking way compare different list types: val = list(event1, event2, event3) val b = list(list(event1, event2, event3)) how can compare these 2 lists equality? trying nesting loop, don't think work. you can flatten events list, so: scala> list("e1", "e2", "e3") res0: list[string] = list(e1, e2, e3) scala> list(list("e1", "e2", "e3")) res1: list[list[string]] = list(list(e1, e2, e3)) scala> res1.flatten res2: list[string] = list(e1, e2, e3) scala> res0 == res2 res3: boolean = true scala

ruby on rails - Linking models created using Devise + Activeadmin -

ruby on rails - Linking models created using Devise + Activeadmin - i have 2 models listing , profile configured active admin. model profile generated using devise. have established has 1 relationship between them. want create scheme in each new listing, profile automatically created , linked. (imagine airbnb in seller can have 1 listing , cannot rent) linking should both valid in activeadmin , when user logins app. how should approach this. side note: model profile not registerable. using through activeadmin of import 1 time listing , profile created superuser, can send login details person , can login view listing. ps: rails newbie here! easier methods,tutorials or directions appreciated , if in or near london thanked beer. for has_one relationship please see: http://guides.rubyonrails.org/association_basics.html#the-has-one-association if want create profile when creating listing, can activeadmin's create controller of listing: the code should this: (put i...