• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 03:07
CEST 09:07
KST 16:07
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview7[ASL21] Finals Preview: Two Legacies21
Community News
Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611Douyu Cup 2026: $20,000 Legends Event (June 26-28)10[BSL22] Non-Korean Championship from 13 to 28 June4Weekly Cups (May 25-31): Clem doubles, 2v2 circuit heads toward finale0
StarCraft 2
General
TL Poll: How do you feel about the 5.0.16 PTR balance changes? Code S Season 2 (2026) - RO8 Preview Updates to The Core/Core Lite for v5.0.16? RSL: S6 Finals played at BlizzCon 2026 Weekly Cups (June 8-14): Clem and Solar double, PTR tested
Tourneys
GSL CK #4 20-21th June Douyu Cup 2026: $20,000 Legends Event (June 26-28) Maestros of The Game 2 announcement and schedule ! Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond)
Strategy
[G] Having the right mentality to improve
Custom Maps
Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
Mutation # 530 One For All The PondCast: SC2 News & Results Mutation # 529 Opportunities Unleashed Mutation # 528 Infection Detected
Brood War
General
BW General Discussion vespene.gg — BW replays in browser Where is EffOrt? BGH Auto Balance -> http://bghmmr.eu/ Quality of life changes in BW that you will like ?
Tourneys
[Megathread] Daily Proleagues [ASL21] Grand Finals [BSL22] Grand Finals - Sunday 21:00 CEST Escore Tournament StarCraft Season 2
Strategy
Relatively freeroll strategies Creating a full chart of Zerg builds Why doesn't anyone use restoration? Any training maps people recommend?
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Beyond All Reason Total War: Warhammer 40K Path of Exile
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
Vanilla Mini Mafia
Community
General
UK Politics Mega-thread US Politics Mega-thread Russo-Ukrainian War Thread [H]Internet/Gaming Cafe Tips and Tricks Trading/Investing Thread
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion [Manga] One Piece
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion Cricket [SPORT] NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
Does Workplace Frustration D…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7118 users

The Big Programming Thread - Page 114

Forum Index > General Forum
Post a Reply
Prev 1 112 113 114 115 116 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
Last Edited: 2012-02-06 19:53:22
February 06 2012 19:53 GMT
#2261
--- Nuked ---
esotericc
Profile Joined July 2011
449 Posts
February 06 2012 21:21 GMT
#2262
On February 07 2012 04:53 Inori wrote:
Show nested quote +
On February 07 2012 03:52 esotericc wrote:
Read the first page, just getting confirmation that I understood the advice properly, I start a comp sci degree in a year, I already know web languages fairly well and did a couple years free lance development but stopped because there was no market near me and I couldn't afford to move.

Anyway, I take it I should learn C++ first and then java second and not the other way around? I want to have a decent grasp on languages before I get to school but I am a little cloudy on the most optimal place to start. I feel like this may have been covered in the first post but I am not sure if the advise would be the same for someone going into the course and not someone already in the course.

Thanks guys.

Well if you know your way around in programming (i.e. paradigms, design patterns, etc), then language doesn't really matter. Pick something that suits you. Or something trendy like Scala or node.js.

Since you have a whole year before school, then you could just learn them all (think of a simple project and build it with scala, node.js, ruby, python, java and c++), doing 1 language/1-2 months.


I am fairly rusty as I spent most of my time focusing on HTML and CSS, while I did learn actionscript and PhP during my colledge diploma (different than the degree I am going for) I mostly forgot the ins and outs of each language as I never really used them. Thanks for the advice, I think the one language every few months plan seems like the best course.

SiKStArCuE
Profile Joined April 2011
United States19 Posts
February 07 2012 00:19 GMT
#2263
I'm having trouble figuring this hw problem out and would appreciate it if anyone could guide me on how to solve it.

Problem A. The values of two float variables, x and y, are saved in IEEE single precision floating point format
as below. Calculate the value of z in IEEE single precision floating point format if z = x + y. You should begin
the calculation with the packed 32-bit representations of x and y and end with the 32-bit packed result for z.

