Posts by g.carvalho97 • 681 points
21 posts
-
0
votes3
answers280
viewsA: How to compare data with accents in the database?
I recommend you take a look at the PHP documentation and look for the functions utf8_encode and utf8_decode. When sending a string to BD, force the correct encoding on it with utf8_encode and when…
-
1
votes3
answers1681
viewsA: Find day of the week of the first day of January from the date of Easter
It seems to me that this concept on the Wikipedia page itself is incorrect or was misinterpreted by me, but I found a solution that suits me very well: To reach the 1st of January from any date, you…
canswered g.carvalho97 681 -
1
votes3
answers1681
viewsQ: Find day of the week of the first day of January from the date of Easter
I have a college assignment in which I must build a calendar on C from the date of Easter of a given year. I can find the date of Easter and correctly build the calendar in ASCII art, but I can’t…
casked g.carvalho97 681 -
2
votes1
answer450
viewsA: Call Java class (.JAR) using C++ (.EXE)?
As stated in the comments, this is not practical and does not make as much sense even to the end user. What I can recommend is to create an installer that extracts files from your program in a…
-
2
votes3
answers1012
viewsA: Recover md5 password from an Android application
First, change your hashing algorithm. MD5 is not recommended for passwords, and can be broken easily. Take a look at the algorithms SHA256, SHA512, Bcrypt and Blowfish (I recommend the last two, the…
-
1
votes3
answers831
viewsA: Changing the theme of a website
Wouldn’t it be better to put button image rules in CSS as well? This way, in addition to changing the CSS, you can change all the properties of your entire site and do various themes. But if you…
-
2
votes3
answers220
viewsA: Show query (Problem Different Id’s)
First, normalize your database. Even though the company or department will only have 16 employees, it is a very bad practice to keep 16 tables in your database, because if another programmer has to…
-
3
votes3
answers456
viewsA: Why does IDLE not finish running the program automatically?
This is due to the fact that IDLE uses Python’s own console to run its programs, line by line. Therefore, when the execution of your program ends, IDLE does not exit Python automatically, because…
-
1
votes2
answers545
viewsA: Right structure to work with java (JSP)
Since you asked about patterns... The most common is the MVC(Model-View-Controller): Model: Class where is the business logic and logic of the program. EX.: Ejbs, Beans, Daos. Controller: Class that…
-
2
votes3
answers856
viewsA: Problem running Session start!
As said in the stacktraces that are leaking on your site: Warning: session_start() [function.session-start]: open(/var/tmp/sessions/sess_7ekql9e05ss2pnkat0d01bilu4, O_RDWR) failed: No such file or…
phpanswered g.carvalho97 681 -
0
votes2
answers505
viewsA: Passing Different Object Types to a Tablemodel
Since you have different lists, you will have to create one TableModel for each. Ex: One for List<Livro>, one for List<Professores>, one for List<Alunos> and etc. Because your…
-
0
votes3
answers953
viewsA: php script running as sudo
You can already create the folder with permissions for everyone to access: mkdir("pasta", 0777); To run any linux command in PHP as an admin, you must create a root password file and pass it to…
-
1
votes1
answer875
viewsA: Return json to a variable
If so, you can create this array in PHP as you are creating it, and send it through a function: <?PHP $array3 = array(array('0,1300', 'Thalita', 'Nicole')); $jsonArr=json_encode($array3); ?>…
-
2
votes3
answers603
viewsA: Multithread in web application
The best solution would be to create a stack for each user, and limit all of them to run only 3 threads at once, and put the rest on ThreadPoolExecutor. Thus, as the stack will not cease to exist…
-
2
votes1
answer949
viewsA: Tomcat continues to show old files
Stop all instances of Tomcat on your computer and uninstall Tomcat (if installed). Then delete all directories that belonged to Tomcat (Tomcat directories and applications) and reinstall Tomcat. I…
tomcatanswered g.carvalho97 681 -
4
votes1
answer387
viewsA: Does Codeigniter work under Linux?
Frameworks in PHP are independent of the platform your server is running, they only depend on the version of PHP installed! Before installing Codeigniter check if it supports the PHP version…
-
1
votes2
answers1540
viewsA: Jtextarea receives the append but does not display the text
Your method code writeTextArea(String msg) could be like this: private void writeTextArea(String msg){ area.setText(area.getText()+msg+"\n"); area.repaint(); } Basically it defines your Jtextarea…
-
1
votes1
answer188
viewsA: I get nothing from php on android
Your SQL query is not escaping the variable, if it is a string, it may be causing problems when the database runs the query. Change to: $sql=sprintf("select * from info where Tecnica = '%s' order by…
-
4
votes4
answers13723
viewsA: Hide Javascript code
You can use this site to "compress" your Javascript code, if you want to obfuscate the code, check the option "Base62". Remembering that there is no way you can completely hide your Javascript,…
javascriptanswered g.carvalho97 681 -
1
votes2
answers1295
viewsA: Customization of Jtextfields
You could start by exploring the methods setBorder(Border border) and setBackground(Color bg) to change edges and background color. For example: photo_panel.setBackground(Color.red) //Muda a cor de…
-
17
votes2
answers3267
viewsQ: When and why should we use polymorphism?
When and why should we use polymorphism in Java, because so far I’ve only used it to make multiple windows based on a model. The polymorphism the way I’m applying is better than making one window…