Posts

Showing posts from July, 2015

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

appium - Access iphone’s settings app on real device -

i want access device settings, checked there similar posts no answer real device. i tried passing parameters as desired_caps['app'] = 'settings' , desired_caps['bundleid'] = 'com.apple.preferences' but error instruments trace error : target failed run: permission debug com.apple.preferences denied. app must signed development identity (e.g. ios developer). seems above works on simulator not device. i can launch test app, i'm passing other parameters correctly. or there other way access device settings? desired_caps = dict() desired_caps['platformname'] = 'ios' desired_caps['platformversion'] = '9.2.1' desired_caps['devicename'] = 'iphone' desired_caps['udid'] = '09d905a' desired_caps['app'] = 'settings' # desired_caps['bundleid'] = 'com.apple.preferences' # desired_caps['fullreset'] = true desired_caps['newcommandtimeout'

model view controller - Insert data into multiple table in entity framework -

Image
i have 2 tables below. using db first approch public class team { public long id { get; set; } public string name { get; set; } public string description { get; set; } } public class employee { public long id { get; set; } public long teamid { get; set; } // foreign key reference fom team table public string name { get; set; } public long referedby { get; set; } // foreign key reference fom employee table } now have insert data both table once. example need insert data below. before introducing referred column using below code insert. team team = new team(); team.name = "team1"; team.description = "some description"; employee e1 = new employee(); e1.name = "jon"; employee e2 = new employee(); e2.name = "harish"; team.employee.add(e1); team.employee.add(e2); dbentity db = new dbentity(); db.set<team>().add(te

vba - Running a script in shared mailbox only when opening a mail -

i have tried find answer question on web. since don't have experience outlook-vba decided ask here. what i'm trying run script when user opens mail. need run script in shared mailboxes not in users own box. i've used code found in users @zza question # 21727768 has little annoyance creating mail , replying 1 (it runs script in these cases also). helpful haven't found way apply code cases user opening mail shared mailbox. any here? thanks! okay, found easier way (this code question linked to, in op) public withevents myitem outlook.mailitem public eventsdisable boolean private sub application_itemload(byval item object) if eventsdisable = true exit sub if item.class = olmail set myitem = item end if end sub private sub myitem_open(cancel boolean) eventsdisable = true 'this new part if myitem.parent = "nameofyoursharedinbox" 'your code here end if eventsdisable = false end sub

android - Google Place Api gives Status{statusCode=ERROR, resolution=null} -

below code neaby places @ current location.the code works , not without changing anything. why happens . have checked api key valid , status code "error" says operation failed no more detailed information on https://developers.google.com/android/reference/com/google/android/gms/common/api/commonstatuscodes.html#constants thank below activity: public class placesapiactivity extends appcompatactivity implements onconnectionfailedlistener, googleapiclient.connectioncallbacks { private static final string log_tag = "ppppppppppppppppp"; private static final int google_api_client_id =0; private googleapiclient mgoogleapiclient; private static final int permission_request_code = 100; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_places_api); log.d("resuktfvvvfdfd", "oncreate: "); buildgoogleapicli

UWP CustomControl as a drop container at design time -

because in uwp application there no form of layout inheritance 1 forced use customcontrol base layout. how in uwp app can customcontrol used drop target in design mode? that, button dropped design palette becomes contained within customcontrol. all documentation can find relates wpf app , doesn't apply uwp app. any complete examples appreciated. xaml: <usercontrol x:name="usercontrol" x:class="ids2.programbaselayout" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:ids2" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" d:designheight="300" d:designwidth="400" style="{binding source={staticresource programbaselayoutstyle}}" >

javascript - How do I disable browser's "save your password" option from my website's users? -

Image
i have login this: as see, username , password saved in inputs. want know, possible disable saving password property of browser js or html or whatever? note: using autocomplete attribute isn't useful that: <form autocomplete="off" ...> <input name="username" placeholder="email" type="email" autocomplete="off" /> </form> as see, both form , input have autocomplete="off" attribute, still saving password happens.

javascript - How to rotate a group of text elements -

i have fiddle : https://jsfiddle.net/thatoneguy/j0gnm5mw/1/ i have group of text elements create : var text = container.append('g').selectall('text'); text.data(testdata).enter() .append('text') .attr('x', function(d, i) { return (i + 1) * 100; }) .attr('y', 100) .text(function(d) { return d.label; }) i try rotate : .attr("transform", "rotate(-10)"); i have found few examples similar : http://bl.ocks.org/mbostock/4403522 they following rotate : .selectall("text") .attr("y", 0) .attr("x", 9) .attr("dy", ".35em") .attr("transform", "rotate(90)") .style("text-anchor", "start"); however still gives same output. thanks @robert longson, has been solved. i didn't realise can rotate different centre point. rotate function looks : var thisx = (i + 1) * 100, thisy = 1

node.js - npm Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\nodejs' at Error (native) -

i have installed nodejs (version 6.2.1) , nodejs tools visual studio (version 1.1.1) on laptop. have cloned 1 of projects github, when try update npm dependencies (i.e. express, bower) error error: eperm: operation not permitted, mkdir 'c:\program files (x86)\nodejs' @ error (native) my default nodejs install @ c:\program files\nodejs. i have tried run command npm update using admin permission in cmd, create folder command seems never finish. thanks in advance if can help it occured me same error situation.you need open node.js command prompt administratior.i hope can you.

mongodb - Get the size of an array of each document in a sub array -

i've document in collection 'gyms' looks following: "name" : "testing", "albums" : [ { "name" : "aerobics", "photos" : [ { "filepath" : "aerobics.jpg" } ] }, { "name" : "aqua", "photos" : [ { "filepath" : "aqua.jpg" } ] }, { "name" : "zumba", "photos" : [ { "filepath" : "zumba.jpg" } ] } ], i'd select amount of photos each album projection. so output following: "name" : "testing", "albums" : [ { "name" : "aerobics", "amount_photos" : 1, "photos" : [

matplotlib - scatter plot same point repeated several times python -

Image
i trying draw scatter plot dictionary bellow: data_dict = {12: [1, 17, 11, 17, 1, 14, 38], 13: [13, 6, 4, 6], 14: [15, 8, 20, 8, 7], 15: [2, 3, 3, 1], 16: [62, 13, 36, 3, 8, 99, 54], 17: [1], 18: [44, 30, 36, 14, 21, 13, 44, 1, 62, 36], 19: [5, 5], 20: [27, 42, 42, 18, 31, 55, 31, 55], 21: [59, 1, 42, 17, 66, 26, 18, 4, 36, 42, 20, 54, 44, 35]} i using following code draw scatter plot dictionary keys x values values corresponding values. for xe, ye in data_dict.iteritems(): plt.scatter([xe] * len(ye), ye) and getting plot: i'de able distinguish between having 1 point @ given x , y location vs having multiple point. example x = 12, y = 1 , 17 repeated twice. i'm looking in way of representing repetition either color or size of data points. i not find reference on how this. appreciate or guidance. thanks. you can .count() each item , calculate size based off that, use named parameter s specify sizes. btw change .items() .iteritems() if on pytho

php - Method orderBy does not exist in Laravel Eloquent? -

i have piece of code this: $products = product::all() if ($search_value) { $products = $products->where('name', 'like', "%$search_value%"); } $products = $products->orderby('created_at', 'desc')->skip(10)->take(10)->with('tags')->get(); i got following error: badmethodcallexception in macroable.php line 81: method orderby not exist. i guess orderby need follow product:: directly, can't save $products = product:: , can i? any suggestions? thanks. you're trying use orderby() method on eloquent collection. try use sortbydesc() instead. alternatively, change $products = product::all(); $products = new product(); . code work expect.

svn - How to highlight folders with new files in IDEA -

i changed eclipse idea , wondering how activate function. more detailed: activated 'show directories changed descendants' in settings → version control → subversion. if modify file, idea change text color of folders root folder containing file , file itself. easy browse folders changes have been made. if add new file folder, idea change color of file not change folders above. i found color 1 files in 'unknown' status in settings editor → colors & fonts → file status. i working idea 2016.1.3 , svn 1.9.4 question: there way text color folders changed when there files in 'unkown' state? if not, there similar highlight folders new files? one possible solution found add file svn (ctrl + alt + a). svn knows file new 1 , folders highlighted if known files have been changed.

r - ggplot: "size-robust" way to place horizontal legend at the bottom-right -

Image
i trying place horizontal legend @ bottom-right corner, outside of plotting area. i realize has been discussed before. however, after long frustrating morning, wasn't able reach "size-robust" solution. here 3 solutions i've found: when set legend.position bottom : legend placed @ bottom-center, yet fail push right side using legend.justification when set legend.position c(1,0) : legend placed @ bottom-right corner. however, legend placed inside plot. when add plot.margin , push legend.position further down: legend placed @ bottom-right corner , outside of plot. however, when change size of plotting area, legend not correctly positioned more. incorrect positioning of third solution: reproducible code: # generate random data------ sample.n = 50 sample.data = data.frame(x = runif(sample.n,0,1), y = runif(sample.n,0,1), value = runif(sample.n,0,10)) # plot ------ library(ggplot2) # margins fine. , if change size of plotting area, legen

sql - Generate a unique number in a auto-incrementing 6-8 pattern mysql -

lets have table, e.g. id | membername | memberphonenumber | prefix | suffix i want generate prefix , suffix composite key must in 6-8 pattern. primary key still id. these 2 columns used reference number, e.g. prefix-suffix 000000-00000000 000000-00000001 000000-00000002 ... 000000-99999999 000001-00000000 000001-00000001 000001-00000002 ... 567889-48329484 and on. ideally auto-incrementing. best way this? doing through staging table populate number had generated through function 8 pattern, , auto incrementing 6 pattern prefix outside of database based on count of staging table storing used numbers, truncating rinse/repeat want simpler auto-incrementing solution. possible? i've been doing reading on composite keys since have primary key that's distinct , not used, i'm unsure of how outside of current method. any thoughts? your prefix-suffix pattern equivalent normal integer primary key. imagine had suffix length of 1 digit (instead of 8 in example)

.net - How to cleanly save richtextbox content? -

i've got problem : creating text editor, save richtextbox content in rtf file. i'm ok, test it, and, adding text alignement option, release alignement not saved in rtf file ! said, know how save cleanly text, i.e. saving fonts properties text alignement ? you can try this: file.writealllines(filename, richtextbox1.lines); or this: rtftextbox.savefile(filename); add richtextboxstreamtype e.g. rtftextbox.savefile(filename, richtextboxstreamtype.richtext); or rtftextbox.savefile(filename, richtextboxstreamtype.texttextoleobjs);

c++ - How to access pair elements nested inside pair in a vector in stl -

i have vector : vector < pair < int, pair < int,int > > > v i want access 3 elements . how can through iterator? have declared iterator it1 , it2 below : #include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d",&t); while(t--) { vector<pair<int,pair<int,int> > > v; int n,a,b,i; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d",&a,&b); v.push_back(make_pair(b,make_pair(a,i+1))); } sort(v.begin(),v.end()); vector<pair<int,pair<int,int> > > :: iterator it1=v.begin(); vector<pair<int,pair<int,int> > > :: iterator it2=v.begin()+1; printf("%d ",(it1->first)->second); while(it2!=v.end()) { if(it2->first.first>it1.first) { printf("%d ",it2.first.second); it1=it2; }

ruby on rails - `require': LoadError: cannot load such file -- sequel/adapters/sqlite3 (Sequel::AdapterNotFound) -

i using sequel in rails application instead of active record. how configure , connect database? using db = sequel.connect(env['database_url']) but getting errors: /home/aaditya/downloads/ruby-bench-suite/rails/vendor/bundle/ruby/2.3.0/gems/sequel-3.40.0/lib/sequel/core.rb:379:in `require': loaderror: cannot load such file -- sequel/adapters/sqlite3 (sequel::adapternotfound) /home/aaditya/downloads/ruby-bench-suite/rails/vendor/bundle/ruby/2.3.0/gems/sequel-3.40.0/lib/sequel/core.rb:379:in `block in tsk_require' /home/aaditya/downloads/ruby-bench-suite/rails/vendor/bundle/ruby/2.3.0/gems/sequel-3.40.0/lib/sequel/core.rb:100:in `block in check_requiring_thread' /home/aaditya/downloads/ruby-bench-suite/rails/vendor/bundle/ruby/2.3.0/gems/sequel-3.40.0/lib/sequel/core.rb:97:in `synchronize' /home/aaditya/downloads/ruby-bench-suite/rails/vendor/bundle/ruby/2.3.0/gems/sequel-3.40.0/lib/sequel/core.rb:97:in `check_requiring_thread' /

excel - VBA Web Automation -

i'm trying write macro access data web portal, need launch website , click 'open in excel' button. i've launched webpage fine, can't not click link. understanding should able similar this: browswerobject.document.elementid.click but i'm not sure correct element , coding be. 1 webpage when inspect element has code: <a onclick=ur_button_click(event); tabindex=0 id=button_toolbar_standard_btn7_acbutton title="open in excel" class=urbtnstd onkeydown=ur_button_keypress(event); style="overflow: visible; text-align: center" href="javascript:void(0);" ct="b" ti="0" st="" ocl="sapbi_page.sendcommandarray([['guid','11',0],['nouilock','x',0],['bi_command_type','abstract',0]],event);">open in excel</a> could pinpoint should focus on this? edit: i've tried getelementbyid i'm running in error: method ‘document’ of object ‘iw

javascript - How to format a number using jQuery? Ex. 119.0484 I want to format it to "9999.99"? -

how format number using jquery? ex. 119.0484 want format "9999.99"? how can achieve this? can give sample code? thank can me this. i've tried code. whenever click radio button again value changing. think problem here structure of code. want know if .tofixed(2) solved 9999.99 format.. html <input type="radio" name="unitscale" id="opt1" onclick="changeunit()" checked class="roleauthorization"><label>metric (kg&cm)</label> <input type="radio" name="unitscale" id="opt2" onclick="changeunit()" class="roleauthorization"><label>english (lbs&in)</label> script function changeunit() { var requestnum = $("#requestnum").val(); var username = $("#username").val(); if ($("#opt1").is(":checked")) { $("#kg").removeattr("style"); $("#lbs&q

ios - when button is selected, there should be a new view loaded -

this first time in stackoverflow , i'm pretty new objective c language. best solution in order load page in 1 view controller? references welcome , new great coder's :( some when using ibaction, load newviewcontrollers, put modal view on there. however, there should going button, can't use modal view in 1 single viewcontroller there should new view coming out when pressing button this main page when press button moves image 1 it looks second view being presented on first view. can present second view on ibaction self.presentviewcontroller(secondviewcontroller, animated: false, completion: nil) that cross button in second view should dismiss view through ibaction as dismissviewcontrolleranimated(false, completion: nil)

java - Why is 'create' asynchronous? -

i told, creating new instance async message; don't understand why. e.g.: foo myfoo = new foo(); here have wait until constructor finishes , returns new object. doesn't asynchronous mean, go on independently (no waiting) - starting thread? i told, creating new instance async message; sorry, have either heard wrong or told wrong. first off, should terminology straight. term "async" or "asynchronous" means invocation returns immediately caller. can demonstrate not true constructor, simple experiment [1]. in other words, constructor must return caller make progress . starting thread indeed asynchronous. call thread.start() returns , @ later point in time thread starts running , executing run() method. 1 experiment consider class (for illustration only) below: foo.java class foo { foo() throws interruptedexception { while (true) { system.out.println("not returning yet ..."); threa

jquery - Scrollspy with ancor transition -

i have issue scroll spy , transition navbar specific anchor location. when ever click on portfolio tab cuts off , goes down fast though specified move in smooth animation. page cut out half way next one. scroll spy not follow when scroll. ideas why happening? have checked , have jquery in directory. $('a').click(function(){ $('html, body').animate({ scrolltop: $( $(this).attr('href') ).offset().top }, 500); return false; }); body { position: relative; } /*footer*/ .navbar-brand { padding: 0px; } .navbar-brand>img { height: 100%; padding: 15px; width: auto; } .huskynav .navbar-brand { height: 80px; } .huskynav .nav >li >a { padding-top: 30px; padding-bottom: 30px; } .huskynav .navbar-toggle { padding: 10px; margin: 25px 15px 25px 0; } /*deviders*/ .home{ height: 100%; padding-top: 150px; text-align: center; background: #423840; } .about {

python - django-excel importing files without overwrite the database -

i'm developing web-app manage data have in excel , csv files. i'm using django-excel in order import files in database (the default of django-framework) of web-app. i read documentation , find import function: def import_sheet(request): if request.method == "post": form = uploadfileform(request.post, request.files) if form.is_valid(): request.files['file'].save_to_database( name_columns_by_row=2, model=question, mapdict=['question_text', 'pub_date', 'slug']) return httpresponse("ok") else: return httpresponsebadrequest() that import data of 1 file in database. can't import file without having error. how can import data file appending them, without overwriting database? [edit after question of solarissmoke] i explain myself example: have table mytable in database.

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

java - Security.Authenticator is not working in Junit test -

i writing junit test controllers in javaplay framework . used spring security login authentication. here source used reference. everythings working fine until start writing test cases controller. issue unit test shows weird behaviour. here test file: @test public void logintestfail(){ result result = invokewithcontext(fakerequest("get","/merchantvisibility"), () -> assetcontroller.merchantvisibilitydemo()); assert.assertequals(303,result.status()); assert.assertequals("/login",result.header("location")); } @test public void logintest(){ map map = new hashmap<>(); map.put("email","abc@xyz.com"); result result = invokewithcontext(fakerequest("get","/merchantvisibility").session(map), () -> assetcontroller.merchantvisibilitydemo()); assert.assertequals(200,result.status()); } here controller file: @singleton @security.authenticate

Wireframe cubes in vb.net using point 3D not executing -

imports system.drawing.graphics imports system.drawing.pen imports system.drawing.color imports system.drawing.brush imports system.drawing.point public class main protected m_pen pen protected m_timer timer protected m_vertices(10) point3d protected m_faces(10, 4) integer protected m_angle integer private sub main_load(byval sender system.object, byval e system.eventargs) handles mybase.load ' create gdi+ pen. used draw lines. m_pen = new pen(color.red) initcube() ' create timer. m_timer = new timer() ' set timer interval 33 milliseconds. give 1000/34 ~ 30 frames per second. m_timer.interval = 33 ' set callback timer. addhandler m_timer.tick, addressof animationloop ' start timer. m_timer.start() end sub private sub initcube() ' create array 12 points. m_vertices = new point3d() { new point3d(0,

angularjs - Ionic App I've been having this issue for quite some time now is it a permissions issue? -

after logging in app want bind profile(front end) data (username , email) front end. doesn't work. there i'm doing wrong here? $scope.login = function() { fbref.$authwithpassword({ email: $scope.email, password: $scope.password }).then(function(authdata) { $scope.userprofile = authdata; $state.go('tabscontroller.pendingtasks'); }) } <div ng-controller="loginctrl" class="card" ng-show="user"> <div class="item item-divider">username: {{userprofile.email}}&nbsp;&nbsp;&nbsp; </div> <div class="item item-text-wrap"> {{userprofile.password.email}} </div> </div> according documentation success callback returns object fields uid, provider, auth, , expires. put breakpoint inside callback or log console. https://www.firebase.com/docs/web/api/firebase/authwithpassword.html console.log('authdata

javascript - Return variable value from request.get inside one function to another NODEJS express -

i calling function request.gets json , fills in variables router.get the variables value inside callfunc function undefined in router.get how make them global can assign value inside request.get , use value in router.get var title; var headline; router.get('/test/code/:code', function(req, res, next){ var procedure = "execute procedurename 999, 'username', "+req.params.code callfunc(procedure) res.render('display', { title: title, // <-- value here undefined descritpion: headline, // <-- value here undefined var1: 'block sidebar', var2: 'block content', image: 'http://baidun.com/wp-content/uploads/2013/06/si_rm_1070bw-900x598.jpg', url: 'https://www.youtube.com/watch?v=zb_vpdxahku' }) }) function callfunc(procedure){ request.get('http://mywebservice.com/myservice.asmx/myservicedb?callback=&username=username&procedurename='+procedure, functi

Terraform and docker networking -

i have defined terraform recipe docker provisioner this: provider "docker" { host = "tcp://127.0.0.1:2375/" } # create network resource "docker_network" "private_network" { name = "${var.customer_name}_network" } resource "docker_container" "goagent" { image = "${docker_image.goagent.latest}" name = "${var.customer_name}_goagent" command = [ "/bin/sh", "-c", "/usr/bin/supervisord" ] network_mode = "bridge" networks = [ "${docker_network.private_network.name}" ] hostname = "${var.customer_name}_goagent" } resource "docker_image" "goagent" { name = "local/goagent" } i expect container connected network created on fly (using variable customer_name). see container gets connected default bridge network (172.17.0.0/16), gets connected 2 networks. is there way configu

Building Mongoose Schema with indeterminate number of nested objects -

1. sample dashboard menu data: const dashboards = [ {"dashboard": "sample", "items": [ { "title": "title 1" }, { "title": "title 2", "items": [ { "title": "title 2-1", "items": [ { "title": "title 2-1-1" }, { "title": "title 2-1-2" } ] }, { "title": "title 2-2" } ] }, { "title": "title 3", "items": [ { "title": "title 3-1" }, { "title": "title 3-2", "items": [ { "title": "title 3-2-1" }, { "title": "title 3-2-2" } ] } ] }, { "title": "title 4"

python - 2 y-axis graph with x-axis as date and time . x value and y value data not showing on mouse point -

Image
i created 2 y-axises ( y, y1 ) graph x-axis date , time. while pointing graph y , x showing me data of x , y1 . here code proof: import sqlite3,time,datetime,os import numpy np import matplotlib.pyplot plt matplotlib import dates import matplotlib.dates mdates matplotlib import style style.use('ggplot') def bytedate2num(fmt): def converter(b): return mdates.strpdate2num(fmt)(b.decode('ascii')) return converter conn = sqlite3.connect("datas.db") c = conn.cursor() sql= "select timestap,date,val,num table" grapharray = [] temp=0 row in c.execute(sql): if temp > int(row[0]): continue else: temp=int(row[0]) grapharray.append(row[1]+','+row[2]+','+row[3]) date_converter = bytedate2num("%y-%m-%d %h:%m:%s") date_formatter = dates.dateformatter('%m/%d %h:%m') datestime, val, num= np.loadtxt(grapharray,delimiter=',', unpack=true,converters={ 0: date_converter})

Can still access LAMP server, even after deleting local ssh keys -

server newbie here , on mac reference. so i'm trying break ssh key authentication between me , lamp stack although can't. in other words, gives me access , don't know how! here's i've done... created key via terminal: ssh-keygen -f foo_key stuck pub key in correct place on server... ssh'ed in via terminal: ssh -i /users/me/.ssh/foo_key root@x.x.x.x it's asked password chose upon setup, fine inputed that. so have access, next logout server. want rid access on computer. i've tried removing local private , public keys, i've tried removing checksum in known_hosts , i've tried locating key saved in keychain access , nothing there. so has authentication information been saved, it's pretty annoying. all guidance appreciated. edit here's verbose info, doesn't seem using foo_key @ now: debug1: identity file /users/me/.ssh/id_rsa type 1 debug1: key_load_public: no such file or directory debug1: identity file /users/me

github - Git - remote: Repository not found -

i have sourcetree local working copy. , operations work good, can simple fetch, push, pull , etc via sourcetree. needed make force push not exist in sourcetree. i opened terminal made git push -f remote: repository not found. fatal: repository 'https://github.com/myrepo/project.git/' not found i not sure can issue. because did not identify remote git repository terminal first. git remote set-url origin https://github.com/myrepo/project.git and then, git add . git commit -m "force push" git push origin master --force

c# - Entity Framework: Selecting distinct objects -

i using entity framework data access , manipulation. have following class: public class productcategory { [key] [databasegenerated(databasegeneratedoption.identity)] public int id { get; set; } [required] [minlength(5)] [maxlength(45)] public string name { get; set; } [column("parentid", typename = "int")] public int? productcategoryid { get; set; } public virtual productcategory parent { get; set; } public icollection<productcategory> subcategories { get; set; } } now querying using linq list of categories, including related child categories (using parentid column) this: public async task<iqueryable<productcategory>> getall() { return await task.run(() => { return _db.productcategories.asqueryable(); }); } when run code, following result: [ { "id": 1, "name": "computers & software", "parent": null, "subc

javascript - Firefox console getting SyntaxError: illegal character -

i trying following code http://jsfiddle.net/qlmhuge/t7a1sh4u/ work in wordpress 4.5.2. example spotify web api html widgets. getting following error: syntaxerror: illegal character {{#each albums.items}} on # sign the site trying run on here: http://dev-markandersonpianist.pantheonsite.io/discography/ here script getting error: <script id="results-template" type="text/x-handlebars-template"> {{#each albums.items}} <div style="background-image:url({{images.0.url}})" data-album-id="{{id}}" class="cover"><a href="{{external_urls.spotify}}"><div class="spotify-button"><img src="https://developer.spotify.com/wp-content/uploads/2014/06/play_on_spotify-green.png" /></div></a></div> {{/each}} </script> it works in jsfiddle can see above. don't understand why it's not working in wordpress. that's because of {{#e