x = 0 11100010 00101100000000000000000
y = 1 11100000 11010000000000000000000
tofucake
Profile Blog Joined October 2009
Hyrule19221 Posts
February 07 2012 00:27 GMT
#2264
People won't give you the answer, but they will help. But we want to know what have you done to try to solve it so far? What particular part are you having trouble with?
Liquipediaasante sana squash banana
SiKStArCuE
Profile Joined April 2011
United States19 Posts
Last Edited: 2012-02-07 01:11:09
February 07 2012 01:09 GMT
#2265
I'm having trouble unpacking the numbers. I know that I need to insert a number into the fractional mantissa to get the true mantissa. However, I don't know how to get that number. Also since the exponents are different I need to get them to be the same. In order to do that do I need to subtact the first number by the second number and then shift the mantissa however many times? I didn't mean to come off as asking for the answer I'm just curious about the steps. Thanks Chris,
eFonSG
Profile Joined November 2010
United States255 Posts
February 07 2012 21:18 GMT
#2266
Hey, i need some help with string manipulation in Java.

Essentially im suppose to take a string from the user that is a word
Im writing a class that with a few different methods that are to help split the word up into syllables and help with pronunciation
For one of my methods, Im suppose to change lets say September into sep/tem/ber. Im not really sure how to go about attacking this. We have rules given for when to break syllables up, how to count them, etc.

"How to identify syllables: We’ll confine ourselves to just two situations, commonly known as the ‘vccv’
and ‘vcv’ rules. As you scan a word from left to right, if you encounter a vowel followed by two consonants
(non-vowels) followed by a vowel, divide between the consonants. For example, “hidden” contains this
pattern and is divided into two syllables: ‘hid/den’. If you see the ‘vcv’ pattern, divide before the
consonant. Thus, “consonant”, which exhibits both patterns, would be divided like this: ‘con/so/nant’."

I just need some direction on a project like this, im pretty lost about where to start. The string were manipulating is user input, so i cant find a consistent way to break it up correctly. Sometimes it feels like my brain just cant make the right connections when it comes to programming -.-
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2012-02-07 21:50:42
February 07 2012 21:48 GMT
#2267
On February 07 2012 04:53 Inori wrote:
Show nested quote +
On February 07 2012 03:52 esotericc wrote:
Read the first page, just getting confirmation that I understood the advice properly, I start a comp sci degree in a year, I already know web languages fairly well and did a couple years free lance development but stopped because there was no market near me and I couldn't afford to move.

Anyway, I take it I should learn C++ first and then java second and not the other way around? I want to have a decent grasp on languages before I get to school but I am a little cloudy on the most optimal place to start. I feel like this may have been covered in the first post but I am not sure if the advise would be the same for someone going into the course and not someone already in the course.

Thanks guys.

Well if you know your way around in programming (i.e. paradigms, design patterns, etc), then language doesn't really matter. Pick something that suits you. Or something trendy like Scala or node.js.

Since you have a whole year before school, then you could just learn them all (think of a simple project and build it with scala, node.js, ruby, python, java and c++), doing 1 language/1-2 months.

node.js is not a particularly useful skill toi have. I would ignore this advice.

Scala is very interesting, but learning & refining your understanding of Java must come first. Scala is not for beginners, and you won't appreciate what it's offering until you've struggled through Java's intricacies. And after using Scala, you may just realize that it is not always the best tool for the job (in which case you might use a combination of JVM languages).

If you're going into CS, study Python and C. Python is a decent flexible language to get a lot of general-purpose stuff done, and it's got tons of support & libraries + language bindings where performance is important. Python is your multi-tool utility knife, learn it well and you shall prosper. As a CS, you must understand how C works or you will never understand anything about modern computer architecture. Your degree will probably demand that you become familiar with assembly programming (x86), maybe embedded device programming, and/or fpga programming: knowledge of C (particularly the call stack conventions, segments & object code linking, memory addresses & pointers) should be prerequisite.

After you understand C, you can debate the merits of C++/C#/Java(/Go/D/...). Most likely your degree will require you to use one of these three languages in a software engineering course.

