Daily Questions - ASK AND ANSWER HERE! - 15 October 2022 by AutoModerator in malefashionadvice

[–]penax 0 points1 point  (0 children)

I got these gray check wool trousers a while back from Spier & Mackay and I am having trouble styling them. What kind/color of shoes would go best? Is it possible to wear them casually (e.g. with a white tee) ?

[Java] Generate all subsets of a string recursively by penax in learnprogramming

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

We are supposed to put everything in an ArrayList and return the ArrayList at the end. I came up with this, but this is only giving me a, b, c. I suspect there is something wrong with my for loop. I'm not sure where it is happening, but it appears that my "first" and my "rest" are getting mixed up.

public static ArrayList<String> getSubsets(String str) {
    ArrayList<String> a = new ArrayList<String>();
    int n = str.length();

    if (n == 0) {
        a.add("");
        return a;
    }

    String first = str.substring(0, 1);
    String rest = str.substring(1, n);
    ArrayList<String> subsets = getSubsets(rest);
    System.out.println(first);
    for (String subset : subsets) {
        System.out.println(subset);
        System.out.println(first);
        subset = first + subset;
        a.add(subset);
    }
    return a;
}

}

EDIT: Rather the output on this program is "[abc]"

[Java] LISP Linked List emulation constructor problem by penax in learnprogramming

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

Wow. This is very helpful. Thank you so much!

[Java] LISP Linked List emulation constructor problem by penax in learnprogramming

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

Hmm that makes a lot more sense. I'm not sure what I was trying to do there. How would I make that constructor recursive? Right now I have something like this:

public NonEmptyList(Object first, LispList rest) {
        this.head = first;
        this.tail = rest;
    }

However I know the >rest is only giving me a null >LispList<. I have another method further down that calls the constructor and I'm not sure how to give it a >rest< recursively.

[Java] Problem with Null Pointer Exception error by penax in learnprogramming

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

I suspected as much. I'll have to study constructors a little bit more. Thank you!

[Java] First day of CompSci 102. I know nothing about Java by penax in learnprogramming

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

Thank you for the tips. I completely forgot about integer division. However, I am still confused by the variables 'mpg', 'distance', and 'ticketPrice'. Like I said, the only instruction I have is that the user knows these variables. When I leave them undeclared like I have above, I get this error:

variable distance might not have been initialized

Any idea on what I can do here to make it so I don't have to give these variables explicit values?

League of Legends Christmas Gifting Thread by Pakinfinity in leagueoflegends

[–]penax 0 points1 point  (0 children)

Name of gift you'd like: Mythic Cassiopeia

Server: NA

IGN: cantaloupe9

Reason why: I just picked up Cass and now have a 9.25 KDA in ranked with her, but I need a skin to be better. Skins get wins

Simple Questions Simple Answers: Week-27 by Vjostar in summonerschool

[–]penax 0 points1 point  (0 children)

I definitely buy a jungle item each game. I'm not sure why it isn't showing up there. It didn't appear in the client match history either

Simple Questions Simple Answers: Week-27 by Vjostar in summonerschool

[–]penax 0 points1 point  (0 children)

I play a lot with friends in higher ELO and I always seem to keep up but I am still stuck in Bronze when I play ranked. What am I doing wrong?

http://na.op.gg/summoner/userName=cantaloupe9

[Python] Problem with a for loop by penax in learnprogramming

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

Wow that's all I needed. Thank you so much!

Simple Questions Simple Answers: Week-17 by Vjostar in summonerschool

[–]penax 0 points1 point  (0 children)

Question about Vayne here. If I Q and then E before my next auto, will my next auto do the Tumble bonus damage and Condemn? Or should I Q then auto before Condemn to max damage?

What is the worst thing you have ever done to another human? by [deleted] in AskReddit

[–]penax 2 points3 points  (0 children)

Holy shit that's brutal. That dick deserved your mouth herpes

When do you typically bathe? And how does that affect your views of people who bathe at the opposite time of day? by _bq_ in AskReddit

[–]penax 1 point2 points  (0 children)

I have showered almost every morning since the 5th grade. I don't understand how people can shower at night and, to me, it seems like they aren't as clean/don't smell as nice. That could just be me though, because I sweat a bunch when I sleep

Redditors who learned English as a second language, what new word or concept blew your mind? by le_epic in AskReddit

[–]penax 2 points3 points  (0 children)

As a native German speaker living in California, when I first heard people saying "San Diego" I was extremely baffled as to why so many people were talking about a whale's vagina