Posts by EduardoFernandes • 1,925 points
61 posts
-
0
votes2
answers420
viewsA: C# Web Forms - Missing Session
I believe the problem is in the IIS configuration. Probably in it the timeout configuration is shorter.
-
2
votes2
answers78
viewsA: PHP 5.5 implemented the foreach functionality with list. What are the benefits of this?
The advantage is that there is no need to create index variables and retrieve each element of the array using these variables. Everything is provided to you in a simple and compact way. Basically…
phpanswered EduardoFernandes 1,925 -
4
votes2
answers410
viewsA: Array with a text file
Run the code below, where "filename.txt" is the name of your file to be read. The array will be stored in the variable $conteudo $conteudo = array(); $f = fopen("nomedoarquivo.txt", "r"); while…
phpanswered EduardoFernandes 1,925 -
2
votes1
answer311
viewsQ: Install ASP.NET 5 on Linux
I read some news that it is possible to install ASP.NET 5 on Linux. Would someone please have a nice tutorial that could help me with this? I would like to install on Ubuntu.
-
5
votes1
answer995
viewsA: Adding a comma to a string
Do the following: lst = list(a) // transforma sua string em lista txt = ",".join(lst) // coloca vírgula entre as letras Note that this can be done in just one step: a = ",".join(a)…
-
4
votes2
answers1471
viewsA: Allow special characters as Java keyboard input
Use the constructor of Scanner with, overload of encoding, as follows: Scanner skener=new Scanner(file,"ISO-8859-1"); if reading from a file or Scanner skener=new Scanner(System.in,"ISO-8859-1"); if…
javaanswered EduardoFernandes 1,925 -
2
votes1
answer465
viewsA: Error installing apache2 on Ubuntu
To install apache2 in Ubuntu, use the following command: sudo apt-get install apache2. See the reference here.…
-
4
votes4
answers33522
viewsA: How to read a CSV file in Python?
See below for how: >>> import csv >>> with open('eggs.csv', 'rb') as csvfile: ... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|') ... for row in spamreader: ...…
pythonanswered EduardoFernandes 1,925 -
1
votes2
answers726
viewsA: How to use Hashmap in this case?
The program below shows how to do this. First, a list is created where objects Pessoas are created and inserted. Next, you scroll through this list and add HashMap as key, the number and as value…
-
2
votes1
answer178
viewsA: How to remove Android project from SVN?
Remove all . svn folders from your project, "recursively". Under linux, you can use the following command: find . -iname ".svn" -print0 | xargs -0 rm -r
-
1
votes2
answers6461
viewsA: Error opening emulator in Android Studio
First, it ensures that the HAXM installer is included in your SDK Manager, as in the following figure. After downloading the component, run your insalador via command line:…
-
0
votes1
answer259
viewsA: Testing data integrity using Mysql Transactions
Before answering your question, note that to ensure the atomicity of your database operations, you should be concerned about the Isolation Level, that is, ensure that during your purchase the…
-
3
votes2
answers169
viewsA: How to capture the Exception generated by a method whose access is not authorized by a particular user profile
Tag statusCode in your javascript, as shown below: $.ajax({ .... statusCode: { 405: function() { alert( "Você não temn permisão para...." ); } } .... }); The Controlller returns a "Method Not…
-
2
votes1
answer54
viewsA: Nullpointerexception error with class composition
This happened because the attribute protected Sensors sensors[10] was not initialized. You can do this, either in the constructor or in the attribute statement itself, in this way: protected…
-
4
votes2
answers2895
viewsA: Recover Google Maps Address by informing Long and Lat
Use the following URL to get a JSON with the address: http://maps.googleapis.com/maps/api/geocode/json?latlng=44.4647452,7.3553838&sensor=true In this case, the latitude is: 44.4647452 and the…
-
0
votes3
answers229
viewsA: Search HTML LIKE style %.. %
The example below returns all Divs with the value "Lubiscréia". $( "div:contains('Lubiscréia')" ); Or even, filtering by class:…
-
0
votes2
answers69
viewsA: Give same value independent of the order
Sort the String and use the hash function. See the code below >>> a = '1234+4321' >>> b = '4321+1234' >>> a '1234+4321' >>> b '4321+1234' >>> sorted_a =…
-
1
votes2
answers82
viewsA: Error minSdkVersion 1 cannot be smaller than version 4
There is no version "1" android, so the error message. Utilze the 19, for example, which is the Kitkat. Place: <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />. Don’t…
-
2
votes1
answer710
viewsA: Capture information and use when you need Java
If your application is web, this information is usually saved in the application section. Here’s a good explanation of sessions:…
-
6
votes1
answer3125
viewsA: How to set up UTF-8 in Android Studio?
You can solve this problem in two ways: convert the file to utf-8 put the correct type of encoding in your build.Radle script. To convert the file, click the menu, right down in your IDE. Select the…
-
2
votes3
answers438
viewsA: How to make a standalone script using Global.asa
I believe that a better solution would be to use a Scheduler in the event Application_Start of your application. This Scheduler will be fired only once and run every 24 hours. The Quartz is a good…
-
1
votes3
answers275
viewsA: can’t access already instantiated class data
Use the include_once, in that way: <?php include_once('../config/config.php'); // Inclui o arquivo de conexão com o código descrito anteriormente include_once('../sql/class-connection.php'); //…
-
0
votes2
answers1018
viewsA: My js file is not loading
Import javascript this way: <script src='<%=ResolveClientUrl("~/Scripts/Ajax/libAjax.js") %>'></script>
-
0
votes2
answers380
viewsA: Error in getWritableDatabase()
Your dbHelper is not initiated in its Activity. In his oncreate(..._) incise it as follows: dgHelper = new CriaDespesas(this);
-
1
votes2
answers666
viewsA: error message while trying to remove file
Perform the operation with sudo: sudo rm teste.txt If this does not work, perform the following operations: sudo chown root teste.txt sudo chmod 777 teste.txt sudo rm teste.txt…
linuxanswered EduardoFernandes 1,925 -
0
votes2
answers990
viewsA: Joptionpane - Error cancel button
With your code in hand, it’s easier. See correction: valorTotal = ((caixa[0][1] * 100) + (caixa[1][1] * 50) + (caixa[2][1] * 20) + (caixa[3][1] * 10) + (caixa[4][1] * 5) + (caixa[5][1] * 2)); int…
javaanswered EduardoFernandes 1,925 -
0
votes1
answer624
viewsA: Remove all leaves from a binary pascal tree
Just adjust the recursion. See the example below: procedure removeFolhas(p:arv); var v:integer; t:arv; begin if(p = NIL) then exit; removeFolhas(p^.esq); removeFolhas(p^.dir); if((p^.esq = NIL) AND…
pascalanswered EduardoFernandes 1,925 -
5
votes1
answer401
viewsA: How to understand the error message?
Whenever you examine a stacktrace, look for classes you’ve written and exceptions linked to it. In your case, it’s a NullPointerException in class FileUploadBean. See the relevant part of stacktrace…
-
1
votes1
answer228
viewsA: How to receive a value and store it in the position indicated by the user in an array of arrays (matrix)?
To solve your problem simply insert the value for each loop iteration into the coordinates of the matrix. See the example below: int matriz[][] = new int[numLinhas][numColunas]; //FOR PARA RECEBER…
-
4
votes1
answer3080
viewsA: How to use for each in array of arrays(array)?
The namer to traverse the array using "foreach" is as follows: int matriz[][] = new int[1][1]; int valorRecebido = 0; for (int[] vetor : matriz) { for (int elemento : vetor) { valorRecebido =…
-
4
votes2
answers2640
viewsA: Take data attribute value and apply as text in another html element
Yes there is. Look at this jsfiddle. Just put, as you yourself mentioned, data-<elemento> and use it. Note that in the case, it was used data-text and to iterate on it just use the jquery…
-
2
votes2
answers409
viewsA: How to find specific point coordinates
Here are shown examples in HTML page and Android application. HTML page The following example opens a popup when you click on the map: <html xmlns="http://www.w3.org/1999/xhtml"> <head>…
-
1
votes2
answers1376
viewsA: Hide Pop Up Lightbox div when Clicking an Element/button
If you are using jQuery, run the following command to hide the div: $("#divId").hide(); If it is a dialog of jquery-ui open, execute the following command to close the dialog:…
-
4
votes2
answers571
viewsA: How to transmit data securely?
Understand that cryptography is a dense subject that requires a lot of study. I will try here to answer your questions succinctly. 1 - What is time synchronization? In fact this is one of the ways…
-
0
votes1
answer177
viewsA: Data array for controller
Since I don’t know what technology you’re using, I’ll give you three solutions: When the controller(1) saves the data, put it in the session for the controller(2) to retrieve it and use it to send…
codeigniteranswered EduardoFernandes 1,925 -
4
votes2
answers2295
viewsA: How to find CSS images and styles that are not used on a website?
See these two plugins for firefox: https://addons.mozilla.org/en-US/firefox/addon/css-usage/ https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/ See this tool to remove unnecessary…
-
2
votes1
answer1573
viewsA: What is the best way to make an HTTP request on Android?
Utlize Httpclient. See the example below: package com.hostingcompass.web.controller; import org.apache.http.Header; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient;…
-
1
votes2
answers120
viewsA: (Business rule) -Repeated registration
Your code is correct. What is not is the way you work with the parameters. You can do it like this: public class Main { public static void main(String[] args) { menu(); } public static…
-
1
votes1
answer153
viewsA: Can a Model use a Webservice for "business rules"?
I believe this would be a very risky architectural decision. Think of the following situation. Your model moves through all the layers of your application and soon you can call these methods web…
-
2
votes2
answers1792
viewsA: Generate random number with date value and current time with Javascript
See the following example: function dataAleatoria(dataIni) { var dataAtual = new Date(); return new Date(dataIni.getTime() + Math.random() * (dataAtual.getTime() - dataIni.getTime())); } var…
-
2
votes1
answer43
viewsA: Dynamic Data() Jquery Add
The command $('.vor:last').data("tipo_m", v.cob); that you used does not add values but recovers them. To add use something like: jquery.data($('.vor:last'), "tipo_m", v.cob);. Note that for the…
jqueryanswered EduardoFernandes 1,925 -
1
votes2
answers537
viewsA: When should I save my application data to the system registry?
You could think of following solutions: Use an embedded database with the HSQLDB and the H2. If there is really little information, save it in a text file in the format of .properties. I believe…
javaanswered EduardoFernandes 1,925 -
0
votes1
answer458
viewsA: How to browse Hashmap with subkeys?
See the code below, exemplifying several ways to make such an iteration: See that you can access the values via keys, values or by recovering values through keys. Note here the great flexibilities…
-
3
votes1
answer3207
viewsA: How to check if an email has been sent successfully?
After the execution of the method SmtpCliente.Send(mail);, If no exceptions occur, this means that the email was sent to the SMTP server. After that, there is no guarantee that your email will be…
-
2
votes3
answers760
viewsA: How to close mysql connections in C#
Run the query as shown below: DataSet bdDataSet; MySqlConnection conexao; public void inserir() { bdDataSet = new DataSet(); conexao = new MySqlConnection("Server=localhost; Database=teste; Uid=;…
-
5
votes2
answers1287
viewsA: Know last index of a . each
Just you recover the size - length of your result. The code is shown below: $.getJSON("/Contrato/CriarCopiarContrato", { agrupamento: $("#listaAgrupamentos").val() }, function (result) { var len =…
-
2
votes3
answers279
viewsA: How to test whether an instance is dynamic or static?
See in the example below: <?php class MyClass { public function func1(){} public static function func2(){} } $reflection = new ReflectionClass('MyClass'); $func1 =…
phpanswered EduardoFernandes 1,925 -
2
votes3
answers302
viewsA: Practical use of Constant scalar Expressions in PHP and other languages
An interesting example are configuration variables. For example, suppose a scenario where services are consumed, or a basis of approval, or production. These services originate through a URL, which…
-
18
votes4
answers3366
viewsA: Are getters and setters an illusion of encapsulation?
The advantage of using getters and setters is the possibility of validating or modifying data when using this Pattern. For example, suppose you have a class Produto with the attribute preco that…
-
4
votes4
answers1784
viewsA: Confirmation of sending email?
It is not possible because the protocol SMTP does not guarantee email delivery. Look at this link for further explanations.…