Posts

Getting Tumblr's API to work in ruby -

Getting Tumblr's API to work in ruby - can't seem tumblr's api working. i'm trying utilize tumblife gem. took @ source , think these equivalent calls it's trying make: consumer = oauth::consumer.new(app_key, app_secret, site: 'http://api.tumblr.com/') access_token = oauth.accesstoken.new(consumer, oauth_key, oauth_secret) access_token.post('http://api.tumblr.com/v2/user/dashboard') which returns not authorized error. help? ruby api tumblr

php - Login Script working local but not on live environment -

php - Login Script working local but not on live environment - i seem have problem login script, works on local php dev box, not on live environment, i'm assuming i'm missing can advise further? <?php $user = $_post["swtorun"]; $pass = $_post["swtorpw"]; // generate hash $enc_pwd = hash('sha256', $pass); // connect database include('../../settings.php'); $conn = mysql_connect($host,$username,$password); $db = mysql_select_db($database, $conn); // mysql query users $sql = "select * `users` username='$user' , password='$enc_pwd'"; $result = mysql_query($sql, $conn); $count = mysql_num_rows($result); // number of results (should 1) if($count==1){ // initiate session session_start(); $_session['logged'] = "1"; echo "you logged in, homecoming <a href=\"../../index.php\">index</a>"; } else { echo "wrong username or password"; } ?> add ...

c# - Autocomplete jquery not working? -

c# - Autocomplete jquery not working? - i have text box, within want auto complete. info auto finish going given through database. this jquery: var info = "autocompletetagdata.aspx" $("#item").autocomplete({ source: info }); this have set in autocompletetagdata now: protected void page_load(object sender, eventargs e) { string term = request.querystring["term"]; sqlconnection myconnection = new sqlconnection(connstr); myconnection.open(); string sql = ("select top 10 ltrim(rtrim(pgprdc)) pgprdc sroprg sroprg"); sqlcommand mycommand = new sqlcommand(sql, myconnection); stringbuilder sb = new stringbuilder(); seek { sqldatareader reader = mycommand.executereader(); if (reader.hasrows) { while (reader.read()) { sb.append(reader.getstring(0)) .append(environment.newline); } } ...

xmlhttprequest - JQuery AJAX and XHR2 responseType "document" -

xmlhttprequest - JQuery AJAX and XHR2 responseType "document" - i requesting website jquery's ajax function. little bit unclear responsetype of xhr request. far using "datatype: "html"" attribute not happy it. i'd rather have finish htmldocument returned allow me traverse dom tree , scrape info needed. believe "document" responsetype supported xhr2 requests. how can done jquery? there way homecoming domtree can navigate through? simply add together next $.ajax() call: xhrfields: { responsetype: "document" }, to retrieve document object, success phone call should this: success: function(data, textstatus, request) { if (textstatus == "success") { myresponse = request.responsexml; } else // not successful }, jquery xmlhttprequest

iphone - Always open application at rootViewController -

iphone - Always open application at rootViewController - in app want user see rootviewcontroller 's view when app opened if app has not been killed completely. one alternative have considered calling abort() in applicationwillresignactive: doesn't seem nice solution. any suggestions? set uiapplicationexitsonsuspend in info.plist true. iphone ios ipad

php - Calculating percentage changes without dividing by zero -

php - Calculating percentage changes without dividing by zero - i have next php using calculate percentage decreases or increases: function calculatepercentageincrease( $nlastmonthperiod, $ncurrentperiod ) { if ( !is_numeric( $nlastmonthperiod ) || !is_numeric( $ncurrentperiod ) ) homecoming 0; if ( $nlastmonthperiod == 0 ) homecoming 0; $nlastmonthperiod = intval( $nlastmonthperiod ); $ncurrentperiod = intval( $ncurrentperiod ); $ndifference = ( ( ( $ncurrentperiod - $nlastmonthperiod ) / $nlastmonthperiod ) * 100 ); homecoming round( $ndifference ); } the problem wondering if $nlastmonthperiod 0 , $ncurrentperiod 10 should returning 100 , not 0? if $nlastmonthperiod 0 , $ncurrentperiod 10 should returning 100 , not 0? thats coded ... if ( $nlastmonthperiod == 0 ) homecoming 0; did mean? if ( $nlastmonthperiod == 0 ) if ($ncurrentperiod>0) homecoming 100; //whatever w...

flex3 - global variable not getting set with proper values in another function in flex -

flex3 - global variable not getting set with proper values in another function in flex - i have global variable 'csid' of string type. in code below under drawchart() function, in loop, csid variable should set '1' modellocator when i=0 , csid should set '2' modellocator when i=1.(considering lengh=2). alert in drawchart() (for csid) seems printing right 'csid' values(both 1 , 2) in datafunction() 'columnseries_labelfunc' getting csid alert value '2' , never '1'. please find code below: drawchart() function:: public function drawchart():void { var cs:columnseries= new columnseries(); var lenght:number=appmodellocator.getinstance().ctsmodel.productsummary.getitemat(0).collmgmtofclist.length; mychart.series = [cs]; var tempobj:object; for(csloop=0;csloop<lenght;csloop++) { cs = new columnseries(); this.csid= new string(string(appmodellocator.getinstance()...