Overpopulation is the main cause, if the class is crowded there's no way of waiting for everyone to get it.
......?????
|
Programming Discussion Thread
|
|
11-10-2012, 06:02 PM
Overpopulation is the main cause, if the class is crowded there's no way of waiting for everyone to get it.
......?????
11-11-2012, 06:25 AM
Now, back vaguely towards actual programming:
Can someone who knows some java help me with something. For a program I'm working on I need a method which puts the frequency of each character in the alphabet as a separate entry into an array (or as parts of the internet have suggested when I googled it, a hashmap, which I don't have a clue how to use). The program overall will put this data into a .csv file with a user specified name (which I've already got working). Basically, I have no idea what functions will help me, so can't even write a psuedocode version. When I looked it up, I found some examples, but don't like using other people's code unless I know what each line does and why, which is why I'm asking for help: I'd like to be told generally what I'll need to do, and which functions I'll need, and why, then try and make it myself from that information.
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X RAM: 16GB GPU: Radeon Vega 56 11-12-2012, 01:39 AM
Seeing as LordVador is making so may new threads, it looks like I'll have to...
*Bump*
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X RAM: 16GB GPU: Radeon Vega 56 11-12-2012, 07:45 AM
Why don't you just make the method yourself?
"Normally if given a choice between doing something and nothing, I’d choose to do nothing. But I would do something if it helps someone else do nothing. I’d work all night if it meant nothing got done."
-Ron Swanson "I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. " -Mark Antony 11-12-2012, 10:36 AM
I see you skim read what I wrote. The reason I don't write the code is that I have no idea what I'm doing. If I did, I could.
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X RAM: 16GB GPU: Radeon Vega 56 11-12-2012, 10:58 AM
I keep thinking that there must be something that I'm missing because that seems pretty easy.
Quote:I need a method which puts the frequency of each character in the alphabet as a separate entry into an array So you want an array with 52 elements for each alphabetical character (upper and lower) with each element holding the number of times that character appears in the file correct? Just make a for loop that runs 52 times and increments to the next letter each time. Then within that for loop have another for loop that goes through every character, checks to see if it matches the currently set character using an if statement, and if it does += 1 to the counter, then when it's done write the counter to the current array element. The outer loop should then pop to the next letter and the next array element.
"Normally if given a choice between doing something and nothing, I’d choose to do nothing. But I would do something if it helps someone else do nothing. I’d work all night if it meant nothing got done."
-Ron Swanson "I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. " -Mark Antony 11-12-2012, 11:07 AM
(11-09-2012, 04:10 PM)NaturalViolence Wrote:This is not true. If you are good, many places do not care if you got a degree in something unrelated or never even attended university.Quote:Ye, reason why you shouldn't rely on classes and start teaching stuff yourself lol...Quote:Most of my programming knowledge came from the internet when I studied stuff myself. 11-12-2012, 11:16 AM
(11-11-2012, 06:25 AM)AnyOldName3 Wrote: Now, back vaguely towards actual programming:in high level languages, hashmaps typically work such that you have pairs of values, called a "key", and a "value". The key is used as if it is an index into the hashmap. Consider a normal array where you might do something like this: Code: alphabet[0] == "a"Code: alphabet_indices["a"] == 0you can use this to easily do something like: Code: for character in input_string:note i'm not using java, but you should get the idea. 11-12-2012, 11:20 AM
Actually I only need to search for uppercase characters, so would only need 26 elements.
The problems are as follows: a) The internet has told me to use a hashmap instead of an array. I have no clue what the difference is, and no clue how to implement one. b) I don't know exactly how to do the comparing a specific location in a string to another string. I only learned this afternoon how to compare the whole of a string to another string @(as stringName != "y" apparently always evaluates to true, even when the string is "y"). c) The example code I can find doesn't do this exactly how you say. There's a faster way to do it (there may be a library function that gives the total count of a character in a string, but the code I've seen was poorly formatted, so I struggled reading it).
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X RAM: 16GB GPU: Radeon Vega 56 11-12-2012, 11:20 AM
(This post was last modified: 11-12-2012, 11:21 AM by NaturalViolence.)
Quote:This is not true. If you are good, many places do not care if you got a degree in something unrelated or never even attended university. Well it certainly increases your chances, a lot. Quote:Actually I only need to search for uppercase characters, so would only need 26 elements. I'm guessing you got ninja'd by shuffle.
"Normally if given a choice between doing something and nothing, I’d choose to do nothing. But I would do something if it helps someone else do nothing. I’d work all night if it meant nothing got done."
-Ron Swanson "I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. " -Mark Antony |
|
« Next Oldest | Next Newest »
|