Posts

javascript - Is there (should there be) any difference between native js defaultValue and jQuery prop(defaultValue)? -

i'm litte confused native javascript defaultvalue functionality. have understood value of html input must set , value initial default value. i wanted restore specific input (text) element default value when have inside click-event. (cancel button) //restore values var name_person = $(this).find('.nameofperson'); //attempt 1 name_person.val(name_person.defaultvalue); alert('restored value=' + name_person.val()); //this alerts nothing //attempt 2 name_person.val(name_person.prop('defaultvalue')); //this alerts default value alert('restored value=' + name_person.val()); why doesn't native defaultvalue attribute work when prop('defaultvalue') does? shouldn't same? initial value set value="bla bla bla" in input element. i got work (with jquery), wonder - missing something? it not work because name_person jquery object , jquery not have defaultvalue . need reference dom object name_person[0].defau...

java - JFrame does not show up in Eclipse -

i tried execute following code within eclipse (osx): public static void main(string[] args) { jframe frame = new jframe("test"); frame.setsize(new dimension(400, 30)); frame.add(new jbutton("hello")); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setvisible(true); } the frame not show following console messages: 2014-05-16 14:45:35.230 java[8685:903] [java cocoacomponent compatibility mode]: enabled 2014-05-16 14:45:35.232 java[8685:903] [java cocoacomponent compatibility mode]: setting timeout swt 0.100000 2014-05-16 14:45:35.546 java[8685:903] *** __nsautoreleasenopool(): object 0x100612800 of class nsconcretemaptablevalueenumerator autoreleased no pool in place - leaking 2014-05-16 14:45:35.547 java[8685:903] *** __nsautoreleasenopool(): object 0x100613f40 of class __nscfdate autoreleased no pool in place - leaking 2014-05-16 14:45:35.547 java[8685:903] *** __nsautorelease...

php - color picker issue in plug in development wordpress -

i trying add color picker in wordpress settings api plugin development. facing problem that. have code color picker. // create function color picker. add_action( 'admin_enqueue_scripts', 'mw_enqueue_color_picker' ); function mw_enqueue_color_picker( $hook_suffix ) { // first check $hook_suffix appropriate admin page wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'my-script-handle', plugins_url('my-script.js', __file__ ), array( 'wp-color-picker' ), false, true ); } //call in input field option <tr valign="top"> <th scope="row"><label for="cursor_color">scrollbar color</label></th> <td> <input id= "cursor_color" type="text" name="ppmscrollbar_options[cursor_color]" value="<?php echo stripslashes($settings['cursor_color']);?>" class="my-color-field"/><p class="description"...

javascript - Can't Perform action on click yes in Jquery based confirmation box -

i have template using fallr confirmation or alert boxes features. has code confirmation box, working fine not working according requirement..means i have 1 link delete row table like: <a href="<?php echo base_url(); ?>admin/del_menu/<?php echo $values->id; ?>" rel="tooltip-top" title="delete" id="confirm"> when click on showing dialog box ask 'yes' , 'cancel' it's jquery code is: $('#confirm').click(function(ev) { var clicked = function(){ $.fallr('hide'); return true; }; $.fallr('show', { buttons : { button1 : {text: 'yes', danger: true, onclick: clicked}, button2 : {text: 'cancel', onclick: function(){$.fallr('hide')}} }, content : '<p>are ...

spring - Securing a REST application in SpringBoot and accessing it from a Rest Client -

i pretty new springboot. have developed rest server wondering how perform basic authentication client , how configure spring boot server authenticate request. tutorials saw online didn't include restful client. great if can show code including both client request , server authentication process springboot rest. on client side since using jersey client need following: client c = client.create(); c.addfilter(new httpbasicauthfilter(user, password)); one server side need enable spring security , set basic authentication following (this simplest possible case). @configuration @enablewebsecurity public class rootconfig extends websecurityconfigureradapter { @override protected void registerauthentication(authenticationmanagerbuilder auth) throws exception { auth.inmemoryauthentication() .withuser("tester").password("passwd").roles("user"); } @override protected void configure(httpsecurity http) throws exception { http .aut...

php - SELECT does not selects -

this question has answer here: call undefined method mysqli_stmt::get_result 7 answers i'm tryign creat user_login system website. , got problems selection of user_info database , using mysqli , prepared statements . problem , can't output . i'm using manual @ php.net . here have got moment: <?php require_once 'php/includes/constants.php'; $connection = new mysqli(db_server, db_user, db_password, db_name)or die("error"); $phone = "0661488342"; $password = "1234"; $query = " select * userinfo phone = ? , password = ? limit 1"; $stmt = $connection->prepare($query); $stmt->bind_param('ss', $phone, $password); $stmt->execute(); $res = $stmt->get_result(); $row = $res->fetch_assoc(); echo "password = ".$row['password']; t...

math - Cryptarithmetic Multiplication Prolog -

i have grasp of idea of crypt arithmetic , addition cannot figure out how multiplication crypt arithmetic problem. it's two*six=twelve or along lines without middle additional part of multiplication problem given. couldn't find online , found constraints problem nothing leads me answers. not sure ask , thought best place. i want know how solve multiplication crypt arithmetic problem. i concluded: t w o * s x _________________ t w e l v e t \= 0 means s \= 0 t 1-6 e (o*x) mod 10 o or x cannot 0 or 1 since e has different , 0 or 1 gives same value either o or x. edit: using generate , test method solve(t,w,o,s,i,x,e,l,v) :- x = [t,w,o,s,i,x,e,l,v], digits = [0,1,2,3,4,5,6,7,8,9], assign_digits(x, digits), t > 0, s > 0, 100*t + 10*w + o * 100*s + 10*i + x =:= 100000*t + 10000*w + 1000*e + 100*l + 10*v + e, write(x). select(x, [x|r], r). select(x, [y|xs], [y|ys]):- sele...