Posts by noNihongo • 2,004 points
30 posts
-
3
votes2
answers1038
viewsQ: Java Timestamp and Mysql Timestamp
Problem: I’m storing a timestamp in MYSQL, but when I reset this timestamp I’m losing the thousandths. Java timestamp with thousandths. MYSQL timestamp without thousandths. Why does this occur? How…
-
0
votes5
answers145
viewsA: Strange behavior in a possible way to comment
You should use the comments: /* */ or // And it’s not good to use / #### ... ### / because this is a regex. I hope I’ve helped.
javascriptanswered noNihongo 2,004 -
1
votes2
answers267
viewsQ: How to use cookies or other local storage in Flash?
I would like to persist some information in the program I am doing in Flash. I need to save primitive data from internal controls of my application, and thought of something like a local XML or a…
-
29
votes3
answers1131
viewsQ: String and its efficiency
Doubt I would like to know what design patterns or other "nerdy" things have been applied to this class StringBuffer. Why does String create new objects in a concatenation? As far as I know, String…
-
3
votes1
answer107
viewsQ: Socket with Timertask
I want to request the serverSocket a response (some information) every 5 seconds. I rode my socket and I’m wearing a TimerTask to execute a method every 5 seconds, but only the first execution is…
-
2
votes1
answer160
viewsQ: Serversocket and Socket
I’m trying to create a ServerSocket: public class RunServer { public static void main(String[] args) { try { byte[] buffer = new byte[1024]; String passwordCript; ServerSocket socketRecepcao = new…
-
6
votes2
answers9026
viewsQ: The difference between Software Service and Standalone
I have a question about Softwares who function as Service and others that function as Standalone. Software Service (background process) A background process is a computer process that runs "in…
-
14
votes3
answers337
viewsQ: Doubt about the responsibility of a get()
It is acceptable to have a method getter that you receive a parameter to be able to have a return variation? Example: getAllNome("M"); <- retorna tudo que for masculino. getAllNome("F"); <-…
-
5
votes2
answers148
viewsA: Why does the Chrome console return 8 when I type 010?
The browser is making a DECIMAL to OCTAL conversion Decimal for octal: 10 is 8; 100 is 64; 45 is 55. And so on. Remembering that 010 is equivalent to 10, as well as 0100 is equal to 100. How to make…
-
2
votes3
answers2600
viewsA: Align text within <select> in Firefox
You can also use this form and leave the text away from the left. CSS select { width: 200px; padding: 10px 10px 10px 40px; } or select { width: 200px; padding-top: 10px; padding-bottom: 10px;…
-
9
votes2
answers6704
views -
4
votes2
answers2530
viewsQ: Maven - Configuring the Mainclass
Problem: When I create a JAR for eclipse it works smoothly, but I’m trying to enjoy the JAR that the Maven is creating and I realized that it does not perform, because my class main is not in the…
-
2
votes3
answers1689
viewsA: How to read file passing part of the name in Java
This method solved a similar problem I had. FileFilter filter = new FileFilter() { public boolean accept(File file) { return file.getName().endsWith("name.txt"); } }; File dir = new…
-
2
votes6
answers11947
viewsA: How to create a password reset link?
Remember Password Can create a link, where user informs the e-mail and with this email you provide a link to troca de senha, since if the password is encrypted in the bank I believe I do not have a…
-
3
votes1
answer703
viewsQ: Picking up Timeinmillis and using Timestamp
Doubt: I know two ways and capture one TimeInMillis() does anyone know the difference and what is the most efficient? What if there is a third way to capture that value? Option 1:…
-
11
votes4
answers1866
viewsQ: How do Stringbuffer() and Stringbuilder() behave?
Problem and Mystery: StringBuffer y = new StringBuffer("Eduardo"); I’m wearing a StringBuffer, because I need to add some values later to it. I was debugging and noticed that there is a blank at the…
-
11
votes2
answers14796
viewsQ: Turn Byte into String
Problem: I’m getting byte and when I try to turn into String is making a mistake. ... byte[] msgBytes = ch.decode(hex, ch.key()); // retorna byte String msgDecode = msgBytes.toString(); // tentando…
-
4
votes1
answer435
viewsQ: Using BASE64 in Java
Problem: I can’t import the classes BASE64Decoder and BASE64Encoder, there are N code that use them and when I use them everything that is related does not work precisely because they are not found.…
-
11
votes5
answers61683
viewsQ: Using line break " n" in Java
What problem can a Java programmer have when using "\n" to jump line? Observing: I’ve used it for N reasons, record a file TXT and others.
-
3
votes3
answers166
viewsQ: Form waiting for a request
Problem My form makes a statement requisição a database (select, insert, update, delete values), but whenever these requests are made a lock occurs in the form (a freeze)! How to prevent forms from…
-
15
votes7
answers20768
viewsA: How to protect source code?
Solution for Source Code Protection The only alternative I’ve found for this is known as Ofuscamento of .JAR, with it you will difficulty reverse engineering in your application follows below some…
-
1
votes2
answers4563
viewsA: Virtual machine does not share folder
Solution in Virtualbox: About Guestadditions: Guest Additions This is what we have to do: Virtualbox Guest Additions for all operating systems supported guests are provided as a CD image file…
-
1
votes2
answers4563
viewsQ: Virtual machine does not share folder
Problem: Use Virtual Box and MVWare in both programs I cannot share folder, using their internal option Pasta Compartilha. Look at the images for a better explanation of the problem: Photo 1: Pasta…
-
0
votes3
answers150
viewsA: Crash after reading value with scanf
Problem: scanf ("%d, &sal"); <- You can’t leave all the content of scanf in quotes. Correction: scanf ("%d", &sal); <- The variable that will receive the value of input cannot be…
-
2
votes2
answers891
viewsQ: Obfuscating Java code with Proguard
Problem: I’m getting warnings of Proguard and with it I can’t outshine my .jar, this is the first time I’ve received these warnings and with that I can’t finish the obfuscation. Image with details…
-
3
votes1
answer1060
viewsQ: Schedule Tasks with Timer
Situation: Description: I have this Timer to perform my tasks in a certain period of time according to the seconds informed. Problem: When running the program the tasks starts by ignoring the…
-
5
votes2
answers8082
viewsQ: Maven how to define JDK version?
Problem: When I create a project maven the project always got the version JDK 1.5, change the JDK version in the IDE when doing a Maven > Project Update he goes back to JDK 1.5. The archive…
-
6
votes3
answers6578
viewsQ: How to resolve the SLF4J failure in Maven?
Problem with Maven install: When I spin in the eclipse Run As > Maven install I always get that message: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to…
-
23
votes4
answers3497
viewsQ: Capture the values of JSON that is Online
My problem: I need to read a JSON that is in a certain URL. I tried the following code, but it doesn’t work: JSONObject jsonObjeto; JSONParser parser = new JSONParser(); URL url = new…
-
2
votes1
answer3372
views