Stefano Carniel

Ranch Hand
+ Follow
since Aug 01, 2013
Stefano likes ...
Android Java Spring
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stefano Carniel

Thank you for the answer. I already know Java :-). Well, If I have to choose between JavaFx and Swing, I think I will go for the latter, but for now I will wait for further suggestions.
3 months ago
Hello folks,
I need to develop an application in Java which should be a kind of DSP workbench. The application should:
  • Allow to select a media file (wav)
  • Open the file and show a chart of the samples in the time domain (one chart for each channel if there are more than one)
  • Calculate the FFT
  • Display a chart of the frequency domain

  • Enough for now. Now the problem: which solution should I choose for developing the user interface? I read a lot of articles and the situation looks quite confused.

    What I tried so far:
  • JavaFx: I would avoid it since it's not sure it will be maintained
  • Swing: could be ok, but it has ugly components rendering (windows, fonts,...) and looks like (let me say) old style

  • Please, note Java is not a strong constraint, I could use Javascript too, which has tons of nice gui frameworks, but I'm not sure this language fits the computation requirements of such an application.
    I think it could be possible to develop the program as web application, to deal with local files?

    I hope my problem is clear, and someone could point me in a good direction.

    3 months ago
    Hello all,
    I need to implement a client/server application that works in this way:

    1 - On server side I have some values, picked from the sensors on a machine. These values change randomly, they could also stay constant
    2 - I have a publisher/subscriber mechanism that notifies me when one or more variable change
    3 - I need a web page that connect to the server and shows data in real time, I guessed I can use React with socket-io.client
    4 - What I don't know is how to implement the server  side; I would like to use Webflux with WebSockets, but how can I bind a Flux to an unpredictable train of variable-changed events? As far as I know, Flux implements a continuous emission of data, for example the record from a database table, but how to deal with random events?

    I hope the problem is clear, I would like a suggestion on how to structure the application.

    Thank you
    7 months ago
    If you can, take a look at this book. It explains very well these concepts, not only, it teaches how to implement classes that support this programming style (methods cascade).
    Honestly, what your book states is not in contrast whith what mine states. Functional programming can help to essentially produce safer and more concise code, but for sure this code is less readable (but not necessarily less clean).
    1 year ago
    Don't know what that book focus on, but functional programming states the opposite. In particular, afaik, with the introduction of the stream (in Java >= 8), it is common practice to call method in "cascade" style.
    1 year ago
    a suggestion: change the name of your getters and setters to be clearer (getFirstname(), setFirstname(String firstname),...).

    then, to print the firstname:

    In your code you're applying the indexing to an object of type Employee, which doesn't make sense.

    Most elegant solution, for Java >= 8
    2 years ago
    2 years ago
    If you want to have fun too while learning, try codingame. They have a lot of interesting problems (also from algorithmic point of view) and, after you solved, you can see a nice graphical representation
    2 years ago
    One example that come into my mind is grouping a set of utilities functions that can be invoked frequently and does not require the instantiation of an object. A typical example is the Math class, which includes lot of static functions.
    2 years ago
    They can be used to store matrix, for example to represent a maze, or a chessboard, but also in lot of mathematical application, to solve linear sytems,...
    2 years ago
    If I'm not mistaken, BlueJ is an IDE, what's the problem to use it with version 8 of Java?
    2 years ago
    What about Javafx? It's based on MVC pattern and you have complete separation between views (screens) and logic
    2 years ago
    If you use Java 8, take a look at the Stream interface. It provides a lot of functions to iterate through the list and reduce results
    2 years ago
    I read my first post again, well, it is wrong abut the loop upper limit, I explain better my idea in the second post
    2 years ago
    No, I don't create 10 indexes, I create Array.Size*p/100 indexes (2 if the array has 20 elements). Of course some round checks are required (what if array size = 23?) and of course I have to keep track of the already randomized indexes
    2 years ago