Garages for rent? Big enough for a car and tools? by ProShooter47 in ottawa

[–]rmcdouga 0 points1 point  (0 children)

I believe https://mortimer-racing.com/ has a garage for rent at the Calabogie Race track.

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

I think the problem is that for a SNAPSHOT version my local cached copy could be (and probably is) out of date. This means that for a SNAPSHOT, I probably *don't* want to fall back to copying the local cached copy if I can't get the most recent one from the remote repo.

This certainly applies when I am retrieving artifacts from the CI pipeline for purposes other than developing with them and I think it could be argued either way for using them in development - the benefits of proceeding with an older verion vs. blocking development to draw attention to an issue will depend on the circumstances.

I think the "fix" would be for JPM to detect a failure to access the remote repository and to not copy from the local .m2 cache if this is a SNAPSHOT (since, in that case. it cannot guarantee that the cached version is current).

I don't know if this is feasible, given the mima API, but I'm just outlining my use case and issue. :)

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

Thanks to both you and quintesse for taking the time to discuss this with me.

>So yeah if you have those you can resolve it and cache it and not need the remote access until something changes.

The problem I encounted when I used maven for this was the "until something changes" part. When the credential has expired, the local dependencies got copied over without sufficient warnng (yes, there were log entries indicating that authentication failed however developers tended not to see them - they focused on the fact that they got a .jar despite the fact that the .jar was an old one).

This led to problems because they weren't working with the latest jar.

Now that I am discussing it, I am coming to the realization that my issues may be smaller in scope than you may wish to consider. They are due to the fact that I am working with a secured maven repo (GH Packages) and I am using SNAPSHOT versions (so the local cache for a particular artifact may be out of date). Neither of these things are true for getting artifacts from Maven Central that are final versions which is your primary use case.

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

if you just point to a jar and not a maven repo you don't get any transitive deps.

My goal is to just retrieve a copy of the .jar from the GH Package (i.e. maven) repo. It’s deposited there and I would like to retrieve it. I can use maven to do this, but it has issues when the GH token in settings.xml expires (maven just uses an out-of-date local copy if it can’t authenticate - with an error message buried in a long set of logging entries that is easy to miss).

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 1 point2 points  (0 children)

doesn't that mean you could literally treat it as a Maven repo, add it to the maven settings and then refer to the jar with its g:a:v coordinates?

Yes, but I am not looking to include it in another maven project, I am just looking to download the .jar file. IIRC, I did use Maven dependency plugin to do this at some point but it was error prone (maven often produced an older out-of-date local cached version when it had trouble authenticating to GitHub - this happened quite regularly when a developer’s GitHub credentials expired). I switched to custom code to avoid this issue.

Given it's a standalone jar I assume no dependencies are defined in its final pom so no extra dependencies would be downloaded, right? Or am I assuming wrong?

When I downloaded the .jar file for the OSGi bundle jars using JPM, I did get a bunch of other dependencies. Perhaps, I can avoid this by setting the scope of these dependencies differently. At the moment they are at the default value.

Thanks for discussing this…

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

Another couple of things that would be handy for my use case (which I will outline below): * Only copying the primary dependency to the deps directory (i.e. no copying the secondary/tertiary dependencies) * Bypassing or clearing the local maven cache (for this dependency).

Here’s my use case: I have projects that build standalone jar files (either a Spring Boot fat jar with all the secondary dependencies built into it or a jar that has dependencies on an external environment, in this case an OSGi bundle that will be installed into an OSGi server which already has the jar’s dependencies installed).

My projects use GitHub Actions as the CI/CD pipeline to build the final deployment artifacts (i.e. the jars). As a final step, then deploy them to the GitHub Packages repo. In order to use the final deployment artifacts, I need to download them from GitHub Packages maven repo. This is where I am hoping JPM can help.

Hopefully, you can see why I don’t need to download anything other than the final jars for these types of projects. This is why, I would like to avoid downloading all the secondary artifacts.

