Les Morgan

Rancher
+ Follow
since Sep 29, 2015
Les likes ...
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
Cows and Likes
Cows
Total received
23
In last 30 days
0
Total given
1
Likes
Total received
180
Received in last 30 days
2
Total given
163
Given in last 30 days
3
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Les Morgan

i think i'd do something like this for my comparison logic:

to count the occurrences of each target

sai rama krishna wrote:Looks like i cannot change method signature so method still has to return EmployeeData object not List<EmployeeData>



sai,

I guess my question would be: "How constrained are you in the implementation?"  you say you must return an EmployeeData, but why?  do you have this with hundreds or even thousands of calls throughout your project?  is this a legacy project or a system that is outside of your rewrite authorization?  i guess: what is the reason that you are constrained to only return an EmployeeData record and not the List or some other data structure?

I have had some truly bitch of rewrites throughout my career, but I have always been given god rights in making any changes that I deem necessary to implement the desired features.

If you are truly constrained to return only 1 record, then you are constrained to return only 1 record (this is what you are telling us) ... any thought otherwise is nothing more than a fools errand because you are not authorized to do so by those that do have god powers.

If you do have the god power to change things as you need, then by all means--change it.  I've told this to more than one developer in my time: grow some stones and get the implementation done.  Even if it is a new feature and not a override of the existing call, make the requested changes to the project.

Les
1 week ago
Claude,

i work with data systems that have billions of rows that we import from external sources on an "as is" basis.  that does not stop us from checking our own business needs and decided what needs to be done with each column of data.  Once we know the use we will be putting the data to, then we check to see if the datatypes will support the err which we need to stay within.  if they do not, then we massage the data.  once the data has been curated, it is read for our use.  once we have the data under our control, we are always free to use it within the bounds of our data sharing agreements.  in any case, there are always the ability to get specs.

i have had projects that both ends of the channel refused to make any decisions, when i am faced with that, i look over what i think the path should be.  i then write the specs and distribute them to the concerned parties and with an activation date of the specifications taking effect.  after the activation date, i use my specs and continue the project.  one thing i am always sure of when i produce the specification, business may be run and the err will be within acceptable standards and there is a clear audit trail of what is happening.

Les

Claude Moore wrote:I'm afraid there's no much hope for getting specs. The data are exported 'as are', from a legacy API.

That is going to have to, once again, depend on the definition of loop.  That camparator will have some looping involved.
2 weeks ago
brian,

in most of these types of games you have 2 things you have to have:

1-the array to use for calculation
2-a graphical representation for the array (your array printed on the screen)

remember in Math class where the teacher started talking about Algebra and everyone rolled their eyes and said: "I'll never need that."

welcome to Math Class' Revenge.  get used to it, if you are going to do programming, especially graphics, you are going to have to learn to do at least simple Algebra.  you have do dynamically define blocks on the screen--height, width, and placement of such.  it takes basic algebra to do that.  don't want to?  quit programming anything that requires graphics.

you need to go back and read your Java Fundamentals book while you're at it.  each of the blocks on the screen is an object--make it that.  The blocks have to fit into a grid--ooh another object (i suggest you make a separate one from your panel object so you can keep it visualized in your head (my preference, but you do what you wanna do).

now you have the problem that yo are making a basic shooter game--firing a projectile at the blocks (and yet another object)

each object should know how to do the things that it will need to do: like blowup, move, accelerate, bounce, and etc (ooh there is some more Algebra and maybe some Physics)

so... go back and redesign your project to be object oriented, it is really what Java is good at, and the model you might just as well learn to use properly from the beginning.

Les

BTW: some 4 decades ago when i started all this programming stuff--i naturally migrated to an object oriented model for programming.  back in the day it was in Assembler though, but still very much structured like todays OOP models.  it's just easier to program, maintain, and follow.
2 weeks ago
Claude,

many databases have a type to use for financial transactions--MS SQL Server has money that does not round, but basically has 2 integer parts.  you have to actually design your data types according to your data range to reduce or eliminate the possibility of underflow, overflow, and rounding.  look at your data and see what functionality you need to implement and then check your data types to eliminate or minimize err.

Les
it is going to depend on the definition of loop and where it is placed:

you could do a recursive walk of the array and return back through using just a comparison of some type, but that is horrible use of resources, but then if this is a homework problem or a test of some sort, there are almost always ways of doing things--no matter how horrible it my be.
2 weeks ago
Carey,

