Stefano Carniel

Ranch Hand
+ Follow
since Aug 01, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

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.
5 years 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, but...how to deal with local files?

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

    Bye
    5 years 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
    6 years 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).
    7 years 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.
    7 years 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
    7 years ago
    7 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
    7 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.
    7 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,...
    7 years ago
    If I'm not mistaken, BlueJ is an IDE, what's the problem to use it with version 8 of Java?
    7 years ago
    What about Javafx? It's based on MVC pattern and you have complete separation between views (screens) and logic
    7 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
    7 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
    7 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
    7 years ago