Posts

r - Fetch the original name of vector variable passed to a custom function -

my problem best understood after reading r script: plothistogram <- function(data, x, binw=0.30, color=false, density=false, h=10, w=10) { require(ggplot2) # data$x <- as.numeric(x) plot <- ggplot(data, aes(x)) if(density & color) { plot <- plot + geom_density(fill="blue", aes(alpha=0.2)) } else if (density) { plot <- plot + geom_density() } else if (color) { plot <- plot + geom_histogram(binwidth=binw, aes(y=..density.., fill=..count..)) + scale_fill_gradient("count", low="purple", high="red") } else { plot <- plot + geom_histogram(binwidth=binw, aes(y=..density.., fill=..count..)) } ggsave(file="histo_plot.svg", plot=plot, height=h, width=w) return(plot) } notice commented line. have use ggplot recognize x belongs data . hack. intent plot name of whatever series input x . i'm not sure how because far can tell, ...

Eclipse java debugging: source not found -

while debugging java app in eclipse receive " source not found " error in 2 cases: stepping in file in different project imported stepping in file in installed maven repository the files there, eclipse won't step them, instead shows button " attach source " i tried attaching (which opened dialog define variable?!) , eclipse did jump file, debugger not inspect variables there. manually attaching source each dependency isn't practical, in case there thousands of dependency files. i'm new eclipse\java explanation of why happening + how resolve lot! eclipse debugging works class actually loaded program. the symptoms describe sounds class in question not found in project, in distribution jar without debug info found before project working with. this can happen several reasons have @ location classes showing behaviour found (look in navigation pane identify it). need change build path of project avoid using jar , have jvm use pr...

javascript - jQuery UI: Set class for draggable when valid -

i know can set class dropable object when valid dragable hovering, using hoverclass. posible that, draggable object (just when hovering on valid target)? ok, managed using events in dropable: el.dropable({ accept: ".target", over: function(e, ui){ ui.draggable.addclass("valid"); }, out: function(e, ui){ ui.draggable.removeclass("valid"); }, hoverclass: "valid" });

python - Using webp images with Pillow 2.2.2 or 2.3.0 -

i using pillow version 2.2.2 convert webp image jpeg image. webp images stored in memory buffer. found when try tom open webp image cause memory leak large number of images become real problem. def webp_to_jpeg(raw_img): image = image.open(stringio.stringio(raw_img)) buffer = stringio.stringio() image.save(buffer, "jpeg") return string_buffer.getvalue() this memory leak happen when work webp images. try update pillow 2.3.0 when did not able read webp images @ , got following exception "webp unknown extension" it's webp decoder bug in pillow (see here ). it's still leaking memory in version 2.4.0 the workaround i've found based on python-webm . 1 leaking memory too, can fix it: in encode.py, import libc free() function : from ctypes import cdll, c_void_p libc = cdll(find_library("c")) libc.free.argtypes = (c_void_p,) libc.free.restype = none then modify _decode() free buffer allocated in webp decoder .dll: def _...

What is the order of evaluations of parameters inside the function? -

having foo(bar1(), bar2()) can sure in sml evaluate bar1() first , after bar2() ? yes. strictly speaking have function applied tuple. fields of tuple evaluated left right bar1() evaluated before bar2() . see "the definition of standard ml (revised)" milner, tofte, harper , macqueen page 41. note if foo expression have side-effects or raise exception evaluated before argument , therefore before either bar1() or bar2() . particularly has implications curried applications. foo (bar1()) (bar2()) will evaluate first bar1() foo(bar1value) before evaluating bar2() .

apache - Receving request from Woopingbot/1.1 -

so question next 1 because haven't been able find info woopingbot. recenlty have been receiving http request website, can see in apache log user agent woopingbog/1.1, bot 1 or bot trying find security issues in website?? thanks gabriel this bot woorank.com up-time bot. check see if website calculate uptime statistics. there bot called woobot check site seo.

javascript - Prioritize html elements in @media queries with PHP or JS -

think having divs in page <div id="1"> <div class="2">content</div> <div class="3">content</div> <div class="4">content</div> <div class="5">content</div> </div> is there way sort out divs in different media queries? for example if device "ipad portrait" code should be; <div id="1"> <div class="5">content</div> <div class="2">content</div> <div class="4">content</div> <div class="3">content</div> </div> you can use media queries in javascript, depending on match different dom manipulations. in example if window less 770px reverse order using jquery. var mediaquery = window.matchmedia( "(max-width: 770px)" ); if ( mediaquery.matches ) { var container = $('#1'); var items = container.children(...