|
Is Java's formatter just weird or what, compared to ANSI C Or is there some other way to specify "precision" than this hot garbage: Java code:
Or "#%.d | #%.s #\n", col0_width, i, col1_width, param" instead of.. whatever you have to do with Java. code:
Ihmemies fucked around with this message at 18:30 on Jan 14, 2023 |
# ¿ Jan 14, 2023 18:25 |
|
|
# ¿ May 9, 2024 08:02 |
|
Thanks. It was a school exercise so I assume using the formatter was the idea behind it. Anyways, it is not good But I'll live. I've been doing an ANSI C course too so I got somewhat used to it.. just type what you want to be printed, then enter the list of variables separated by commas. Stringutils looks handy, thanks.
|
# ¿ Jan 15, 2023 09:06 |
|
School exercises have progressed. I made a MovieAnalytics class, as instructed - using streams and Collectors.groupingBy. Automatic grading gave it a pass. The three methods I implemented look like each other. The .collect method differrs, and sort has descending order in some.. also the printouts differ. Does it make any sense to try to make some kind of combination of these three? The code looks repetitive, but does it matter? If I "must" do some kind of combination method, how could I get started? I have no functioning ideas after trying. It gets too hard for me to choose elegantly between different groupingBy() methods with streams... Also the .sorted() is not very good, but I could not figure out another way to sort those... Java code:
|
# ¿ Feb 28, 2023 23:27 |
|
Eezee posted:The only thing i would change is your sort method. You can do better using the built in Comparator functions. See: Thanks, I found out about the Java8's Comparator comparing but I was too dense to understand how to use it. I will try again
|
# ¿ Mar 1, 2023 08:02 |
|
So finally we're doing some javafx-maven-whatever programs. The first is a very simple calculator. It is tested on school's black book CalculatorTest tester.code:
I read the values like this on my controller class: code:
code:
|
# ¿ Mar 21, 2023 14:53 |
|
Jabor posted:It's not on your code. The crash is in the tester code. Do you have access to the tester source? Welp gently caress, the idea was so stupid my brains just smoothed over it. It had to be a LABEL which LOOKS LIKE a text field... sigh. Thanks for the help!
|
# ¿ Mar 21, 2023 15:26 |
|
smackfu posted:Can you just tel them to stop teaching you poo poo no one uses? It's hard. Anyways we got to do our own project now where we can do whatever we want. It pulls some jsons from a rest api over the internet, and we display some data in a javafx application. Anyways, should vscode display tooltips and tell me more about the classes? For example in our maven project: ObjectMapper mapper = new ObjectMapper(); tooltips tell only: com.fasterxml.jackson.databind.ObjectMapper.ObjectMapper() Not very helpful. What is an ObjectMapper? Why the tooltip doesn't tell me anything about it? I have no idea should it show more, or is something just broken in my vscode. If I right click and go to definition, it shows just this: Java code:
I had to go vscode settings -> search for download sources -> enable java > eclipse & java > maven download sources. Then I had to go find my maven's settings.xml and add this (it was in some weird random folder in my C:\users\username\.m2\ folder.) code:
Ihmemies fucked around with this message at 09:41 on Apr 22, 2023 |
# ¿ Apr 22, 2023 09:26 |
|
Qt, IntelliJ IDEA, Netbeans, Visual Studio just feel like "legacy" apps compared to VSCode. Like, I haven't even tested them myself, but that was my impression! I got the java documentation to work in vscode, so it was pretty nice after all. I don't know what I'm missing. What am I missing while using vscode instead of intellij idea for example? As a student I don't really have money to pay for software, so vscode is nice in that respect too, since it's completely free and open source. We coded a javafx app which pulls open data from REST API and displays our university's degree programmes and courses. You can add and remove courses and mark them as completed, and it shows your progression. Supports multiple users (for no real benefit). Took maybe 2 weeks of coding from three guys. We didn't make a spec first, so it was kind of uhh "let's try if this works" approach. Worked well enough.
|
# ¿ Apr 29, 2023 13:29 |
|
hooah posted:In my (limited) experience, VS Code requires at least a few plugin to get it working for Java, then you have to write your own run commands or whatever. IntelliJ, even the community edition, understands how to run and debug Java programs out of the box, and makes it very easy to do so. I installed some set of Java tools which vscode suggested. They seemed to work fine, except for the documentation issue, Maven didn't know how to download docs automatically. Only missing debugger feature was that it would be nice to have some kind of "developer mode" in javafx where you can "inspect" elements in the javafx app, like in a webpage in a browser or something. There was some maven plugin for that but it hadn't been updated in years and supported only ancient java versions.
|
# ¿ Apr 29, 2023 13:52 |
|
fletcher posted:IntelliJ just works so well out of the box. I would ditch VSCode for Java development so you don't have to waste time trying to get it to do what IntelliJ does by default. The Community Edition is also free. I have no idea when school will force more java for us, so I have no idea when I will do more java coding. Maybe never? My vscode is set up now, so what is the point of changing and learning to use some new tool? Just because it's new and fancy is not a good enough reason.
|
# ¿ Apr 29, 2023 15:23 |
|
I tried searching for reasons why IntelliJ is better, but I could not find a single concrete example on why it is better. Even better would be a list of benefits with concrete examples. Surely someone must have made one? Or maybe even a list of what’s missing from vscode, and why the missing feature matters? Even chatgpt could not give answers.
|
# ¿ Apr 29, 2023 16:42 |
|
I have a problem deciding what is the least crap way of implementing choicebox values in javafx. Depending on user selections and choiceboxes, I need to have a variable_id (for API calls) associated with the choice, or a LineChart.class for example, so I know what kind of XYChart the user wants to draw. How would you store the choices? Enums? Classes? Something else? Enums work ok'ish with strings, like this: Java code:
This seems to work: Java code:
Java code:
This thing is a 4 man course project, still on prototype stage, so I can try out all kinds of stuff. Ihmemies fucked around with this message at 06:14 on Sep 17, 2023 |
# ¿ Sep 17, 2023 06:07 |
|
Well that seems to work too. We are using 17 so I guess I can research sealed classes too. Thanks
|
# ¿ Sep 17, 2023 07:08 |
|
|
# ¿ May 9, 2024 08:02 |
|
We're doing a desktop app for course, because web abbs were explicitly forbidden. We ended up using javafx because that's what a few guys have used earlier. Is there some "easy" way to specify the line/area colors? I looked at assigning an ID to each data series (line) depending on datatype, and then applying the color for that id with CSS. Like nuclear = YELLOW, wind = GREEN, hydro = BLUE etc. But no, this poo poo rear end piece of garbage apparently gives data series id's automatically from 0..n, based on the add order to chart. So I'd have to make some kind of hell construct to figure out the id of each added series... etc. I don't even want to think about it. The chart can have any amount of series depending on datatype. Each datatype should have a specific color always... Who ***** thought that it is ***** good idea to label the series automatically with incrementing id, which depends on add order... Already thinking about implementing a webview inside the javafx app. Ihmemies fucked around with this message at 11:31 on Oct 20, 2023 |
# ¿ Oct 20, 2023 11:28 |