You will also want to check out lisp, haskell, smalltalk, ocaml, clojure, etc. to get a feel for the alternative school of design that has survived in the shadow of Worse is Better. I think Scala is probably in this category of the Right Thing; it is superengineered to be super awesome, but it ends up becoming terribly difficult to master, adopt in a workplace, and tune for performance.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2012-02-07 22:22:46
February 07 2012 22:15 GMT
#2268
On February 08 2012 06:18 eFonSG wrote:
Hey, i need some help with string manipulation in Java.

Essentially im suppose to take a string from the user that is a word
Im writing a class that with a few different methods that are to help split the word up into syllables and help with pronunciation
For one of my methods, Im suppose to change lets say September into sep/tem/ber. Im not really sure how to go about attacking this. We have rules given for when to break syllables up, how to count them, etc.

"How to identify syllables: We’ll confine ourselves to just two situations, commonly known as the ‘vccv’
and ‘vcv’ rules. As you scan a word from left to right, if you encounter a vowel followed by two consonants
(non-vowels) followed by a vowel, divide between the consonants. For example, “hidden” contains this
pattern and is divided into two syllables: ‘hid/den’. If you see the ‘vcv’ pattern, divide before the
consonant. Thus, “consonant”, which exhibits both patterns, would be divided like this: ‘con/so/nant’."

I just need some direction on a project like this, im pretty lost about where to start. The string were manipulating is user input, so i cant find a consistent way to break it up correctly. Sometimes it feels like my brain just cant make the right connections when it comes to programming -.-

This sounds like homework...

First thing you want to do is think about the problem, think about how you would do it by hand if you were given this task to do instead of the computer. Use pencil & paper to sketch out your strategy.

Once you think you've got a basic strategy laid out, look for exceptional cases, anything you think might break your basic strategy.

Once you have a sound strategy, write it down as a series of logical steps, pseudocode preferably. Abstract over any details, like converting uppercase to lowercase, or how you will break the word into syllables. Just write what is intuitive.

