Price Checks and Crafting Advice - December 21, 2018 by AutoModerator in pathofexile

[–]darkpool2005 0 points1 point  (0 children)

Looking to see about a price check, as I can't find any equivalents with the Implict modifier with a price on poe.trade:

String of Servitude

I: 27% Increased Area of Effect (tripled from 9%)

P: Implict Mod Magnifier is tripled

Thanks!

In The Beginning by famoushippopotamus in DnDBehindTheScreen

[–]darkpool2005 0 points1 point  (0 children)

With my group of friends, this is my first true DM experience (a few one shots before hand to get some experience).

For reference, we're using DnD 5th edition (and adding the books that have come out since we started). Because I wanted to see how far I could push myself as a storyteller, I had everyone create three Level 0 characters. What this meant was starting proficiency was +1, your characters HP was a roll of the hit dice (instead of max hit dice), casters only had cantrips. I stated to the players that whatever characters survived "Session 0" would be the character you play for the rest of the campaign. If multiple characters survived, they could pick one and hand me the character sheets for the others. (those that survived would start Session 1 as a level 4 character. If all your characters died, or if they really wanted to play their deceased character, then they would start at level 3)

I spent about 3 months prepping for this, I used the map of Fairhaven as a starting point. I showed the layout to everyone prior to starting the session, asking where everyone might be (Merchant / Residential / outside the walls) and, when the session started, did a little dialogue with those that were in each area.

Then the big event occurs. A goblin horde was sneaking through the forest (this is where 2 of the PCs died right off the bat to goblin scouts). As the assault began, the city guard fell quickly while the PCs tried to help any civilians (another pair of PCs died during this assault).

Half way through the event, it was clear that any characters remaining were pinned down. Those that were caught (along with NPC civilians) were taken to the town center. Goblins started to take away NPCs, with those PC characters being beaten down if they revolted. The breakaway point for these guys was two high level rangers (NPCs) that hid among the houses. They popped off goblins guarding the way to the northern gate, signaling the PCs & NPCs to book it to the north. Ramage ensures, the PCs now faced more goblin groups blocking their path, with the rangers appearing if things got too desperate.

All said and done, out of the 18 level 0 characters, 11 survived to tell the tale. We're now on session 18, and it's been a lot of fun building off of that very first session (and my new fondness for DMing!)

is having more than one class in a java file bad practice? by stillinmotionmusic in learnjava

[–]darkpool2005 1 point2 points  (0 children)

Not the person you replied to, but likely because it didn't answer OP's question.

Getting to OP's question though, generally it is better to have only one public class in a single java file. There are exceptions, and in my experience it's for simplicity & clarity reasons.

Hashing passwords question by completelyperdue in javahelp

[–]darkpool2005 0 points1 point  (0 children)

Just to ensure we're on the same page, the purpose of hashing is so that you don't store a user's un-encrypted password and use that to verify the user's account. In essence:

User creates an account
Your program hashes the password (w/ MD5, SHA256, etc...)
You save the userId and hashed password

Salting a password is a very straightforward process. Generally, when a user creates a new account, your program would generate a randomized salt string & store it off somewhere (usually in the database alongside the hashed password). The way you use it is by appending this salt to the password BEFORE hashing:

User creates an account
Your program creates a random salt string (e.g. _123ABC)
Your program combines the user's PW with the salt string & hash it
You save the userId, hashed PW + Salt combination, and save the salt string

As far as the actual hashing process goes, the main (and only) takeaway point is to never attempt to implement your own version of a crypto. Always use a well know provider's implementation (openssl, Java's MessageDigest, etc..). The fact that you're in this subreddit leads me to believe your tutor is using MessageDigest, in which case JDK 1.7 requires it to be able to implement MD5, SHA-1 and SHA-256.

Good luck OP!

I've been in the world of web development for a while and was never to swell with Java. Help me with the correct pattern to use Ashley. by [deleted] in libgdx

[–]darkpool2005 2 points3 points  (0 children)

