Stephan van Hulst

Saloon Keeper
+ Follow
since Sep 20, 2010
Merit badge: grant badges
For More
Cologne, Germany
Cows and Likes
Cows
Total received
363
In last 30 days
3
Total given
261
Likes
Total received
3985
Received in last 30 days
33
Total given
728
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stephan van Hulst

When posting code, please use code tags like [code]this[/code]. This time, I have added them to your posts for you.

Where is configu.xml located inside your project directory? And how do you build and run your application?
7 minutes ago

kevin Abel wrote:I have about 25 commands written on paper and typed in a file on EverNote.


That seems like a lot to me. What have you written down?

Question:  What is the difference between main,  the branch with the *,  HEAD and master(obsolete)  ?


There's no conceptual difference between different branches. They're all just labels that point to a commit. You must have at least one branch in your repository. When you initialize a new repository, it used to be the case that the initial branch was named "master" by default. They changed that to "main". So "main" is just the default name of the first branch of your repository. However, it has no special meaning. You can use it the same way as any other branch you create.

HEAD is not a branch. HEAD is a pointer to the currently checked out branch or commit. Checking out means loading the version of the source code into your working directory, so you can make changes to that version of the source code. If you make a new commit, its parent will be the commit that HEAD used to point at before you made the commit.

HEAD is not supposed to point to a commit directly. Instead, you almost always want HEAD to point to a branch label (which in turns points to the checked out commit). The tutorial you're working with could have displayed this by having a HEAD label point to the branch label, but they chose to display this as an asterisk inside the branch label instead. If you see an asterisk, just think "Oh, HEAD is pointing at this branch".

Some commands automatically move the labels around for you, such as when you make a commit or when you merge or rebase branches. But if you want to move the labels around without changing the structure of the commit tree, you can use git branch and git checkout. You move branch labels using git branch. You move HEAD by using git checkout, but remember that git checkout also changes the contents of your working directory to a different version of your source code.


Is there a way to remove the commits at the bottom and then recommit bugFix?


No. A feature of Git is that it almost never removes commits completely. You need to embrace this. It prevents you from accidentally losing data.

