Most voted questions
150,413 questions
Sort by count of
-
10
votes2
answers390
viewsWhat types of attacks can I suffer with global variables and how to prevent
Thinking about creating a secure login and registration system, I want to take some measures, as I’ve been reading, I check several errors I committed, mainly regarding Global variables:…
-
10
votes2
answers11707
viewsHow, when and where to use PHP’s magic methods? Get and Set? What’s the difference? Should I use them in every class I create?
I’m starting in POO and would like to know when, where and how I should use the magical methods GET and SET and if possible cite their differences in practice. Should I use them in all the classes I…
-
10
votes2
answers16045
viewsForeach or lambda in lists
Which one do I get the best performance to get the value of a given in a list? I do foreach or lambda(when possible, of course)? I can have this: foreach(var i in lista) { var teste = i.NmCampo; }…
-
10
votes1
answer248
viewsHow to check if the message has been delivered, websocket php
How can I check if a message that is sent by the WEBSOCKETS Server has been delivered to the end point? I use this class:…
-
10
votes5
answers6566
viewsRemove last comma from an array
In this Code below I have a array that returns a comma to me at the end exe: '98602','98603','98604', How can I remove this comma? if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as…
-
10
votes1
answer747
viewsWhy does Codeigniter do so well in benchmarks even if it doesn’t follow the language standards?
I see many people spitting on Codeigniter, saying that it is a framework junk that refuses to follow the "language patterns". But I find it strange to say this of the framework that has the best…
-
10
votes3
answers42472
viewsError Segmentation fault (core dumped)
I’m getting the following error message in my code: Segmentation fault (core dumped) Another thing is, when I performed the same function operation preenche in the main, using ficha.name in place of…
-
10
votes1
answer834
viewsHow is the life cycle of an ASP.NET 5 application?
This is a question that I have always had (including in previous versions of ASP.NET), but I will ask here in the context of ASP.NET 5. The question is this: when building an application with…
-
10
votes1
answer2121
viewsHide default component [arrow] form select in IE
I got a problem here at IE. I am styling the select component of the form, hiding the arrow that comes by default from the browser to load an image in its place. In FF and Chrome was quiet, but in…
-
10
votes1
answer11862
viewsUpload does not work $_FILES Undefined index error
While uploading a file I’m getting the following error: Notice: Undefined index: file in Z: web upload.php on line 3 upload.php: <?php $location = 'uploads/'; $arquivo = $_FILES['file']; if…
phpasked 9 years, 11 months ago Guilherme Nascimento 98,651 -
10
votes3
answers11142
viewsDifference between Console.Read(); and Console.Readline();
I’m starting to learn C# and I got a little confused by one thing. What’s the real difference between Console.Read(); and Console.ReadLine(); ?
-
10
votes1
answer400
viewsIs it good to use global variables for greater readability in the code?
I am implementing an exercise of the Deitel book, How to Program C, 6th edition, the Logo problem in chapter 6. It was an interesting question with legal logical problems etc. The only question of…
-
10
votes1
answer452
viewsjQuery does not use the HTML5 dataset on the date?
When modifying a certain initial value of data from jQuery, I noticed the value of the dataset is not modified. So I drew up the following test: HTML: <div data-value="initial value"…
-
10
votes2
answers2045
viewsAre functions and methods in PHP case-insensitive?
Some time ago, by an accident at the time of a debug I realized that PHP makes no difference between upper and lower case when calling a function. Example: print_r($teste); print_R($teste);…
-
10
votes3
answers5279
viewsHow to check if a variable was set in Python?
Is there any way to check whether a variable was set in Python or not?
-
10
votes1
answer10326
viewsConnect the webservice with SOAP in PHP
I’m trying to connect to the webservice but it’s not working. wsdl address is http://91.205.172.97/globalsight/services/AmbassadorWebService?wsdl PHP code: <?php if (!class_exists('SoapClient'))…
-
10
votes2
answers8126
viewsWhat is the service layer in DDD?
Reading about Ddds I’ve heard about the service layer and I’m having a little doubt about that because from what I read a service can count business logic. Basically the definition I saw is this:…
-
10
votes5
answers17262
viewsHow to use ajax and php to call a function in php?
I’m having difficulty requesting a PHP function via Ajax AJAX code: $.ajax({ url: 'geraSenhaProvisoria.php', type: 'POST', cache: false, data: {geraSenha(6, true, true, true)}, error: function() {…
-
10
votes2
answers15531
viewsHow to find the version of Laravel installed in my project?
I was with the version of Laravel 4.2.7 installed on my computer. I missed two important methods in Illuminate\Database\Eloquent\Builder, which is the whereDoesntHave and the doesntHave. When…
-
10
votes2
answers517
viewsHow does Std::move work?
I would like to understand the operation of std::move. I realized that with the C++11 specification comes this new function, as well as now we have a new operator (&&). What is the semantics…
-
10
votes4
answers58562
viewsCss comments with // instead of /* */
Place // at the beginning of a line creates an invalid property, i.e., CSS ignores that line. div { background-color: cyan; // background-color: red; } I know the CSS standard is using /* */, but…
-
10
votes1
answer1769
viewsCompressing data with Javascript
Is there any way to compress data (strings) using Javascript? I am developing something for a platform where it is not possible to make use of any server language (at least on their host) and we do…
javascriptasked 10 years, 1 month ago waghcwb 1,915 -
10
votes3
answers667
viewsWhat are these attributes in the properties?
What are the names of these "attributes" and what are they used for? Examples: in the declaration of a class: [ComVisibleAttribute(true)] public sealed class SerializableAttribute : Attribute in the…
-
10
votes1
answer470
viewsWhat is the difference between using the class method and the Javascript prototype?
Hello I would like to know if there is any difference between the normal method( created in class ) and the prototype. I am thinking of a high-scale type: various objects (instances) of a certain…
javascriptasked 10 years, 1 month ago Douglas dos Santos 1,019 -
10
votes1
answer3152
viewsupload without refresh with Formdata, jquery
I need to update my script and I want to adapt my upload formats to be upados without the need to refresh. I didn’t enjoy using third party script so I researched and came across this function of…
-
10
votes2
answers4210
viewshow to represent a monetary field with semicolons in javascript jquery
I’m having a huge doubt. I need to take the values that are in the database with decimals of 3 (for example: 56826.497) and show on the screen the value 56.826,497. I’ve tried using the maskMoney…
-
10
votes1
answer8664
viewsSocket between 2 clients and 1 C server
How to receive two connections? The system consists of 2 clients and 1 server, the server must receive the connections and initiate a sequential conversation with the clients. I was able to…
-
10
votes2
answers1053
viewsHow to transform the first letter of words into a string
Having a given string, how to put in large letter (High Box) the first letter of each word? For example: original: 'a música é universal' Caixa Alta: 'A Música É Universal' but also names like…
javascriptasked 10 years, 2 months ago Sergio 133,294 -
10
votes2
answers440
viewsExport Reportviewer report to CSV
In the Reportviewer using Winforms, when creating the report I only have the option to export to PDF, Excel and Word and need to add the option to export in CSV.
-
10
votes1
answer19729
viewsSending Files on Nginx Error "413 Request Entity Too Large"
I’m trying to send a file from 2MB using Nginx, but I keep receiving the 413 arquivo muito grande. Version: Nginx/1.4.6 OS: Ubuntu 14.04 LTS
-
10
votes2
answers1467
viewsMethod to execute when destroying class instance
There is some way to execute a method automatically by destroying a class instance. I have a generic SQL class, where in the constructor I call a method that opens the connection. Only I want to…
-
10
votes1
answer3240
viewsDisplay something when trying to close my site
It is possible to display something (a Alert, or a popup, an optin catcher(newsletter)) when the person tries to close mine website? I’ve seen something like it, that it displays a alert() to…
javascriptasked 10 years, 2 months ago Ale 2,461 -
10
votes1
answer1444
viewsWhat is an Array-Like?
A given string is an array-like, whereas a given number is not. Its respective objects are array-Likes (the objects themselves), right? A declared object, a DOM object is also an arraylike, correct?…
-
10
votes2
answers1330
viewsURL Forwarding With Spring MVC
I want to put in my project access a page in a subdirectory of views. Type views/pessoa/criar.jsp. How can I write a controller who goes to this page? I’m using Spring MVC 3 and…
-
10
votes3
answers561
viewsNth value of a binary search tree
I’ve been trying to create a recursive function from the function that lists a binary tree in order. This function would return the term N-th, in order, from a binary search tree. Each node is in…
-
10
votes3
answers13854
viewsFill string with zeros on the left
I’m doing a work of Operating Systems and need to turn decimal numbers into binaries. So far so good, because the method below takes an integer and converts to binary. My problem is the following:…
-
10
votes4
answers11103
viewsHow to get the last days of the month in PHP
I want to get the last days of the current month. This is the code for today’s date: $datee= date("d/m/Y");
-
10
votes1
answer227
viewsCSS display and visibility - SEO effects
I’m making a website and applying some SEO techniques, but I have a div that needs to be hidden (property display:none; and visibility:hidden;). What is the effect on search engines for this DIV…
-
10
votes2
answers2126
viewsMultiple LEFT JOIN and slow search
In a client application (a school calendar and record of absences/presences) there is this query: SELECT *, the_courses.course_desc as course_name, schedule.id as schedule_id, students.id as…
-
10
votes3
answers2642
viewsReceive array and record multiple lines in Mysql
I have the following HTML form: <h2>Sessao 1</h2> <input type="text" name="ipl[]" class="span12 "> <input type="text" name="spot[]" class="span12 "> <input type="text"…
-
10
votes1
answer333
viewsDelphi estate
I have a component that has the function of connecting to a specific hardware. It connects through the network or serial port. Something like the code below: TConexao = (conRede, conSerial);…
-
10
votes2
answers591
viewsNested class in Java
I need to have nested classes in Java. Why the following implementation doesn’t work? public class A{ private class B{ public B(){ System.out.println("class B"); } } public static void main(String[]…
-
10
votes2
answers19497
viewsHow to get a snippet of a string?
I have a string like this: ~/Areas/Teste/Views/home/index.cshtml I just need the word that comes right after ~/Areas/, in the case Teste (remembering that this word may vary in size). How do?…
-
10
votes3
answers2035
viewsInterface or Abstract?
I read several contents on this subject, until arriving at this example: public interface Funcionario{ public void trabalha(); public void recebe(double salario); } public abstract class Geek…
java oop software-engineering interface abstract-classesasked 10 years, 3 months ago Franchesco 5,144 -
10
votes2
answers5369
viewsCommunication with Pagseguro
I need to make an application to communicate with the pagseguro. That is he makes the purchase, I send and then I need to automatically update in the bank when you make the payment. Until sending to…
asp.net-mvcasked 10 years, 3 months ago Felipe 327 -
10
votes1
answer269
viewsDifficulty in Syntax
I would like you to explain this function, I do not understand this syntax: double sum_arithmetic(double x0, double r, int n) { return n == 0 ? 0 : x0 + sum_arithmetic(x0 + r, r, n-1); }…
-
10
votes2
answers882
viewsStandard for typifying errors/exceptions?
As far as I know, Javascript has no error typing. In C# and Java, it is possible to do things like: try { /* .. snip .. */ } catch (FooException foo) { /* .. snip .. */ } catch (BarException bar) {…
-
10
votes4
answers24249
viewsWhat is the right way to connect to the Mysqli database
I have a question that has brought me several incompatibilities. With the evolution of PHP and Mysql, more recent versions have emerged, this way Mysqli. That’s where my problem lies, I would like…
-
10
votes4
answers1502
viewsHow to make a layout ready for all resolutions
I know it sounds confusing, there is some way for a layout to be "prepared" to be responsively visible when the customer resizes the browser and to any device?
css3asked 10 years, 4 months ago adventistapr 5,498 -
10
votes1
answer4542
views3 layers vs MVC
3 layers: DAL (Where the classes (model) and bank operations are located BLL (Where the business rule is) Presentation (Usually the WEB) An example: DAL public class AlunoBanco { public void…