Posts by Tiago Tiede • 186 points
14 posts
-
0
votes1
answer42
viewsA: Can I use activerecord for basic queries? No mapping?
It is possible to do this using the execute method, see the example: conn = ActiveRecord::Base.connection result = conn.execute "SELECT id, email, age FROM users LIMIT 3" The result will be a Mysql…
-
1
votes1
answer1383
viewsA: Friendly URL with . htaccess
Good from what I understand wants something easy way. It follows an easy way to do. However I really recommend studying and learning how htaccess works.…
-
0
votes1
answer302
viewsA: Format ISO date (yyyy-MM-ddThh:mm:ss.sssZ) to be displayed in INPUT (dd/mm/yyyy hh:mm)
When I went through it I found the recommendation to use the angular-datetime <input type="date" class="form-control" date='dd-MM-yyyy HH:mm' ng-model="tarefa.createdAt" />…
-
1
votes1
answer7390
viewsA: Bubble Sort Algorithm in Python
I believe it’s more of an identation error: That way came out right: def bubble_sort(lista): elementos = len(lista)-1 ordenado = False while not ordenado: ordenado = True for i in range(elementos):…
pythonanswered Tiago Tiede 186 -
0
votes2
answers349
viewsA: How to declare a javascript array that will receive a JSON array
I believe the best solution is for you to type the attribute array options. In some cases when you don’t do this process, you can use a array of any. For example: public opcoes: Array<any>;…
-
2
votes1
answer5218
viewsA: How to generate an Angular PDF report
There is a list of solutions, you will need to structure the content and use some of these possibilities. https://www.npmjs.com/package/electron-pdf https://www.npmjs.com/package/html5-to-pdf…
-
0
votes3
answers90
viewsA: Remove Button and Field
When you make a new one request it will reload the elements again! Ie the DOM comes as if it were the first time you load this content. What is the expected behavior in this code. A suggestion: make…
-
4
votes1
answer95
viewsA: EL JSP does not work
You did the assignment for the amount token: request.setAttribute("token", token); Have you tested with <p>Primeiro token adicionado é : ${token} </p>? Watch out for the use of {}.…
-
0
votes2
answers5641
viewsA: What is the use of the word "self" in Python?
The reserved word self is used as a reference to the same object. recommend reading Significadodoself and Introducaooop…
-
1
votes1
answer2430
viewsA: Rails 5 validate CPF
Using the Gem: CPF/CNPJ Note the use of the require I used it to test with Rails 5.0.6 and ruby 2.3.1p112 The same worked perfectly, can be used other Gems also. You can use the resources of…
-
0
votes5
answers988
viewsA: Error Split by 0
As noted above, the mathematical rule precludes division by 0. So if you want to try to divide some number by 0, you could try the solution 10.try(:/, 0) where you will get the answer:…
-
1
votes2
answers66
viewsA: Symbols on the Rails
By changing the config/initializers/inflections.Rb file you can configure the pluralization in Rails. I recommend reading the Caelum booklet to better understand. Ruby Workbook on Rails - Caelum…
-
0
votes1
answer50
viewsA: How to search for Entity and Daughters in a single sql
I recommend reading the site below. http://blog.arkency.com/2013/12/rails4-preloading/ Within the reading of the specific tested content with the use of a LEFT OUTER JOIN To run with a single query,…
-
1
votes1
answer940
viewsA: How to create and popular a table using jquery and database?
Good by what you describe exercise 2 steps that are required. I believe that a solution would be you make a service to receive the information given that it is a database, so the method would return…