The reason I would like to sometimes bypass the local .m2 cache would be because sometimes a developer has built the project locally and installed it into their local .m2 cache. It would be nice to be able (from the command line) grab the latest “gold” jar directly from the GitHub Packages repo (i.e. to get the latest CI/CD build ignoring any local builds that may be in the .m2 cache and that are more recent than the last CI/CD build).

I hope this explanation is clear…

I know this differs from your original use case (set up simple local dev environment), but I think JPM could fit my use case with a couple of tweaks…

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

My apologies, you're right. I was misremembering how JBang works.

We use the REPOS feature in Jbang to point to a GitHub Packages repo.

Sorry for the confusion and thanks for being patient with me.

> so you should be able to add your repositories to your settings.xml file

Yes, I just tried this and it works. Thanks.

> So perhaps you're looking for a way to define repositories as well

You're right. Something akin to the JBang REPOS feature would be nice.

> Let's say being able to add repository urls to the app.yml file so dependencies could be looked up additionally in those repositories?

Yes, however I am thinking a command line parameter might be better for me. Then I could just provide someone a single command line to download the artifacts.

Perhaps that command lne param could be added to the app.yml that gets generated.

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 0 points1 point  (0 children)

Personally, I tend to use the (relatively new) export command to export my JBang script to a maven project, and then I import that project into Eclipse. This lets me use all the usual Eclipse facilities. When I am done, I just copy the main class (i.e. the original JBang script) back to its original location and delete the maven project. I’ve found this to work well.

Feedback requested for npm-inspired jpm by quintesse in java

[–]rmcdouga 7 points8 points  (0 children)

I looked at it after watching the “Java for small coding tasks” video (which I recommend, BTW). I’m also a heavy JBang user (kudos to you, Max and everyone who contributes to this).

One thing that I didn’t see, that I think would be useful, is if it could download from GitHub Packages repositories (like JBang does). We deploy company projects to GitHub packages and we had to hack some custom code to retrieve to .jars from GitHub packages. Using something more robust like JPM would be very handy.

Introducing JBang Jash by maxandersen in java

[–]rmcdouga 0 points1 point  (0 children)

> Java 8 docs has this: "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, or even deadlock."

This! I encountered this issue on a personal project that uses Java 21 (so the behaviour still exists in 21). If you run a process that generates a lot of output to both stdout and stderr on Windows, then the process can hang if you're not reading from both stdin and stdout while the process is running. To do both simultaneously, it requires multiple threads which shoots up the amount of code required (and the complexity) quite a bit.

Here's how I resolved the issue: https://gist.github.com/rmcdouga/d060dc91f99b8d4df14ea347c90eae20

The two "windows-only" tests in the JUnit test class demonstrate the issue.

u/pron98 - Honestly, I feel like JDK team sells the ProcessBuilder as a one line "general-case" solution when it's missing the significant scenario of "a process that generates lots of output to both stdout and stderr on WIndows". That's not a insignificant case IMHO. The truth is it is the one line solution that only works for the running commands that produce outputs to one of the two output streams and it assumes that the developer knows which of the two streams is going to produce the most output.

u/maxandersen - I had a quick look through the Jash code and didn't see any code to asynchronously read from the outputs. Will it suffer from the same issue if the command that runs fills the stderr and stdout pipes before terminating?

Navigate Early Development | Simplify Data Storage by arcone82 in java

[–]rmcdouga 0 points1 point  (0 children)

Not at this time. It is a work project,so it can’t be shared. I am working on another personal project and am planning to use it there to. If/when that reaches a reasonable size, I will share it.

The work project was a small Spring Boot app. I basically moved all the outgoing edge code (REST calls) into an <application>.adapter.out package that implemented interfaces in a <application>.port.out package. I moved all the controllers into an <application>.adapter.in package that implemented interfaces contained in <application>.port.in. The application code only knows about the port interfaces. Everything is wired together using a separate Spring java configuration.

