Posts

c++ programming function error -

my full code (couldn't make smaller) : /*password admin*/ #include <iostream> #include <fstream> #include <algorithm> #include <string> using namespace std; //------------------------------- fstream d_base; char path[] = "library books.txt"; void output(){ //this function displaying choices cout << "***********************************" << endl; cout << "1. list books in library" << endl; cout << "2. list available books borrow " << endl; cout << "3. borrow book library" << endl; cout << "4. search book" << endl; cout << "5. add new books"<< endl; cout << "6. delete book" << endl; cout << "7. exit library"<< endl; cout << "***********************************" << endl; } //=======================================================================...

ruby on rails - Capybara "can't find" text field, yet fills it in -

in integration specs, log users in this: fill_in "session_email", :with => user.email fill_in "session_password", :with => password click_button "submit" capybara fails tests unable find field "session_email" . strange thing is, fills in fields , logs user in (i can see output sessions controller, , when use selenium can see working). tests fail. the log-in thing opens in bootstrap modal. i'm using capybara (2.1.0) , capybara-webkit (1.0.0). has else experienced this? what's solution? i had similar issue, , switching capybara-webkit fixed me. using bootstrap well, not sure if selenium doesn't bootstrap or what, webkit worked me

linux - Translating a vimrc to Windows -

i installed vim windows, , trying port vimrc linux. the bash script in vimrc need make work follows : set nocompatible source $vim behave mswin let icanhazvundle=1 let vundle_readme=expand('$vim/bundle/vundle/readme.md') if !filereadable(vundle_readme) echo "installing vundle..." echo "" silent !mkdir $vim/bundle silent !git clone https://github.com/gmarik/vundle $vim/bundle/vundle let icanhazvundle=0 endif " required vundle filetype off set rtp+=$vim/bundle/vundle/ call vundle#rc() " let vundle manage vundle " required! bundle 'rip-rip/clang_complete notice checks see if vundle packages have been installed or not(based on existence of readme), , installs them if not. included first bundle call give idea of how executes. difference in code below , original linux script replaced entries linux file system: ~/.vim $vim . when run :echo $vim in windows vim terminal gives me proper path. script runs, fails c...

unix - Regex & ls or find -

i need select directories between periods of 2014 0729 - 2014 0921 . the directories this. 20140729_154208 20140814_221350 20140829_215623 what best method this? thanks using find in order find files modified within range, if creation time of last file in directory matches directory name , easiest way create files @ boundaries of range , use -newer predicate. touch -t 201407290000 start touch -t 201409210000 stop find . -newer start \! -newer stop -type d (i know not how work dates within regex , hope have time learn) using awk yeah, why not using awk instead of building static regex match case? pass find or ls result awk little program checking result between stop , start (nb: find had substr(3,10) comparison): find . |awk -v start=20140729 -v stop=20140921 \ '{ curr=substr($0, 3, 10); if (curr <= stop && curr >= start) { print $0 } }' (it worked me on aix , linux )

Powershell - converting hex from the registry key -

i have following output mru list. how can convert string or ascii characters? 'gp "hkcu:\software\microsoft\windows\currentversion\explorer\comdlg32\lastvisitedpidlmru"' 18 : {80, 0, 120, 0...} 5 : {50, 0, 109, 0...} assuming gp "hkcu:\software\microsoft\windows\currentversion\explorer\comdlg32\lastvisitedpidlmru" gives : pspath : microsoft.powershell.core\registry::hkey_current_user\software\microsoft\windows\currentversion\explorer\comdlg32\lastvisitedpidlmru psparentpath : microsoft.powershell.core\registry::hkey_current_user\software\microsoft\windows\currentversion\explorer\comdlg32 pschildname : lastvisitedpidlmru psdrive : hkcu psprovider : microsoft.powershell.core\registry mrulistex : {14, 0, 0, 0...} 11 : {114, 0, 117, 0...} 9 : {69, 0, 120, 0...} 19 : {83, 0, 107, 0...} 10 : {78, 0, 79, 0...} 17 : {123, 0, 57, 0...} 15 : {115, 0...

(Excel-VBA) Specific data import (on the background) in the active sheet -

would please me (total beginner) prepare vba macro open sheet on background , import specific selection shown below: let's have downloaded wordcount analysis (xlsx) this downloaded cat tool testing. now need add macro main sheet read lines starting (column a) "all". if "all" i'd need record columns of line (specficilly columns - o) in array / hashtable?. please take @ this image summs (better explaining me :-) let me know in case need know more details. all tips / suggestions appreciated. many thanks! my suggestion (i'm beginner too) use macro recorder. great tool learn ( example ). start recording filter 'all' copy/past cells stop recording then have @ recorded code , adjust :)

python - Heroku refuses connection to postgres database -

i trying deploy flask app based on postgresql on heroku, when try create table db.create_all() keep getting error: (psycopg2.operationalerror) not connect t rver: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5432? here how code looks like: app=flask(__name__) app.config['sqlalchemy_database_uri']='postgres://kfgriimpfjecsv:bk1*****g@localhost:5432/dd71doth8gopgh' db=sqlalchemy(app) if __name__ == '__main__': app.debug=true app.run() i using heroku toolbelt communicate heroku servers. also, when try this: psql -p 5432 -h localhost i same error: psql: not connect server: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5432? i tried ec2-23-21-215-184.compute-1.amazonaws.com instead of localhost in uri, got same error. and here complete traceback when run db.create_all(): ...