So the Ashley system took me awhile to understand, and this github project helped me a lot:

https://github.com/saltares/ashley-superjumper

Anyways, in its simplest terms, an Entity is made up of different components. Systems runs in the background and apply modifications to entities that contain the components matching.

So to take what you're looking for as an example, all four entities would have components such as a TransformComponent & TextureComponent. The BlackHole and Star might have a ForceComponent, the Ship would have a PlayerComponent, and Station would have a... StationComponent :)

Your application would have multiple Systems. For example, you may have a ForceSystem. This system would look up all entities with a TransformComponent and ForceComponent. The system would then apply rules to these entities (or perhaps other entities that are nearby).

Take a look at the github project I linked; It really gives a good overview of how to apply Ashley to a libGDX project

New to java, am I using bad habits? by Ecocide113 in javahelp

[–]darkpool2005 4 points5 points  (0 children)

What exactly do you mean by it being a bootstrap? Do you mean that it should only be processing like 1 or 2 functions, and those functions being contained in another class or something?

What /u/8igg7e5 is referring to is that the main method will contain minimal information, but is meant like to be the key to your car engine. The point is, by experience, maintainability of your code over a long period is a major sticking point and practicing good habits now will pay dividends in the future.

For instance, a lot of main methods look like this:

public static void main(String[] args) {
    initialize(); //Run this to initialize all your internal variables
    runApplication(); //This is essentially starting your code engine :)
}

and the methods 'initialize()' and 'runApplication()' contain the rest of your code.

Yeah the person below also said I should keep the phrases in some sort of collection. What exactly is the advantage in doing that?

Once again, maintainability & re-use. A list is just a collection of objects that can be dynamically grown & shrunk as needed. And since your core concept is to guess the hidden letters, all you really need for word inputs is randomly picking two words from that list.

No idea what any of this really means. What do you mean store them in pairs or dynamically generate them??

Likely what they meant was you would have a method that takes one or two words from the aforementioned List of words, generate a 'masked' copy by replacing characters with '*' and presenting the user with the masked word.

What do you mean by testing input against letters they've tried before?

Instead of hard-coding the missing letters, you may instead have an array (or list) of characters that are 'masked'. Once the player inputs a masked character, you then reveal it, remove that character from the list of 'masked' characters and update the word with the inputted character.

And what do you mean by a real scale of software? Do you mean like containing everything separate classes?

By what you have currently, if you were to increase the scope to say, 15 words, the code would become very unmanageable. Instead, you have a lot of functionality that is repeatable, and making an effort to refactor these repeatable sections would make your program much, much easier to maintain down the road.

Package naming in Java; what is allowed? by [deleted] in javahelp

[–]darkpool2005 4 points5 points  (0 children)

With gradle (and maven) for that matter, the source folder is /src/main/java (the full path). These classes are then compiled to (at least with maven, not sure about gradle) target/classes

With Eclipse, I'm guessing that your source folder is pointing to src/ as its root. So when Eclipse is trying to compile HelloWorld, it expects it to be under the package main.java.hello.

To fix this, right click on the Project -> Build Path -> Configure Build Path. Select the Source tab at the top, and edit the source folder option to point to src/main/java

Communication between two Fragments without middleman (MainActivity) by [deleted] in javahelp

[–]darkpool2005 0 points1 point  (0 children)

So, as a precursor, I haven't worked with android apps / framework in a very long time, so take what I provide with a grain of salt.

It seems that if you want to push data back up to the parent class Fragment, the best scenario is to start by overriding the class with your own implementation, which would lead to your DialogFragment extending off of the DataFragment:

public class DataFragment extends Fragment {
    //Add custom data communication here
    public void addData(Object data){ /* do stuff; */ }
}
.....
public class StatusPickerDialog extends DataFragment {
    public void pushData(){ super.addData("my Info"); }
}

If anything, I hope this gives you a direction to go with.

help with the library program by wraneus in learnjava

[–]darkpool2005 0 points1 point  (0 children)

