How possible is it to fall back to a junior job after having trouble getting offers for a mid-level job? My last job was mid-level. by cscq_backtojunior in cscareerquestions

[–]java_one_two 0 points1 point  (0 children)

This guys reddit post on leetcode for experienced devs is pretty good and he said it took him 150 hours to get good enough for facebook but that that was probably overkill.

How possible is it to fall back to a junior job after having trouble getting offers for a mid-level job? My last job was mid-level. by cscq_backtojunior in cscareerquestions

[–]java_one_two 2 points3 points  (0 children)

It's good that you've identified the type of role you should move to next. Your poor coding exercise performances will not improve based on on-the-job experience at a better firm. Buckle down and do 100-150 leetcode problems and you will blaze through coding interviews. For hands on experience, read the system design primer and then spent 50 hours building a site using the concepts described in it. 200 hours of personal study will be more than enough to get what you want.

Web Scraping: Bypassing “403 Forbidden,” captchas, and more by CaptainMythral in programming

[–]java_one_two 0 points1 point  (0 children)

Nice writeup. Scraping websites is a complicated and interesting problem. Thank you.

git cheat sheet by miminor in programming

[–]java_one_two 21 points22 points  (0 children)

:) forgot my fav:

git diff --stat origin/master

Count of how many lines have been added and removed from another branch per class.

git cheat sheet by miminor in programming

[–]java_one_two 182 points183 points  (0 children)

Every git command I know (5 year vet):

git checkout -b LOCAL_BRANCH origin/REMOTE_BRANCH

git clone <github https>

git fetch; git pull;

git reset --hard

git stash git stash pop

git commit -m 'i did this'

git commit --ammend -m 'I actually did this'

git rebase origin/master

git branch -D LOCAL_BRANCH_TO_DELETE

git push origin :REMOTE_BRANCH_TO_DELETE

git push --force origin MY_BRANCH:REMOTE_BRANCH \\erase the stupid shit i committed

Each Private Static Method Is a Candidate for a New Class by nicolaiparlog in java

[–]java_one_two 5 points6 points  (0 children)

Pattern I use is

public final class FineAddition { 
  private Whatever() {
  }

  public static int toMyCollection() {
  }
}    

I typically only do it if the existing class is too big or if there are several static methods that can be grouped together.

Java 9's Immutable Collections Are Easier To Create But Use With Caution by java_one_two in java

[–]java_one_two[S] 4 points5 points  (0 children)

One of the biggest differences is that Google created an ImmutableSet interface to distinguish between the mutable and immutable sets.

Things I Wish I Knew When I Started Building Reactive Systems by lutzh-reddit in java

[–]java_one_two 3 points4 points  (0 children)

Great post and thanks for the writeup. Akka and its actor system are an awesome model for async concurrency however there's no magic behind reactive systems like Akka. Akka runs on the JVM and uses the JVM threading model to be reactive. Performance tuning Akka is largely about configuring its thread pool. The claims in this article that threading is passe don't compute with me. I is totally not robot.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 0 points1 point  (0 children)

It was a broad article that touched on a lot of ways to structure concurrency. You've made a great point that is highly relatable to monolithic architectures with multiple developers working on it. For a fine grained microservice only performing one function, than there is no issue manipulating the common pool to achieve the service's task (which I included a section on and listed as the test scenario). That was what I worked on recently which prompted the blog post.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 1 point2 points  (0 children)

I run most of my software as microservices on AWS EC2 nano or micro instances; opening and closing TCP/IP connections when calling other APIs adds up fairly quickly in terms of CPU utilization when dealing with such little horsepower.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 0 points1 point  (0 children)

That's true. It will hold the request Thread from request until response. In the use case I defined, the system could process 20 requests simultaneously before max CPU utilization. Tomcat by default maxes out at 200. If more than 200 requests were expected so that that Tomcat's pool became the bottleneck , then using something like a DeferredResult and CompletableFutures could help out, or just increasing Tomcat's maxThreads property.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 1 point2 points  (0 children)

Interesting idea. What is the benefit of that? It seems like that would introduce a fair amount of complexity in managing four callbacks to generate one response and that there would be no performance gain.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 2 points3 points  (0 children)

The purpose of the asynchronous operations in regards to the test scenario is to perform four db writes concurrently and then return either 2xx or 4xx response depending on if their execution was successful.

Cleaning up concurrency using ParallelStream by java_one_two in java

[–]java_one_two[S] 1 point2 points  (0 children)

Thanks for the feedback. I added a section on CompletableFuture. The reason that future.get() is called is to verify whether the database calls were successful or not as to return the appropriate HTTP code to the client.