Posts

c++ - what's wrong with std::remove_if in this code -

solution.cc:14:47: error: no matching function call 'remove_if(std::basic_string::iterator, std::basic_string::iterator, )' #include <iostream> #include <algorithm> using namespace std; int main() { /* enter code here. read input stdin. print output stdout */ string s; std::getline(cin, s); std::transform(s.begin(), s.end(), s.begin(), ::tolower); std::remove_if(s.begin(), s.end(), isspace); // cout<<s; int len=s.length(); len=len+90; bool temp; bool value[len]; for(int i=0;i<len;i++) { int x=(int)s[i]; if(value[x]!=1) value[x]=1; } for(int i=65;i<=90;i++) if(value[i]==1) {temp=true;continue;} else {temp=false;break;} if(temp) cout<<"pangram"<<endl; else cout<<"not pangram"<<endl; return 0; } i tried compiling code in g++ 4.9.1 . exact error is: in function int main() : error: no...

NameError: global name 'unicode' is not defined - in Python 3 -

i trying use python package called bidi. in module in package (algorithm.py) there lines give me error, although part of package. here lines: # utf-8 ? need unicode if isinstance(unicode_or_str, unicode): text = unicode_or_str decoded = false else: text = unicode_or_str.decode(encoding) decoded = true and here error message: traceback (most recent call last): file "<pyshell#25>", line 1, in <module> bidi_text = get_display(reshaped_text) file "c:\python33\lib\site-packages\python_bidi-0.3.4-py3.3.egg\bidi\algorithm.py", line 602, in get_display if isinstance(unicode_or_str, unicode): nameerror: global name 'unicode' not defined how should re-write part of code works in python3? if have used bidi package python 3 please let me know if have found similar problems or not. appreciate help. python 3 renamed unicode type str , old str type has been replaced bytes . if isinstance(unicode_or_str, s...

r - {plotrix} - gap.plot - colors and background of points -

Image
i using gap.plot function plotrix package. have following points: circles in black (often written pch=21, col="black" ) with background in chosen color (e.g. col="red" ) however, doesn't seem work on gap.plot : the col set color black but bg not fill background of points chosen color (strangely, color "cut" part of plot, see below). here code, showing various attempts following reading of this link , that link . edit: better description of question problems are: gap.plot() attempts not have red background points() gives black circle red background, "y" value false (normally y=12.5, here y=21 instead; because of gap). do know how obtain black circle filled color? library(plotrix) x=seq(from=0,to=18,by=2) y=rep(15,10) cex=1 ## plots x11() # gap.plot() pch=21 col="black" bg="red" gap.plot(x,y+2.5, gap=c(1,9), gap.axis="y", xlim=c(0,25), ylim=c(0,25), type="b",cex=c...

version control - Git and Dropbox, gitignore trouble -

me , team have been trying set version control repository in dropbox, we've run strange snag, not sure if it's because of dropbox or not, gitignore file being, well, ignored. we're working on windows 7, , we've tried of fixes we've found on .gitignore not working seems none help, guys have ideas on fix, or recommend version/source control plays dropbox? git , dropbox technologies don't play together. in git, local , on purpose. means can locally make changes, commit when done , push in shared place, others can access it. how source code developed. dropbox more writing , sharing documents. not have control shared others, dropbox continuously syncs. can lead coworker getting changed file you, breaks work. furthermore can no longer make use of branches, coworkers have same dropbox folder, ergo working tree , means have same branch. no way user test on local branch. you should ask question whether developing documents (text, spreadsheet, etc.) or...

text to speech - Docker espeakbox: What do I do now? -

seems real simple, i'm not sure now. have docker on osx , i'm want try out espeakbox. ran the command mentioned here . to "run container " it's evidently running: bash-3.2$ docker ps container id image command created status ports names 705a605786c7 parente/espeakbox "/server" 34 seconds ago 33 seconds 0.0.0.0:8080->8080/tcp espeakbox so, do now, use see it, hear it, etc. thanks. there's full instructions on github page, i'm loath answer question. however, i'm assuming confusion you're not sure container running. if you're using boot2docker, do: $ curl http://$(boot2docker ip):8080/speech?text=hello i assume sends mp3 file. basically, docker run command told docker forward port 8080 on container port 8080 on host. when using boot2docker, host virtualbox vm, need use ip of vm connec...

Use specific jvm installation when call java application from php code -

i have 2 installations of jdk on account , not have root access change default 1 "usr/bin/java" specific 1 /home/username/jdk/bin/java" i tried following in php code: $java_home = "/home/username/jdk"; $path = "$java_home/bin:".getenv('path'); putenv("java_home=$java_home"); but when execute following below above mentioned lines: which java i got /usr/bin/java any idea please how make works? java application want run php code not work on default one. thanks if feasible, qualify java command, e.g. /home/username/jdk/bin/java , when running java program. this way can use multiple different jvm's in different places of php code. note: know using qualified access works on windows, if java_home points different installation. i'm assuming same true linux.

configuration - Can I get Kronos-Haskell to use my Haskell platform? -

kronos-haskell installs self-contained application , can exist (as near can tell) alongside installation of haskell platform without issues or interactions. nice feature, use current version of haskell, along additional packages i've installed haskell platform. is there way kronos-haskell use installation of haskell platform? you can build ihaskell using recipe readme : git clone http://www.github.com/gibiansky/ihaskell cd ihaskell ./macos-install.sh note - might take while there ton of dependencies.