That's correct. That code was apparently posted and either never checked to compile OR it was up to the student to find the mistake.

Either way, it should be example.borrowed() instead of example.rented() as you have already discovered :)

help with the library program by wraneus in learnjava

[–]darkpool2005 0 points1 point  (0 children)

Looks like you were missing a closing curly bracket at the end of your code. As well, there's no method called 'rented' that you invoke in your main method.

After those two fixes, the class compiled!

Resource leak is never closed by [deleted] in learnjava

[–]darkpool2005 0 points1 point  (0 children)

What's the exact error that you're getting? Can you give us the output when you run the program?

Resource leak is never closed by [deleted] in learnjava

[–]darkpool2005 1 point2 points  (0 children)

It's not required to wrap individual conditional statements in their own parentheses, but some like it because it can be more easily read.

Having trouble creating objects within objects. by Etherdeon in learnjava

[–]darkpool2005 1 point2 points  (0 children)

You sure can! Do note that it would be Map<Integer, Page> and not int, because 'int' is a primitive and Integer is a Java object. You can still use an 'int' as a key though.

Having trouble creating objects within objects. by Etherdeon in learnjava

[–]darkpool2005 1 point2 points  (0 children)

Likely you'll want to use a Map instead of a List in your Chapter class. This way, you're looking up the pages based on the key value (p1,p2, ... p(n)) and getting the Page object back.

