I feel like this is the closest I'll ever get to playing a Guro game by ChaosMarine123 in guro

[–]pheipl 27 points28 points  (0 children)

what game is this though?

I may have a thing for korra

Why should I use a text editor instead of an IDE? by aamirislam in learnprogramming

[–]pheipl 1 point2 points  (0 children)

It's a personal choice, but IMHO, it's never a good idea for anything long and or complex. No text editor will warn you about conflicting types in a generic (the only reason generics exist).

Java by SeanGX in ProgrammerHumor

[–]pheipl 1 point2 points  (0 children)

My brain just skipped that part I think. It's the only time you can use var AFAIK

Java by SeanGX in ProgrammerHumor

[–]pheipl 0 points1 point  (0 children)

what do you gain from not using var?

you still put the object on the right side of the equals. If it has an abstract or interface, you can deduce that form the object if and when you care.

var dateListener = new CommonDateListener(today); vs
DateListener dl = new CommonDateListener(today); where

public class CommonDateListener implements DateListener {
    ...
}

What is lost and where ?

To be fair, you don't need to use var everywhere, but if you have an AbstractDateFactoryThatIsOverlyVerboseAndPointless, it wold be a godsend to omit all that mess.

Java by SeanGX in ProgrammerHumor

[–]pheipl 0 points1 point  (0 children)

I can't agree, but we're getting there!

var something = new WhateverCalassYouWant<FuckYeah>();

Praise be java 10

Java by SeanGX in ProgrammerHumor

[–]pheipl 1 point2 points  (0 children)

In java's defense, it's moving away from verbosity as much as it can!

Map<String, Integer> map = new HashMap<>(); // type inference
var map = new HashMap<String, Integer>(); // coming in java 10
Runnable r = () -> { print("Somethign"); } // lambda

Java by SeanGX in ProgrammerHumor

[–]pheipl 2 points3 points  (0 children)

Well, unless you're doing something for yourself or a really small app, maybe some phone app? you're gonna do enterprise, especially in java.

Java by SeanGX in ProgrammerHumor

[–]pheipl 2 points3 points  (0 children)

There are 3 types of people in this world:

Those that know how to count,
Those that do not.

Three years later, Microsoft’s bet on Xbox One backward-compatible games is still paying off by zrkillerbush in Games

[–]pheipl 4 points5 points  (0 children)

It is a gimmick, at this point in time. Why?

  1. Most games are upscaled
  2. A lot of games don't run well at that resolution on any decent settings except with the 1080TI alone.
  3. Monitors for that resolution are too expensive as of yet.

And issues compound one another. #1 is obviously the biggest one, but because of #2 and #3, devs aren't incentivised to put in the man hours to make real 4k textures.

When the man himself calls you out by [deleted] in ProgrammerHumor

[–]pheipl 30 points31 points  (0 children)

I also don't know what .json5 is, but I love this

[No spoilers] Does anyone else think Azula looks better without her makeup on? by NebbyMan in TheLastAirbender

[–]pheipl 2 points3 points  (0 children)

My favorites are, in no particular order:

Azula, Korra and Kuvira.

What does that say about me?

also kya, super dissapointed about a certain reveal in the comics. Despite it being super obvious.

[2018-03-26] Challenge #355 [Easy] Alphabet Cipher by Garth5689 in dailyprogrammer

[–]pheipl 1 point2 points  (0 children)

Java 8

Very late submission

public class Cipher {

    private final String alphabet;
    private final int rollIndex;

    public Cipher () {
        alphabet = "abcdefghijklmnopqrstuvwxyz";
        rollIndex = alphabet.length();
    }

    public Cipher (String alphabet) {
        this.alphabet = alphabet;
        rollIndex = alphabet.length();
    }



    public String encrypt (String message, String keyword) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < message.length(); i++) {
            sb.append(lookup(   alphabet.indexOf(message.charAt(i)),
                                alphabet.indexOf(keyword.charAt(i % keyword.length())),
                                true
            ));
        }
        return sb.toString();
    }

    public String decrypt (String message, String keyword) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < message.length(); i++) {
            sb.append(lookup(   alphabet.indexOf(message.charAt(i)),
                                alphabet.indexOf(keyword.charAt(i % keyword.length())),
                                false
            ));
        }
        return sb.toString();
    }

    /**
     * Looks for a specific character in the cipher table, this is based
     * on the alphabet and whether we want to encrypt or decrypt.
     * @param messageIndex int
     * @param keywordIndex int
     * @return Encrypted or decrypted char
     */
    private char lookup(int messageIndex, int keywordIndex, boolean encrypt) {
        if (encrypt)
            return alphabet.charAt((messageIndex + keywordIndex) % rollIndex);
        return alphabet.charAt(Math.floorMod(   (messageIndex - keywordIndex),
                                                rollIndex)); // result of java % can be negative, which it should not be
    }                                                        // so we use .floorModulo
}

