In computer programming, the scope of an identifier is the part of a computer program where the identifier, a name that refers to some entity in the program, can be used to find the referred entity.
4
votes
0answers
56 views
Angular controller scope inheritance vs service
On my site I have a navbar component that I want to customize for each and every ng-view I end up loading. Currently I'm doing ...
0
votes
0answers
56 views
Angular $watch functions for two popovers
I have the following code and would like to optimise it:
...
1
vote
0answers
33 views
Eloquent Scope and Normal Way
I read the documentation part of Eloquent, especially scopes:
Scopes allow you to easily re-use query logic in your models. To define a scope, simply prefix a model method with scope:
And so, ...
0
votes
1answer
3k views
Accessing parent scope from directive
This is how I can access the exact scope value, otherwise it will be $scope.type of local scope.
I am accessing this from the template in ...
1
vote
1answer
84 views
Caching DOM-queries
I've been optimizing my code and I always tend to cache common selectors like this (jQ):
...
6
votes
3answers
541 views
Nested loop to render tiles in a grid
This code works but I'm not really sure if I wrote it good enough. It seems a bit vague but I can't really assess it properly. I'm particularly concerned with the ...
1
vote
1answer
3k views
Shopping cart application in Spring MVC
I am creating a shopping cart application to learn Spring MVC. I want to display a list of all categories and subcategories in more than one page. i.e; Home Page, Products page, and Category page.
In ...
3
votes
4answers
674 views
Summing up distinct elements in steps
My current task is to find a score from an array where the highest/lowest scores have been taken away, and if the highest/lowest occur more than once (ONLY if they occur more than once), one of them ...
7
votes
2answers
6k views
Handling signals in Python inside a function
I have code that needs to exit gracefully. To simplify things, I am presenting an example based on the answer given here.
Since I need to handle a few signals, I thought of putting this logic in a ...
5
votes
1answer
225 views
Communicating between plugins whilst maintaining context in Javascript
I'm making some changes to a JavaScript plugin on a site I've been made steward over. This main plugin has it's own sub-plugins and I'm trying to make certain aspects modular.
Currently, I'm ...
7
votes
2answers
176 views
Conway's Game of Life - Conventional JavaScript?
I'm using the Game of Life Kata to help me learn JavaScript. I've picked up the syntax through Codecademy tutorials, but my current skill level is Novice.
The example code has working functionality ...
8
votes
2answers
156 views
Advice needed for scopes in JavaScript
I would like to connect this "JS" to Bugzilla (example: bugzilla.mozilla.org or landfill.bugzilla.org).
I started to learn JS language today and I would like to ask you:
How can I not do bad ...
1
vote
1answer
147 views
3
votes
2answers
1k views
Accessing a global list
I'm sort of at a loss for what to do with webapps and whether what I'm doing is actually allowed or not. Here is a sample of the type of thing I'm doing at the moment. I need a list that is accessible ...
1
vote
2answers
505 views
Using a dependency container to load a parent/child class
In PHP, I have a parent/child class and am using dependency container to load them. I am trying to use the same database connection on all of them without duplicating the object.
I used ...
-1
votes
1answer
64 views
Is declaring a property as `public` insecure?
I posted a question few weeks back, on making a PHP Login Script. Most of you guys told me not to use global variables and especially for something like MySQLi ...