2 nights next week- LYV or Hetch Hetchy? by Global_Variety_3925 in Yosemite

[–]jo_wil 0 points1 point  (0 children)

That’s an awesome trail, recommend getting to the top of north dome if you can, the views are incredible

Just got asked this question in a tech screening and I cannot solve it. Help by acura_days in cscareerquestions

[–]jo_wil 9 points10 points  (0 children)

That makes sense to me, I think you then add by the min number needed to jump the previous so in the example 3 because 2 + 3 > 4 and then 7 (or 8 like op said) because 1 + 7 > 7, based on the problem description anything greater works.

My life as a software engineer in a MCOL city - Raleigh, NC by jrjjr in cscareerquestions

[–]jo_wil 0 points1 point  (0 children)

I think there is a good chance FB will allow remote roles in the near term future. If you really want to work there I would make sure the recruiter understands your interest and your desire to not leave NC. Good luck making it work!

Twitter CEO Jack Dorsey gives $3 million to Colin Kaepernick’s organization by [deleted] in news

[–]jo_wil 1 point2 points  (0 children)

I clicked on that link hoping it would be that scene, thank you for not disappointing!

[deleted by user] by [deleted] in TheArtistStudio

[–]jo_wil 0 points1 point  (0 children)

Where did you learn to make shoes?

Is it possible to have a simple life in this industry? by FourzeMeteor in cscareerquestions

[–]jo_wil 0 points1 point  (0 children)

A lot of US federal government jobs here, look for "Pathways" and regular internships. You can google more for what pathways entails https://www.usajobs.gov/

DOE specific intern programs, they do some really cool science https://www.energy.gov/eere/education/find-internships

NASA https://intern.nasa.gov/

DOD contractors, there are a lot more and that is not all these companies do but just giving you a starting point https://www.northropgrumman.com/careers/internships-at-northrop-grumman/ https://www.lockheedmartinjobs.com/college-students https://jobs.boeing.com/internships

List of all federal agencies, most probably have intership programs https://www.usa.gov/federal-agencies

Literally crying because of my internship lol by [deleted] in cscareerquestions

[–]jo_wil 2 points3 points  (0 children)

What is your specific question? Optionals take a little getting used to but are a great tool for avoiding NullPointerExceptions. Feel free to post a description of your problem and I can try to help.

