Posts

What is the purpose of the symlinks within the include and local directories in a python virtualenv? -

what purpose of symlinks automatically created within include , local in virtualenv? when run: virtualenv myvirtualenv it creates following directory structure , symlinks: myvirtualenv/ ├── bin ├── include │   └── python2.7 -> /usr/include/python2.7 ├── lib └── local ├── bin -> ../bin ├── include -> ../include └── lib -> ../lib why important virtual environment track /usr/include/python2.7 or have additional references own directories? ever different set here?

Jquery filter on php generated Divs -

i can't seem figure out why jquery isn't filtering. jquery function not correct or php using generate divs wrong. each generated div so each generated div looks so <div class="content" style="background-color: firebrick"> content </div> this code on page jquery function <html> <head> <link rel="stylesheet" href="css/logged_in.css"> <?php include("login_php_scripts.php"); ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $('#filter').keyup(function () { var filter = $("#filter").val(); $('#warnings').each(function() { $(this).find("div:not(:contains('" + filter + "'))").hide(); $(this).find("div:contains('" + filter + "')").show(); }); }); </...

r - Get the SHA of the version used when run -

is possible sha of version of code being run in r? i have following code, outputs sha master head: readme<-file("info.txt") writelines(paste(c("document produced using version", paste(readchar("./.git/refs/heads/master", 10)), "of code")), readme) close(readme) but if makes mistake , accidentally runs code different branch? possible r active branch that? possibly this, activebranch figured out other bit of r code? readme<-file("code version info.txt") writelines(paste(c("document produced using version", paste(readchar(paste("./.git/refs/heads/", activebranch, collapse = ""), 10)), "of git instructions")), readme) close(readme)

php - Add prefix to link url in wordpress -

i want add image link on wordpress site redirect user page of same url different prefix. example page url mydomain.com/post1234 when user click image on page redirect user url mydomain.com/md/post1234 the following code print current page url on every post page on site want add "md" prefix in url <a href="<?php $path=$_server['request_uri']; $uri='http://www.example.com'.$path; ?>"><img src="<?php bloginfo('template_url'); ?>/images/sgxx.png">click here</a> pls suggest correct code this. try this: <?php $domain = get_site_url(); //you can use or either "http://".$_server[http_host]; $path = $_server[request_uri]; $prefix = "/md"; ?> <a href="<?= $domain.$prefix.$path ?>">link</a> for more info $_server , check link below: http://php.net/manual/en/reserved.variables.server.php

c++ - Substring Replace Vector -

this minimal code sample i'm trying create array of substrings find can replace them single word. in case i'm changing common greetings simple 'hi'. the problem when run code i'm getting error. error: no matching function call 'std::vector >::push_back(const char [4], const char [4], const char [3])' if me understand why error occurring , suggest solution perfect. #include <iostream> #include <string> #include <algorithm> #include <cctype> #include <ctime> #include <vector> vector<string> hiword; hiword.push_back("hey", "sup", "yo"); (const auto& word : hiword){ while (true) { index = r.find(word); if (index == string::npos) break; r.replace(index, word.size(), "hi"); } } you might want start creating vector of strings want search , replace: vector<string> searchwords = {"hey", "hello...

java - Sorting int field of the wrapper class spring -

i have navigation class dynamically creating navigation having 2 tables folder(it directory contains files) , content(it files or pages render content on public site). have created navigation class in having wrapper class merging fields of content folder. have tried using @orderby , @ordercolumn came know work collections. list<folder> folder = folderrepository.findallbynavdepthlessthanorderbynavdepthasc(3); here sorting navdepth(this column belongs folder entity) want sort navorder(this column belongs content entity) @service public class navigationservice { @qualifier("jdbcmysql") private jdbctemplate jdbctemplate; private folderrepository folderrepository; private folderservice folderservice; @autowired public navigationservice(jdbctemplate jdbctemplate, folderrepository folderrepository, folderservice folderservice) { this.jdbctemplate = jdbctemplate; this.folderrepository = folderrepositor...

java - Obtaining list views in Jenkins from nested view plugin -

i have developed plugin has extension point listviewcolumn have run problems when combining plugin, nested view plugin . my plugin enables 1 select jobs in current view , make modifications 1 button press. when view resides inside nested view, can't find view (from java code , jelly scripts) , no modification can made. in columnheader.jelly execute ${it.getheadertext(view.name)} where getheadertext() defines as public string getheadertext(string viewname) { hudson.getinstance().getview(viewname); // access jobs return object of .getview(viewname) return viewname; } this works fine regular list views whenever enter nested view's list view, getview(viewname) returns null. upon further investigation i've noticed nested views show when calling hudson.getinstance().getviews(); which returns views in toplevel of whole jenkins instance (no views inside nested views). here have nested view shows , instance of hudson.plugins.nested_view.nestedview. ...