landed an internship with a software company brahs. I know c++ at a sophomore level but they use java, anybody have some good java books they would recommend?
|
-
02-17-2016, 10:07 AM #361
-
02-17-2016, 11:03 AM #362
Effective Java
http://www.amazon.com/Effective-Java.../dp/0321356683
Has real good, nuts and bolts advice.Jesus is my lifting partner.
-
02-17-2016, 11:38 AM #363
How do you guys plan out how to make a program?
I've been doing intro to java since september and we've been given an assignment that just seems completely way out of ours scope.
its a train seat booking system where the user can choose forward/backward facing seat, window/aisle, table or no table, first class/standard, normal or assisted seating. If the person chooses a seat which is taken then they're put in a txt document waiting list and allows them the seat once someone else cancels. we need to input the seating plan which is in a txt document also to show availability etc.
Idk but this just seems way out of the scope of what we have learned considering we've been doing it 5 months... How do you guys even start to tackle this type of problem? like how do you know what to make a method out of, what to seperate into different classes how to use public/private/static/void etc effectively what variables you're gonna need etc and how would i mock this up in something like UML?
I'm ****ing panicing here because it seems like an impossible task for anybody who's only been doing 1 hours lectures per week for the past 5 months (also many breaks inbetween like chirstmas etc.)/
-
02-17-2016, 11:59 AM #364
-
-
02-17-2016, 12:04 PM #365
uml shmuml
start by drawing **** in your own notation
and start drawing **** by drawing high level **** "here i input ****" "here i process ****" "here i do something else" "here im done and print that user is a *******", public/private and methods are implementation details, think thru the general logic of what youre doing firststraight white male and proud
fat as fuk and disgust
no hover - no enter thread crew
-
02-17-2016, 12:17 PM #366
- Join Date: Nov 2002
- Location: Puttin' names on my blacklist
- Posts: 2,559
- Rep Power: 19175
Start with identifying simple things. The specifications are discerned by reading. Nouns are typically data items and verbs will be your methods. Once identified you can create a UML notation and then start with pseudo code or just jump into actually coding it.
If you're really lost then PM the assignment and I can help with the specs and UML. Though you should be able to determine the specs and perhaps compare it to what others arrive at.
-
02-17-2016, 01:14 PM #367
- Join Date: Apr 2010
- Location: New York, New York, United States
- Age: 33
- Posts: 10,421
- Rep Power: 27436
Doesn't seem too complicated brah, just clear your mind and break down the program into separate functions. My last C++ class had us do job inventory system with reports, item input from file, selling items and management in general within 5 weeks of class. This is perhaps one of the most important skills, being able to plan accordingly and deploy the idea.
Yeah, this. srs. I usually do it in my head, unless something gets complex then I have a giant whiteboard in my room where I draw things out.
-
02-17-2016, 01:17 PM #368
See i would do that but i don't know how to create the 2d array which stores the seating plan from an input file. Without that i can't even build the rest of the system.
I've wrote a list down of things which i think need to be methods but stuck on how to design the data structures and how the flow of the thing will go.
We need to use UML to meet the first part of the requirement brah, i wrote a little plan but i dont see how it fits together. We should have something similar to this to submit with the program itself.
I'm not 100% on how i break the components down into different methods though as we haven't been shown that and every extra reading i've done assumes im so hot **** programmer lol.
Thank you i'll have a look and get back to you.
I don't want somebody doing my coursework for me but a little help with what i should be splitting into different methods/functions/data structures or whatever would be nice.
Also how would i go about putting something like this into an array and changing if a seat is booked or not?
seating plan is similar to this
Code:1A 2A 3A T 4A DOOR 5A T 6A 7A T 8A 9A 10A DOOR 14A T 15A 1B 2B 3B T 4B 5B T 6B 7B T 8B 9B 10B 14B T 15B ======================================================================== 3C T 4C 12C T 13C 14C 15C 3D T 4D DOOR 5D 6D T 7D 8D T 9D 10D 11D DOOR 12D T 13D 14D 15D
/
-
-
02-17-2016, 01:40 PM #369
- Join Date: Apr 2010
- Location: New York, New York, United States
- Age: 33
- Posts: 10,421
- Rep Power: 27436
Look up multi dimensional arrays then brah. Create the array structure so they make the most sense. It's nothing else, but char[][] where you have two levels. Categorize them by rows then by seats. I.E. char[][] = new char[15][4] - this means you have 15 rows with 4 possible seats in each.
then loop it over and create rows and seats. For booked seats, I'd honestly create a separate array to keep track of it with more info per booking. Or if you went over objects already then create a two dimensional array of objects where you store booking status for each seat as well.
It depends how you are going to use the booking data later on, each use case will have strengths and weaknesses to each approach thus the charts and planning you are doing.
-
02-17-2016, 01:57 PM #370
Thanks, yeah i have learned about 2d arrays i think my main concern is how im gonna specify if its next to a aisle or window etc. Should i just leave out the doors/tables in my array and whenever i want a certain seat for example
3A just do seats[0][3] to get it from there? then how would i specify that 3A is a window seat which is in first class with easy access seating plus front facing for example? This stuff is really out of the scope of what we've learnt and i've attended every single lecture + tutorial + extra reading + extra classes yet i still don't feel comfortable with it./
-
02-17-2016, 02:00 PM #371
-
02-17-2016, 02:05 PM #372
Nope, no previous CS experience required. It's an online program but you take the same courses as on-campus students and earn the same degree.
Post-bacc is great because you don't have to waste time/tuition on arbitrarily redoing freshman level general requirements that you did the first time around. There was no way I was going to spend two years and tens of thousands of dollars taking physics, econ, and english 101 again. I already did all of that for my first degree, so there's no reason why I should have to do that all over again; it's nothing but a shameless cash-grab by universities. With post-bacc you can focus on the two years worth of classes that actually matter without the fluff.
If you're interested you should definitely look into it.Carpe diem
-
-
02-17-2016, 02:10 PM #373
Don't tell anyone I said this, but you can do the UML after you write your program lol. No, but seriously the point of doing the UML is so you can break down the problem. It seems really complex to you right now, but programming is making really complicated problems into really simple ones. All you do is identify a small problem you need to solve within the bigger one. Ie. you mentioned the user has some choices. Well a good approach would be to make a function/class to retrieve your users choice. From there you can ask yourself what each possible choice does, and implement them one by one.
If things still seem to complicated, break your initial problem into smaller problems, and then those problems into even smaller problems. Just find the simplest thing you can do to write your program, and get going.
-
02-17-2016, 02:13 PM #374
-
02-17-2016, 02:19 PM #375
- Join Date: Apr 2010
- Location: New York, New York, United States
- Age: 33
- Posts: 10,421
- Rep Power: 27436
Seems like an array of objects is what you should be doing imo. Been a while since I was doing anything Java related so not sure if that would be correct
public Seat(int i, char t){
this.id = String.valueOf(i) + String.valueOf(t); // for reference, denormalize for display
this.window = false;
this.booked = false;
//etc. you could use some algorithm to determine your other seat criteria instead of mapping it manually
}
then create a static and initialize
Seat[][] = new Seat[15][4];
for(your loop - i){
for(your loop for A,B,C,D seats - t){
Seat[i][t] = new Seat(i,t);
}
}
Something of that sort, can't remember if that's how you created objects in Java so make sure to double check. Been a while
-
02-17-2016, 02:20 PM #376
- Join Date: Nov 2002
- Location: Puttin' names on my blacklist
- Posts: 2,559
- Rep Power: 19175
Would help if you knew the data type of the array. You could use a 2d array of type string. Each char can represent some. W=window, A=aisle, B= booked, F=1st class, B=business etc. So parse the string by each char and go from there. Or a multi dimension char array doing the same and no string processing. Or you can have multiple parallel arrays. Their related based on the position in array. One array could be whether the seat is booked.
You should make a 2d array though that represents the seat layout. Columns 0 and 6 are obviously window seats. Rows 0-3 are 1st class, etc. But without knowing the exact specifics we can't really help you in the design of the array.
Code:[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
-
-
02-17-2016, 03:36 PM #377
Thanks i'll look into those, what do you mean you need to know the data type of the array? Couldn't it just be string if its gonna store 1a 2a 3a 1b 2b 3b etc? It's gotta read what i posted above from an input file i think then process it from there. I'll have to copy my array to make waiting lists and stuff too i think.
Thanks i'll have a look into that tomorrow, a lecturer said we could use something called a 'collection' but i'm not sure what that is as we haven't covered it.
Yeah i know that but i think if i got something down design wise first it would help tremendously with the programming side. I done decent in the last coursework just programming as i went along but that was without classes/user-defined methods/arrays.
Thanks man i'll try and have a solid go at breaking everything down tomorrow it's just hard as hell to figure out where to start./
-
02-17-2016, 05:55 PM #378
- Join Date: Nov 2002
- Location: Puttin' names on my blacklist
- Posts: 2,559
- Rep Power: 19175
Using a simple string array to represent multiple data items is an inelegant solution and can bind the data together too tightly. It's not good practice and violates several objectives of OOP. How are you gonna have private data types and restrict access to them?
As zinkhan99 said an array of objects would be your best solution. You make not have learned about them yet though. But you could have a Seat object and set various properties.
Do you have the file from which you are supposed to read from? It's formatting could help you determine what structures to use.
You also might want to start an independent thread in this section rather than clogging this one up though.
-
02-17-2016, 06:07 PM #379
-
02-17-2016, 07:15 PM #380
- Join Date: Jan 2010
- Location: California, United States
- Age: 32
- Posts: 5,682
- Rep Power: 6924
{u'results': [{u'keywords_result': {}, u'alternatives': [{u'timestamps': [[u'your', 0.43, 0.58], [u'friend', 0.58, 0.86]], u'confidence': 0.439, u'transcript': u'your friend '}, {u'transcript': u'actor Frank that '}, {u'transcript': u'actor Frank '}, {u'transcript': u'actor friend '}, {u'transcript': u'actor frankly '}], u'final': True}, {u'keywords_result': {u'this': [{u'normalized_text': u'this', u'start_time': 4.12, u'confidence': 0.949, u'end_time': 4.36}]}, u'alternatives': [{u'timestamps': [[u"it's", 1.28, 1.37], [u'none', 1.37, 1.61], [u'of', 1.61, 1.69], [u'your', 1.69, 1.82], [u'business', 1.82, 2.24], [u'got', 2.27, 2.47], [u'it', 2.47, 2.72], [u'excuse', 2.97, 3.62], [u'me', 3.62, 4.09], [u'this', 4.12, 4.36], [u'is', 4.36, 4.48], [u'not', 4.48, 4.66], [u'about', 4.66, 4.87], [u'protecting', 4.87, 5.37], [u'my', 5.37, 5.58], [u'friend', 5.58, 6.18]], u'confidence': 0.955, u'transcript': u"it's none of your business got it excuse me this is not about protecting my friend "}, {u'transcript': u'none of your business got it excuse me this is not about protecting my friend '}, {u'transcript': u'is none of your business got it excuse me this is not about protecting my friend '}, {u'transcript': u"it's none of your business that it excuse me this is not about protecting my friend "}, {u'transcript': u"it's none of your business got it excuse me this is not about protecting my friend he "}], u'final': True}, {u'keywords_result': {}, u'alternatives': [{u'timestamps': [], u'confidence': 0.0, u'transcript': u'ha '}, {u'transcript': u'whole '}, {u'transcript': u'hello '}, {u'transcript': u'ha ha '}, {u'transcript': u'hot '}], u'final': True}], u'result_index': 0}
What's with the 'u' before each key name?
This is in Python btw. Not until I realised Python reads json as a dictionary did it become easier to work with.
Still brb ['key1'][i]['key2'][j]['key3'][k]
u wot m8War is Peace; Freedom is Slavery; Ignorance is Strength.
-
-
02-17-2016, 07:19 PM #381
-
02-17-2016, 08:02 PM #382
-
02-18-2016, 03:21 PM #383
- Join Date: Apr 2010
- Location: New York, New York, United States
- Age: 33
- Posts: 10,421
- Rep Power: 27436
Tfw your school sucks all the fun out of programming... Had to pick a minor, I am pursuing my BA degree only part time while working in the field already. Taking Web scripting, and professor is all anal about everything, requiring essays based on our programming and more... To top that, our final project is supposed to be a shopping platform coded only on the client side, with registration and authentication capabilities via cookies. Who the fukk teaches things like that ?? Seriously, this is against any practical use of web development and will just confuse the students. I feel sorry for all the beginners, from my experience with Online college so far, there are a lot of mediocre people teaching there.
-
02-18-2016, 03:51 PM #384
-
-
02-18-2016, 04:37 PM #385
Most people probably know plenty of design patterns through experience without knowing the official name for it, one day you could just sitting there caching immutable objects to reuse and save memory and without realizing it you've done flyweight pattern for example...Misc Global Rep Rankings. Find out where your rep power ranks on the misc.
http://forum.bodybuilding.com/showthread.php?t=155785183&p=1243080953&viewfull=1#post1243080953
For source code to the above, go to bitbucket.org/Muckle_ewe.
-
02-19-2016, 05:10 PM #386
-
02-19-2016, 07:09 PM #387
-
02-19-2016, 07:18 PM #388
- Join Date: Jun 2010
- Location: California, United States
- Posts: 6,095
- Rep Power: 7136
I had a professor (i took CS courses as my additional classes) who was a complete stickler to everything. Code had to be commented correctly, braces in the right place, tabs with right spaces, equals signs lining up on each other in methods, etc. It was a pain at first but towards the end of the semester you start to see merit in it all because our final project involved everyone working on one project.
One student would be in charge of developing a certain framework and others would be in charge of modifications to the code (this forced us to use the correct design patterns like the strategy pattern and factory pattern). If the code wasn't commented or formatted correctly you ran into huge issues, usually involving trying to get a hold of that student to ask wtf he was doing. Overall, it was one of the best real world application classes I've taken.
And any true software company should have style guides to get everyone working on the same page.
I think the professor was trying to shove you into the real world (find solutions on your own/self-learn) much like mine was. Its the best way to teach this chit IMO.
-
-
02-19-2016, 09:12 PM #389
Has anyone ever tried drunk coding before?
Brb wondering why my code isn't compiling, because I didn't even have an ide/terminal open and was just pressing buttons in the VLC media playerBest lifts:
Bench press: 315x4, 345x1
Squat: 465x1
Strict press: 185x8, 195x5, 215x1
Deadlift: 405x13 (conv tap'n'go with straps)
-
02-19-2016, 11:34 PM #390
Bookmarks