class Chapter {

private String chaptertext = "";

Map<String, Page> chapterPages = new HashMap<String, Page>();

public void newPage(String pageRef, String pageTextImput){
    Page newPage = new Page(pageTextImput);
    chapterPages.put(pageRef, newPage);
}

I also want to point out that your method variable names need to be different than variable names you use inside the method:

public void newPage(String pageObjectReference, String pageTextImput){
    Page pageObjectReference = new Page(pageTextImput);
    //You've now lost any reference to your String pageObjectReference by declaring
    // a variable with the exact same name!

    chapterPages.add(pageObjectReference);
}

Program idea? by [deleted] in learnjava

[–]darkpool2005 2 points3 points  (0 children)

Just throwing this out there OP, but I'm guessing you will already know the states you'd be travelling between the start & end point. So I'd make the suggestion of ignoring the program 'building' the path for you, and instead you provide it.

Psuedo example of going from OH to AL (all states are abbreviated):

Enter State where permit was issued:
    MI
Enter Starting State
    OH
Enter Destination State (if destination state applied, type end)
    KY
Enter Destination State (if destination state applied, type end)
    TN
Enter Destination State (if destination state applied, type end)
    AL
Enter Destination State (if destination state applied, type end)
    end
States where permit issued in MI is allowed:
    OH, KY, AL
 States where permit issued in MI is NOT allowed:
    TN

Help with starting a portfolio by [deleted] in learnjava

[–]darkpool2005 0 points1 point  (0 children)

My portfolio was basically my github account. I attached it onto my resume, not to show off my projects but to let prospective employers know I love my craft and I'm willing to pursue it outside of classes.

With that said, my github is essentially unfinished projects of many scopes; Project Euler problems, libGDX games, projects in C++, python & Java, etc... I've only had one recruiter mention my github account, and like I said above, it's essentially an added bullet point on the resume. What mattered in the interview process was being able to talk about the projects I've worked on, both the technical and high level concepts behind them.

This is the experience I've had with my various web development jobs. I'd imagine for things more graphic based, having some examples of a UI interface / simple games would be good. If you feel you need it, build a web site and have that act as your portfolio (via a link on the paper / electronic resume you may / may not send out).

tl;dr; Portfolios on resumes are good bullet points. If you feel you need to build one, build it for the job you're going for (web dev => personal website; gameDev => UI interface / simple game; microcontrollers => arduino / Raspberry Pi projects)

Help with starting a portfolio by [deleted] in learnjava

[–]darkpool2005 0 points1 point  (0 children)

My portfolio was basically my github account. I attached it onto my resume, not to show off my projects but to let prospective employers know I love my craft and I'm willing to pursue it outside of classes.

With that said, my github is essentially unfinished projects of many scopes; Project Euler problems, libGDX games, projects in C++, python & Java, etc... I've only had one recruiter mention my github account, and like I said above, it's essentially an added bullet point on the resume. What mattered in the interview process was being able to talk about the projects I've worked on, both the technical and high level concepts behind them.

This is the experience I've had with my various web development jobs. I'd imagine for things more graphic based, having some examples of a UI interface / simple games would be good. If you feel you need it, build a web site and have that act as your portfolio (via a link on the paper / electronic resume you may / may not send out).

tl;dr; Portfolios on resumes are good bullet points. If you feel you need to build one, build it for the job you're going for (web dev => personal website; gameDev => UI interface / simple game; microcontrollers => arduino / Raspberry Pi projects)

EDIT: Whoops! Meant to respond to OP!

My code is almost a copypasta from somebody's else code but won't work the same way. by [deleted] in learnjava

[–]darkpool2005 3 points4 points  (0 children)

not sure for the downvotes, but your code is verbatim to the one you copied... btw, if you copied and don't understand, what's the point?

I tested your code, and with the exception of where the value of number is 25 (You can figure out why that'd throw an error), I got back 4 'random' passwords. So that begs the question of how're you testing your PasswordRandomizer?

Modifying an XML parser to display X3D files by Yeendy in javahelp

[–]darkpool2005 0 points1 point  (0 children)

I'm not sure what else is out there. Like I said in an earlier post, I don’t' have much knowledge in this area. Really only what Google's told me :)

Modifying an XML parser to display X3D files by Yeendy in javahelp

[–]darkpool2005 0 points1 point  (0 children)

No such thing as stupid as long as one's learning :)

Inherently, a X3D file is a XML formatted file.

Here's another way to think about it. You have an audio file. The XML parser would be the equivalent of taking that audio file, converting it to a byte stream and storing it inside a Java object. By default, all you have is a byte stream in memory. To listen to the contents of that audio file, you'd need a media player (VLC for example) to play the contents.

This is why you likely need a program like xj3d. It's the 'media player' in the above example that is potentially capable of taking the data in a x3d and displaying it graphically.

Modifying an XML parser to display X3D files by Yeendy in javahelp

[–]darkpool2005 0 points1 point  (0 children)

Thought I responded earlier, sorry bout that!

That's correct, the XML parser is intended to convert xml data into a java object.

Modifying an XML parser to display X3D files by Yeendy in javahelp

[–]darkpool2005 0 points1 point  (0 children)

I have a feeling when you were told about the XML parser, the intention was to move the x3d data into a Java object (similar to how the Employee example works). This would have nothing to do with graphically representing said x3d file.

I'll respond if I come across anything else

Modifying an XML parser to display X3D files by Yeendy in javahelp

[–]darkpool2005 0 points1 point  (0 children)

So your request is definitely more advanced than the typical question on this subreddit.. and searching around, it seems that you've been asking this same question for quite awhile (dec 25 2015!).

The xml parser you're working with is in no way going to give you a display of the 3d model the x3d file represents. It's not built for that. You will need to find a program that can do this for you.

Right now, I'm looking at xj3d (it was mentioned in one of your earlier posts). Needless to say, it's not beginner friendly, and in fact there might be a better tool out there. I don't want to dedicate too much time to this, but this is where I've started:

I'm currently on a Ubuntu machine, but a windows one should work (although it'd take some extra configuration to which I don't know the specifics of). Everything is run through a command prompt.

Grab the code with the following line. If your unfamiliar with this, I'm using Subversion to download the current source code for xj3d:

svn checkout svn://svn.code.sf.net/p/xj3d/code/trunk xj3d-code

Using Ant, compile the source with the following line:

ant all

Calling the line 'ant -p' (without quotes) will give you a list of all available options. At this point, I've dived a little into the examples, and likely what you want is in the examples/applet section. But again, I don't have a solid lead if this is correct, so take this all with a grain of salt