recentpopularlog in
« earlier   later »
MySQL Bugs: #45634: --init-connect option for mysql CLI |
It doesn't seem like you can put 'init_command' in an option file, though.
dba  mysql  bug 
march 2018
What is cmake equivalent of 'configure --prefix=DIR && make all install '? - Stack Overflow |
You can pass in any CMake variable on the command line, or edit cached variables using ccmake/cmake-gui. On the command line,
<code class="language-bash">cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr . && make all install</code>

Would configure the project, build all targets and install to the /usr prefix. The type (PATH) is not strictly necessary, but would cause the Qt based cmake-gui to present the directory chooser dialog.
cmake  build  toolchain  devel  dammitbrain  solution 
march 2018
xpath - Why doesn't xmlstarlet select all nodes? - Stack Overflow |
Is this what you need?
<code class="language-bash">xml sel -t -m "//@category" -v "." -o " " books.xml</code>

or to separate the results on each line
<code class="language-bash">xml sel -t -m "//@category" -v "." -n books.xml</code>
xml  xpath  xmlstarlet  webdevel  samplecode  patternmatching 
march 2018
command line - Why does XMLStarlet return additional whitespace/newline for XML text nodes? - Super User |
I thought I got this to work, but in the end I still had to pipe it all through
<code>tr -ds '[:blank:]\r' '' | sed '/^$/d'</code>
<code>xmlstarlet sel -T -t -v "//node/item" file.xml</code>

and it outputs the content of
<code class="language-xml"><node><item>content</item></node></code>

as text without additional whitespace.
xml  xslt  xpath  whitespace  textprocessing  webdevel  almost  solution 
march 2018
xpath expression to remove whitespace - Stack Overflow |
The 'translate' function doesn't seem to work on node lists, though.

Note that you can just use 'xmlstarlet -T -t -v //xpath/expression' if you have XmlStarlet available. Otherwise...
I. Use this single XPath expression:
<code class="language-xpath">translate(normalize-space(/tr/td/a), ' ', '')</code>


normalize-space() produces a new string from its argument, in which any leading or trailing white-space (space, tab, NL or CR characters) is deleted and any intermediary white-space is replaced by a single space character.

translate() takes the result produced by normalize-space() and produces a new string in which each of the remaining intermediary spaces is replaced by the empty string.

II. Alternatively:
<code class="language-xpath">translate(/tr/td/a, ' &#9;&#10;&#13', '')</code>

xml  xslt  xpath  whitespace  textprocessing  webdevel  maybesolution 
march 2018
html - XPath with optional element in hierarchy - Stack Overflow |
My answer was to just use two piped XPath expressions. This seems to work if you have something like 'saxon-lint' that understands it, though:
In XPath 2.0, the optional step can be expressed as (tbody|.).
xpath  xpath2  patternmatching  xml  webdevel  solution 
march 2018
nagative aurument in converter.rb:417 · Issue #12 · ttscoff/mdless |
I got this error without having 'pygmentize' installed:

<code>$ mdless --width=80
/Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:428:in `*': negative argument (ArgumentError)
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:428:in `block (2 levels) in convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:424:in `map'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:424:in `block in convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:404:in `gsub!'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:404:in `convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:118:in `block in initialize'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `each'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `initialize'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/bin/mdless:17:in `new'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/bin/mdless:17:in `<top (required)>'
from /Users/username/.gem/ruby/2.3.0/bin/mdless:23:in `load'
from /Users/username/.gem/ruby/2.3.0/bin/mdless:23:in `<main>'</code>
markdown  viewer  errormessage  ruby  workaround  solution 
march 2018
command line - Markdown Viewer - Unix & Linux Stack Exchange |
Brett Terpstra's 'mdless' is still prettier, and it's as easy as a 'gem install mdless'.
markdown  terminal  commandline  cli  viewer  workaround  solution 
march 2018
axiros/terminal_markdown_viewer: Styled Terminal Markdown Viewer |
See also:
The ones I know of (and which made me write mdv ;-) ):

1. There are quite a few from the js community (e.g. msee, ansidown, ansimd and also nd which is great) but they require nodejs & npm, which I don't have on my servers. Also I personally wanted table handling and admonition support throughout and prob. too old to hack other peoples' js (struggling enough with my own). But have a look at them, they do some things better than mdv in this early version (I try to learn from them). Also this would be worth a look ;-)
2. pandoc -> html -> elinks, lynx or pandoc -> groff -> man. (Heavy and hard to use from within other programs. Styling suboptimal)
3. vimcat (Also heavy and hard to use inline in other programs)