Maybe it is sketched out something like this (don't actually use this, it is non-normative):

variable lower <-- lower_case <-- word
variable vc_form <-- convert_vowels_to_v <-- convert_consonants_to_c <-- lower
for symbol in vc_form:
... details ...


Ok, then in Java, you go and code up the lower_case method, the convert_foo_to_bar methods, etc. Once all of the pieces are put together, you test it. If it fails, then you either (a) didn't assemble one of the pieces correctly, or (b) your strategy failed.

If you think your strategy is getting too large and complicated for this task, then you need to go back to that pseudocode and find a more concise way of expressing your abstractions (how would you instruct a human to do this task?). Very likely, if you are concise enough in your abstraction, there is probably a library or algorithm already in existence to solve a similar problem.

Hint:
+ Show Spoiler +

You shouldn't need to reinvent the wheel.
http://en.wikipedia.org/wiki/Regular_expressions
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2012-02-07 22:49:58
February 07 2012 22:49 GMT
#2269
On February 07 2012 06:21 esotericc wrote:
Thanks for the advice, I think the one language every few months plan seems like the best course.

I think this is a poor course. Going into a degree program, you will be better served by depth of knowledge in a useful language, not shallow familiarity in irrelevant languages (you can adopt them later once you appreciate how irrelevant they are).

Python and C are both practical and relevant, more than any other languages I could recommend. Practical knowledge of Python will let you code up homework, class projects, and personal experiments quickly and with little headache. It's a decent scripting language to know, and is popular in software industry. Deep knowledge in C/C++ will make learning other languages a walk in the park, and is core to your education in computers. You'll do a lot better in compilers, computer languages, operating systems, distributed systems, parallel programming, and other classes that focus on low-level details if you start with an understanding of C.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
eFonSG
Profile Joined November 2010
United States255 Posts
Last Edited: 2012-02-08 01:45:04
February 07 2012 23:02 GMT
#2270
On February 08 2012 07:15 mmp wrote:
Show nested quote +
On February 08 2012 06:18 eFonSG wrote:
Hey, i need some help with string manipulation in Java.

Essentially im suppose to take a string from the user that is a word
Im writing a class that with a few different methods that are to help split the word up into syllables and help with pronunciation
For one of my methods, Im suppose to change lets say September into sep/tem/ber. Im not really sure how to go about attacking this. We have rules given for when to break syllables up, how to count them, etc.

"How to identify syllables: We’ll confine ourselves to just two situations, commonly known as the ‘vccv’
and ‘vcv’ rules. As you scan a word from left to right, if you encounter a vowel followed by two consonants
(non-vowels) followed by a vowel, divide between the consonants. For example, “hidden” contains this
pattern and is divided into two syllables: ‘hid/den’. If you see the ‘vcv’ pattern, divide before the
consonant. Thus, “consonant”, which exhibits both patterns, would be divided like this: ‘con/so/nant’."

I just need some direction on a project like this, im pretty lost about where to start. The string were manipulating is user input, so i cant find a consistent way to break it up correctly. Sometimes it feels like my brain just cant make the right connections when it comes to programming -.-

This sounds like homework...

First thing you want to do is think about the problem, think about how you would do it by hand if you were given this task to do instead of the computer. Use pencil & paper to sketch out your strategy.

Once you think you've got a basic strategy laid out, look for exceptional cases, anything you think might break your basic strategy.

Once you have a sound strategy, write it down as a series of logical steps, pseudocode preferably. Abstract over any details, like converting uppercase to lowercase, or how you will break the word into syllables. Just write what is intuitive.

Maybe it is sketched out something like this (don't actually use this, it is non-normative):

variable lower <-- lower_case <-- word
variable vc_form <-- convert_vowels_to_v <-- convert_consonants_to_c <-- lower
for symbol in vc_form:
... details ...


Ok, then in Java, you go and code up the lower_case method, the convert_foo_to_bar methods, etc. Once all of the pieces are put together, you test it. If it fails, then you either (a) didn't assemble one of the pieces correctly, or (b) your strategy failed.

If you think your strategy is getting too large and complicated for this task, then you need to go back to that pseudocode and find a more concise way of expressing your abstractions (how would you instruct a human to do this task?). Very likely, if you are concise enough in your abstraction, there is probably a library or algorithm already in existence to solve a similar problem.

Hint:
+ Show Spoiler +

You shouldn't need to reinvent the wheel.
http://en.wikipedia.org/wiki/Regular_expressions
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html



Hey thanks for the reply, and it is homework; but its self mandated homework. Im doing this out of a book i bought. But thats why i tried not to ask for direct help instead i just wanted some direction. I Want to be able to do this, so just getting the answer doesnt help all that much. One of my problems though, is that this is straight up not that intuitive to me and im very unfamiliar with writing any code by hand. Still, I appreciate the help, and i like the approach you laid out, ill do my best on this see if i can piece it together. Thanks again

Edit: a few hours later and 0 progress, i cant wrap my head around any of this. And ive been doing this for months, i must just be fucking stupid, it will not click in my head.
Kasha_Not_Kesha
Profile Blog Joined October 2011
United States71 Posts
February 07 2012 23:44 GMT
#2271
I had a couple of responses to Crazyeyes, the guy who's post is quoted in the first post, so I figured I'd throw them out there and see what you all think =P

So anyways. As I've mentioned, I'm third year. All of my knowledge in computer programming comes from my classes. I'll admit I'm not the best student, but I do pay attention when I can and I'm not exactly failing my way through this. I don't ever program on my free time or read programming-related things that aren't school related.

This is a huge issue right here. It honestly doesn't even matter that you aren't the best student; the issue is you aren't driven to learn. You need to pursue this stuff in your spare time, and you need to do so because you love it. Math teachers always say "you can't learn math unless you practice it a lot"; the same is true of Computer Science. You can't learn to program unless you do it a lot, and you probably won't do it a lot unless you really truly love it.

Any computer-related(or even technology-related) job you ever get will only be familiar, related to your college education, and simple for a short period of time. In case you weren't aware, computers are leaps and bounds ahead of where they were a mere 10 years ago. Look back 20 years, and it's almost like we're dealing with alien technology. Computer related fields are constantly changing, and if you don't love learning/lack the drive to continually teach yourself new things and keep up to date on the major developments that are going on in your field, you aren't going to be very successful (Unless your job involves computer proficiency, rather than computer science).

Taking a passive approach to learning programming is a pitfall because it sets you up for failure in a big way, and it doesn't prepare you for a future where everything you learned in college is antiquated and discussed in history books. You have to get yourself interested and knowledgeable about this stuff, because eventually the demands placed on you won't come from a professor that also gives you everything you need to know to meet those demands.

The thing is, I feel like I don't know anything. I feel like pepole who have way less education than me are more capable than I am.

They probably are. You don't need (nor, in my opinion, should you really have) someone to teach you how to program; there are guides and tutorials galore available for free online, and knowing how to find them is just another skill every programmer should develop as soon as possible. I'm a sophomore in college at the moment, and I have a friend who is two years younger than me that recently graduated High school and isn't going to college. He's never taken a single programming course in his entire life; I've taken somewhere around 8. Despite all of this, he's a hundred times more knowledgeable about computers in general, and a million times better at programming than I am, because he's so damn interested in it, and he has the drive to teach himself and learn, something I only recently developed in myself.

What I hope is going on is that I'm being given the basic (and hopefully more advanced, too) programming skills and knowledge that can be applied to all computer science, and then the more specific things I'll be able to pick up without too much effort.

If I can give you any advice it's that you not rely on college to teach you ANYTHING. College is more or less a place you go to in order to secure a paper that tells possible employers that you probably aren't too stupid. You won't get anything of value out of college unless you pursue it yourself. Your professors *should* know a hell of a lot, and they are resources you literally can't utilize enough, ever. Ask them questions, ask them for challenges, ask them for interesting topics to look into and read about. Just going to lectures and pulling off B's in all of your classes isn't going to make you a good, or even mediocre programmer. You *have* to work at it yourself and go beyond what is required of you, and the best time to do it is now, while you still have physical access to people that (ideally) know how to answer any questions you could have.
Human beings are literally made up of potential more than anything else.
thedz
Profile Blog Joined March 2011
United States217 Posts
February 07 2012 23:52 GMT
#2272
Any computer-related(or even technology-related) job you ever get will only be familiar, related to your college education, and simple for a short period of time. In case you weren't aware, computers are leaps and bounds ahead of where they were a mere 10 years ago. Look back 20 years, and it's almost like we're dealing with alien technology.


This.

When I'm hiring, candidates that have an existing GitHub or similar account with code that I can look at and appreciate almost always have the leg up, even if someone else has a more impressive educational background. That said, this is in the SF Bay Area, where practical experience trumps nearly everything.
shannn
Profile Blog Joined May 2010
Netherlands2891 Posts
February 08 2012 00:05 GMT
#2273
On February 08 2012 08:44 Kasha_Not_Kesha wrote:
I had a couple of responses to Crazyeyes, the guy who's post is quoted in the first post, so I figured I'd throw them out there and see what you all think =P

Show nested quote +
So anyways. As I've mentioned, I'm third year. All of my knowledge in computer programming comes from my classes. I'll admit I'm not the best student, but I do pay attention when I can and I'm not exactly failing my way through this. I don't ever program on my free time or read programming-related things that aren't school related.

This is a huge issue right here. It honestly doesn't even matter that you aren't the best student; the issue is you aren't driven to learn. You need to pursue this stuff in your spare time, and you need to do so because you love it. Math teachers always say "you can't learn math unless you practice it a lot"; the same is true of Computer Science. You can't learn to program unless you do it a lot, and you probably won't do it a lot unless you really truly love it.

Any computer-related(or even technology-related) job you ever get will only be familiar, related to your college education, and simple for a short period of time. In case you weren't aware, computers are leaps and bounds ahead of where they were a mere 10 years ago. Look back 20 years, and it's almost like we're dealing with alien technology. Computer related fields are constantly changing, and if you don't love learning/lack the drive to continually teach yourself new things and keep up to date on the major developments that are going on in your field, you aren't going to be very successful (Unless your job involves computer proficiency, rather than computer science).

Taking a passive approach to learning programming is a pitfall because it sets you up for failure in a big way, and it doesn't prepare you for a future where everything you learned in college is antiquated and discussed in history books. You have to get yourself interested and knowledgeable about this stuff, because eventually the demands placed on you won't come from a professor that also gives you everything you need to know to meet those demands.

Show nested quote +
The thing is, I feel like I don't know anything. I feel like pepole who have way less education than me are more capable than I am.

They probably are. You don't need (nor, in my opinion, should you really have) someone to teach you how to program; there are guides and tutorials galore available for free online, and knowing how to find them is just another skill every programmer should develop as soon as possible. I'm a sophomore in college at the moment, and I have a friend who is two years younger than me that recently graduated High school and isn't going to college. He's never taken a single programming course in his entire life; I've taken somewhere around 8. Despite all of this, he's a hundred times more knowledgeable about computers in general, and a million times better at programming than I am, because he's so damn interested in it, and he has the drive to teach himself and learn, something I only recently developed in myself.

Show nested quote +
What I hope is going on is that I'm being given the basic (and hopefully more advanced, too) programming skills and knowledge that can be applied to all computer science, and then the more specific things I'll be able to pick up without too much effort.

If I can give you any advice it's that you not rely on college to teach you ANYTHING. College is more or less a place you go to in order to secure a paper that tells possible employers that you probably aren't too stupid. You won't get anything of value out of college unless you pursue it yourself. [Your professors *should* know a hell of a lot, and they are resources you literally can't utilize enough, ever. Ask them questions, ask them for challenges, ask them for interesting topics to look into and read about. Just going to lectures and pulling off B's in all of your classes isn't going to make you a good, or even mediocre programmer. You *have* to work at it yourself and go beyond what is required of you, and the best time to do it is now, while you still have physical access to people that (ideally) know how to answer any questions you could have.

This man speaks the truth

Out of 40 or so CS students in my senior year probably less than 8 people know how to program, know the concepts and have the basics under control.
The degree really really says nothing when it comes to CS at my college tbh.

My study in the past 3.5 years so far consisted 75% of how to work with tools like PowerDesigner, PowerBuilder, ISAH etc and learning ITIL v2. I can't see myself working with any of these tools.
I was lucky enough that I was programming on the side for my part-time job and for fun.

If I knew anyone RL who is planning to study CS then I'd just quote the above poster and tell him exactly that especially the first bolded part.
http://www.teamliquid.net/forum/viewpost.php?post_id=6321864 Epic post.
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2012-02-08 02:18:02
February 08 2012 02:08 GMT
#2274
On February 08 2012 08:02 eFonSG wrote:
Show nested quote +
On February 08 2012 07:15 mmp wrote:
On February 08 2012 06:18 eFonSG wrote:
Hey, i need some help with string manipulation in Java.

Essentially im suppose to take a string from the user that is a word
Im writing a class that with a few different methods that are to help split the word up into syllables and help with pronunciation
For one of my methods, Im suppose to change lets say September into sep/tem/ber. Im not really sure how to go about attacking this. We have rules given for when to break syllables up, how to count them, etc.

"How to identify syllables: We’ll confine ourselves to just two situations, commonly known as the ‘vccv’
and ‘vcv’ rules. As you scan a word from left to right, if you encounter a vowel followed by two consonants
(non-vowels) followed by a vowel, divide between the consonants. For example, “hidden” contains this
pattern and is divided into two syllables: ‘hid/den’. If you see the ‘vcv’ pattern, divide before the
consonant. Thus, “consonant”, which exhibits both patterns, would be divided like this: ‘con/so/nant’."

I just need some direction on a project like this, im pretty lost about where to start. The string were manipulating is user input, so i cant find a consistent way to break it up correctly. Sometimes it feels like my brain just cant make the right connections when it comes to programming -.-

This sounds like homework...

First thing you want to do is think about the problem, think about how you would do it by hand if you were given this task to do instead of the computer. Use pencil & paper to sketch out your strategy.

Once you think you've got a basic strategy laid out, look for exceptional cases, anything you think might break your basic strategy.

Once you have a sound strategy, write it down as a series of logical steps, pseudocode preferably. Abstract over any details, like converting uppercase to lowercase, or how you will break the word into syllables. Just write what is intuitive.

Maybe it is sketched out something like this (don't actually use this, it is non-normative):

variable lower <-- lower_case <-- word
variable vc_form <-- convert_vowels_to_v <-- convert_consonants_to_c <-- lower
for symbol in vc_form:
... details ...


Ok, then in Java, you go and code up the lower_case method, the convert_foo_to_bar methods, etc. Once all of the pieces are put together, you test it. If it fails, then you either (a) didn't assemble one of the pieces correctly, or (b) your strategy failed.

If you think your strategy is getting too large and complicated for this task, then you need to go back to that pseudocode and find a more concise way of expressing your abstractions (how would you instruct a human to do this task?). Very likely, if you are concise enough in your abstraction, there is probably a library or algorithm already in existence to solve a similar problem.

Hint:
+ Show Spoiler +

You shouldn't need to reinvent the wheel.
http://en.wikipedia.org/wiki/Regular_expressions
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html



Hey thanks for the reply, and it is homework; but its self mandated homework. Im doing this out of a book i bought. But thats why i tried not to ask for direct help instead i just wanted some direction. I Want to be able to do this, so just getting the answer doesnt help all that much. One of my problems though, is that this is straight up not that intuitive to me and im very unfamiliar with writing any code by hand. Still, I appreciate the help, and i like the approach you laid out, ill do my best on this see if i can piece it together. Thanks again

How would you tell a human (me, for example) to do this task in English instructions? Your book told you to "divide between the consonants" in a word. That's a very high-level instruction, so break it down into terms that make a little more sense for a machine.


(1) You are given a word (String) as input.
(2) The word is a sequence of characters, either classified as "consonants"|"c" or "vowels"|"v".
(3) Output a new String that is the word with a "/" character inserted everywhere "vc" is followed by "cv" and everywhere "v" is followed by "cv".


This appears to be the same problem, just stated at a lower level. Which parts appear easy to translate into Java, which parts do not? (1) just fetches the argument from the user. (2) is some discrimination of vowel & consonant characters in the word. (3) does some kind of scanning to figure out everywhere the "vccv" & "vcv" patterns occur, and it magically comes up with a new word that has all of the "/"s inserted.

Your task is to figure out what that magic component is and dissect it into terms as simple as (1) or (2). This is a top-down problem-solving approach, breaking something abstract down into smaller concrete pieces until the entire task is understood. But when you're trying to solve a tough problem, you have to break it down into the parts that you do understand and the parts that you do not; if you understand everything about a problem except one thing, then you can ignore everything else and try to answer that one smaller problem.

So the big problem here is breaking down the magic:
(a) How do we scan for "vccv" & "vcv"?
(b) Once we've found an instance of either, where do we put the "/"? That is, we need to remember or store in some way the occurrence of a new syllable.
(c) However we've scanned the word and analyzed it, we need to form a new word now that has "/"s.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
mmp
Profile Blog Joined April 2009
United States2130 Posts
February 08 2012 02:16 GMT
#2275
A really cool high-level talk on persistent hash maps in clojure:
http://blip.tv/clojure/clojure-concurrency-819147
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
Kasha_Not_Kesha
Profile Blog Joined October 2011
United States71 Posts
Last Edited: 2012-02-08 15:02:39
February 08 2012 04:55 GMT
#2276
On February 08 2012 08:02 eFonSG wrote:
Edit: a few hours later and 0 progress, i cant wrap my head around any of this. And ive been doing this for months, i must just be fucking stupid, it will not click in my head.

I'm being as serious as I can when I say this; welcome to programming. Programming is all about that state of "huhwah" following your introduction to a problem. First off, you have to understand the concepts intrinsic to the problem itself, i.e. if you weren't a programmer, but in expert in the field most closely related to the problem, how would you solve the problem? That alone is a pretty considerable burden for you. Then you have to break it down into a set of sub-problems you can solve, and get to work solving them. Sometimes you run into something that doesn't seem simple or easy to solve; i.e. it's a pretty major problem that you can't break apart, but which seems pretty hefty. At that point, you should assume there's an easier way, and start trying to find that easier way.

Trust me when I say that it has nothing to do with your intelligence or problem solving ability; you're just fundamentally approaching the problem the wrong way, which is not necessarily a negative thing because there are a ton of ways to approach the problem, and only a few are helpful. You don't have the experience needed to immediately know the proper approach to the problem, which is fine, because once you solve this one, you'll be able to apply variations of this solution to tons of problems you might run into down the line. You've been programming for months; I've been programming for years and this problem was still a bit difficult for me to solve.

And let me tell you; the problem you're working on is a fun/frustrating one. Hopefully you have a decent grasp of the Object Oriented paradigm, because if you're doing all of this functionally it's going to be hell to try and organize the code you write.

I literally just finished something similar to what you have to do here, and if you would like I can tell you two Java classes that will make the solution a lot easier to find. Let me know; I don't want to spoil the research side of it if you want to try to find them on your own, I just know that I wouldn't have found them without my infinitely more knowledgeable friends' help.
Human beings are literally made up of potential more than anything else.
Deleted User 61629
Profile Blog Joined March 2010
1664 Posts
February 08 2012 15:15 GMT
#2277
--- Nuked ---
silentsaint
Profile Joined September 2010
Germany540 Posts
February 09 2012 21:31 GMT
#2278
Does anyone know a good book about c#?
It really tied the room together.
Kasha_Not_Kesha
Profile Blog Joined October 2011
United States71 Posts
February 09 2012 21:47 GMT
#2279
Programming books are very rarely worth the money. If you're trying to teach yourself how to program in a specific language, it's usually easier and cheaper (and more beneficial in the long run) to look up tutorials online. That's my opinion anyway =P
Human beings are literally made up of potential more than anything else.
Frigo
Profile Joined August 2009
Hungary1023 Posts
February 09 2012 22:26 GMT
#2280
On February 10 2012 06:47 Kasha_Not_Kesha wrote:
Programming books are very rarely worth the money. If you're trying to teach yourself how to program in a specific language, it's usually easier and cheaper (and more beneficial in the long run) to look up tutorials online. That's my opinion anyway =P

Read Clean Code: A Handbook of Agile Software Craftsmanship, I doubt you will find that in tutorials.
http://www.fimfiction.net/user/Treasure_Chest
Prev 1 112 113 114 115 116 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech135
Nina 119
StarCraft: Brood War
Britney 24883
Sea 3137
Rain 2536
Mind 108
NaDa 34
ZergMaN 33
Noble 21
Leta 17
Icarus 8
Super Smash Bros
Mew2King204
Other Games
summit1g7203
WinterStarcraft565
ceh9440
Happy219
RuFF_SC238
crisheroes26
Trikslyr22
Dewaltoss16
Organizations
Dota 2
PGL Dota 2 - Secondary Stream2208
Other Games
gamesdonequick833
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 11 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1376
Upcoming Events
Replay Cast
1h 53m
The PondCast
1d 2h
OSC
1d 5h
OSC
1d 16h
CranKy Ducklings
2 days
GSL
3 days
Maru vs ShoWTimE
Classic vs Reynor
herO vs Lambo
Solar vs Clem
BSL22 NKC (BSL vs China)
3 days
XuanXuan vs Jaystar
Mihu vs Messiah
eOnzErG vs Dewalt
Bonyth vs Jaystar
TerrOr vs Messiah
XuanXuan vs Mihu
eOnzErG vs Jaystar
Replay Cast
3 days
GSL
4 days
Patches Events
4 days
[ Show More ]
BSL22 NKC (BSL vs China)
4 days
Dewalt vs Messiah
Bonyth vs Mihu
TerrOr vs XuanXuan
eOnzErG vs Messiah
Jaystar vs Mihu
Dewalt vs XuanXuan
Bonyth vs TerrOr
Replay Cast
4 days
WardiTV Weekly
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2026-06-16
uThermal 2v2 2026 Main Event
Heroes Pulsing #1

Ongoing

IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
CSCL: Masked Kings S4
YSL S3
BSL 22 Non-Korean Championship
SCTL 2026 Spring
Maestros of the Game 2
WardiTV Spring 2026
Murky Cup 2026
Heroes Pulsing #2
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1

Upcoming

CSL 2026 Summer (S21)
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
Douyu Cup 2026
BCC 2026
Heroes Pulsing #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.