• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Offtopic › Delfino Plaza v
« Previous 1 2 3 4 5 6 ... 64 Next »

Programming Discussion Thread
View New Posts | View Today's Posts

Pages (67): « Previous 1 ... 5 6 7 8 9 ... 67 Next »
Jump to page 
Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Programming Discussion Thread
11-10-2012, 06:02 PM
#61
Zee530 Offline
Above and Beyond
*******
Posts: 1,747
Threads: 12
Joined: Jan 2011
Overpopulation is the main cause, if the class is crowded there's no way of waiting for everyone to get it.
......?????
Find
Reply
11-11-2012, 06:25 AM
#62
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,533
Threads: 1
Joined: Feb 2012
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
Find
Reply
11-12-2012, 01:39 AM
#63
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,533
Threads: 1
Joined: Feb 2012
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
Find
Reply
11-12-2012, 07:45 AM
#64
NaturalViolence Offline
It's not that I hate people, I just hate stupid people
*******
Posts: 9,013
Threads: 24
Joined: Oct 2009
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
Website Find
Reply
11-12-2012, 10:36 AM
#65
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,533
Threads: 1
Joined: Feb 2012
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
Find
Reply
11-12-2012, 10:58 AM
#66
NaturalViolence Offline
It's not that I hate people, I just hate stupid people
*******
Posts: 9,013
Threads: 24
Joined: Oct 2009
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
Website Find
Reply
11-12-2012, 11:07 AM
#67
shuffle2 Offline
godisgovernment
*
Project Owner  Developers (Administrators)
Posts: 698
Threads: 17
Joined: Mar 2009
(11-09-2012, 04:10 PM)NaturalViolence Wrote:
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.

Well obviously. But to do anything with that knowledge career wise you need a degree. And to get that degree you're going to need to take these classes. And if you take these classes you're going to have to put up with the idiots in those classes. Therefore it's a common issue regardless of how much or little you learn about programming outside of class.
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.
Find
Reply
11-12-2012, 11:16 AM
#68
shuffle2 Offline
godisgovernment
*
Project Owner  Developers (Administrators)
Posts: 698
Threads: 17
Joined: Mar 2009
(11-11-2012, 06:25 AM)AnyOldName3 Wrote: 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.
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"
hashmaps make it easy to use whatever datatype you want as the index, so instead of using integers you can use strings, for example:
Code:
alphabet_indices["a"] == 0

you can use this to easily do something like:
Code:
for character in input_string:
    hitcounts[character] = hitcounts[character] + 1
...and that's about it.

note i'm not using java, but you should get the idea.
Find
Reply
11-12-2012, 11:20 AM
#69
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,533
Threads: 1
Joined: Feb 2012
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
Find
Reply
11-12-2012, 11:20 AM (This post was last modified: 11-12-2012, 11:21 AM by NaturalViolence.)
#70
NaturalViolence Offline
It's not that I hate people, I just hate stupid people
*******
Posts: 9,013
Threads: 24
Joined: Oct 2009
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.

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).

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
Website Find
Reply
« Next Oldest | Next Newest »
Pages (67): « Previous 1 ... 5 6 7 8 9 ... 67 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 2 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode