Posts by Daniel C. Sobral • 2,050 points
20 posts
-
4
votes1
answer292
viewsA: Scala memory leak and processes (memory Leak)
These objects are all part of the scala.collection.concurrent.TrieMap. As, from what you indicated, who uses this is the SBT, my suggestion is that you stop using the SBT to start your application.…
-
30
votes3
answers4357
viewsA: Difference between Date, sql. Date and Calendar
It is best to understand this from a historical point of view. The first version of Java had a class for date and time: java.util.Date. This class contains information: an instant in time. It makes…
-
5
votes1
answer160
viewsA: Serversocket and Socket
Basically, there is already something listening on this door (22300). Possibly your own program, running in the background -- take a look at the java processes, make sure to kill them all, and try…
-
3
votes2
answers710
viewsA: Static string being created with wrong Encode
Of the documentation of javac: -encoding encoding Set the source file encoding name, such as EUC-JP and UTF-8. If -encoding is not specified, the Platform default converter is used. That is, if not…
-
20
votes2
answers5931
viewsA: git merge or rebase
Let’s consider the scenario below to better understand what happens and which option to use: --- A --- B --- C --- D --- remotes/origin/master \ --- E --- F --- master Let’s say you based your work…
gitanswered Daniel C. Sobral 2,050 -
4
votes1
answer39
viewsA: How to turn an Ipath into Path
Thus: Path path = Paths.get(iPath.toFile().toURI());
javaanswered Daniel C. Sobral 2,050 -
2
votes4
answers1259
viewsA: Git merge between branches with submodules
First, merge with the parameter --no-commit: git merge --no-ff --no-commit projeto1 At that point, the merge will have been done, but the commit has not yet been performed. Take the opportunity to…
-
5
votes4
answers2018
viewsA: How to use a class-specific thread with multiple threads?
You don’t "access" a thread. You start it, and it keeps running. By the way, your program is already running on a thread -- what you do is start new threads. It is possible to coordinate threads…
-
6
votes1
answer4691
viewsA: GIT/Github Versioning Conflict for the same branch and only one commiting user
Instead of giving git pull, make a git fetch, and then git log origin/branch and git log branch to compare the location with the remote, and find out what exactly is on the remote that has no…
-
6
votes2
answers372
viewsA: How to create regexReplace for a delimiter?
I would use a more direct translation than was stated: any | provided that it is not preceded by \. That, in regex, is: (?<!\\)\| With this, you can make this substitution in a single line:…
-
2
votes4
answers228
viewsA: Read XML documentation generated by Visual Studio
I recommend the Doxygen. Some examples of doxygen documentation: Precog Client (very simple) Craig’s Utility Library (more complete)…
-
2
votes3
answers1094
viewsA: Assign value to a dictionary variable that is optional
This is no good? def uma_funcao(um_dict = {}): um_dict['uma_chave'] = True return um_dict I don’t understand why to assign None rather than assign {} directly. If there is any reason for this,…
-
16
votes1
answer1315
viewsA: How does Spliterator work in Java 8?
The Spliterator looks more like a class created for other more sophisticated classes to use. The basic logic is in trySplit(), attempting to divide the remaining elements in two Spliterator: the…
-
4
votes5
answers2222
viewsA: Which libraries to develop a Restful API in JAVA?
I would use the Play! Framework. See also the documentation specific to Java. The route file allows the creation of REST interfaces very easily, for example: # Home page GET /…
-
9
votes4
answers1546
viewsA: How can I optimize a recursive method for finding ancestors?
The problem is not exponential, it is linear, but it is linear in the number of people’s ancestors: there is no guarantee that John is not Mary’s ancestor without examining all of Mary’s ancestors.…
-
23
votes5
answers32714
viewsA: Java Library for Brazilian Electronic Invoice (Nfe)
I know of jNFE and of Jenifer. I didn’t use either, but I put more faith in Jenifer. In github they also have the Caelum-Stella, which has an Nfe module, although not documented on the wiki. Alias,…
-
8
votes2
answers419
viewsA: How do Nginx provide pre-compressed content?
Look, I think you confused module. Httpgzipstaticmodule serves files pre-compressed if they exist. That is, if you have image.png and image.png.gz and the customer asks image.png, the module will…
-
8
votes4
answers805
viewsA: How to use Simpledateformat in concurrent environments?
I personally think it’s best to set aside all pre-Jjava 8 date and time classes and use the JODA Time. JODA Time in general is immutable and thread-safe. With it, would look like this: // A…
-
11
votes3
answers2369
viewsA: Definition of the day of the week in the Gregoriancalendar
Up to Java 7 For the purpose of the following discussion, note that France starts the week on Monday while the US starts on Sunday. The code below is running in Scala REPL, calling the Java…
-
7
votes1
answer112
viewsQ: How to use SBT 0.12 and 0.13 at the same time?
I have the SBT 0.12 installed on my computer, with several plugins but I have seen several projects that are already using the SBT 0.13. How can I have you both on my machine at the same time,…
sbtasked Daniel C. Sobral 2,050