Posts

parallel processing - bash: running script on multiple directories simultaneously -

let's have multiple directories: nmg_1, nmg_2,..., nmg_5 . each of these directories contains 2 subdirectories: fol, unf . in each of subdirectories there text file. so, have script: run.sh , read line of text files in each subdirectory , output file. thus, wondering, there way run script in parallel, is, script run in multiple subdirectories @ once? given run.sh required processing on 1 text file @ time, following command keep 4 parallel bash sessions alive: find -name "*.txt" -print0 | xargs -n 1 -p 4 -0 -i {} bash run.sh {} from man xargs : --max-procs=max-procs, -p max-procs run max-procs processes @ time; default 1. if max-procs 0, xargs run many processes possible @ time. use -n option -p; otherwise chances 1 exec done.

How to do a for with fades in jquery? -

suppose have div: <div id="blink">blink</div> and want blink 3 times. this ugly code that : var t = animationtime = 600; $("#blink").fadeout(t).fadein(t).fadeout(t).fadein(t).fadeout(t).fadein(t); but if want blink ten times? how can loop fades? thanks in advance. animation on same element gets added queue, add them in loop! @:) for (var = 0; < 10; i++){ $("#blink").fadeout(t).fadein(t); } jsfiddle: http://jsfiddle.net/trueblueaussie/22bpkhtf/2/

Boilerpipe import error in python -

i have installed boilerpipe , jpype in python getting error while importing boilerpipe >>> import boilerpipe traceback (most recent call last): file "<pyshell#0>", line 1, in <module> import boilerpipe file "c:\python27\lib\site-packages\boilerpipe\__init__.py", line 10, in <module> jpype.startjvm(jpype.getdefaultjvmpath(), "-djava.class.path=%s" % os.pathsep.join(jars)) file "c:\python27\lib\site-packages\jpype1-0.6.0-py2.7-win32.egg\jpype\_core.py", line 50, in startjvm _jpype.startup(jvm, tuple(args), true) runtimeerror: unknown exception how can solve issue? thanks in advance

javascript - Unit Test a AngularJS Directive's Controller (Karma, Chai, Mocha) -

having trouble reaching directive's scope unit test. getting generic compile errors when trying run unit test. my app compiles ( gulp ) , runs fine, , can unit test non-directive's fine well. not sure how test's work directive, trying other people's solutions educated guesses. main page's html , js <div company-modal="companyoptions" show-close="false"></div> . (function() { 'use strict'; angular .module('app') .controller('companymodalctrl', ['$scope', selectionpage]); function selectionpage($scope) { $scope.companyoptions = {}; } })(); here first portion of directive (it big including important-top part. (function() { 'use strict'; angular .module('app') .directive('companymodal', companymodal ); function companymodal() { return { restrict: 'a', replace: fal...

How to concatenate two class arrays to an allocated space in c++ -

i have 2 class arrays, each 1 pointer pointed to. wonder possible concatenate these 2 arrays new allocated space. in mind std::copy(). possible use copy()? or other idea? just create new array , iteratively copy each old array new array using loops

javascript - Index-Id always has the same value for every input -

so have dynamically created form index-id of inputs names championspell[] need know 1 thought of using index-id changes every inputs index same value when pressing add spell button. can test problem here http://89.69.172.125/test.php $(function() { $('body').on('click', '#addspell',function() { $( '<p><select name="change[]" id="change[]" onchange="val(this)"><option value="passive">passive</option><option value="q" selected>q</option><option value="w">w</option><option value="e">e</option><option value="r">r</option></select><label for="var"><input type="text" id="championspell[]" name="championspell[]" data-id="" readonly="true"><br><textarea type="text"...

Change width size using CSS when window size is reduced -

in general, want body div 60% width of window size. there exceptions. on large monitor, gets big, have set max-width of 800px, so: #lbp-text-body {margin-top: 100px; width: 60%; max-width: 800px; text-align: justify} this works pretty good, text adjusts within range, @ max threshold holds shape. now want similar small window sizes. i've added 'min-width: 300px;' , seems seems override width 60%, however, if screen size less 300px, user have scroll horizontally see part of text. i prefer actual width size change 90% or 100% after viewer size hits 300px threshold. any ideas on how this? you can use media query achieve this: js fiddle example @media screen , (max-width: 300px) { #lbp-text-body { // whatever styles want have @ 300px or less } } you can use media-queries have specific styles if window greater specific width using min-width . @media screen , (min-width: 800px) { #lbp-text-body { // whatever styles want have @ 800p...