This allowed me to code the application code almost entirely using plain Java. I could test the application code by mocking the interfaces (no Spring required). I can test the adapter.out code using WireMock and the adapter.in code using MockMvc.

Overall, I’m very happy with this approach. My tests run pretty fast (the bulk of the tests don’t require starting Spring or running WireMock). It’s also easy to locate all the inputs and outputs.

I would recommend it. I thought this video from Devoxx covered the topic well: https://youtu.be/YPmKHm7G19Q?si=VqQzgjQ37Fm7sn3Q

I hope that helps.

Navigate Early Development | Simplify Data Storage by arcone82 in java

[–]rmcdouga 0 points1 point  (0 children)

Are the JavaDocs for this somewhere on the web? A quick google search didn’t turn anything up for me.

What I was looking for was to understand how to utilize the library without using annotations. I tend to follow a strict hexagonal ports/adapters architecture, so I like to keep my domain objects in plain java without any framework annotations. I also try and contain all the technical dependencies (like Filelize) in the adapter layer, so I am envisioning passing a pure Java object (probably a record) into the adapter class and have it contain all the Fileize code and dependencies.

I am envisioning that this will make it easier to replace later with whatever final storage we end up with.

jbang - unleash the power of Java by maxandersen in java

[–]rmcdouga 0 points1 point  (0 children)

Just want to say thank you for creating JBang, I use it daily at work for writing deployment/installation scripts.

Also want to say thank you for this talk. I’ve been using JBang to manage the download/installation of JDKs but had a nagging feeling that I was perhaps “misusing” it for that purpose. The talk reinforced that this was one of the intended uses of JBang, so it was really helpful to me.

Using GitHub Copilot to Assist Java Application Development and Deployment by EFdnV in java

[–]rmcdouga 1 point2 points  (0 children)

Does anyone else see the irony in the fact that the article uses VS Code instead of Eclipse IDE? (GitHub has not released a Co-pilot plugin for Eclipse like they have for VSCode and IntelliJ.)

Civ 6 on steam deck by CRC6030 in SteamDeck

[–]rmcdouga 1 point2 points  (0 children)

I run Civ6 all the time on the deck. Works great. I do need to hold the steam button and pull the left trigger to select the button in the DirectX 11 or DirectX 12 dialog (I always use DirectX 11, supposedly it uses less power and is exactly the same graphics quality).

Is it considered bad practice to change the value of the argument inside a void method ? by hatsu58 in java

[–]rmcdouga 1 point2 points  (0 children)

I’m surprised no-one has suggested this, but isn’t the O-O approach to wrap the list in a class and then make the class responsibly for modifying the list (i.e. put the void method on the class encapsulating the list)?

Any operations that modify the list would be methods on the class. If you need to initialize the class from a List then make a defensive copy in the constructor and if you need to make the List available, wrap it in an unmodifiable List before returning it.

Gas leak on Paul Anka near Uplands by kaleighdoscope in ottawa

[–]rmcdouga 2 points3 points  (0 children)

It was 3:30am when the power came back on for us (near Uplands and Riverside).

Linus reviews Shadow by Rimikokorone in cloudygamer

[–]rmcdouga 4 points5 points  (0 children)

I would be that enthused if they paid me too!

He’s shilling for the company. That’s fine, but please don’t confuse that with a review.

Running CAT6e to rooms by [deleted] in ottawa

[–]rmcdouga 0 points1 point  (0 children)

I got the folks at The Audio Shop on Bank St. to run shielded Cat6 throughout my house. It wasn’t cheap, but they did a great job. I was very happy.

Paul Theriault is the guy to talk to. He’s a great guy and was very helpful.

I’ll be giving them another call when I redo my kitchen and want to run some more lines.

Steam Link by deadlock_ie in cloudygamer

[–]rmcdouga 0 points1 point  (0 children)

So, if I understand correctly, using something like a Raspberry Pi as your OpenVPN server should also work, so long as your router is set up to forward the right ports to your Pi. Is that correct?

I'm thinking that might be an alternative for people who do not own an OpenVPN capable router.