All Questions

4
answers

How to tell if an element was clicked using pure Javascript

How to tell if a descendant of a <li> was clicked using pure Javascript. <div id="list"> <a href="#">one</a> <a href="#">two</a> <a href="#">three</a> </div> Using...
asked on 02.04.2014 / 02:23
3
answers

Why does height not accept percentage?

I created this Fiddle as a test. I want to have split screen half green, half red, why is it in the height property I put the value followed by "%" to div disappears? Being here says that you can use "%".     
asked on 09.04.2015 / 11:54
5
answers

console.log () utilities

I was doing a refactoring in a code made in the MVC format, leaving the code more readable, eliminating duplicate code and deleting variables and API's that were no longer being used. By deleting some " console.log(algo.aqui) ", I w...
asked on 07.06.2017 / 19:01
2
answers

How to capture the last element of a list in Python?

In PHP, to get the last element of an array I can do this: $array = array(1, 2, 3); echo end($array); // 3; What about Python? How could I do this with this list: arr = [1, 2, 3]     
asked on 09.01.2017 / 19:28
3
answers

How to create a task scheduler without using cron and without using wordpress

I need to create an automatic method to schedule my email marketing system, to trigger email automatically, without using the browser. Today my system is using cron, and every time I enable it on a server, I need to configure the url of the scri...
asked on 21.10.2015 / 21:28
2
answers

Count the number of occurrences of a value in a list

I have list with the following values: numeros = [5, 3, 1, 2, 3, 4, 5, 5, 5] In Python would have some function to count how many times some value repeats? For example: I want to know how many times 5 has repeated.     
asked on 09.01.2017 / 20:04
2
answers

Why setting a CSS property with the! important attribute does not work in the .css () method?

I would like to know the real reason for the inability that the jQuery.css () function has, which would be the fact that when using the !important attribute on any assigned CSS property, it is not added. I would also like to know if...
asked on 20.02.2014 / 00:12
2
answers

What is the difference between 'string' and r'string 'in Python?

I was looking at the code in Django, framework in Python, and I came across the following code in the file urls.py . urlpatterns = [ url(r'^articles/2003/$', views.special_case_2003), url(r'^articles/([0-9]{4})/$', views.year_a...
asked on 13.08.2015 / 14:29
3
answers

How to send 2 Controller objects to the View in C # ASP.Net MVC?

I made a query in the database in 2 tables and saved in 2 objects in the controller , but I can only send 1 object to view . // Controller // Pego os dados do BD e salvo no objeto var objPessoa = new PessoaAplic(); var dadosPessoa = objPesso...
asked on 06.10.2015 / 21:22
4
answers

How to set --no-ri --no-rdoc as default when using gem install?

Always giving the gem install I have to provide the parameters --no-ri and --no-rdoc, I would like this to be standard for this command! How can I do this?     
asked on 13.12.2013 / 13:31