Posts

python - ImportError: DLL load failed when importing Numpy installed in conda virtual environment -

in windows, created conda virtual environment command conda create -n test python=2.7 pandas scipy matplotlib numpy once created, activated virtual environment , went python interpreter. when trying import numpy, following error: >>> import numpy traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\anaconda3\envs\test\lib\site-packages\numpy\__init__.py", line 180, in <module> . import add_newdocs file "c:\anaconda3\envs\test\lib\site-packages\numpy\add_newdocs.py", line 13, in <module> numpy.lib import add_newdoc file "c:\anaconda3\envs\test\lib\site-packages\numpy\lib\__init__.py", line 8, in <module> .type_check import * file "c:\anaconda3\envs\test\lib\site-packages\numpy\lib\type_check.py", line 11, in <module> import numpy.core.numeric _nx file "c:\anaconda3\envs\test\lib\site-packages\numpy\core\__init__.py", l...

multithreading - GUI with c++. lagged when i use button -

am new in c++ gui, modifying code sent machine me, want make while loop when click button, tried thread , still stuck. void cdlgwriteepc::loop() { // } void cdlgwriteepc::onbnclickedok() { std::thread loadingthread(&cdlgwriteepc::loop, this); loadingthread.join(); } join blocks current thread until other thread done, that's no help. should start worker thread, return , worker thread should send kind of message when it's done. the function names in example code seem it's msvc++ mfc application we'll work that. simply put, windows gui applications event driven, each time event happens wm_message sent. framework receives these messages , calls appropriate functions handle it. can define our own messages , message handlers. way worker thread can send such messages framework , call our handler function. wm_app defined starting point private user messages, there won't conflict existing system messages. ( https://msdn.microso...

apache - How do you run a Lucene fuzzy query only on the non-nummeric part of a string? -

i want run fuzzyquery on string may or may not contain numeric characters in it. want query not match on edits numeric characters. instance if fed in "123abc" want matches still contain "123" in beginning. expect matches "123abg" "123ab" "123cbc" not want "124abc".

jquery - Bootstrap modal when activated inside tab -

wanted see if me. have edit button sits inside table sits inside bootstrap tabs. when click edit link display modal window doesnt work. however, when move same edit link outside of tabs, works charm. think has way bootstrap utilizes jquery work tabs. i'm jquery beginner don't have enough knowledge figure out. any appreciated link invoke modal <li><a href="#" class="btn btn-xs btn-primary" class="edittodo" data-toggle="modal" data-target="#edittodomodal"><span class="glyphicon glyphicon-pencil"></span></a></li> modal code <div class="modal fade" id="edittodomodal" tabindex="-1" role="dialog" aria-labelledby="edittodomodal"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button typ...

partials - First argument in form cannot contain nil or be empty, rails -

attempting use form_for, have been getting error "first argument in form cannot contain nil or empty." error highlited in first line: <%= form_for @item |f| %> #------error highlited here <%= f.label :task %> <%= f.text_field :name, placeholder: "what have do?" %> <% end %> partial: <%= form_for @item |f| %> <%= f.label :task %> <%= f.text_field :name, placeholder: "what have do?" %> <% end %> controller: ``` class itemscontroller < applicationcontroller def index @items = item.all end def new @item = item.new end def create @item = item.new @item.name = params[:item][:name] @item.user = current_user if @item.save flash[:notice] = "item added; go accomplish it!" else flash.now[:alert] = "uh oh, didn't save. try again." render :new end end def show @item = item.fi...

matplotlib - Plotting bar graph with the range in the x- axis -Python -

suppose have data such following, want plot bar graph show each value of range separate bar in x-axis , count in yaxis. range count 0 0-2 172 1 02-05 82 2 05-10 117 3 10-15 164 4 15-20 141 5 20 , above 380 i tried following, plt.bar(a['range'], a['count'], color='blue') but getting following error, valueerror: invalid literal float(): 0-2 i tried converting string. still result same. can me in plotting here? thanks if @ documentation plt.bar , need specify first argument left edges of bars want, not labels. , specify xtick labels, need use plt.xticks function. this: plt.bar(range(len(a['count'])), a['count'], color='blue') plt.xticks(range(len(a['count'])), a['range'])

Web Audio Api biquadFilter in Android needs extra configuration? -

here says web audio api works in chrome android, , here have tested cm browser, chrome , cyanogenmod default android 5.1.1 browsers, , pass tests (specially biquadnode one). but when open this codepen eq (biquadnode), can hear music not eq working. does biquadnode works in android? special implementation needed? *code pen required post var context = new audiocontext(); var mediaelement = document.getelementbyid('player'); var sourcenode = context.createmediaelementsource(mediaelement); // eq properties // var gaindb = -40.0; var bandsplit = [360,3600]; var hband = context.createbiquadfilter(); hband.type = "lowshelf"; hband.frequency.value = bandsplit[0]; hband.gain.value = gaindb; var hinvert = context.creategain(); hinvert.gain.value = -1.0; var mband = context.creategain(); var lband = context.createbiquadfilter(); lband.type = "highshelf"; lband.frequency.value = bandsplit[1]; lband.gain.value = gaindb; var linvert = context.crea...