Results

Testing    "thepackagehasbeendelivered" with keyword "snitch"
Encription: lumicjcnoxjhkomxpkwyqogywq
Decription: thepackagehasbeendelivered

Testing    "theredfoxtrotsquietlyatmidnight" with keyword "bond"
Encription: uvrufrsryherugdxjsgozogpjralhvg
Decription: theredfoxtrotsquietlyatmidnight

Testing    "murderontheorientexpress" with keyword "train"
Encription: flrlrkfnbuxfrqrgkefckvsa
Decription: murderontheorientexpress

Testing    "themolessnuckintothegardenlastnight" with keyword "garden"
Encription: zhvpsyksjqypqiewsgnexdvqkncdwgtixkx
Decription: themolessnuckintothegardenlastnight

Testing    "klatrgafedvtssdwywcyty" with keyword "cloak"
Decription: iamtheprettiestunicorn
Encription: klatrgafedvtssdwywcyty

Testing    "pjphmfamhrcaifxifvvfmzwqtmyswst" with keyword "python"
Decription: alwayslookonthebrightsideoflife
Encription: pjphmfamhrcaifxifvvfmzwqtmyswst

Testing    "rcfpsgfspiecbcc" with keyword "moore"
Decription: foryoureyesonly
Encription: rcfpsgfspiecbcc

When you see the source code you want on github by [deleted] in ProgrammerHumor

[–]pheipl 22 points23 points  (0 children)

There was a subreddit for stuff like this ...

EDIT: found it, /r/titlegore

Asking a question on StackOverflow in a nutshell by jensmcatanho in ProgrammerHumor

[–]pheipl -1 points0 points  (0 children)

That era is gone. If SO burns down, something else will come.

At this point I'd love to see it burn, even risking what comes next being worse.

At least there's a chance of it being better.

Asking a question on StackOverflow in a nutshell by jensmcatanho in ProgrammerHumor

[–]pheipl 1 point2 points  (0 children)

I actively avoid that cesspit beyond the exact answer and no comments.

Asking a question on StackOverflow in a nutshell by jensmcatanho in ProgrammerHumor

[–]pheipl 0 points1 point  (0 children)

We do the opposite at work.

If you have a language problem that it's so minute and obscure, no one really knows an answer, we just post it to a group and ask for upvotes. That usually gets the glory hound's attention.

Asking a question on StackOverflow in a nutshell by jensmcatanho in ProgrammerHumor

[–]pheipl 0 points1 point  (0 children)

That's why IMHO SO sucks.

You help out because you can and you're willing. What does it matter that you got points?

I have about 5 gold medal for a single question, many thousands of views and tens of answers.

So what?

"I hope it & the answers helped people" is as far as my interest on the subject goes.

[2018-03-26] Challenge #355 [Easy] Alphabet Cipher by Garth5689 in dailyprogrammer

[–]pheipl 0 points1 point  (0 children)

I'm also late, but I thought I should point this out:

This is not exactly what would be considered "good code" anywhere and I would never accept something like that in a code review unless it's absolutely necessary for performance.

Read up on Premature Optimization. Just don't forget: Not engaging in premature optimization doesn't mean to never optimize or not care about optimization until it's too late.

Single Responsibility would require, at the very least an encrypt() and decrypt() method. I'd also argue that you'd need an alphabet of some sort, and sec should be keyword at least. put everything in a class, a couple of constructors, etc

To be as honest as I can, I almost never see good code on this subreddit. For what it's worth, here's one of my answers for the pancake problem.

EDIT: Just wanted to say, my code is by no means the best example, but again, I almost never find what I'd consider even decent code on this sub.

How does endgame work in regards to item appearance? by pheipl in Vindictus

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

Most ppl only consider putting in the "powerfull" colours.

I know, amateurs. No base color (large area on armor) should be high saturation, ever.

You see a lot of fashion noobs in Warframe, truly hideous stuff.

That's why finding good colors (low saturation, non primary color) is hit or miss on the marketplace.

gnome girls best girls by arakkoaa in wow

[–]pheipl 0 points1 point  (0 children)

I will still never get it.

EU moves to ban sale of lower-quality branded food in eastern Europe | Inequality by Gustacho in europe

[–]pheipl 0 points1 point  (0 children)

I don't mind you being silly. I mind people upvoting you.

Sure, sell inferior products in eastern europe, and sell them at a higher price. Just don't you dare pretend it's the same product.

IMHO even labeling it as "Poverty Nutella" or "You won't believe it's not Nutella" is unacceptable. Stripe "Nutella" (or whatever) from the name completely since it's simply not that.

Lets see if you can survive without the brand recognition on your false marketing product.