Posts by Sid • 2,921 points
21 posts
-
4
votes3
answers404
viewsQ: How do you test something "unstoppable"?
Testing certain components of a system is simple if that component does not have very relevant dependencies, such as a class like this: public class Data { private final String _field; public…
-
16
votes1
answer462
viewsQ: Security - Syscall inside shellcode does not run
I’m studying information security and doing experiments trying to exploit a classic case of buffer overflow. I succeeded in creating the shellcode, in its injection into the code and its execution,…
-
0
votes1
answer32
viewsQ: Ruby - How to hit LOAD_PATH at development time?
First: I’m a newcomer to Ruby. I have a Ruby project that obeys the design pattern of the vast majority of projects. Therefore, the main executable is in bin/. bin/exec lib/ | -- library.rb --…
-
29
votes1
answer7393
viewsQ: Why does Java consume so much memory?
I wrote this little program in Java to download images of a thread in a imageboard: public class FourChanThreadImageDownloader { private static void usage() { System.out.println("java…
-
9
votes1
answer596
viewsQ: How does software licensing work?
I’ve searched a lot on Google but I couldn’t find an answer that made everything clear. Suppose I have a home project and publish this code in a very famous repository, like the Github. And he’s…
-
13
votes2
answers668
viewsQ: Why is a Fibonacci faster in Java than in C?
Not exactly like this, but I noticed that when the function needs more time to compute Fibonacci, Java actually does better than C. Here are the implementations: C: #include<stdio.h> unsigned…
-
38
votes2
answers2228
viewsQ: What is the difference between a lambda expression, a closure and a delegate?
From what I’ve been reading the three concepts are quite similar, but I was confused as to the clear and exact definition of them. As far as I know, a lambda expression for being understood as a…
-
4
votes1
answer2408
viewsQ: Why should I use getResource()?
In Java it is nothing unusual to see codes that carry images, audio files, XML and other things like this: final ImageIcon programLogo = new ImageIcon("res" + System.getProperty("file.separator") +…
-
2
votes1
answer105
viewsQ: How do you implement a "Preprocessor" Annotation?
I learned that Annotations in Java are just a way to inject metainformation into the code. However, I have seen that frameworks and some libraries have Annotations that "magically" generate code or…
-
2
votes1
answer377
viewsQ: Is it only possible to write code with bugs or vulnerabilities in C?
Anyone who is programmer and experienced knows an implicit truth: C is practically the language of the gods. C corresponds to at least 98% of the software that runs on all computers and thanks to…
-
35
votes2
answers3305
viewsQ: How to best treat exceptions in Java?
Who has created great programs in Java knows of a very common headache: Do not know where to play the flow of Exceptions. Many decide to do things like: Treat everything as Exception (the superclass…
-
3
votes1
answer1642
viewsQ: How to rewind the file pointer correctly in Java?
Actually the problem is quite complex, but I’m going to try to give a notion that I think will be understandable. I have a method in an application that initializes objects to I/O in accordance with…
-
16
votes3
answers2459
viewsQ: How useful are Java Annotations?
When I first studied Java, when I saw about Annotations I only saw that they are useful for generating metadata, but I didn’t see anything that influenced the behavior of the program. Basically, I…
-
16
votes1
answer673
viewsQ: Does compiling on your computer really improve performance?
Any programmer knows that when building a C/C++, the compiler can optimize the code to generate faster executables. But, it is also said that there is the compiler optimization for your processor.…
-
66
votes2
answers38176
viewsQ: How do hexadecimal numbers work?
I have seen that software libraries written in C, in general, use hexadecimal numbers. And Assembly programmers also need to be ninjas with this numerical system. It is not anywhere that one finds a…
-
1
votes3
answers250
viewsA: Java 8 + Android
Not. This is because Android does not use the official Oracle JDK, as already said. But as far as I know, it uses the Apache Harmony class library and also implements a completely different…
-
20
votes2
answers1104
viewsQ: How is Garbage Collection implemented in Go?
In Golang saw that this language is compiled (and indeed, the website itself tells for which architectures the compilers generate code), and, to my surprise, is Garbage Collected! Garbage Collection…
-
7
votes2
answers358
viewsQ: Reference in Flyweight design pattern
There’s something about Desing Pattern Flyweight that’s really getting me confused. Briefly, the pattern says that to save memory in a situation where you use several similar objects, you use a…
-
10
votes1
answer1271
viewsQ: Because the practice of "constant parameter" exists only in C
In C, there is the practice of applying the "const" modifier to function parameters when the function does not aim to change the parameter. As in this code: char process_string(const char *str);…
-
12
votes6
answers5531
viewsQ: Why use Javascript if there are so many other technologies to generate dynamic content?
Specialized technologies and programming languages for the Web, such as PHP, have as part of their set of roles, generate dynamic HTML content (the page will be presented by the browser according to…
-
1
votes2
answers8798
viewsQ: How to install Java EE perspective in Eclipse?
I want to start studying Java for the web (Servlets, JSP, EJB, Servlets and JSP). I have already installed Tomcat, JRE, JDK 7 and Eclipse Kepler Standard. How do I set up Eclipse to add JEE…