Posts

javascript - How to remove a class on click event? -

html: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script type="text/javascript" src="app.js"></script> <title>prueba</title> </head> <body> <div class="prueba"></div> </body> </html> css: .prueba { height: 100px; width: 100px; background-color: green; } js (edited): var main = function() { $('.prueba').click(function() { $(this).removeclass('.prueba'); }); }; $(document).ready(main); it (still) doesn't work. can me? to select class, should preface class name dot: $('.prueba') jquery docs may want review.

Cannot connect CSS to my HTML -

i keep trying , trying have no idea issue is. linked picture of code showing source code , directory structure of site. got answer thanks you need move index.html page websitename directory. page trying find css directory inside of img directory , of course doesn't exist there.

grails - REST API Design for systems with multiple companies or organizations -

most of examples see implement rest url patterns http://www.app.com/books/1 access book id 1 or http://www.app.com/books access books. that's great, commonly work on applications support multiple companies. example, company abc has 2 users , company def has 2 users. user company abc creates book id 100 . when restful call comes in user @ company def : http://www.app.com/books/100 there need access exception, or http://www.app.com/books would list books belonging def (not new book id 100). many entities, book, company id part of table, other entities may not case. example, if there rest operation 1 chapter in book, http://www.app.com/chapter/333 chapter table have foreign key reference book not company. what best practices managing access resource? if def tried access chapter abc have construct query join chapter book verify company id valid. i'm using grails 3.x of logic abstracted , thinks happen "automagically". url comes in specific book id re...

java - Looping into 2d Object array -

object [][] data = new object[4][4] ; (int =0;i<data.length;i++) { data[i]={"a","b","c","d"}; } is there way fill 2 day array way similar that, note: ,b,c , d different data can't use 2 loops fill array 'm searching close way when tried data[i]={"a","b","c","d"}; i thought going work reason didn't you need use "new" or give indexes something this: data[i]= new object[]{"a","b","c","d"}; or data[i][0] = "a"; data[i][1] = "b"; data[i][2] = "c"; data[i][3] = "d";

dump - Segmentation Fault C++, after parentheses operator -

i have class override parentheses operator. following code works: int main(){ .. a; cout << a({0.5}); .. } while following code doesn't work a fun(){ .. a; return a; .. } int main(){ .. a = fun(); cout << a({0.5}); } when execute second code, have following error: segmentation fault (core dumped) i can't understand why. edit: this overriding of operator: virtual arma::vec operator()(const inputc& input) override { const arma::vec& x = params.normalizationf->normalize(base::phi(input)); forwardcomputation(x); return params.normalizationo->restore(h.back()); } this constructor: ffneuralnetwork_(features_<inputc, denseoutput>& phi, unsigned int neurons, unsigned int outputs) : parametricregressor(phi, outputs), batchregressor_<inputc, arma::vec, denseoutput>(phi, outputs) { layerfunction.push_back(new sigmoid()); layer...

image - Charting without using controller action in ASP.NET MVC -

i know how chart using controller action returns fileresult . my question is, possible move action view (cshtml) file helper? way view logic entirely contained in view. the problem is, without controller action, url can fill in img src attribute? or there different way, instead of img tag, display image stream? if core problem want load image data without url (whether url points controller , or static resource), can dump image data directly html using base64 embedding follows: public static mvchtmlstring embedimagewithbase64(this htmlhelper helper, byte[] imagebytes) { var base64data = convert.tobase64string(imagebytes); var imagesrcdata = "data:image/png;base64," + base64data; return new mvchtmlstring(string.format("<img alt="chart data" src=\"{1}\" />", imagesrcdata)); }

How do I write all the printed items in .txt file as an output in R -

suppose have hundreds of print statements , inside loop. although these print statements displayed while running code, want summarized output file written in realtime or @ completion of job. for example print("first print , write.txt") check<-1:50 for(i in 1:length(check)){ print(paste0("this want print , write output",i)) print(paste0("this want print , write output.txt",i)) } i check sink() function. can find information here http://www.statmethods.net/interface/io.html you can setup file want write, , can use cat() output information. can have output sent file , console.