Posts

performance - Will jQuery run faster if the HTML element name is added with the ID? -

below snippet of code use added data table when div clicked on: $(document).on("click", "div#pos_product_id_<?php echo $row['id']; ?>", function() { $("table#pos_till_products_list").each(function() { searchrow = $(this).find("tr#product_id_<?php echo $row['id']; ?>").html(); if (searchrow == null) { $("#pos_till_products_list tbody:first").prepend("<?php echo $product_build; ?>"); } else { var qty = $(this).find("tr#product_id_<?php echo $row['id']; ?> .qty").html(); qty++; $("tr#product_id_<?php echo $row['id']; ?> .qty").html(qty); } }); }); i'm new using js/jquery, can see i've added html element in front of id's. know if adding html element, make jquery perform faster? think would, adding elements name stops jquery searching other html...

r - ggplot2 plotting with black outline -

Image
i cross posting forum ( https://www.biostars.org/p/268514/#268559 ) got useful comments still confused output of ggplot2. i trying simple black outline on circles code giving random colours , seems ignoring scale_colour_manual(values = cols) argument. when run following code: # creating color palette > cols <- c("red" = "red", "orange" = "orange", "nonsignificant" = "darkgrey", "increased" = "#00b2ff", "decreased" = "#00b2ff") # make basic ggplot2 object > vol <- ggplot(data, aes(x = lfc, y = pval, color = color, labels=gene)) # inserting mnaual colors per color pallette term "scale_colour_manual(values = cols)" below > vol + ggtitle(label = "volcano plot", subtitle = "colored fold-change direction") + geom_point(size = 2.5, alpha = 1, na.rm = t) + scale_colour_manual(values = cols) + theme_bw(base_size = 14) + them...

Excel VBA: (Mac-specific) Calling Application object causes other workbooks to un-minimize -

i have workbook includes 12 modules, plus on 25 worksheets sheet-specific macros. on each 1 include line: application.screenupdating = false with corresponding "= true" @ end of code. this great performance, i've noticed if click anywhere in workbook, cause other excel workbook using un-minimize (zoom dock) if minimized. not cause non-active windows become active. this not minor issue, @ organization using workbook simultaneously working on 2-3 other excel documents @ same time, of minimized save screen space. is there way prevent application object unminimizing minimized windows? wiki

How to switch stages in JavaFX -

i have login stage (300 x 250), want open main stage (fullscreen) if credentials correct. i have figured out how check login credentials, how can close login stage , open stage? if application supposed work in 1 window prefer using gui manager singleton class, manages changing windows. below provided complete code of simple application uses mechanism. let's assume files in 1 package, called sample . main.java - initialize javafx components here: package sample; import javafx.application.application; import javafx.fxml.fxmlloader; import javafx.scene.scene; import javafx.scene.layout.stackpane; import javafx.stage.stage; import java.io.ioexception; public class main extends application { @override public void start(stage primarystage) throws exception { fxmlloader loader = new fxmlloader(); loader.setlocation(main.class.getresource("/sample/root.fxml")); try{ stackpane rootpane; rootpane = loader.load(); ...

php - AJAX Request fails because of file_get_contents -

i'm doing fun project myself, involves getting html source web (from different domain) , getting info of it. in first steps made in php worked fine, i'm trying make better jquery page works dynamically. the thing ajax request fails whenever reaches "file_get_contents" call (which 1 gives me html source of url). the js part: $.ajax({ type: 'get', url: 'getimage.php', data: {referencia: $("#referencia").val()}, success: function(data){ var div = document.getelementbyid("print"); alert(data); div.innerhtml = "<img src="+""+"/>"; //not finished }, error: function() { alert("error"); } }); the server part: <?php $ref = $_post['referencia']; if(isset($_get['referencia'])){ $url = /*some external ...

jquery - How to make the code server ip agnostic in Javascript? -

whenever restart server ip changes, force me change ip address in code works properly. want make server ip agnostic, don't have change ip in code everytime restart server. making url relative best solution here. , that's did , worked me. example: create new html file(index.html): <html> <head> <script src="http://code.jquery.com/jquery-3.2.1.min.js"></script> <script src="script.js"></script> </head> <body> make server ip agnostic </body> </html> your javascript file(script.js): var baseurl; //global variable, can use in large codebase later. $.getjson('config.json',function(data){ baseurl = data.url; console.log(baseurl); }); your json file(config.json): { "url": "192.120.12.1/" } and work. when ever want can change url directly in config.json file. wiki

c - execve() with pipe has no output -

i using execve() global variable g_env environment variables. works execvp() no output execve() please !! void execve_pipe(char ***cmd) { int p[2]; pid_t pid; int fd_in = 0; while (*cmd != null) { pipe(p); if ((pid = fork()) == -1) { exit(exit_failure); } else if (pid == 0) { dup2(fd_in, 0); if (*(cmd + 1) != null) dup2(p[1], 1); close(p[0]); execve((*cmd)[0], *cmd, g_env); exit(exit_failure); } else { wait(null); close(p[1]); fd_in = p[0]; cmd++; } } } wiki