• Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember java being my favorite back in college, I don't want to date my self here but that was little over 10 years ago. After uni, I worked for one of those big banks for two years programming mainly in COBOL.

I haven't done any programming or read any book related to that subject since. Lately. I have been thinking about going back to work and figured my best bet is to refresh my java skills and hopefully get the java professional certification. Anyway just wanted to introduce myself and to ask if certification is now required most java opportunities. I mean will it give me a leg up in anyway?

For now I have set up my environment, ordered couple of books and it all seems very familiar. But obviously without solving/coding actual problems I can't really gage where I am. So I guess what I am looking for is besides the assignment in the book is there anywhere I can find project scenario with some requirement and maybe expected outcomes to practice

Thank you for reading my ramplings ... Cheers
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
We try our hardest to be helpful … and sometimes succeed Show us some of what you have written and we'll say what we think of it.
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

It doesn't have to be exercises or problems from books or websites. In fact if you have a particular app you want to do, you can work on that. Throughout it should get you thinking the design process and what API/algorithms to do such and such. Learn the new API as you solve each part of the app.
 
Mia Ahmed
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys for the warm welcome.
I want to write a diff program that takes two source files and outputs a new file that just has the difference and in what line.
I haven't written anything yet but my logic so far is
Read line from source A
Read line from source B
Compare A to B ( not sure how yet but will need to compare each Char I think so I can get any difference)
If everything matches increment and read next lines
Else write new lines
Couple of things I am still working on
I want the change to look pretty
Need to know whether the difference is from A or B
This is going to be my learning project and will appreciate any comment about the logic or even more requirements to my program more useful.

 
author & internet detective
Marshal
Posts: 37518
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mia,
That sounds like a good program to write. If you just wanted to know if two lines were the same, you could use a method in the String class. You want more detail than that, so you are right that you have to compare characters.

Before you code, think about you know if the "difference is in A or B". You can tell they are different, but how would you know which is "right."
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mia Ahmed wrote:Couple of things I am still working on
I want the change to look pretty
Need to know whether the difference is from A or B
This is going to be my learning project and will appreciate any comment about the logic or even more requirements to my program more useful.

Mia,

First; Welcome.

Second: Congratulations on a very concise and comprehensive post. Gets a +1 from me, and I wish there were more "newbies" who did the same.

Third: That "from" qualification - if I understand it right - is very important (and likely to be your killer ) because, rather than being a simple line by line comparison, you'll need something "smart" that can work out whether a line is simply 'different', or whether it's been added (or removed from the other dataset).

It can certainly be done, and is encapsulated in a well-known command in Unix called 'diff'; but be warned: it is NOT simple.
It uses a "stepping-stone" (also sometimes called a "staircase") algorithm to transfer a cursor between the files being compared, depending on whether there is similarity within a defined "horizon".

This page should probably give you a head start; otherwise, Google for something like "diff algorithm".

My advice: Start with whole line comparisons only, and make sure that your program works on that basis first. After that, you can introduce more esoteric stuff like deciding whether a line is 'added' or merely 'changed' based on its characters. Working on the first phase will also give you a feel for how the algorithm behaves, and so give you an idea how to tackle the second (if you decide to).

you should be aware that your results between the "line" and "character" phases may be very different.

HIH

Winston
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!