All Questions

2
answers

Regular expression start, end

I have two regular expressions: $exp1 = '/^abc.*\_20150430.txt$/' $exp2 = '/^def.*\_20150430.txt$/' It should return true for files started by abc in the first and def in the second. In both expressions the string should end with _20...
asked on 30.04.2015 / 20:49
2
answers

Why can this happen in a foreach?

I built two simple classes: import java.util.ArrayList; import java.util.List; public class Aluna { String nome; String idade; String cpf; List<Aluna> listar(){ ArrayList<Aluna> aluns = new ArrayList<>(); Aluna...
asked on 14.02.2016 / 17:34
4
answers

What is the second array_keys parameter for?

I was giving a stir in the sublime text and I came across something I did not expect when I typed the function array_keys array_keys(arg, search_value, strict); I did the test and the second parameter actually works. What is the...
asked on 02.12.2015 / 17:32
2
answers

How to declare a function inside another function in C #?

In Delphi it is possible to declare function within the block of a given function, see this example done in Delphi: procedure TForm1.btnRunClick(Sender: TObject); begin mostrarNome('Carvalho'); end; function TForm1.mostrarNome(nome: String)...
asked on 24.05.2016 / 03:20
2
answers

Collision of names between class and namespace

Is it wrong, bad practice or can I have problems with class equal to namespace ? Example: namespace Cielo { public class Cielo { } } It has worked, in some places it gets a bit strange to call Cielo.Cielo.etc . Should...
asked on 29.04.2016 / 20:08
3
answers

PHP Error - Empty () Function

I have the following error: Fatal error: Can't use method return value in write context in /home/username/public_html/Administrar/application/controllers/holerites.php on line 29 The following sequence of lines 29 follows: if(empty($this-...
asked on 01.08.2015 / 04:23
1
answer

What is the function of the array?

I'm studying algorithms with Portugol and I'm having difficulty understanding the vector's function in code. I already know how to use this structure.     
asked on 22.04.2016 / 22:10
4
answers

What is the difference between creating a module normally and creating a module within a function?

I've been looking at some sample projects in AngularJS and have come across several times with the following code: (function () { angular.module('meuModulo', [ 'alguma.dependencia', 'outra.dependencia' ]); })(); Th...
asked on 30.03.2016 / 15:46
5
answers

Why does NetBeans warn you that you should not access global variables directly?

NetBeans suggests that we do not access the global variables of PHP type $_SERVER[''] directly, what is the suggestion in this case? It's usually done like this: <?php $ip = $_SERVER["REMOTE_ADDR"]; ?> What is the best...
asked on 23.12.2015 / 13:32
3
answers

Why was the parameterized class attribute T not instantiated?

I have this class that implements the IDAO interface package DAO; import java.util.ArrayList; public class BdApp<T> implements IDAO<T> { ArrayList<T> lst = new ArrayList<T>(); //ArrayList<Administrador> lstAdm...
asked on 11.02.2016 / 00:31