Posts

ios - AFNetworking JSONRequestOperation -

ios - AFNetworking JSONRequestOperation - afjsonrequestoperation has successblock block when request succeeds, there no way set "authentication block" other on operation itself, if fails there no way send caller of afjsonrequestoperation . correct, or missing something? i expect able tell caller whole operation failed because authorization failed. actually method takes 2 block parameters success , failure afjsonrequestoperation *operation = [afjsonrequestoperation jsonrequestoperationwithrequest:request success:successblock failure:failureblock]; so in failure block should able notify caller of failure ios objective-c afnetworking

unit testing - Is it possible to change Rspec output on objects? -

unit testing - Is it possible to change Rspec output on objects? - given next spec: describe person describe "scopes , class methods" let!(:sixty_older) { factorygirl.create :person, birthdate: 60.years.ago } describe ".senior" subject { person.senior } { should include(sixty_older) } end end end its output in cli using format --documentation: person scopes , class methods .senior should include #<person person_id: 466, gender: "m", birthdate: "1953-02-07 19:44:22", birthdate_estimated: 0, dead: 0, death_date: nil, cause_of_death: nil, creator: 0, date_created: "0002-11-30 00:00:00", changed_by: nil, date_changed: nil, voided: 0, voided_by: nil, date_voided: nil, void_reason: nil, uuid: "key_4"> is possible me alter #<person person_id: ....> else? say, display person_id, birthdate , uuid? also, if can customized on per test basis , not on class-le...

jquery mobile: what is proper way to programatically fire event on a jqm Select Menu -

jquery mobile: what is proper way to programatically fire event on a jqm Select Menu - edit a: not jquery question, rather jquery mobile question. edit b: changed title ... asked how fire 'click' event specifically, apparently 'click' event not proper event utilize if want re-create jqm:select menu choice. how programatically fire event on jquery mobile select menu? <select id = 'my_select' name = 'my_select' onchange = 'gf_handle_change( this.value );' > <option id = 'option_a' value = 'a'> </option> <option id = 'option_b' value = 'b'> b </option> </select> <script> function gf_fire_event( args_val ) { alert( 'test : ' + jquery( '#option_' + args_val ) ) ; jquery( '#option_' + args_val ).trigger( 'click' ) ; } function gf_handle_change( args_val ) { alert( args_val )...

facebook graph api - auto share links using php curl -

facebook graph api - auto share links using php curl - i want auto share links in facebook wall using script : $attachment = array( 'email' => 'mail', 'password' => 'password', 'access_token' => 'my token', 'message' => "my message", 'name' => 'name', 'link' => 'my_url', 'description' => "my description" ); $ch = curl_init(); curl_setopt($ch, curlopt_url, 'https://graph.facebook.com/me/links'); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_verbose, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt($ch, curlopt_connecttimeout,5); curl_setopt($ch, curlopt_useragent, 'mozilla/5.001 (windows; u; nt4.0; en-us; rv:1.0) gecko/25250101'); curl_setopt($ch, curlopt_postfields, $attac...

android - FragmentManager NullPointerException when trying to commitAllowingStateLoss -

android - FragmentManager NullPointerException when trying to commitAllowingStateLoss - context: have activity fragment , 3 innerfragments . when fragment ondestroy() called, want remove inner fragments fragmentmanager . code ondestroy() below. problem: fragmentmanager throws nullpointerexception , when commitallowingstateloss() called. don't understand why. @override public void ondestroy() { super.ondestroy(); if (getfragmentmanager().findfragmentbyid(r.id.fragment_framelayout_left) != null) { fragmenttransaction fragmenttransaction = getfragmentmanager().begintransaction(); fragmenttransaction.remove(mleftfragment); fragmenttransaction.commitallowingstateloss(); } } stack trace: 02-11 12:15:14.162: e/androidruntime(25911): fatal exception: main 02-11 12:15:14.162: e/androidruntime(25911): java.lang.nullpointerexception 02-11 12:15:14.162: e/androidruntime(25911): @ android.support.v4.app.fragmentmanagerimpl.execpe...

jquery - How can I expand a div to compensate for removing the bordering div's margin? -

jquery - How can I expand a div to compensate for removing the bordering div's margin? - i'm using bootstrap's responsive grid layout. need adjust 1 spot on page there's no margin between 2 columns; left column has bottom border need bring right left border of right column. how can expand div compensate removing right-bordering div's left margin? things i've been able do: i'm able dynamically set height of left div drop bottom border want it: $('#indented_block .border-bottom').height( $('#indented_block').height()-3 ); i'm able determine original width of left div: $('#indented_block .border-bottom').width() i'm able determine left-margin of right div: $('#indented_block .border-side').css('margin-left'); i'm able set left-margin of right div: $('#indented_block .border-side').css('margin-left',0); i'm not able utilize jquery .width() method add together original wi...

sql - Replace Left Outer Join Null values with a string -

sql - Replace Left Outer Join Null values with a string - i want show null values returned left outer bring together string " unregistered". when value integer or bool, write: isnull(returnedvalue, 0) returnedvalue but how can create it: isnull(returnedvalue, 'unregistered') returnedvalue i utilize ms sql server. since need varchar value in same field int/bool, need create sure every row of field has same info type. isnull(convert(varchar(50), returnedvalue), 'unregistered') returnedvalue or can utilize case as case when returnedvalue null 'unregistered' else convert(varchar(50), returnedvalue) end returnedvalue sql sql-server left-join isnull