Summary: For production ready robust markdown viewing (e.g. for your customers) I recommend nd still, due to the early state of mdv. For playing around, especially with theming or when with Python, this one might be a valid alternative to look at.
markdown  terminal  cli  commandline  viewer  alternativeto  mdless 
march 2018
How do you run a perl script using a custom perl build from an AppleScript? |
The solution for me was to change the shebang line to use "#!/usr/bin/env perl"; totally worked when I got the error message

<code>$ ./
dyld: lazy symbol binding failed: Symbol not found: _Perl_xs_handshake
Referenced from: /Users/kernst/perl5/lib/perl5/darwin-thread-multi-2level/auto/XML/LibXML/LibXML.bundle
Expected in: flat namespace

dyld: Symbol not found: _Perl_xs_handshake
Referenced from: /Users/kernst/perl5/lib/perl5/darwin-thread-multi-2level/auto/XML/LibXML/LibXML.bundle
Expected in: flat namespace

Trace/BPT trap: 5</code>

attempting to run saxon-lint with Perl 5.24 from MacPorts.
macports  perl  mac  osx  dyld  dynamicloader  errormessage  sortof  solution 
march 2018
macos - DYLD: Lazy Symbol - Stack Overflow |

if dyld can't find a symbol then you could have one of several problems.

1. dyld can't find the library because it isn't there.
2. dyld can't find the library because it's linker path was wrong.
3. dyld can't find the symbol in the library because it isn't in the library for some reason.

Once you find the library, you should be able to use nm library | grep symbol to figure out if the symbol is in the library.

you didn't mention if you were seeing this on your build machine or on a different machine, which would be a clue, good luck.
mac  osx  perl  errormessage  dyld  ld  dynamiclinker  annoyance 
march 2018
html - Testing text() nodes vs string values in XPath - Stack Overflow |
XPath text() = is different than XPath . =

(Matching text nodes is different than matching string values)

The following XPaths are not the same...
<code class="language-xpath">//span[text() = 'Office Hours']</code>

Says: Select the span elements that have an immediate child text node equal to 'Office Hours`.

<code class="language-xpath">//span[. = 'Office Hours']</code>

Says: Select the span elements whose string value is equal to 'Office Hours`.
xpath  xml  syntax  textcontent  thisvsthat  patternmatching  newbie  webdevel  reference  explained 
february 2018
xml - How to use XPath contains() here? - Stack Overflow |
Example from the comments

