Posts

jquery - Clear input value in form -

jquery - Clear input value in form - due ie8 transparancy issue want remove value form field. <input type="button" value="something" /> i tried several variations of $(' input[type="submit"], input[type="inputsubmit"], input[type="button"]').val(''); with no success. know should simple. i'd appreciate help this. thanks are sure? this working fine me way ie7 $('input[type="button"]').val(''); the result button no text. jquery input clear

hide - jquery, how to find the parent div id? -

hide - jquery, how to find the parent div id? - im trying hide parent div contains clicked link: <div class="user" id="request_1"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree1</a></li> </ul> </div> </div> <div class="user" id="request_2"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree3</a></li> </ul> </div> </div> <div class="user" id="request_3"> <div class="information"> <ul> <li><a href="javascript:void(0)" class="approve_friends agree">agree4</a></li> </ul> ...

java - Is it clone safe to pass a classes enum to a clone? -

java - Is it clone safe to pass a classes enum to a clone? - i have simple class holds skeleton much larger, bulkier class. skeleton is string id, type enumeration , flags options. i able clone skeleton, don't know if enumeration clone safe (pass value). think not since treated classes (pass reference). safe pass enumeration clone? example clarity: class { string id; enum state; int flags; clone() { ret = new a(); ret.id = id; ret.state = state; // safe here? ret.flags = flags; homecoming ret; } } an enum instance, definition, singleton. there 1 instance of each enum instance, design. obviously, thing can re-create reference. java enums clone pass-by-reference pass-by-value

Security concerns while using MongoDB PHP driver -

Security concerns while using MongoDB PHP driver - i have experiences securing sql injections on mysql, should careful on mongodb using php driver? in of pages info via get/post , searching/inserting system. search via udid / other fields, , can insert string value. user's cookies via javascript. so when get/post, i'm adding each variable htmlentities function? what replace mysql_real_escape_string? should utilize it? so, example, when doing $download = array( 'url' => $_get['url'] ); $downloads->insert($download); is ok? is there way check if string uid? any think else should aware when using mongodb , php? cookies using javascript, , searching in db using cookies. that? so when get/post, i'm adding each variable htmlentities function? no need to. should however, utilize htmlentities when outputting user-generated info browser, prevent xss attacks. what replace mysql_real_escape_string? should utilize...

objective c - get an integer -unit digit in a simple way -

objective c - get an integer -unit digit in a simple way - i not sure english, need unit digit of integer. without complex algorithm api or trick. for illustration : int a= 53; int b=76; this add together because dont "meet quality standards" post! drive me crazy! please , prepare ! took me 10 shoots post this,and other issue also. i need a=3 , b=6 in simple smart way. same other digit. thanks lot . here how divine number parts int unitdigit = % 10; //is 3 int tens= (a - unitdigit)/10; //is 53-3=50 /10 =5 objective-c

c++ - Width of cout - display -

c++ - Width of cout - display - i'm wondering: possible width of line in standard output? not std::cout.width() or std::setw() widths, actual maximum number of characters before os wrap line? edit: inform, i'm using windows xp, though i'd prefer portable manner (everything else portable atm). not using standard c++. cout not necessary bound console, in "width" meaningless. of course of study possible using other libraries, e.g. ncurses . if you're using linux, check getting terminal width in c?; if you're using windows, check getting terminal size in c windows?. c++ command-prompt cout

vectorization - how to vectorise an xor operation in matlab -

vectorization - how to vectorise an xor operation in matlab - i have run next code in profiler in matlab , quite essential me vectorise code sense unnecessary loop. i have 2 matrices g , source_data. every column in g determine rows need pick source_data , xor them together. i creating g , source_data using next piece of code for i=1:10 source_data(i,:)=rand(1,20)<.8; end i=1:15 g(:,i)=rand(10,1)<.9; end i performing xor operation using loop below: z=1; while(i<=15) j=1:10 if(g(j,i)==1) intersum(z+1,:)=xor(intersum(z,:), source_data(j,:)); z=z+1; end end c(i,:)=intersum(z,:); i=i+1; end is there way vectorise code ? time lag acceptable little matrix big matrices code quite in efficient. thanks, bhavya assuming that: i starts @ 1 intersum starts @ zeros here's vectorized form of code produces exact same result original: function c = version_a() source_data = rand(10,20)<.8; g = rand(10,15)<....