Posts by OnoSendai • 36,218 points
614 posts
-
2
votes3
answers1534
viewsA: Create global function in Angularjs?
Possible, it is. It doesn’t mean it’s recommended, because you lose context. Assuming that the preview $mdToast is provided by a module called mdToast: var injector = angular.injector('mdToast');…
-
5
votes2
answers1086
viewsA: How to reference an external library?
If you install the libraries via Nuget Package references will be automatically created for you; the package physical repository will be created outside the scope of the project itself. This allows…
-
60
votes9
answers41109
viewsA: What is a programming language, IDE and compiler?
So said the Master Programmer: Without the wind, the grass does not move. Without software, the hardware is useless. Something mysterious is formed, born in the void of silence. Waiting alone and…
-
2
votes1
answer218
viewsA: How can I force a directive to work only if it is within a specific directive?
The parameter require is the correct way to describe dependency requirements in defining Directive. .directive('subDiretiva', function() { return { scope: { data: "=" }, require: ['?^^diretivaPai1',…
-
2
votes2
answers663
viewsA: How to change setInterval delay programmatically?
Sergio’s response fully meets the desired process. However, for clarification purposes to other users with a question that fully corresponds to the title of the question - Maintain a reference at…
javascriptanswered OnoSendai 36,218 -
8
votes1
answer1527
viewsA: Differences between Success and Then Angularjs
The methods success and error are the old way to process Promises for the success and error cases resulting from preview $http. They do the same thing as the method then() and its two parameters of…
-
4
votes1
answer696
viewsA: Angularjs duplicating (briefly) ng-repeat list while making new insertions in the bank
One of the possible ways to avoid this artifact (content duplication) is to use a service to manage your collections, and use a Observer Pattern to receive update notifications. (This demo generates…
-
4
votes2
answers913
viewsA: $http.get with Angular JS
I ran your code without any problem. Maybe the error is being caused by some element not mentioned in the code posted. Follow the functional example - click on > Execute Snippet of Code. var app…
-
9
votes2
answers241
viewsA: What is the purpose of the => operator in the use of lists?
The name of this operation is delegate, and works as a call to a predicate. The code LISTA.ForEach(i => Console.WriteLine(i)); Amounts to foreach (var i in LISTA) { Console.WriteLine(i); }…
-
3
votes2
answers286
viewsA: Javascript for the Angular
Link the value of campo1 a variable in the current scope; use this value as a comparison for via ng-if or ng-show. Functional example to follow: function SampleController($scope, $filter) {…
-
1
votes1
answer704
viewsA: Oracle SQL - Query multiple schemas
Tip: instead of CONCAT(p1,p2), use the concatenation operator ||. Thus: SELECT 'SELECT * FROM ' || a.owner || '.TAB2' TESTE Your first operation will be to aggregate all lines into one. You can do…
-
7
votes4
answers147
viewsA: Is there any way to decrease this script without losing functionality?
Simple solution with CSS only: Implement a CSS class containing the desired definitions in the pseudo-class hover: .hoverable:hover { //conteúdo das classes displayblock e colorblue juntas. } Add…
-
4
votes2
answers140
viewsA: Angularjs - A service is not "static"?
And access this value in another controller, it should keep the value, right? Correct, if this service consumed is under the same context. If, for example, you have the following structure: <div…
-
2
votes2
answers2346
viewsA: Angularjs - File organization for large project
My personal experience led me to adopt a structure similar to the one offered in this blog post. In short - Most Angular-focused tutorials mention a structure similar to this: app/ controllers/…
-
7
votes1
answer1236
viewsA: What is Browser Link?
When Browser Link is enabled Visual Studio acts as a Signalr server where browsers connect via a script injected into the rendered html page. Basically it serves to refresh pages from multiple…
visual-studio-2013answered OnoSendai 36,218 -
3
votes4
answers3805
viewsA: How to order an array dynamically with Angular JS?
There is a shorthand for the $FilterProvider that you can use: $scope.variavel = $filter('orderBy')([colecao], '[propriedade]'); Applying to your case: $scope.tasks =…
-
5
votes2
answers72
viewsA: Why are non-https origins considered unsafe by browsers?
PHP, SQL and similar injections occur in the application layer, which is not the scope of SSL - this occurs in the communication layer. Concerns about communication are clear and valid. For example:…
-
4
votes3
answers2520
viewsA: Search for file with only part of its name in C#
Instead of foreach (FileInfo f in diretorio.GetFiles()) utilize foreach (FileInfo f in diretorio .GetFiles("*" + ParteFinal)) So the source of your foreach will already come filtered, content only…
-
6
votes1
answer381
viewsA: How to deserialize JSON with C#
Your JSON is a collection containing only one item: [{..}] You should then deserializar it for a collection: List<RootObject> data =…
-
1
votes2
answers138
viewsA: Undefined variable
Let’s at the moment ignore the code of each block, and see how the content is interpreted: total = ""; // declare o valor de 'total' function keypressed(obj, e, f) {} // declare uma função…
-
4
votes1
answer7608
viewsA: How to save a JSON locally?
If you are looking for a client-side solution only, one option is Localstorage. var objteste = { 'um': 1, 'dois': 2, 'tres': 3 }; // Armazena no LocalStorage localStorage.setItem('objteste',…
-
3
votes2
answers1098
viewsA: Angular POST with custom header and CORS
You need to add the resource URL to the Delegateprovider. Thus: myApp .config(['$sceDelegateProvider', function($sceDelegateProvider) {…
-
7
votes3
answers2015
viewsA: How to create a controller service?
[...]it is possible with this code to create a service[?]. Yes, it is possible. In fact, the way his controller was written, the conversion to a service becomes very simple. You only need to take…
-
29
votes15
answers4487
viewsA: Determine if all digits are equal
Get the number of decimals of a given original number The using the formula Floor(Log10(numero)) + 1 Example: O = 99999 X = floor(log10(99999)) + 1 = 5 Generate a number N which has the repeated…
-
3
votes1
answer73
viewsA: Identification of regions google maps - Javascript
Utilize Reverse Geocoding. Example: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false Returns a JSON with multiple elements, including: formatted_address"…
-
5
votes2
answers182
viewsA: How to send and receive bitmap on restful server
Simply upload as binary content. String url = "http://seusite.com.br"; File file = new File(Environment.getExternalStorageDirectory() .getAbsolutePath(),"suaImagem.jpg"); try { HttpClient httpclient…
-
1
votes1
answer56
viewsA: Process management in the OS
In multitasking systems, only when a process has its instructions interpreted and executed by the processor is its state called 'under execution'. There are several possible states - 'standby,…
-
9
votes2
answers213
viewsA: What is the name of the operation when we make an ajax request to the internal server that in turn takes information from external?
The name of this type of procedure is actually Proxying? Yes, is. Of wikipedia article, a proxy (in Portuguese prosecutor) is a server that acts as an intermediary for client requests requesting…
-
1
votes2
answers82
viewsA: One Function does not recognize the other
Create a variable to persist the scope reference of the original function: teste.service('testService', function () { var that = this; this.bla = function (a,b){ console.log("ta na function do…
-
2
votes2
answers171
viewsA: How to fix this error correctly?
You’re trying to use $scope, but the qaue function defines your controller or similar is not referencing $scope for injection. Something similar to this: angular.module('myApp', [])…
-
5
votes1
answer161
viewsA: What is $Scope.Answer?
$scope is an object that references the application model that provides an execution context for applications - different contexts have a $scope different. A $scope can be shared between…
-
7
votes2
answers419
viewsA: Is it possible to restrict access to variable information with Angularjs?
The simple answer is nay, there is no way to hide from the client side. And, even if there was, the URL called could be intercepted (via debug tools). However, you can use a different approach.…
-
1
votes2
answers328
viewsA: Write to "Command Line" by C#
Use a StreamWriter to send several commands in sequence: Process p = new Process(); ProcessStartInfo info = new ProcessStartInfo(); info.FileName = "cmd.exe"; info.RedirectStandardInput = true;…
-
1
votes3
answers1208
viewsA: How to use ng-class conditional in Angularjs?
var hasLiked always is returns to its original value (false). On startup of the control you need to get the stored value of hasLiked for that user and re-popule hasLiked with the correct value.…
-
11
votes1
answer1165
viewsA: How to avoid HTTP request overload when consuming REST API?
This is more a matter of architecture than about REST Apis. Any applications, technologies or platforms that do not take into account possible usage loads may become slow. One of the techniques that…
-
9
votes2
answers1593
viewsA: What is the "?" operator?
This code is not about inline ifs, but regarding assessments of NULL cascading. In the above example, the developer wants to get the value of vendor.ContactPerson.HomeAddress.LineOne. However,…
-
0
votes1
answer126
viewsA: Sort by position of edited record (sql server)
Specify the value of ID as part of your inquiry, and use the Less than or Equal to (<=): SELECT TOP(50) * FROM tb_cliente_fornecedor WHERE status <> 'S' AND idclientefornecedor <= 10…
-
1
votes2
answers173
viewsA: Create project file like . psd, . sln, a own, etc
The name of this process is file type association. Basically works this way: A program associates a given extension (for example *.minhaExtensao) to a programme (ex.…
-
1
votes2
answers168
viewsA: Allow a Function to be called only after a time that page has been loaded
Wait for the event DOMContentLoaded document - this will indicate that the page has been completed. After that, you can implement a Timeout to be executed after N milliseconds. // Aguarde a…
-
6
votes2
answers1125
viewsA: Sql - Delete Bulk Records - Delete Bulk
Use TRUNCATE to delete all records. TRUNCATE table; It is an optimized method for complete deletion of records. If you want to propagate the effect to tables that reference a primary key in the…
-
6
votes2
answers2151
viewsA: How to shift the focus from one Textbox to the next?
Use the method SelectNextControl() of the container containing the set of controls in question. private void button1_Click(object sender, EventArgs e) { Control p; p = ((Button) sender).Parent;…
-
10
votes1
answer1283
viewsA: You can take out advertising from Unity by starting games
You can customize the splash screen if you purchase a Unity Pro license at the time of cost 1.500 USD, or a monthly fee of 75 USD per month. To change the image: Editor > Reference Editor >…
-
8
votes3
answers29883
viewsA: DIV/IMG with blurred/blurred background
There is still no CSS specification for the case you describe. However, it can be simulated with a combination. The image ios-7.jpg is our background. The idea is to position the div which will…
-
6
votes6
answers17707
viewsA: How to validate date with Angularjs or jQuery?
Simple way, using pure javascript: Try to accomplish a parse dynamic via the manufacturer of Date(). If it works, the date is valid. Example for imperial dates: var isValidDate = function(str) {…
-
2
votes2
answers3466
viewsA: Select all references to a given table (Foreign key)
PLSQL Developer implements the following query to obtain the list of references: SELECT table_name, constraint_name, status, owner FROM all_constraints WHERE r_owner = :r_owner AND constraint_type =…
-
1
votes1
answer305
viewsA: SPA with ui Router Angular JS files very large
[..] And as it is a SPA and only parts of the pages are rendered as requested I need all components, controllers, directives and etc to be available immediately upon application start. ...or not!…
-
3
votes2
answers81
viewsA: Display most important information from a JSON file
Your question explicitly mentions 'presentation'. So the answer is easy - display only the fields you need. Example: function SampleController($scope) { $scope.dados = [ { "userId": 1, "id": 1,…
-
1
votes1
answer380
viewsA: How to bring null query Sql server value
You need to implement some functionality that lists days between start and end dates: CREATE FUNCTION dbo.ExplodeDates(@startdate datetime, @enddate datetime) returns table as return ( with N0 as…
-
12
votes2
answers141
viewsQ: Dynamic declaration in attribute property
As part of a microplataforma ORM I’m developing, I’m defining a generic class that implements exclusively tight Coupling (1 record x 1 object). public class Course : MicroEntity<Course> {…
-
8
votes2
answers155
viewsA: How to do this effect with CSS
Use CSS gradients: div { background: orange; /* fallback */ background: -moz-linear-gradient(225deg, transparent 10px, orange 10px), -moz-linear-gradient(315deg, transparent 10px, orange 10px);…