<code class="language-xpath">//ul[@class='featureList' and ./li[contains(.,'Model')]]</code>
xpath  xml  webdevel  reference  patternmatching 
february 2018
XPath Reference |
Dunno if this is a good reference or not; it's based on the XPath 1.0 W3C spec.
dotnet  microsoft  msdn  xpath  reference  xpath1 
february 2018
python - Does PyCharm support Jinja2? - Stack Overflow |
Yeah, you need the "pro" version for full support, but to some extent, you can just add the keywords for a new file type (Preferences -> General -> File Types) by yourself.
pycharm  intellij  idea  jinja  jinja2  syntaxhighlighting  sortof  workaround  solution 
february 2018
jinja2 code formatting – IDEs Support (IntelliJ Platform) | JetBrains |
Hi Ivan, formatting of jinja2 templates works in PyCharm. Do you have jinja2 selected as template language on the Template Languages settings page (

Seems to be supported only in the "pro" version.
pycharm  intellij  idea  jinja  syntaxhighlighting  sortof  solution 
february 2018
database - Update MySQL version from 5.1 to 5.5 in CentOS 6.2 - Stack Overflow |
You can use a yum plugin made by the IUS community to switch mysql-libs with mysql55w-libs. (the following assuming you still use Webtatic)
<code class="language-bash">yum install mysql yum-plugin-replace
yum replace mysql --replace-with mysql55w</code>

That should allow you to replace mysql with mysql55w-libs, whilst maintaining the older libmysqlclient for any dependencies.
yum  centos5  mysql  centos55  dba  sysadmin  tipsandtricks  maybesolution 
february 2018
[CentOS-announce] Announcing release for MySQL 5.5 and 5.6 on CentOS Linux 6 x86_64 SCL |
Both the collections include no client library and client applications are advised to use the client library available in mysql-libs package from base system.
mysql  mysql55  centos6  libmysqlclient  library  build  errormessage  annoyance  solution 
february 2018
linux - Find pid of a certain ssh instance - Super User |
What I actually did was *not* put 'ssh' in the background (no '-f') and then capture the PID with '$!'.
Give pgrep a go:
<code class="language-bash">pgrep -f 'ssh .* -nNCTR'</code>
ssh  backgroundprocess  sshtunnels  processmanagement  unix  tipsandtricks  worksok  solution 
february 2018
What is the name of the REAL Motörhead font? · 1001 Fonts Forums |
Hello! I found your font... only 8 years later. You've probably figured it out. It's Fraktur TU EF Bold. I searched blackletter fonts on
typography  font  motörhead  maybesolution 
february 2018
python - Booleans in ConfigParser always return True - Stack Overflow |
Use getboolean():

<code class="language-python">print config.getboolean('main', 'some_boolean')
print config.getboolean('main', 'some_other_boolean')</code>

From the Python manual:

RawConfigParser.getboolean(section, option)

A convenience method which coerces the option in the specified section to a Boolean value. Note that the accepted values for the option are "1", "yes", "true", and "on", which cause this method to return True, and "0", "no", "false", and "off", which cause it to return False. These string values are checked in a case-insensitive manner. Any other value will cause it to raise ValueError.
python  webdevel  configfile  configparser  solution 
february 2018
javascript - How can I change the default width of a Twitter Bootstrap modal box? - Stack Overflow |
Note 3: In Bootstrap 3 and 4, there is a modal-lg class. So this may be sufficient, but if you want to make it responsive, you still need the fix I provided for Bootstrap 3.

You need to use this like this:
<code class="language-html">
<div class="modal fade" id="{{ modal_window_id }}" tabindex="-1" role="dialog" aria-labelledby="{{ modal_label_id }}">
<div class="modal-dialog modal-lg" role="document">
{# bootstrap version > 3.1.0 required for this to work #}
<div class="modal-content">

For Boostrap < 3:
<code class="language-css">body .modal-admin {
/* new custom width */
width: 750px;
/* must be half of the width, minus scrollbar on the left (30px) */
margin-left: -375px;
bootstrap  css  ui  webdevel  solution 
february 2018
Blade Runner Soundtrack [Full Vinyl Rip 2013] - YouTube |
Technics SL-D1 turntable (Empire 888 TE cartridge) ART DJ PRE II Preamp
vinyl  soundtrack 
february 2018
Hamantash - Wikipedia |
"Haman's ears" - eaten during celebration of Purim

From: Mohntaschen?
food  dessert  judaism 
february 2018
How do I find which file Perl loaded when I use a module? - Stack Overflow |
Best solution I've found:

<code class="language-bash">
$ perldoc -lm List::Util

See also:
perl  wherefrom  whereis  module  library  PERL5LIB  solution  devel 
february 2018
Symkat - Find a Perl Module's Path |
Archived version of page (which was offline as of 2019-09-25):

<code class="language-bash">
$ perldoc -lm List::Util

<code class="language-bash">
cpan -l | grep Package::Name

Using Perl itself (maybe `perldoc` isn't installed):
<code class="language-perl">#!/usr/bin/perl
use warnings;
use strict;

for my $module ( @ARGV ) {
my $package = $module;

# From This::That to This/
s/::/\//g, s/$/.pm/ for $module;

if ( require $module ) {
print $package . " => " . $INC{$module} . "\n";

I called this 'p5which'.
perl  devel  library  PERL5LIB  whereis  wherefrom  annoyance  dammitbrain  solution  module 
february 2018
gist:e3896a4a96e931fa7c61 · GitHub |
<code class="language-perl">#!/usr/bin/perl
use warnings;
use strict;
use Class::Load qw( try_load_class );
use Carp qw();
use Package::Stash;

for my $module ( @ARGV ) {
if ( not try_load_class( $module ) ) {
printf "Can't load %s\n";
Carp::carp $Class::Load::ERROR;
printf "%s ( Version %s ) => %s\n",
$INC{ Class::Load::_mod2pm( $module...
perl  PERL5LIB  script  utility  library  whereis  wherefrom  maybesolution 
february 2018
gist:e3896a4a96e931fa7c61 · GitHub |
<code class="lang-perl">#!/usr/bin/perl
use warnings;
use strict;
use Class::Load qw( load_optional_class );

for my $module ( @ARGV ) {
next unless load_optional_class( $module );
printf "%s => %s\n", $module, $INC{ Class::Load::_mod2pm( $module ) };
perl  PERL5LIB  library  script  sysadmin  maybesolution 
february 2018
« earlier      later »
per page:    204080120160

Copy this bookmark:

to read