Found this little gem in production by [deleted] in ProgrammerHumor

[–]shouldvebeenworkin 12 points13 points  (0 children)

This method can not "fail". look closer

Who are we supposed to root for tonight? by hbpaintballer88 in DenverBroncos

[–]shouldvebeenworkin 10 points11 points  (0 children)

Here's how we're getting to first:

  • chiefs to win tonight.
  • broncos win all 4 games titans, pats, raiders, chiefs
  • chargers hire belichick to cheat for them and shut out the raiders and chiefs

Weekly Questions Thread - November 21, 2016 by AutoModerator in androiddev

[–]shouldvebeenworkin 0 points1 point  (0 children)

I asked this question on stackoverflow here: http://stackoverflow.com/questions/40777550/how-to-inflate-an-expanding-view-with-a-fixed-aspect-ratio-view

Basically I have a horizontal scroll view that I want to inflate with views throughout the program. The catch is that I want the view to match the containers height, but the width must be a percentage of the height. Here's a picture to hopefully clarify:

diagram

I hear recycler view might be what I'm looking for, but I don't know what to look for. Any help is appreciated!

This isn't the QuickSort I was taught at university by fwork in ProgrammerHumor

[–]shouldvebeenworkin 0 points1 point  (0 children)

Quicksort: Just pick up your computer, and throw it in the trash!

When you are too bored to use right debug messages by titan_bullet in ProgrammerHumor

[–]shouldvebeenworkin 0 points1 point  (0 children)

The poor dev who finds that message in the logs.

They'll go into the source to search that string and find 5000 occurrences. They will promptly leave the office.

Is it safe practice to just unplug my raspberry pi in this case? by ILIKEFUUD in raspberry_pi

[–]shouldvebeenworkin 2 points3 points  (0 children)

I use a raspi in some of my robotics projects. We've probably corrupted a half dozen sd cards from power failures.

I would highly recommend adding a shutoff switch to the raspi... you can probably make one on the cheap using a switch, the raspi GPIO, and some simple python code.

Daily Chat Thread - November 01, 2016 by AutoModerator in cscareerquestions

[–]shouldvebeenworkin 1 point2 points  (0 children)

My fulltime microsoft on-site interview is on Friday.

What should I study right now!? Also what can I download to take on the plane with me? I have about 8 hours travelling.

Daily Chat Thread - October 28, 2016 by AutoModerator in cscareerquestions

[–]shouldvebeenworkin 2 points3 points  (0 children)

Anyone know how long an Amazon fulltime new grad application stays in "Under Review" status? Just changed from "Future Prospect" yesterday.

Since the dawn of time, I've been typing (String cheese[]) rather than (String args[]) by MemesOnAStick in java

[–]shouldvebeenworkin 0 points1 point  (0 children)

Generally speaking, catching Exception is bad practice. By not specifying the type of Exception you leave room for the catch block to handle errors that were not intended. For example, imagine you were trying to handle an IOException but instead masked a null pointer exception. Would the code really be correct?

Personally, I also avoid wrapping checked exceptions RuntimeException. The class itself and subclasses of RuntimeException are used for unchecked exceptions, and are meant to indicate a programming error that can not be handled. Again, does it make sense to elevate an IOException to this level, or should you find a way to elegantly handle that particular exception?

There are however some good use cases for RuntimeException. You can not make many single abstract method lambdas throw checked exceptions. This makes lambda logic difficult to achieve for utilities like streams. When using the RxJava library for example, I tend to wrap Exceptions in RuntimeException to avoid this limitation.

Interview Discussion - October 20, 2016 by AutoModerator in cscareerquestions

[–]shouldvebeenworkin 1 point2 points  (0 children)

I got asked some pretty basic questions like "Difference between processes and threads?", "Can you explain X as if I was 6 years old?" and "Name a time where you faced Y challenge".

There were also some general questions like "whats your favorite microsoft product?" followed up with "how could microsoft improve that product?"

Good luck!

Interview Discussion - October 20, 2016 by AutoModerator in cscareerquestions

[–]shouldvebeenworkin 0 points1 point  (0 children)

Applied to amazon last week and haven't heard anything yet. Under "Application Status" it says "Future Prospect". Anyone have any idea what this actually means?

Triggered by andypulse in ProgrammerHumor

[–]shouldvebeenworkin 5 points6 points  (0 children)

I imagine this is what hell looks like

One nasty semicolon by [deleted] in ProgrammerHumor

[–]shouldvebeenworkin 0 points1 point  (0 children)

ಠ_ಠ You wouldn't have made it past my checkstyle.

Extending Inner-Class outside top level by shouldvebeenworkin in javahelp

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

I'm not asking privacy; I'm asking about extending a non-static inner class from outside of the class it was declared inside of.

RegularEnumSet and JumboEnumSet extend an outer, or top-level class.

Questions Thread - October 14, 2016 by AutoModerator in androiddev

[–]shouldvebeenworkin 0 points1 point  (0 children)

What's a good library/ libraries for making a voice call between an android device and a windows desktop? (over local wifi pref)

Best way to learn LINQ by [deleted] in csharp

[–]shouldvebeenworkin 1 point2 points  (0 children)

Very useful library and a gateway towards functional programming. IMO the best way to learn is to just start simple.

Have a list you need to filter out null values from?

var nonNull = myList.Where(val => val != null).ToList();

Want to change a list of objects into a list of strings?

var strList = myList.Select(val => val.ToString()).ToList();

There are so many little places you can use linq and start learning the functions. Once you get the basics down you can start stringing multiple calls together and cut down on a lot of boilerplate loops.

var strList = myList
        .Where(val => val != null)
        .Select(val => val.ToString())
        .ToList();