i prefer to use a look ahead type of approach and key off of current.next != tail, but that is personal preference.

Les

Carey Brown wrote:Thanks Les, I hadn't taken it to the next step. Much cleaner.
public void insert( T item )
{
Node node = new Node( item );

if( isEmpty() )
{
insertAfter( node, head );
}
else
{
Node curr = head.next;
while( curr != tail && node.item.compareTo( curr.item ) >= 0 )
curr = curr.next;
insertAfter( node, curr.prev );
}
}



4 weeks ago
William, i've not looked at your code, but if you will put up with my comments, this is what i've found wrong in most linked list work:

1 -- use a true "head" and "tail", if you possibly can, rather than the concept of first and last. it eliminates the need for special cases of ever replacing the head and tail--you will always insert sometime after the head, and sometime before the tail.
2 -- remember the only comparison done in your comparable implementation is your data item or items--what ever they may be.
3 -- you need to set 4 references, to do so you have to have a reference to your current node, the node to be inserted, and a reference to your next node from the current.
4 -- the links will always go like this:

Node2Insert.previous = CurrentNode
Node2Insert.next = CurrentNode.next

CurrentNode.next = Node2Insert

NexNode.previous=Node2Insert

notice how the use of a true "head" and "tail" does away with the need of swapping our the head and tail--ever.
1 month ago
2 is less then or equal to m and m is less than or equal to 100 or, how i prefer it

m is greater than or equal to 2 and m is less than or equal to 100

it is nothing more than m is between 2 and 100 inclusive.
1 month ago
Andy,

I would have to say in my entire career that the worst manager that i ever had was one that came in from retail.  the philosophies are very different.

 1--they didn't know what their people did
 2--they were not qualified to tell if the job was done well or not
 3--they didn't know how to checkup on things during the development phase.
 4--they tried to micromanage everything as they would in retail.

Since they didn't understand what was going on, they never really trusted anyone and that micromanaging was their way of coping with not knowing anything.

Now having said that, i will also say management is a skill that can be applied across all disciplines, but you have to understand what your people do.  Can you handle managing a heard of cats that you have no idea where each cat will run to, or how they will move when you try to heard them?

I don't have a short simple answer for you--I've been a programmer now for 30 years and before that i was a retail manager.  I got out of retail management and went to college and earned my degree in computer science.  i entered the job market and have done well, IMO.  because i have had management experience I have been sought after many times to do management.  Each time i turn that down because it is not what i want to do.

I've been in a Senior development position now since I was out of college for about 6 months, I am usually the lead programmer on a project or even the Senior programmer the an agency or company.  The long range planning associated with that is something of self preservation, so we have a clear and agile path to follow in our integration of technology into our enterprise, but I do not try to heard the cats.  It is more pain and trouble than I wish to deal with.

So how much time are you willing to put in to understand how your cats will move in the IT world?  I assure you, most with 1 or more years of experience do not take well to micromanagement.  I am not saying you would do so--but it is the natural path that managers follow when they don't understand.

best wishes and hope things workout for you,
Les
1 month ago
mike,
if you make what is called a "class variable" which, basically, is static placed before the declaration of an instance variable... you have a variable which is common to all instances and is literally the same in all instances of that class.. ie: when it changes, it changes for all.
1 month ago
Scott,
showing code to say what you are doing would be nice... my guess is, and that is what it is without seeing what you are doing is: you need to use getResource
1 month ago
in my resume, i put exactly how many years of experience that i have in the industry.  I've about 40+ years now in the industry, but progamming i have about 35 and degreed work at programming about 30.  i put my total programming time down about 30 years.  I put my last 3 maybe 5 jobs down--usually 3, but that encompasses over 25 years of experience.  I've never had anyone ask for those extra 4+ years of listings.

Monica Shiralkar wrote:

Paul Clapham wrote:
I would certainly do that. Otherwise, imagine that after 20 years of work you're looking for a new job. Do you put in the job you did as an intern 20 years ago? That isn't going to be interesting to anybody who might want to hire you.



Means in that case not even putting a one liner project description about what one did many years back ? And not even writing that experience in resume and saying you only have these many years of experience (a reduced figure ).?

4 months ago
I only give 3 to 5 jobs and tell them further experience available upon request.
5 months ago