Posts

c# - OneDrive SDK Demo itemNotFound Error -

i trying demo onedrive sdk provided mvc application, here source: github onedrive-webhooks-aspnet . having trouble running app. the problem happens after sign in, line in file "controllers/subscriptioncontroller" throws onedriveexception: var appfolder = await client.drive.special["approot"].request().getasync(); the errocode "itemnotfound" , errormessage "the application id not exist." in exception. search on found little. there issue in git space author answered own question blaming onedrive broken. i hope here @ stackoverflow can me it, much. ok, turned out simple configuration mistake. in web.config appsettings section, value of "ida:msascopes" "files.readwrite", while current onedrive api permission should "onedrive.readwrite". i new api, guess api updated after sample written. after all, hope may others have problem, , general, don't trust default values much.

sql server - What Registration Properties are needed to get Database Workbench up and running? -

i database workbench fan way back, bizarrely have not used quite awhile. i downloaded trial version , trying "register server" first step. the problem don't know use properties. need know: alias host instance "use sql server authentication" checked: username password i've tried guess way through needed where, nothing has worked. i can connect database in (c#) code connection string: "server=platypussql42;database=duckbilldata;uid=youinnocentdog;pwd=contrasena;connection timeout=0"; and have tried these values: alias: dbwbsqlserver host: platypussql42 instance: duckbilldata username: youinnocentdog password:contrasena ..and this: alias: platypussql42 host: duckbilldata instance: username: youinnocentdog password:contrasena ...but both of them, get, " [dbnetlib][connectionopen (connect()).]specified sql server not found. " what values needed? the instance not database in server connecting to....

mysql - SQL query with two different ids -

i need prevent photo_order field exceeding number of photos being associated article. have this, doesn't work. table name has been used 2 times , wrong. update articles_photos set photo_order = if(photo_order < (select count(id) articles_photos article_id = 12), photo_order + 1, 1) id = 26 how can fix above query? database mysql. i assume error getting: you can't specify target table 'articles_photos' update in clause here's 1 work around using cross join subquery: update articles_photos ap cross join (select count(id) cnt articles_photos article_id = 12) temp set ap.photo_order = if(ap.photo_order<temp.cnt,ap.photo_order+1,1) ap.id = 26; sql fiddle demo

c++ - field initializer is not constant g++ 4.8.4 -

i tried compile following code on laptop, using g++ 4.8.4: #include <algorithm> #include <iostream> #include <initializer_list> #include <tuple> struct storage { static const int num_spatial_subset = 8; static constexpr std::initializer_list<std::initializer_list<double>> vectors{ {0,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0,0}, {1,1,1} }; double storage[num_spatial_subset][vectors.size()]; }; int main() { } and got error message: error: field initializer not constant constexpr std::initializer_list< std::initializer_list<double> > vectors{ {0,0,0}, {0,1,0}, {0,0,1}, {1,1,0}, {1,0,1}, {0,1,1}, {1,0,0}, {1,1,1} }; however, copy/paste same code on coliru (g++ 6.1.0), same compilation parameters , worked. can tells me wrong please ? thank you. actually, pointed out chris , baum, updating g++ 4.9 fixed it.

python - Can a Django application authenticate with MySQL using its linux user? -

the company work starting development of django business application use mysql database engine. i'm looking way keep having database credentials stored in plain-text config file. i'm coming windows/iis background vhost can impersonate existing windows/ad user, , use credentials authenticate ms sql server. as example: if django application running apache2+mod_python on ubuntu server, sane add "www-data" user mysql , let mysql verify credentials using pam module? hopefully of makes sense. in advance! mysql controls access tables own list of users, it's better create mysql users permissions. might want create roles instead of users don't have many manage: admin, read/write role, read-only role, etc. a django application runs web server user. change "impersonate" ubuntu user, if user deleted? leave "www-data" , manage database role way.

performance - Matlab: How to speed up integration (int) for computing Arc lengths? -

as part of code build geometry meshing, calculating 2d arc lengths integration. below sample code that: fun=@(ss)integral(@(t)sqrt((r0+a1*cos(1*t)+a2*cos(2*t)+a3*cos(3*t)+a4*cos(4*t)+a5*cos(5*t)+a6*cos(6*t)+a7*cos(7*t)+a8*cos(8*t)).^2 ... + (-a1*1*sin(1*t)-a2*2*sin(2*t)-a3*3*sin(3*t)-a4*4*sin(4*t)-a5*5*sin(5*t)-a6*6*sin(6*t)-a7*7*sin(7*t)-a8*8*sin(8*t)).^2),0,ss); integration on 't' , other parameters constant (i.e. r0, a1, etc) but integration takes long time, , since try many different geometries great if can find way around speed integration takes bit long. how can compute same integral in more quicker way?

javascript - Angular http$ response for text/plain file download fails with SyntaxError: Unexpected number in JSON -

i have implemented download file feature on angular-based client , node.js backend based on following solution: https://stackoverflow.com/a/20904398/1503142 . in general works, receive "syntaxerror: unexpected number in json @ position x" combined "typeerror: cannot read propery 'messages' of undefined". a few observations: everything appears working on node server-side, because response @ client. error in question reported client; no errors reported server. the log file consists of time stamp, basic log information text. text contains ascii characters using postman, response works every time, lends idea http$ code might having issue response. postman's response header information indicates response content-type->text/plain; charset=utf-8. i using angularjs v1.2.21 , node v0.12.13 here's client-side code: $http({ method: 'get', url: "/api/logging/logfiles/" + logfile, headers: { 'content-type'...