Posts

javascript - Paste function in jquery/java script on button click -

i have textbox write website url.and place button beside that. i want if user copy url place , click on button copied url paste in textbox. now can use ctrl+v paste url in text box.but mobile user not able use that. need on click on button copied url paste in textbox. any highly appreciable , in advance. based upon many questions past... javascript clipboard data on paste event (cross browser) get current clipboard content? is possible read clipboard in firefox, safari , chrome using javascript? how copy clipboard in javascript? ... answer "no, it's impossible." i suggest, though, you've skipped important step in development process. problem face want allow mobile users painlessly enter text (in particular, urls, pain type) other sources textbox on site. take step , @ other possible solutions problem don't involve javascript access user's clipboard. in fact, 'solution' you're trying implement doesn't user, becaus...

java - Line Number Reader -

i got problems code window.videoinfo.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { try { url url = new url(window.videoinput.gettext()); urlconnection con = url.openconnection(); linenumberreader in = new linenumberreader(new inputstreamreader(con.getinputstream())); in.setlinenumber(1523); in.getlinenumber(); system.out.print(in.readline()); } catch (ioexception ex) { ex.printstacktrace(); } i trying display specific line website. if press button displays first line. when set line number 1523. setlinenumber(1523) makes line number returned getlinenumber() starts 1523 . won't skip 1523 lines. skip 1523 lines, need do: for(int = 0; < 1523; i++) in.readline();

How to iterate day in php? -

i need next 7 (or more) dates except sunday. firstly did $end_date = new datetime(); $end_date->add(new dateinterval('p7d')); $period = new dateperiod( new datetime(), new dateinterval('p1d'), $end_date ); and after checked $period in foreach . noticed if remove sunday need add 1 more day end , each time when sunday is... there way it? $start = new datetime(''); $end = new datetime('+7 days'); $interval = new dateinterval('p1d'); $period = new dateperiod($start, $interval, $end); foreach ($period $dt) { if ($dt->format("n") === 7) { $end->add(new dateinterval('p1d')); } else { echo $dt->format("l y-m-d") . php_eol; } } see in action

default to index.html but allow user to type to index.php and get the php page -

i'm busy building wordpress website client. i've developed site off-line , upload live server show client i've done far. want keep "under construction" html page i've create default when browsing site if type in www.sitename.com/index.php want actual site displayed. i don't want use "under construction" plugin don't want user have enter form of username or password gain access site. i have tried: directoryindex index.htm browse index.php flips me index.htm page. i've had here: make index.html default, allow index.php visited if typed in unless i'm missing it, there's no real conclusion. my development machine runs windows 8 xampp. use in .htaccess file redirect user index.html when types domain name, if types index.php , able on page rewriterule ^$ index.html [r=301,l]

linux - what is the meaning of key size of cipher -

what key size or key length of cipher , , heard 128 bit key, 1024 bit rsa key , mean? for suppose there 1024 bit key , thought 1024 means number of bits required store key , right? and have public , private keys ( ssl keys ) , how can find key size of certs ( public key , private key). there linux tool find key size? all explained here: http://en.wikipedia.org/wiki/key_size . to check key size of cert can use example openssl : openssl x509 -in your_cert_in_pem_format.crt.pem -noout -text

javascript - multiple arguments with PySide QtCore.Slot decorator -

how define multiple arguments? types supported? , why fail when combine decorator? i couldn't find real documentation on went source -- pysideslot.cpp . slot takes 2 keyword args, name (a string name slot) , result (a python type object or string naming qt type, used specify return type of function). if name isn't supplied, try read function you're decorating, careful: other decorators ruin name of function, if you're combining slot decorator may want explicitly specify name arg. any positional arguments feed slot converted strings pyside::signal::gettypename , joined comma-separated string. become signature of slot , used routing calls. for example, given decorator: @qtcore.slot(int,str,result=float) def func(a,b): assert len(b)==a; upload(b); return 2.5 the pyside internals create call signature string of 'int,qstring' , resulttype string of 'double'. i hope helps next person struggling debug slots.

java - How do I get started with JFreeChart? -

i've never used third party library before. should after downloaded jfreechart-1.0.14.tar.gz ? i don't know if i'm doing these things right: 1. put jcommon-1.0.17.jar , jfreechart-1.0.14.jar @ same directory source code. 2. import needed class in source code (e.g. import org.jfree.util.rotation; ) many articles tell how in ides. instead of ides, i'm writing codes vim , compile myself. so, assume didn't thing wrong, how should compile source code javac , run code java ? edit: here's file layout: ./src | - test.java ./lib | - jcommon-1.0.17.jar | - jfreechart-1.0.14.jar i compile by javac -cp "lib/*" -d classes/ src/test.java run by java -cp classes:lib/jcommon-1.0.17.jar:jfreechart-1.0.14.jar test however, error occurs: exception in thread "main" java.lang.noclassdeffounderror: org/jfree/data/general/piedataset how can resolve problem? exception in thread "main" java.lang.noclassdeffounderror...