All Questions

2
answers

What is the name of the operator ... used in PHP 5.6?

From PHP 5.6 we now have the possibility to invoke or declare a function, stating that the arguments are infinite, using the ... operator. Example: function add(... $arguments) { return array_sum($arguments); } add(1, 2,...
asked on 16.09.2015 / 17:55
3
answers

How to remove specific words with javascript

How can I remove specific values from the page title? Title : STACKOVERFLOW REMOVE : STACK RESULT : OVERFLOW     
asked on 04.02.2015 / 00:10
5
answers

Default Parameters

I'm having a problem with the parameters in a PHP function. For example: function exemplo($par1 = 1, $par2 = 2) { return $par1 . " - " . $par2; } exemplo(); // 1 - 2 exemplo(3); // 3 - 2 exemplo(3, 4); // 3 - 4 exempl...
asked on 24.04.2015 / 22:21
3
answers

Recognize duplicate items in a list

I'm getting a list of items in my action public ActionResult New(List<Itens> Itens) { return View(); } How do I recognize which items are duplicates in this list?     
asked on 27.03.2015 / 22:08
2
answers

I have a multi-lingual website, in SEO question which is the best: Use Subdomains or Directories?

I'm creating a multi-language site (Portuguese, Spanish, English). In the SEO issue, what is the most correct way to use it? Subdomains ( pt.meusite.com ) or Directories ( meusite.com/pt )? Since in the eyes of Google...
asked on 09.08.2014 / 22:48
3
answers

JS or jQuery sessions

Is there any way to use sessions in js or jquery? I would like to do something like the php sessions.     
asked on 19.03.2015 / 13:49
2
answers

In an MVC structure, can we create a model that represents a View (SQL)?

I was arguing with a friend of mine about using views (say MySQL, not the pattern MVC). A question arose in the following way: A Model serves to represent a data structure, being able to read and write data in a table through it. So, co...
asked on 14.09.2015 / 19:12
2
answers

How to identify a specific number in any numeric value?

For example, my variable valor has the value 1354 , note that 13 appears in this numeric value . How can I identify a specific number in any other numeric value? I would like an example in C. The following is the problem stateme...
asked on 30.08.2015 / 01:33
3
answers

Avoid the last occurrence of a concatenated character in a loop

The question is whether I have a foreach or any other repeat structure that receives data from the table and displays the categories: foreach ($categories as $c){ $c.nome . ' - '; } Assuming this code would display as a resu...
asked on 26.02.2015 / 01:27
2
answers

Formatting dates with calendar dd / MM / yyyy

I'm having trouble formatting the date for the dd / MM / yyyy format Como aparece: Sat Feb 26 11:38:28 BRT 2015 Como eu quero que apareça: 04-07-2015 Here is how I show on the screen JOptionPane.showMessageDialog...
asked on 04.07.2015 / 16:44