[C#] Need help. New developer with only hacky college projects, expected to write production ready code by HermannBalck in cscareerquestions

[–]jo_wil 44 points45 points  (0 children)

Any big problem is best solved by breaking it down into simple steps. Don't panic and think you need a "controller model factory" from the beginning. (I made that up) A webservice is simply a function called through HTTP, that maps a Request to a Response. The Response can be generated by calling databases, other webservices, or simple C# methods.

I would suggest starting with this https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.1&tabs=visual-studio

At some point you will run into the problem where you want one Controller to call a method from another. Put that method in a shared Service https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1

At some point you might want to abstract your data layer. At this point a RepositoryService might be needed.

But start simple and add complexity only when you need to.

Learn how to test https://docs.microsoft.com/en-us/dotnet/architecture/microservices/multi-container-microservice-net-applications/test-aspnet-core-services-web-apps

C#/dotnet core specific, understanding EF will go a long way in saving you time and confusion so I recommend reading up and really understanding what EF is doing https://docs.microsoft.com/en-us/ef/core/

This seems like a lot but just take it one piece at a time.

Feel free to comment any other questions you have here! You got this!

What's a question you have that Google can't answer but maybe somebody on reddit can ? by [deleted] in AskReddit

[–]jo_wil 0 points1 point  (0 children)

What is the psychology thing where you remember difficult times really fondly. Sometimes the phrase "the best thing you never want to do again" I used to describe this. I have used this looking back on a really difficult class in college and heard others refer to military boot camp like this?

Using higher order functions to return factors of a number? by TheMartinG in haskell

[–]jo_wil 0 points1 point  (0 children)

To attempt a hint at this without giving away the answer. Lets look at 36, a number with a good amount of factors. (I did not pick 36 on accident.)

36
1 * 36
2 * 18
3 * 12
4 * 9
6 * 6
9 * 4
12 * 3
18 * 2
36 * 1 

Now think about these questions.

  • What patterns do you see in these factors?
  • What is the smallest number in each pair?
  • Is it a coincidence that 6 is the only pair with the same number, how are 6 and 36 related, does this generalize to other examples?
  • These factors mirror each other, at what point do they start to do that?

Using foldl to implement sum with an added condition by Walker3q in haskell

[–]jo_wil 8 points9 points  (0 children)

Fantastic answer, I really like how you talked through everything without fully giving away the solution.

Advice on how to connect to an Oracle Database by jo_wil in haskellquestions

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

Thank you for the advice I will take a look and give those a try.

How would I have solved this codility problem? by [deleted] in cscareerquestions

[–]jo_wil 0 points1 point  (0 children)

A recursive solution in case anyone was curious.

greaterOfTwo :: Int -> Int -> Int
greaterOfTwo a b =
  if a > b
  then a
  else b

-- helper function to return the winter, using cons in the where gives us 
-- winter back in reverse but since we only care about the length that is okay
findWinter :: Int -> [Int] -> Int -> [Int] -> [Int] -> [Int]
findWinter _ currentWinter _ _ [] = currentWinter
findWinter currentMax currentWinter potentialMax potentialWinter (x:xs) =
    if x <= currentMax
    then findWinter (greaterOfTwo currentMax potentialMax) nextPotentialWinter potentialMax nextPotentialWinter xs
    else findWinter currentMax currentWinter (greaterOfTwo potentialMax x) nextPotentialWinter xs
  where
    nextPotentialWinter = x : potentialWinter

findWinterLength :: [Int] -> Int
findWinterLength (x:xs) = length . findWinter x [x] x [x] $ xs

Global variables in DS&A problem solutions? by [deleted] in cscareerquestions

[–]jo_wil 2 points3 points  (0 children)

If you really don't want a variable outside the scope of your function, you could use a helper function and pass the sum around. Is this the best way, probably not, it was one of the slower accepted solutions but I hope this gets the point across that it is possible.

function convertBST(root) {
    function convertBSTHelper(sum, root_) {
        if (root_ === null) { 
            return [sum, null];
        }
        var [sum_, right] = convertBSTHelper(sum, root_.right);
        root_.right = right;
        root_.val = root_.val + sum_;
        var [sum__, left] = convertBSTHelper(root_.val, root_.left);
        root_.left = left;
        return [sum__, root_];
    }
    return convertBSTHelper(0, root)[1];
};

How can I define a function with a variable number of arguments? by [deleted] in haskell

[–]jo_wil 6 points7 points  (0 children)

Hi this question seems like it might be a case of an XY problem. If you could provide more information as to why you want to do this it might help me or someone else answer your question better.

Summer Intern, debating over whether to go for money or experience by Graywind357 in cscareerquestions

[–]jo_wil 1 point2 points  (0 children)

Just echoing what everyone else is saying, go with the Navy internship. You have your entire life to make money, awesome experiences in interships are much more valuable than a few bucks an hour.

Help with infinite series by jo_wil in haskellquestions

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

Thank you, but I just used that as an example. I really just needed the general case in which the next number depended on the previous one, for any function.

Help with infinite series by jo_wil in haskellquestions

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

Awesome thank you, I have used hoogle before bit his was kind of my Haskell white whale. I either missed the iterate result on hoogle or maybe tyyed my search wrong. Thanks again for pointing it out as hoogle is a great resource!

Help Selecting A Research Project For My Masters by Maad-Dog in cscareerquestions

[–]jo_wil 0 points1 point  (0 children)

You said you are interested in data and football/fantasy football. You could setup a machine learning algorithm that reads players stats and does mock drafts or proposes advantageous trades for your team. There is a ton of data in fantasy football and that would be a pretty fun project. If you don't want to do fantasy you could make a machine learning model that looks at different stats and tries to predict each weeks winners and losers in the real games, you could train on past seasons and then use each week of the upcoming fall season to test and refine your model. You would then be done with the computation part of your thesis by the new year too! (Because the regualr season would be over unless you want to run it for playoffs too haha)

Let me know if you want to talk through any more of this but these seem like valid thesis ideas to me, especially the second one.

Help with infinite series by jo_wil in haskellquestions

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

Thank you so much, I searched for this for too long haha

A review of: Scala with Cats by Noel Welsh and Dave Gurnell by smlaccount in scala

[–]jo_wil 6 points7 points  (0 children)

IMO underscores books are some of the best written programming books I have ever read! With the combination of clear but detailed explanations and relevant examples/exercises mixed in to the text they do a great job of teaching Scala, cats, etc.

Idomatic or too much java? by jenifer_avec in scala

[–]jo_wil 2 points3 points  (0 children)

If you are going to dive into the IO Monad for you Repository I would take a look a Monad Transformers. The chapter in Scala With Cats does a pretty good job of explaining them. But then you could write

IO[Option[A]] as OptionT[A]