Posts

oracle - SQL query to get current and last year sales -

i have following table sales: date store sales 1/1/2015 st01 12123 1/1/2015 st02 3123 1/1/2016 st01 4213 1/1/2016 st03 2134 when try self join year , last year sales closed store not showing up. result should this: date store year sales last year sales 1/1/2016 st01 4213 1212 1/1/2016 st02 0 3123 1/1/2016 st03 2134 0 my query follows: select cy.date, cy.store cy.sales, ly.sales sales cy, sales ly cy.store(+) = ly.store(+) , ly.date = cy.date - 365 oracle setup : create table sales ( "date", store, sales ) select date '2015-01-01', 'st01', 12123 dual union select date '2015-01-01', 'st02', 3123 dual union select date '2016-01-01', 'st01', 4213 dual union select date '2016-01-01', 'st03', 2134 dual; query : select trunc( sysdate, 'yy' )...

javascript - Async .eachLimit callback Error not called -

i following code in node.js project. async.eachlimit(dbresult, 1, function (record, callback) { var json = json.stringify(record) var form = new formdata() form.append('data', json) form.submit(cfg.server + '/external/api', function (err, res) { if (err) { callback(err) } if (res.statuscode === 200) { connection.query('update selected_photos set synced = 1 selected_id = "' + record.selected_id + '"', function (err, result) { if (err) { console.log(err) callback(err) } else { callback() } }) } else { console.log(res.statuscode) return callback(err) } }) }, function (err) { // if of file processing produced error, err equal error if (err) { // 1 of iterations produced error. // processing stop. console.log('a share failed process. try rerunning offline sync') process.exit(0) } else { console.log(...

.net - The file Form1 cannot be modified at this time -

opening visual studio 2015 project , in design-time modifying form designer or code error: ------------------ microsoft visual studio --------------------------- file c:\tfs...\form1.cs cannot modified @ time. --------------------------- ok --------------------------- its bug discussed here https://github.com/dotnet/roslyn/issues/4039 , solutions not applicable: a) convert workspace local workspace. it local workspace. b) check-out form before opening in designer/code editor. it checked out. in addition msdn article: the designer cannot modified @ time not applicable: c) ensure file not marked read-only , solution not running. the file read/write , solution not running. i've been experiencing same problem after converting server workspace local workspace. deleting vssscc file may best option i'll document did. checked in file in question. opened visual studio 2015 command prompt , ran: tf lock /lock:none /workspace:dev02l...

android - How to update Listview from background service -

i have background service downloading image server.i want update ui or listview when download finished.want change text on button "downloaded". please me out in advance either can through broadcast background service received main thread activity. onrecieve() method can update listview updating model , calling notifydatasetchanged() of adapter. example of broadcast reciever http://www.tutorialspoint.com/android/android_broadcast_receivers.htm or can pass handler of main thread service usnig intent , can update main thread or listview posting message on main thread using handler. example of handler https://developer.android.com/training/multiple-threads/communicate-ui.html

php - laravel 5.2 set attribute name -

how set custom attributte names in laravel 5.2 try code, doesn't work: $attnames = array( 'code' => 'número', 'contributor' => 'nº contribuinte', 'create_date' => 'data criação', 'address' => 'morada', 'zip_code' => 'cod. postal', 'city' => 'localidade', 'email' => 'e-mail', 'phone_number' => 'telefone', 'note' => 'observações', ); $validator = validator::make($client, $this->rules,[],$attnames); $validator->setattributenames($attnames); if ($validator->fails()) { // send page input data , errors $errors = $validator->messages(); return redirect::to('/client/create')->withinput()->witherrors($errors); } you have passed wrong arguments validator::make . you...

stata - Evaluating the Fractional Logit Model - McFadden's Adjusted R^2 -

i estimating model dependent variable fraction (between 0 , 1). used commands in stata 14.1 glm y x, link(logit) family(binomial) robust nolog as fracreg logit y x, vce(robust) both commands deliver same results. now want evaluate outcome, ideally mcfadden's adjusted r^2. yet, neither fitstat nor estat gof seem work after run regressions. error message fitstat not work last model estimated , not available after fracreg r(321) . does of know alternative command mcfadden's adjusted r^2? or have use different evaluation method? to adjust mcfadden's r^2, need subtract number of predictors full model log likelihood in numerator of fractional part. formula here . note may negative values. here's how might that: set more off webuse set http://fmwww.bc.edu/repec/bocode/w webuse wedderburn, clear /* (1) fracreg way */ fracreg logit yield i.site i.variety, nolog di "fracreg mcfadden's adj. r^2:" %-9.3f 1-(e(ll)-e(k))/(e(ll_0)) /*...

shortcut - Fileendings native Apps - APPX? -

i'm writing thesis mobile apps. now wanted mention files required specific platforms. those android, ios, windows 10 mobile: apk (android application) ipa (idevice package) appx ( ??? ) i not figure out appx stands , not find official source. obviously app stand application, x? guesses 'cross' windows 10 apps cross platform apps on microsoft devices, or x '10' windows 10. appx stands application package described in documents . the x not stand , might there consistency other file formats share similar structure ( appx files, same docx or xlsx archives contain metadata , content 1 file). *that being said, isn't right place question this. better suited on other stackexchange websites , question closed soon