Posts

How do I get my menu to drop down? CSS & HTML -

i have tried making drop down menu. have made simple ones, cannot seem 1 work now, after adding more complex css. surely missing line of code somewhere, not sure where. know how subitems1,2,3,and 4 drop down item3 in menu? menu code <body> <div id = "horizontalmenu"> <ul class = "fancynav"> <li><a href = "item1.php" class = "homeicon">item1</a></li> <li><a href = "item2.php">item2</a></li> <li><a href= "#">item3</a> <ul> <li><a href = "sub1.php"> subitem1</a></li><br> <li><a href = "sub2.php"> subitem2</a></li><br> <li><a href = "sub3.php"> subitem3</a></li><br> <li><a href = "sub4.php"> subitem4</a></li> </ul> </li> ...

validation - Validating entire form with "required" in parsley without adding "required" to individual fields -

is there way validate entire form in parsley? in, want make sure fields validated "required" without adding keyword each of fields. following: <form action="file.jsp" method="post" data-parsley-validate required>

Perl's conditional operator in string context -

this question has answer here: why aren't newlines being printed in perl code? 3 answers let's take following minimalistic script: #!/usr/bin/perl # # conditional_operator.pl # use strict; print ( 1 ? "true" : "false" )." statement\n"; exit; i expect output "true statement". when execute snippet, see ... deviolog@home:~/test$ perl conditional_operator.pl true the " statement\n" concatenation seems ignored. my perl version v5.14.2. read perlop manual conditional operator , think, string concatenation should possible. can explain behaviour? always include use warnings; @ top of every script. to desired behavior, add parenthesis print called entire argument instead of first part: print(( 1 ? "true" : "false" )." statement\n"); if you'd had warni...

c# - Adding information to an already existing xml folder from a windows form -

i trying store information writen form following code keeps happening override 1 there no add it. have following code xml serilaztion. xmlserializer xmlserializer = new xmlserializer((iclass.gettype())); writer = new streamwriter(filename); xmlserializer.serialize(writer, iclass); creditcard cc = new creditcard(cardnumber, expirydate, creditcardtype); user u = new user(name, surname, gender, posistion, wage, amount, banktype, cc, username, password); xmlsave x = new xmlsave(u, "customers.xml"); i have try keep same format because school project.

java - I get access denied when I try to implement TwitterStream filter or sample function -

i access denied when try implement twitterstream filter or sample function. java code follows: package tweettmap; import twitter4j.*; import twitter4j.conf.configurationbuilder; public class stream { public void getstreams() throws twitterexception{ configurationbuilder cb; cb = new configurationbuilder(); cb.setoauthconsumerkey("my key"); cb.setoauthconsumersecret("my consumer secret key"); cb.setoauthaccesstoken("my acess token"); cb.setoauthaccesstokensecret("my token key"); twitterstream twitterstream = new twitterstreamfactory(cb.build()).getinstance(); statuslistener listener = new statuslistener() { @override public void onstatus(status status) { system.out.println("@" + status.getuser().getscreenname() + " - " + status.gettext()); } @override public void ondeletionnotice(st...

memory - How to set the OpenCL's local work space size? -

i'm doing image processing using opencl. for example, used 100*200 size image. in .cl code, half image pixel value by: { int width=get_group_id(0); int height=get_group_id(1); // col(width) int x= get_global_id(0); // row(height) int y= get_global_id(1); (unsigned char) data_output[x*width+y]= (unsigned char)data_input[x*width+y]/2; } after kernel's parameter setting run kernel by: clenqueuendrangekernel( queue,kernel_dip,2,null,global_work_size,local_work_size, 0,null,null); the global_work_size used image size: size_t global_work_size[2] = {100,200}; i found .cl code doesn't include code "get_local_id(0);" the local_work_size did have lots influence on performance. both "size_t local_work_size[2]= {1,1};"(small local work size) , "size_t local_work_size[2]= {50,50};" (big work size) slow. some suitable size below faster: size_t local_work_size[2]= {10,10}; so here question: why code with...

python - Why is cffi so much quicker than numpy? -

i have been playing around writing cffi modules in python, , speed making me wonder if i'm using standard python correctly. it's making me want switch c completely! truthfully there great python libraries never reimplement myself in c more hypothetical really. this example shows sum function in python being used numpy array, , how slow in comparison c function. there quicker pythonic way of computing sum of numpy array? def cast_matrix(matrix, ffi): ap = ffi.new("double* [%d]" % (matrix.shape[0])) ptr = ffi.cast("double *", matrix.ctypes.data) in range(matrix.shape[0]): ap[i] = ptr + i*matrix.shape[1] return ap ffi = ffi() ffi.cdef(""" double sum(double**, int, int); """) c = ffi.verify(""" double sum(double** matrix,int x, int y){ int i, j; double sum = 0.0; (i=0; i<x; i++){ (j=0; j<y; j++)...