Posts

node.js - Where i should keep my libs for testing with mocha in nodejs? -

i need test nodejs module, writes data output. wrote debugstream stream collect output data assert later: function debugstream () { stream.writable.call(this); this.data = ''; }; util.inherits(debugstream, stream.writable); debugstream.prototype._write = function (chunk, encoding, done) { this.data += chunk; done(); } debugstream.prototype.getdata = function () { return this.data; } i not want write code in every test file. nice move away somewhere, can't how organize it. can't place in test/ folder, because mocha think it's test. how that? under tests can create folders , node modules, treat tests subproject in folder required modules , tools, check example: https://github.com/edsadr/change-api/tree/master/test

android - Unable to apply plugin: 'dexguard' at build.gradle file -

i've below error when add apply plugin: 'dexguard' main module's build.gradle file. error:unable load class 'com.android.build.gradle.baseplugin$postcompilationdata'. possible causes unexpected error include: you using jdk version 'java version "1.7.0_67"'. versions of jdk 1.7 (e.g. 1.7.0_10) may cause class loading errors in gradle. please update newer version (e.g. 1.7.0_67). open jdk settings gradle's dependency cache may corrupt (this occurs after network connection timeout.) re-download dependencies , sync project (requires network) the state of gradle build process (daemon) may corrupt. stopping gradle daemons may solve problem. stop gradle build processes (requires restart) your project may using third-party plugin not compatible other plugins in project or version of gradle requested project. in case of corrupt gradle processes, can try closing ide , killing java processes. my project's bu...

mysql - play 2.4 connect to remote database -

i'm new play , scala, using latest play 2.4.x. want connect mysql through remote ip following configuration in application.conf db.default.driver="com.mysql.jdbc.driver" db.default.url="jdbc:mysql://10.0.1.32:3306/scala_test_db" db.default.username="scalauser" db.default.password="test" in build.sbt "mysql" % "mysql-connector-java" % "5.1.36" but jdbc trying connect local ip. following error got java.sql.sqlexception: access denied user 'scalauser'@'10.0.0.224' can me how connect remote ip? your configuration looks fine. error message told mysql user 'scalauser'@'10.0.0.224' has no access. means app connecting database 10.0.0.224. i guess need add new database user. grant usage on scala_test_db.* 'scalauser'@'10.0.0.224'; flush privileges; check mysql docs: http://dev.mysql.com/doc/refman/5.6/en/grant.html

c++ - Sending QStringList between classes using signals and slots -

i have gui built using qt creator. @ point dialog window opened need send variable of type qstringlist. using signals , slots method. however, variable empty once sent. here code samples: widget.h class widget : public qwidget { q_object public: explicit widget(qwidget *parent = 0); ~widget(); signals: void mysignal(qstringlist); }; widget.cpp widget::widget(qwidget *parent) : qwidget(parent), ui(new ui::widget) { // blah blah } widget::~widget() { delete ui; } void widget::on_pushbutton_4_clicked() { qstringlist dlist; int damount = ui->listwidget->count(); for(int i=0; < damount; i++){ dlist << ui->listwidget->item(i)->text(); qdebug() << dlist; } emit mysignal(dlist); mysaver mdialog; mdialog.setmodal(true); mdialog.exec(); } mysaver.h (the dialog box) class mysaver : public qdialog { q...

c# - Get system path from rewritten URL -

given rewritten url string: /contact-us i convert it's actual path, example: /pages/contact/contact-us-page.aspx is possible? please note, i'm not asking how re-write url's, how convert re-written path it's actual file in code.

Character array in c with function -

i have problem character array in c program. the program shutdown when run it. think problem somewhere passing character array in function. here's code: #include<stdio.h> #include<string.h> #define dagen 7 void inlezen(int[][dagen], char[][12]); int main(void) { int i; int temp[1][dagen]; char dagen[7][12]; strcpy(dagen[0], "ma"); strcpy(dagen[1], "di"); strcpy(dagen[2], "woe"); strcpy(dagen[3], "do"); strcpy(dagen[4], "vr"); strcpy(dagen[5], "za"); strcpy(dagen[6], "zo"); inlezen(temp, 1, dagen, dagen, 7, 12); } void inlezen(int t[][dagen], char d[][12]) { int i; (i = 0; < dagen; i++) { printf("geef de temperatuur overdag van %s", d[i]); scanf("%d%*c", &t[0][i]); } (i = 0; < dagen; i++) { printf("geef de temperatuur 's avonds van %s", d[i]); ...

symbol table not found debugging python + C -

i have c module, compiled -g option, using of functions of module using python script. when run command - gdb -ex r -args python test.py it shows- reading symbols /usr/bin/python2.7...reading symbols /usr/bin/python2.7...(no debugging symbols found)...done. (no debugging symbols found)...done. and while using gdb command list throws - no symbol table loaded. use "file" command. what potential reason..? what potential reason.. the reason /usr/bin/python2.7 compiled without debug symbols, , c module has not yet been dynamically loaded. one way deal set deferred breakpoint on module initialization code. once hit breakpoint, list start working.