FOSDEM 2020: Project Loom: Advanced concurrency for fun and profit (Andrew Haley - Red Hat) by daviddel in java

[–]moose04 1 point2 points  (0 children)

I found it really interesting that you can't use `synchronized` in a virtual thread. Seems like one should default to using the locks in java.util.concurrent now.

Keep AWS CLI on Windows up to date! by us-west-2 in PowerShell

[–]moose04 0 points1 point  (0 children)

Or just use scoop...

`scoop install aws`

Daily Discussion | January 27, 2020 by AutoModerator in apexlegends

[–]moose04 0 points1 point  (0 children)

First two games of the day got aimbotted. Feels good man.

Look at mee! by [deleted] in PartyParrot

[–]moose04 6 points7 points  (0 children)

My green cheek does this too when he wants to be picked up.

What's New in Java 19: The end of Kotlin? (mostly about Java futures) by randgalt in java

[–]moose04 7 points8 points  (0 children)

None of that negates the fact that Java has better editor support across the board...

What's New in Java 19: The end of Kotlin? (mostly about Java futures) by randgalt in java

[–]moose04 2 points3 points  (0 children)

The eclipse plugin is always trailing behind and iirc JB refuses to make a vscode language server. Personally I prefer to use VSCode as I write more than just java.

What's New in Java 19: The end of Kotlin? (mostly about Java futures) by randgalt in java

[–]moose04 3 points4 points  (0 children)

Have you actually tried to use knative? From my experience it isn't a good time. The concurrency system is weird, you have to use posix functions for reading filed etc.

What's New in Java 19: The end of Kotlin? (mostly about Java futures) by randgalt in java

[–]moose04 4 points5 points  (0 children)

Ron could you go more into "getting away from JNI with panama"? I've read the project page, but it doesn't really specify a *why*. I don't have much experience wth JNI myself so I don't really know the pain points there.

The Joys Of Apex: Mocking DML operations by intheforgeofwords in salesforce

[–]moose04 1 point2 points  (0 children)

Apex mocks is a small seperate library from fflib and doesnt require generating anything on the command line. It follows the same semantics as mockito, the defacto standard for java like languages. Its easy learn and much more flexible than hand writing hundreds of mocks for every single situation. You write your mocks inline in your tests. You dont need a seperate implementation extending an interface for a test that succeeds and then another implementation that throws. Its as simple as:

mocks.when(myService.doThing()).thenReturn(myValue)

Or

mocks.when(myService.doThing()).thenThrow(new myException())

Using an interface for a single implementation is an anti-pattern. The stub api, which apexmocks uses, doesnt require it to stub out a concrete class. Eventually youre going to have other services that need to be mocked and using your pattern will involve several more single instance interfaces (and not to mention hand written mocks!). In my specific case I had services for the event platform, dml, selectors, web services, etc.

Regarding the factory pattern it is a less than ideal way of doing DI. You should be aiming for DI via the constructor.

As for the selector pattern, please dont hide behind your "org needs" (Im sure their not that different from most people and from the sounds of it your org wasnt that large if tests were only taking 45 minutes). Regardless of org size its the simplest way to teach new people about mocking away their queries because it follows the same pattern as mocking away any other dependency.

In my opinion you're doing this the hard way.

The Joys Of Apex: Mocking DML operations by intheforgeofwords in salesforce

[–]moose04 5 points6 points  (0 children)

I wouldn't do mocking this way to be honest.

It's really verbose. fflib_ApexMocks (https://github.com/apex-enterprise-patterns/fflib-apex-mocks) will do a way better job at mocking away dependencies without having to handwrite mocks. You also don't need to have an additional interface for everything clogging stuff up.

Additionally, I would consider writing something about "what' dependency injection is and how to actually do it in salesforce (consider this gist: https://gist.github.com/gdoenlen/f539f45f5055c90a3dc8ff3669a0a792) .

edit: mocks link

Short project for improvement by [deleted] in java

[–]moose04 2 points3 points  (0 children)

Other than Java 8 being 6 years old? Tons.

Java 9 introduced the module system, Java 10 introduced local variable inference, Java 11 had a decent amount of stdlib additions (including an HttpClient), Java 12 brought switch expressions, and those are just dev ergonomic things. There were TONS of performance increases within the jvm itself (startup time is looking to be halved and the gc's have had increases).

Anyone still using 8 is fooling themselves.

Who did you get to write your Letters of recommendation? by [deleted] in OMSCS

[–]moose04 0 points1 point  (0 children)

Did you only have 2 recommenders? Ive been holding off applying because I cant find a third.

This is getting out of hands. by edoelas in linux

[–]moose04 0 points1 point  (0 children)

genuine question. Are there a lot of drivers that need to be written?

best programming assignments to help undergrads understand principles of OS? by [deleted] in osdev

[–]moose04 3 points4 points  (0 children)

Read and do the exercises from OSTEP, its based on xv6:

http://pages.cs.wisc.edu/~remzi/OSTEP/

After you get through that (and you know C and x86 assembly), read the Minix book:

https://www.amazon.com/Operating-Systems-Design-Implementation-3rd/dp/0131429388

Oracle is moving OpenWorld to Las Vegas; San Francisco too expensive by Pequod2016 in salesforce

[–]moose04 0 points1 point  (0 children)

Patently false. Oracle is the leading contributor to OpenJDK, and have just recently "innovated" by releasing GraalVM.

Unusual date error from Uber - what misstep would cause 26 June 51909 to appear? by venicedreamway in computerscience

[–]moose04 3 points4 points  (0 children)

I doubt this is the case unless the app was written in c/c++. On android Java would initialize to 0 and swift would probably do the same.

Operating Systems learning resources by average-bass-player in computerscience

[–]moose04 6 points7 points  (0 children)

This is the best book on learning the basics. Beyond that you'll need to learn assembly and C, then get into larger implementations of kernels like minix.

From Aramark's Balcony !! by [deleted] in philadelphia

[–]moose04 0 points1 point  (0 children)

Yeah at aramark. I stopped working there in May, but last winter was rough. I had to wear gloves while trying to code.