Posts

php - Codeigniter decode not working -

i making little login system using php inside of codeigniter framework. using encryption class encode password, store in database. on login, finds encrypted password using username, matches against password entered. passwords getting encoded during registration. , in below code, have been able print out encoded password database, fails out whenever run through decode. no error message, nothing. public function check_pw(){ //post username , password database $data['username'] = $this->input->post('username'); $data['password'] = $this->input->post('password'); $this->load->model('lindsdata'); //encoded password returned database - working $return_data = $this->lindsdata->password($data); //$return_data = $this->encrypt->decode($return_data); //print_r shows $return_data hold encrypted password //but when uncomment line decode in it, $return_data print_rs nothing. print_...

javascript - Embed Facebook video via ajax -

i have database store id of x videos facebook also, youtube , vimeo, load video via ajax, vimeo , youtube load facebook doesn't load, loads html code via ajax contains script wich requiered facebook... embed video facebook code this: <script> (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.0"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk') ); </script> <div class="hidden-xs hidden-sm visible-md visible-lg"> <div id="fbid"> <div id="fb-root"></div> <div class="fb-post" data-href="https://www.facebook.com/video.php?v=<?php echo $v->v; ?>" data-width="800"> <div c...

.net - App with windows auth asks for login -

i have auth set windows because running on company intranet. web.config looks like: <authentication mode="windows" /> <authorization> <deny users="?" /> </authorization> i building in vs 2013. each day, first time run app pops auth required login box , once give windows creds, fine (i assume caches creds). want app start , not ask valid user login creds. i thought behavior of windows authentication. there iis express setting need change? else needed in web config? you have configure web application domain "local intranet" site in internet explorer (chrome inherit setting ie, believe firefox have configured manually). can accomplished through "internet options --> security --> local intranet --> sites --> advanced --> add website". you need configure automatic logon outlined in link: https://technet.microsoft.com/en-us/library/dd572939%28v=office.13%29.aspx?f=255&mspperror=-214...

Java runtime retention annotations - annotation class required at compile time but not at runtime? -

i trying figure out exact effects in regards compile time , runtime classpaths of class annotated runtime level retention annotation, example: @javax.inject.named. understanding far: the javax.inject.named class must present @ compile time on classpath. this compiled bytecode meta-data , can obtained @ runtime via reflections api , processed accordingly; however, class not need exist on runtime classpath. thus, if compile jar java class annotated @javax.inject.named, compiled jar file can run both in container (ie jboss) , in plain old jvm launched command line (with no additional classpath entires). however, if make source code available project compiled along using javac (and no additional classpath entires), no longer compile correctly? if assumption correct, seems little limiting if need share both compiled binaries , source files amongst projects may or may not running in container (ie jboss). if case, need create wrapper object (annotated @javax.inject.named) delegat...

java - Parenthesis/Brackets Matching using Stack algorithm -

for example if parenthesis/brackets matching in following: ({}) (()){}() () and on if parenthesis/brackets not matching should return false, eg: {} ({}( ){}) (() and on. can please check code? in advance. public static boolean isparenthesismatch(string str) { stack<character> stack = new stack<character>(); char c; for(int i=0; < str.length(); i++) { c = str.charat(i); if(c == '{') return false; if(c == '(') stack.push(c); if(c == '{') { stack.push(c); if(c == '}') if(stack.empty()) return false; else if(stack.peek() == '{') stack.pop(); } else if(c == ')') if(stack.empty()) return false; else if(stack.peek() == '(') stack.pop(); else ...

stata - Sort by variable in twoway scatter. X-axis stays alphabetical and sort produces gibberish: why? -

Image
i have 2 variables: ie_ctotal cntry2 note: cntry2 encode d version of string variable cntry : don't know if may affecting things. i want twoway scatter of ie_ctotal , cntry2 , , want sort scatter variable gdppc , twoway || scatter ie_ctotal cntry2, c(1) xlabel(,valuelabel) the above without sort works fine. once introduce sort , however, twoway || scatter ie_ctotal cntry2, c(1) sort(gdppc) xlabel(,valuelabel) the graph turns gibberish, or rather connects according sort , x axis remains alphabetical, making connections seem scribbled. any ideas doing wrong? note: don't want sort original data, because advised in previous questions bad idea. want sort data 1 graph. there no reproducible example here, , not graph, possible guess problem. you typing above c(1) which ill-advised, although stata right thing. better type c(l) which instructs stata join data points on graph in line. (nod @dimitriy v. masterov on detail.) in first ex...

javascript - Detecting if you are on a desktop -

i'm building app touch screens , has on screen keyboard them use. works wonders desktop computers, not mobile devices have built in keyboards. i have been looking around see if there way detect if on desktop or mobile, have seen has been deprecated. there way so? can enable library if on desktop computer. you can accomplish doing: if(/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.useragent)){ //your code mobile devices } here fiddle: http://jsfiddle.net/mnbw23gg/