Posts by Vinicius Zaramella • 1,377 points
30 posts
-
1
votes2
answers64
viewsA: Use JSON in Jquery library
To make this transformation you could use the javascript map function. Would look like this var listaUrls = obj[0].map(function( url ){ return { src: url }; })…
-
2
votes1
answer654
viewsA: How can I find out the http request method from PHP?
You can use the following code: if( $_SERVER['REQUEST_METHOD'] == 'POST'){ //retorne 405; }
-
1
votes1
answer29
viewsA: Searching Array of variables via Ajax and inserting in their due inputs of a form
You can do something like this. php search. $cpf = $_GET['cpf']; $sq1 = select nome,datanascimento from tabela where cpf = '$cpf'; $registro = myslq_fetch_array($sq1); header('Content-Type:…
-
1
votes1
answer144
viewsA: Doubt about the use of Static
Your cliente_divida function can receive a client instance as a parameter, so another part of the code would be responsible for instantiating the client and calling the cliente_divida function.…
-
2
votes1
answer42
viewsA: Doubts about the use of class
A class should follow the principle of sole responsibility. Another way to see this is that it should have only one reason to change. The way you built any modifications you make to the software you…
-
1
votes1
answer511
viewsA: How do you instantiate a class in php using an array as argument (equal to call_user_func_array)?
You can use Reflection to build an instance of a class by passing the parameters as an array. <?php $class = new ReflectionClass('Carro'); $instance = $class->newInstanceArgs(array('fiat',…
phpanswered Vinicius Zaramella 1,377 -
0
votes1
answer62
viewsA: How to work with Parallel using the Ninject library
Ninject will only try to do the Dispose of your object if you set its Scope. In your case I believe that the proper Scope is Inthreadscope.…
-
2
votes2
answers1652
viewsA: Send specific branch with Git to Github
Git is not meant to be used as you think. If you store the build generated by your code it makes more sense to have another repository just for the build. Or keep a subfolder called build that is…
-
2
votes2
answers1140
viewsA: Monitor if REST services are online
One possibility is the Runscope. It allows you to write tests of what is expected as a response. Store variables between a request and another so you can make call streams within your API. Test…
-
2
votes1
answer40
viewsA: Error: "update Were Reject because the remote work that you do not have locally"
The error is saying that the repository has modifications that you do not have in your local repository. Then you must first give a "pull" to update your local code and then push. git pull origin…
-
4
votes1
answer1827
viewsA: Is there a difference between bool and Boolean?
In C# bool is just a nickname for System.Boolean, as well as int is a nickname for System.Int32. The complete list of aliases can be found here.…
-
5
votes3
answers779
viewsA: Is there any way to make asynchronous PHP url requests?
The library Guzzle in its latest versions has support for asynchronous requests. Example taken from the documentation. $requests = [ $client->createRequest('GET', 'http://httpbin.org'),…
phpanswered Vinicius Zaramella 1,377 -
41
votes3
answers9745
viewsA: What are Javascript Promises (promises)?
Promises of javascript is an implementation of the Futures idea of functional programming. It has become the standard way of working with asynchronous javascript code. An object preserves the…
-
1
votes1
answer536
viewsA: passing Scope value to javascript function
You can use the angular inside your script in the view directly because it is globally defined. <div ng-controller="AlgumCtrl" id="ctrlID"></div> <script> function foo(){ var scope…
angularjsanswered Vinicius Zaramella 1,377 -
3
votes4
answers569
viewsA: In Object Orientation, does an inheritance violate encapsulation?
In some moments you may end up falling into situations where the internal implementation of the mother class will generate strange behaviors when you overwrite some method of it. Ex: Case that…
-
8
votes3
answers247
viewsA: What is "One Level of indentation"?
They’re referring to the indentation of the code. To maintain the readability of the code they are advocating that only one indentation level should be used. The following example would be out of…
terminologyanswered Vinicius Zaramella 1,377 -
2
votes1
answer58
viewsA: Stringreplace on all occurrences
You must pass the rfReplaceAll flag as stated in documentation Stringreplace(Edit1.text, ' ', '/', [rfReplaceAll]);…
delphianswered Vinicius Zaramella 1,377 -
0
votes1
answer311
viewsA: Sort the Table by the value closest to the parameter passed in stored procedures
A solution for postgres would be the following: with ldist as ( select name, levenshtein(name, nameParametro) as distance FROM names ) select * from ldist order by distance; If you are using another…
-
3
votes3
answers8991
viewsA: What language is used to program an operating system?
In the case of Windows is C, C++, C# and some things in Assembly according to microsoft itself. Linux is just take the distribution code on the internet and look. Most use a lot of C, C++ and…
-
1
votes1
answer61
viewsA: Http Doubt x Https Android
Https communication is encrypted. In practice any intermediary who intercepts their packages and does not possess the private key will not be able to read your message. To see the output just…
-
5
votes3
answers14329
viewsA: How to use the C++ vector class?
As described in the documentation http://www.cplusplus.com/reference/vector/vector/ to put values inside the vector you must use push_back(value) and to take a value you can use the operator [] or…
-
1
votes3
answers404
viewsA: How do you test something "unstoppable"?
To corroborate with the explanations already given, they would like to point out three cases where testing does not make sense in my opinion. First is in classes that represent only one data…
-
3
votes2
answers692
viewsA: What is the purpose of the super command when used in the parameter declaration of a method?
It means any superclass of E will be accepted. Examples: List<? super Integer> foo1 = new ArrayList<Integer>(); // Integer é superclasse de Integer List<? super Integer> foo2 = new…
-
-1
votes3
answers2921
viewsA: Show and hide content in Javascript (Menu)
Using an event to click on the element and changing the style.display between None and block you can do what you want. <div class="nav"> <ul class="menu"> <li class="mnativo"><a…
-
1
votes1
answer140
viewsA: Simulate different Timezone with Java
If you are using java 7 down recommend using the library Joda Time . Here’s an example of how to find time with this library. //cria datetime com UTC DateTime dt = new…
-
3
votes1
answer262
viewsA: Integrate nodejs (frontend) and C ,Erlang, Go...(backend)
There are some possibilities to work with requests that require heavy processing. I will base my response on the assumption that you are using nodejs as frontend server. First you will have to…
-
0
votes1
answer88
viewsA: Send live notification without repeating
You will need to use some logic to identify the user and if you have already sent the message to him on the server. The simplest way would be to store a list of ips and check if you are and instead…
-
3
votes1
answer2390
viewsA: Validate Form without changing page
First your form should have an id so we can identify it with javascript <html> <form id="myform" method="post" action="inserir.php"> <input type="submit" value="Enviar!">…
-
1
votes1
answer460
viewsA: Message appears in modal and page at the same time
I think the best way to solve your problem without starting to mix the Copes is to put in your Alertservice who is the callback that it should notify when Alertservice receives notifications. One…
-
2
votes2
answers1100
viewsA: GIT - "import" content from another branch
If the modification between what you have in one repository for the other is completely different it makes no sense to keep in the same. If upgrading bootstrap v3 to v4 is partial, it makes sense to…