Posts by lemoce • 661 points
30 posts
-
-1
votes2
answers218
viewsA: How to break an infinite loop using Ctrl-C in Java
I made a example minimum and functional Stackoverflow site. In my example, I didn’t need to add a finishing hook. The operation is very simple, a Thread was created to be the application’s Listener…
-
2
votes2
answers131
viewsA: Connect to Ubuntu Server with Putty+Xming
Following this reference xming+Putty, looks like you have to score Enable X11 Forwarding and set X11 display location with localhost:0.0, as shown. This way, your terminal will have the correct…
-
1
votes0
answers319
viewsQ: Documentation in C#
I would like to document an api for C#, in the style javadoc. Is there any way to memorize/comment the code so that documentation of the types and their members is generated automatically? C# gives…
-
1
votes2
answers3965
viewsA: What Development Environments (IDE) for Android and IOS using Lua?
For ios, I’ve used the Codea. It seems to be friendly, with a built-in game engine. For prototypes and in early stages for design evaluation, it can help.…
-
5
votes2
answers605
viewsA: Why do I need './' to run Unix commands?
You need it because the current directory is not in PATH. Linux/Unix always looks in the $PATH environment variable. Windows already has a behavior: if it is not on PATH, looks in the current…
-
1
votes3
answers68
viewsA: Shell: download and unpack in a row
I managed using wget -qO- [link] | tar xz The z parameter was inserted because it is a tar.gz file.
-
0
votes3
answers68
viewsQ: Shell: download and unpack in a row
I tried to use wget with tar as follows wget -qO- [url] | tar xvf but I can’t get the expected effect. There are other ways to do this?
-
1
votes6
answers7179
views -
0
votes2
answers2506
views -
1
votes3
answers21057
viewsA: read text file and generate lists for each line with element separation
I will give an answer only for the conversion of the array, the other two responses of colleagues show how to read the file line by line. First, uses a function to convert the value to integer, if…
-
6
votes1
answer163
viewsA: What is the "@" inside the Solve function printf for
In C, @is an int. But, the type char is the size of 1 byte. main() { char arroba = '@'; printf("tamanho '@' = %d\n", sizeof('@')); printf("tamanho char = %d\n", sizeof(arroba)); return 0; } The…
-
1
votes2
answers38
viewsA: C++ method assignment
There’s an error in your code: media1 = aluno1->media(float n1, float n2); media2 = aluno2->media(float n1, float n2); You don’t need to declare the type before using the function. Switch to:…
-
1
votes1
answer74
views -
1
votes2
answers116
viewsA: ERROR - Cannot stat file /proc/32641/fd/338 - What is the utility of the proc directory?
The directory /proc contains some statistics about the machine. In general, they are raw files without formatting. For example: [leandro@localhost ~]$ cat /proc/cpuinfo processor : 0 vendor_id :…
-
3
votes1
answer2112
viewsA: 2019 LNK ERROR - How to resolve?
You need to mark your project as Console Application. It is interesting to read these two references: Creating a Console Application and Walkthrough: Creating a Standard C++ Program (C++). There is…
-
1
votes1
answer70
viewsQ: Why use the rational type?
Why do languages like Haskell and Clojure adopt rationale as a type? Why would I use Rationale instead of Float or Double?
-
-1
votes1
answer691
viewsA: Doubt with bool in C
I edited your program #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> int main() { char *palavras[] = {"maca", "uva", "pera"}; int tamanho =…
-
2
votes1
answer497
viewsA: Direct link does not work with wget on ubuntu
It looks like your wget is set by default with --max-redirect 0. This implies that you will not redirect after a 301 and 302. For this you can use the options -L of the Curl and --max-redirect of…
-
7
votes2
answers2142
viewsQ: Difference between /dev/urandom and /dev/Random
I recently read a post on the oracle jdbc driver, talking about making the following configuration on jvm running on Linux: -Djava.security.egd=file:/dev/../dev/urandom According to the reference,…
-
1
votes2
answers630
viewsA: Java Fork/Join Does it work the same as C Fork?
From what I read of tutorial, is a little different. In C, when you do Fork, you have 2 processes, a father and a son. In possession of the child’s pid, the parent process can do the Join, when the…
-
0
votes1
answer178
viewsQ: Code Conventions in C#
I have some experience with Java and C. Recently, I picked up a project in C#. I wonder if there is a style guide from Microsoft or some other entity to learn what the C programming style looks…
-
1
votes1
answer301
viewsA: Allow unmanaged DLL’s in IIS
At first, you don’t need to set anything up. Just be visible in the Windows PATH or in the Windows/System32 directory, this to dll x64. For x86, you need to put inside the Windows/Syswow64/System32…
-
0
votes1
answer2879
viewsA: Consume wsdl webservice in java
You can use the command: wsimport -d [caminho_destino_do_source] [arquivo_wsdl] In this destination, classes will be generated, just import into your IDE.
-
2
votes2
answers3951
viewsA: Factorial function in C does not return the result
By default, C returns 0 for a function without Return, for example the function int teste() { } no build error, because the C language returns zero as a default Return. Then, the function becomes:…
-
3
votes6
answers6389
viewsA: What is a legacy code?
This is a definition of my authorship: "Legacy code is one that is inherited and you don’t have enough confidence to modify it." All created code has the potential to become legacy, yes. But not all…
-
1
votes1
answer369
viewsA: Convert cer certificate without PK to PCKS12
From what I understood from the last link, the command to generate the P12 was: openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -name "Whatever" In the link itself, it says…
-
0
votes1
answer363
viewsA: How to compile C/C++ for Linux/Mac OS on a Windows?
I think the most important thing is to do your project in a way that you can easily compile on multiple platforms. I use the cmake (cmake cross compiling). With cmake, I can compile for Visual…
-
3
votes4
answers3293
viewsA: Separate String Number Letters
It’s just the solution of the same problem with another flavor. String chars = "A1B2C3D44F555"; List <Character> letters = chars.chars(). boxed(). map(ch -> (char) ch.intValue()).…
-
3
votes1
answer75
viewsQ: How to use Monad batteries?
I studied the topic of Monad and decided to make a program to test my knowledge. import Control.Monad.IO.Class (liftIO) import qualified Control.Monad.State as ST import Control.Monad.Trans.State…
-
0
votes2
answers1590
viewsA: Wildfly error: [org.jboss.remoting.remote.Connection] (XNIO-1 I/O-2) JBREM000200: Remote Connection failed
I found a reference. As a workaround, you should start Jboss with -Djboss.remoting.pooled-buffers=false. Even so, it is interesting to read the Issue to understand what happens. Other reference says…