The only thing you need to do to fix the situation is move the bugFix label one commit up:
The bugFix branch will now point to commit C2', making commit C4' unreachable (but doesn't delete it completely).

Think of "unreachable" commits as being in your trash can. Until the trash can is emptied, you can still restore those commits by having a branch label point to them.
If you're just rounding off the time part, and you're also just using UTC, then what is the point of returning a ZonedDateTime, and not just a LocalDate?
10 hours ago
A type can not be a subset of another type because types are not sets.

You can assign a String to a variable of type Object because String is a subtype of Object.

You can assign a List<? extends Integer> to a variable of type List<? extends Number> because List<? extends Integer> is a subtype of List<? extends Number>.

If List<? super Integer> were a subtype of List<? super Number>, you would be able to assign a List<? super Integer> to a variable of type List<? super Number>. You can't, because it doesn't make sense and would lead to broken code:

If the second statement were allowed, we would be able to add a Float to a List<Integer>.
Your bean definition file is not located on the path you indicated when you created your application context.

Please show us how you initialize your application, and where your configuration file is located in your project directory.

Is there a reason you're not using Spring Boot to initialize your application?
20 hours ago

kevin Abel wrote:I think that I'm missing a middle piece of knowledge.   I know the basics of git and very little of branching.  These examples seem to be for more advanced branching.  Is that correct?


Branching IS the basics of Git. Without branching, Git is nothing more than a simple backup tool. The examples you've worked through currently are quite basic.

To use Git effectively, at the very least you need to be familiar with creating branches, checking out branches, and rebasing (or preferably merging) branches.

The situation where you have to move around branch pointers using the git branch command doesn't really happen that much in real life. But it's still useful to know how to do it, if only so you can get a feeling for what a branch pointer is in the first place.


I'm enjoying going through the teaching screens, guessing at the answers and then seeing how the answers work.


I think the problem is that you're guessing. If you feel you need to guess, then you haven't internalized the previous lessons.


I'll go back to W3schools for git because there has to be some base knowledge that I don't have.


The tutorial is pretty much self-contained. You don't need to read anything else to complete the tutorial, as long as you remember the commands you've learned from earlier lessons.

You seem to have problems with the git branch command. It won't do to try and guess the correct way to call the command. If you do that in real life you will make a mess of your branches.

Level 3 of the second series ("Ramping up"; "Relative Refs #2") explains how you use the git branch command to move a branch pointer to a different location. Review that lesson before you try the level you're stuck on.

Don't worry, in real life you don't have to remember how to call every single git command. But you need to know roughly what you can do with a certain command, and then you can just look up how to call the command in the git handbook.


It was a bad time to get hit with covid.    I run into a new thing to learn and my mind only wanted rest.  I slept for about 18 hours a day back and when I woke up I felt great but tired.


I'm very sorry to hear that. Hopefully you'll be back to your old self soon. Covid seems to be going strong again lately.

Anil Philip wrote:If this is not allowed by the language then why does it compile?


Nobody said it's not allowed. It's just not possible to call the implementation of a grandparent class A if the implementation has been overriden by a parent class B. You can use the method name given by the grandparent just fine, but it will execute the implementation given by the object's actual type at runtime, which in this case is C.

Calling the method m1() on an object of type C will always call C.m1(). It doesn't matter that the reference that points to the object is of type A, the referenced object is still an object of type C. Casting the reference to a different type also doesn't make a difference. The object that the reference points to remains of type C.

This is the entire point of polymorphism: the behavior of an object is always determined by the actual type of the object at runtime, no matter the type of the reference that point to it.

Furthermore, why is it in an infinite loop?


Now that you know that calling m1() on your object always calls the implementation given by class C, it is easy to see why the code appears to loop: C.m1() calls C.m1() in its method body, which in turn calls C.m1(), which calls C.m1(), which...

wonder if the compiler is not clever enough to catch the flow of execution.


Clever enough to do what? Detect an infinite recursive call? Why would it do that?

There are legitimate reasons to make a recursive call, and it's not trivial to detect the recursion won't be infinite. In fact, if you can solve that problem, you've solved the Halting Problem and everything we know about computer science will be different forever.

If you assign a C instance to an A reference and cast it, then one can access only the member variable of A but not execute its methods?


You can access any visible member of A. But for instance methods, calling the method means the implementation given by C will be executed. This is polymorphism.
1 day ago
Please show us:

  • AbstractCustomerApproveTypeAction
  • struts-config.xml

  • 1 day ago
    No, what I mean is, why would the cancel tag specifically call a method named "unspecified"? Why not "other" or "cancel" or any other arbitrary name?

    Where did you get the method name "unspecified" from?
    2 days ago
    What makes you think the unspecified() method should be called?
    2 days ago
    There is no platform independent way to do this in Java.

    The best you can do is let the user know they must press 'Enter'.
    3 days ago

    kevin Abel wrote:Should I make a new thread for each question next time?


    That's not necessary. Let's just keep the discussion in this thread.

    git checkout bugFix      -It moves the asterisk * to bugFix so it becomes the tip, HEAD?   git has focus here.   I'm not exacly sure what the * means.


    The asterisk just means that HEAD is currently pointing at the indicated branch. So what is HEAD exactly?

    HEAD is just a pointer that indicates which branch or commit you are currently working with. All operations you perform are done relative to the commit that is currently checked out. If you git checkout a specific branch or commit, it does two things:

  • Move HEAD to indicate which branch or commit you are currently working with.
  • Load the version of your source code that was recorded in the checked out commit.

  • If you've checked out a specific branch, the tutorial will not display HEAD and instead just indicate the checked-out branch with an asterisk.

    If instead, HEAD is pointing at a commit directly, it will not display an asterisk but it will display HEAD as a separate label. We call this situation "Detached HEAD". This is a situation that has its uses, but they are pretty advanced and in real life, you will almost always want to have HEAD point to a branch instead (the situation where the HEAD label isn't displayed, but instead the checked-out branch is displaying an asterisk).

    I need some clues please.


    In this assignment, you can see that you don't need to create any commits or rebase or merge anything: The commit tree that you start with already contains all the commits that the goal also contains. That means that the only thing you need to do is move the branch and HEAD pointers around.

    Again, let's solve one thing at a time. The order isn't important, but let's focus on HEAD first. HEAD is pointing at commit C2, but it needs to point at commit C1, which is the direct parent of commit C2.

    Here are the ingredients:
  • To move the HEAD pointer, you need to use the git checkout command.
  • To reference the parent of a commit, you can use the ^ or ~ operators.


  • Next, let's move bugFix to commit C0, which is the direct parent of the commit that HEAD is now pointing at. The ingredients:
  • To move a branch pointer, you can use the git branch command with the -f switch.
  • To reference the parent of a commit, you can use the ^ or ~ operators.


  • Finally, we need to move main to commit C6. C6 is greyed out because it is not part of any branch. To be part of a branch, a commit needs to be pointed at by a branch pointer, or it needs to be the ancestor of such a commit. In a way, a commit that is not part of a branch is "unreachable": We can not use the ~ or ^ operators to reach it from a branch pointer. Instead, we need to reference the commit directly by using the commit hash. The ingredients:

  • To move a branch pointer, you can use the git branch command with the -f switch.
  • To reference an "unreachable" commit, you need to use the commit hash directly. In this case, the commit hash is C6.


  • Write down all the commands that you used to solve this assignment. Write down what you tried to achieve by calling the command. I can review your thought process, and let you know whether you've made any mistakes.
    There's a simple reason for this: ease of hardware implementation.

    If you take the bit sequence 1111 1111 and add 1 to it, you get the bit sequence 1 0000 0000. The leftmost bit is then discarded.

    So if you add 1 to 1111 1111 and it naturally results in the integer 0, then what integer should the bit sequence 1111 1111 represent? That's right, the integer -1.
    3 days ago