Posts

javascript - XML request in jQuery gets ignored -

i have build webpage focuses lot on xml file populate it. generated second 1 additional tasks. unfortunatly, everytime try parse it, dows not succeed. i using simple code demonstrate problem. stripped function, writing strings browser console. once excecute code, "pos1, pos3, pos4" success function not excecuted. know sounds dumb question, hard me, find mistake right now. function insertfirstbeginnerquestion(){ console.log('pos1'); $.ajax({ url: 'xml/questions.xml', type: 'get', datatype: 'xml', success: function(data) {console.log('pos2');}, error: function(){console.log('pos3');}, }); console.log('pos4'); }; are trying in server? code works me , loads xml properly. http method, have deploy in server , access using http protocol. otherwise give 404 error while trying load xml file.

java - Extrating data from jsp form to controller and saving them to database -

hello trying save data form database have no idea how continue now. have following code. i tried using request.getparameter("id") in controller gave me compiler error. so how data jsp form controller , save them mysql database ? jsp file <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> <form action="productcontroller" method="post"> <p>enter product name :</p> <input id="productname" type="text" name="username"> <br> <p>enter product serial number :</p> <input id="serialnumber" type="p...

gulp-notify - get file name, not whole path, with error -

i'm using gulp-notify , gulp-plumber catch errors gulp-sass , notify me before throws error in gulp , stops whole build process. however, error shown gulp-notify isn't particularly helpful...it contains whole path file error; know path file is, need know file name , line number (and column number added not necessary bonus), , actual error message. here code: gulp.task('styles', function () { var onerror = function(err) { notify.onerror({ title: "gulp", subtitle: "build error!", message: "<%= error.message %>", sound: "beep" })(err); this.emit('end'); }; gulp.src('assets/styles/source/style.scss') .pipe(plumber({errorhandler: onerror})) .pipe(sass({ style: 'compressed', errlogtoconsole: false })) .pipe(gulp.dest('assets/styles/build')) .pipe(autoprefixe...

sql - How to handle errors in a select statement when attempting an insert or fail? -

is there way handle errors in select statement when attempting insert or fail? specifically, want insert elements table, select statement used generate these elements failing. have elements select statement succeeded inserted, overall statement fail. thought insert or fail this, not. more specifically, imagine if defined new sqlite function "log" #include <string> #include <sqlite3ext.h> #include <cmath> sqlite_extension_init1 extern "c" { int sqlite3_log_init( sqlite3 * db, char ** err, sqlite3_api_routines const * const api ); } // compute log of input void mylog( sqlite3_context *context, int argc, sqlite3_value **argv ){ // grab number auto num = sqlite3_value_double(argv[0]); // if positive, take log if(num > 0.) sqlite3_result_double(context, log(num)); // otherwise, throw error else { auto msg = std::string("can't take log of nonpo...

android - Can I determine my app's buildType in my build.gradle at run time? -

i need able bump versioncode particular buildtype called " release_beta ". have function bumps fine. i've discovered buildtypes doesn't let override versioncode. also, i'm running lot of different flavors. not want handle versioncode in more flavor variants. this not allowed. buildtypes { release_beta { minifyenabled false testcoverageenabled false signingconfig signingconfigs.release_beta versioncode buildversioncode() } the options see left are can determine build type @ runtime in build.gradle , , conditionally set versioncode depending on buildtype . i.e debug vs release_beta. something like... defaultconfig{ if(buildtypes.name == "release_beta"){ versioncode buildversioncode() }else{ versioncode 99999999999 } } can have config besides defaultconfig , , apply build type, can set different versioncode release_beta buildtype. something like... ...

sql - MySQL getting data + recursive query -

i have got 3 tables: +-----+----------+ +-----+----------+-------+ +-----+----------+-------+ | id | a_id | | a_id| b_id | value | | b_id| b_id_ | value | +-----+----------+ +-----+----------+-------+ +-----+----------+-------+ | 1| 5| | 5| 1| aa| | 1| 2| zzxx| +-----+----------+ +-----+----------+-------+ +-----+----------+-------+ | 2| 3| | 3| 3| bb| | 2| | vvyy| +-----+----------+ +-----+----------+-------+ +-----+----------+-------+ | 3| 4| bbll| +-----+----------+-------+ | 5| | oopp| +-----+----------+-------+ | 4| 5| mmnn| +-----+-----...

javascript - Which files should provided with node application to prod -

i've create nodejs application , i'll need ship ,my question if need following: node modules test folder should put both in gitigonre file , if in addition should additional actions on application you should .gitignore node_modules , npm install in every environment separately. need folder run. you don't need test folder run app though. might want test app in production environment though, depends on needs.