Posts

angularjs - Error: $injector:unpr Unknown Provider -

i trying make share service using following code: whoisapp.service('sharedscope',function($scope){ this.domainname="google.com"; }); whoisapp.controller('maincontroller',function($scope,sharedscope){ $scope.$watch('domainname',function(){ sharedscope.domainname=$scope.domainname; }); }); the problem is, when run application, face error in console: error: $injector:unpr unknown provider it seems little strange since have defined sharedscope service. wrong code? update: here definition of app: var whoisapp=angular.module('whoisapp',['ngroute','ngresource']); whoisapp.config(function($routeprovider){ $routeprovider .when("/",{ templateurl:'home.html', controller: 'maincontroller' }) }); there error in function parameters, should this: whoisapp.controller('maincontroller',function($scope, sharedscope){..

sql - A query with primary key field used twice -

in database have 2 tables: relationship table: organization_id_first, organization_id_second, relationship_type organization table: primary key = org_id ; org_id, org_name, ... how able join organization table org_name both organizations have entry in relationship table? don't think can join on same primary key. have subquery of sort? thanks! this how in t-sql ... join twice , make 2 different object select or1.org_name, or2.org_name, rel.relationship_type relationship rel join organization or1 on rel.organization_id_first = or1.org_id join organization or2 on rel.organization_id_second = or2.org_id

c# - Owin Custom Routing MIddleware in ASP.NET Web Api 2.0 -

i have started building asp.net web api 2.0 application using owin middleware microsoft ( http://owin.org/ ). have several questions related routing can't find great tutorial on web api. have customers potentially have several companies (databases, essentially) want service through web api. wanted user able specify company through custom route. example, route api/mycompany/products load of products mycompany. obviously, not want pass company name every action on every controller, want create custom route or custom routing middleware if standard routing won't work. 1) there tutorials on routing web api can me understand doing , how should doing things? 2) there tutorials building middleware on owin routing? in general? 3) recommendations on better way this, if there one. the companies necessary because don't want hard code web.config file. basically, app have info on of companies and, using route, metadata such related connection string. any advice great! know ...

javascript - value gets submitted through form, then even after the value got submitted and gets displayed, in a form the value got submitted is shown -

sorry long title, happens: submit word "hello", hello gets displayed. in form, still says "hello". i'm not sure why happening. django problem or javascript code needed this...?here's full code think causing problem. in views.py def post(request, slug): user = get_object_or_404(user,username__iexact=request.user) try: profile = myprofile.objects.get(user_id=request.user.id) # if it's onetoone field, can do: # profile = request.user.myprofile except myprofile.doesnotexist: profile = none post = get_object_or_404(post, slug=slug) post.views += 1 # increment number of views post.save() # , save path = request.get_full_path() comments = comment.objects.filter(path=path) #comments = post.comment_set.all() comment_form = commentform(request.post or none) if comment_form.is_valid(): parent_id = request.p...

Create an ASP.NET MVC app with auth and SQL DB and deploy to Azure App Service -

Image
folks, i trying perform steps given on below link create asp.net mvc app auth , sql db , deploy azure app service while doing lost on step #11. says select create new server, enter server name, user name, , password. server name must unique. can contain lower-case letters, numeric digits, , hyphens. cannot contain trailing hyphen. user name , password new credentials you're creating new server. if have database server, can select instead of creating one. database servers precious resource, , want create multiple databases on same server testing , development rather creating database server per database. however, tutorial need server temporarily, , creating server in same resource group web site make easy delete both web app , database resources deleting resource group when you're done tutorial. if select existing database server, make sure web app , database in same region. and below there image i not sure how popup open up. tried steps multiple time don't...

How to count word "test" in file on Python? -

i have file consists of many strings. looks like sdfsdf sdfsdfsdf sdfsdfsdf test gggg uff test test fffffffff sdgsdgsdgsdg sdgsdgsdgsdg uuuttt 555555555 ddfdfdfff dddd4444 66677565 sdfsdf5 556e4ergferg ergdgdfgtest kdfgdfgfg test how count words "test". tried, have result f = open("file") words = 0 s in f: = s.find('test') if > -1: words += 1 print(words) f.close() and script counts strings contain word "test". how count words? if want find matches: with open("file") f: numtest = f.read().count("test") if want find word matches: with open("file") f: numtest = f.read().split().count("test")

performance - Timing test on azure ml -

i have created data sets of various sizes 1gb, 2gb, 3gb, 4gb (< 10 gb) , executing various machine learning models on azure ml. 1) can know server specifications (ram, cpu) provided in azure ml service. 2) @ times reader says "memory exhaust" >4gb of data.though azure ml should able handle 10gb of data per documentation. 3) if run multiple experiments(in different tabs of browser) in parallel, taking more time. 4) there way set ram, cpu cores in azure ml i have partial answer: 1. no, it's abstracted the following types of data can expand larger datasets during feature normalization, , limited less 10 gb: sparse categorical strings binary data (see this ) i'm not sure, while working on it, didn't experience change when running single experiment , multiple experiment you can scale machines in standard tier (see this )