How to avoid neccessity to re-enter password during schell script execution

I am working on a shell script performing recurring tasks of

  • git commit
  • git push
  • mvn release:prepare
  • mvn release:perform

in a couple of paths of a JAVA software project.

Now each of these commands asks for my rsa token password at least once, sometimes even multiple times: “Enter passphrase for key /…./.ssh/id_rsa:”

Is there a way to get around this? It would be OK if I had to enter the password once per script execution.

One boundary condition: I cannot use “spawn, expect, send”

Can deleting a non-inherited object more than once be exploited for code execution?

When assigning priority for a bug, we had an internal discussion whether in C++ deleting an object more than once can result in code execution if the pointer to object can be corrupted. For the objects having virtual destructor the answer seem to be obvious here.

However what is not obvious whether this could be exploited for code execution when a deleted object is either a standard type (i.e. long), an array, or an instance of a class which does not have virtual table.

Can this situation result in code execution on any existing popular implementations?

Namimg Methods – How to name method with complex execution sequence?

This question: https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager contains many examples of suffixes and prefixes that can be used to come up with precise name for your class.

What about methods? For example, how to name a method that should execute some action upon validation of some state – ExecuteIfSomething, if we imagine that some transition in state should be executed after checking if something is true – ValidateTransition (kind of ok, but reading it makes me think that it should just validate something – not additionally execute some action), TranslateUponValidation?

It would be very useful to have list of common parts that can be added to action/topic/… to describe method.

Here are some that I can come up with at the moment:

  • Get
  • Set
  • Contains
  • Add
  • Remove
  • Push
  • Pop
  • Clear
  • Close
  • Lock
  • Open
  • Unlock
  • Enqueue
  • Dequeue
  • Activate
  • Deactivate
  • Translate
  • Move
  • Jump
  • Fill
  • Empty
  • Draw
  • Take
  • Give
  • Stash
  • Group
  • Shuffle
  • Mix
  • Sort
  • Merge
  • Inline
  • Validate
  • Check
  • Execute
  • Apply
  • Compose
  • Decompose
  • Decay
  • Break
  • Gather
  • Fuse
  • Grow
  • Rise
  • Drop
  • Fall
  • Pick
  • Select
  • Accept
  • Decline
  • Retire
  • Upgrade
  • Degrade
  • Increase
  • Decrease
  • Stop
  • Continue
  • Pause
  • Resume
  • Process
  • Advance
  • Create
  • Destroy

Maybe, I have put too many of them.

As you can see now – many if not almost all verbs can be used depending on the situation. Using them or finding the matching one shouldn’t be a problem. The problem is on how to combine them or use some of them to describe complex situations or complex executing sequence. The one I have described as an example is the most common one that I haven’t found a good solution for. Personally I am interested in this particular one. But having some way/approach (not a formula like Object + Action + …) to define/come up with method/function names can be very useful.

Main question here is how do you name a method as the one described in the example? It might seem to be a duplicate of this question – Meaningful concise method naming guidelines – I can clarify and update my question if that is going to be required.

Namimg Methods – How to name method with complex execution sequence?

This question: https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager contains many examples of suffixes and prefixes that can be used to come up with precise name for your class.

What about methods? For example, how to name a method that should execute some action upon validation of some state – ExecuteIfSomething, if we imagine that some transition in state should be executed after checking if something is true – ValidateTransition (kind of ok, but reading it makes me think that it should just validate something – not additionally execute some action), TranslateUponValidation?

It would be very useful to have list of common parts that can be added to action/topic/… to describe method.

Here are some that I can come up with at the moment:

  • Get
  • Set
  • Contains
  • Add
  • Remove
  • Push
  • Pop
  • Clear
  • Close
  • Lock
  • Open
  • Unlock
  • Enqueue
  • Dequeue
  • Activate
  • Deactivate
  • Translate
  • Move
  • Jump
  • Fill
  • Empty
  • Draw
  • Take
  • Give
  • Stash
  • Group
  • Shuffle
  • Mix
  • Sort
  • Merge
  • Inline
  • Validate
  • Check
  • Execute
  • Apply
  • Compose
  • Decompose
  • Decay
  • Break
  • Gather
  • Fuse
  • Grow
  • Rise
  • Drop
  • Fall
  • Pick
  • Select
  • Accept
  • Decline
  • Retire
  • Upgrade
  • Degrade
  • Increase
  • Decrease
  • Stop
  • Continue
  • Pause
  • Resume
  • Process
  • Advance
  • Create
  • Destroy

Maybe, I have put too many of them.

As you can see now – many if not almost all verbs can be used depending on the situation. Using them or finding the matching one shouldn’t be a problem. The problem is on how to combine them or use some of them to describe complex situations or complex executing sequence. The one I have described as an example is the most common one that I haven’t found a good solution for. Personally I am interested in this particular one. But having some way/approach (not a formula like Object + Action + …) to define/come up with method/function names can be very useful.

Main question here is how do you name a method as the one described in the example? It might seem to be a duplicate of this question – Meaningful concise method naming guidelines – I can clarify and update my question if that is going to be required.

Namimg Methods – How to name method with complex execution sequence?

This question: https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager contains many examples of suffixes and prefixes that can be used to come up with precise name for your class.

What about methods? For example, how to name a method that should execute some action upon validation of some state – ExecuteIfSomething, if we imagine that some transition in state should be executed after checking if something is true – ValidateTransition (kind of ok, but reading it makes me think that it should just validate something – not additionally execute some action), TranslateUponValidation?

It would be very useful to have list of common parts that can be added to action/topic/… to describe method.

Here are some that I can come up with at the moment:

  • Get
  • Set
  • Contains
  • Add
  • Remove
  • Push
  • Pop
  • Clear
  • Close
  • Lock
  • Open
  • Unlock
  • Enqueue
  • Dequeue
  • Activate
  • Deactivate
  • Translate
  • Move
  • Jump
  • Fill
  • Empty
  • Draw
  • Take
  • Give
  • Stash
  • Group
  • Shuffle
  • Mix
  • Sort
  • Merge
  • Inline
  • Validate
  • Check
  • Execute
  • Apply
  • Compose
  • Decompose
  • Decay
  • Break
  • Gather
  • Fuse
  • Grow
  • Rise
  • Drop
  • Fall
  • Pick
  • Select
  • Accept
  • Decline
  • Retire
  • Upgrade
  • Degrade
  • Increase
  • Decrease
  • Stop
  • Continue
  • Pause
  • Resume
  • Process
  • Advance
  • Create
  • Destroy

Maybe, I have put too many of them.

As you can see now – many if not almost all verbs can be used depending on the situation. Using them or finding the matching one shouldn’t be a problem. The problem is on how to combine them or use some of them to describe complex situations or complex executing sequence. The one I have described as an example is the most common one that I haven’t found a good solution for. Personally I am interested in this particular one. But having some way/approach (not a formula like Object + Action + …) to define/come up with method/function names can be very useful.

Main question here is how do you name a method as the one described in the example? It might seem to be a duplicate of this question – Meaningful concise method naming guidelines – I can clarify and update my question if that is going to be required.

Namimg Methods – How to name method with complex execution sequence?

This question: https://stackoverflow.com/questions/1866794/naming-classes-how-to-avoid-calling-everything-a-whatevermanager contains many examples of suffixes and prefixes that can be used to come up with precise name for your class.

What about methods? For example, how to name a method that should execute some action upon validation of some state – ExecuteIfSomething, if we imagine that some transition in state should be executed after checking if something is true – ValidateTransition (kind of ok, but reading it makes me think that it should just validate something – not additionally execute some action), TranslateUponValidation?

It would be very useful to have list of common parts that can be added to action/topic/… to describe method.

Here are some that I can come up with at the moment:

  • Get
  • Set
  • Contains
  • Add
  • Remove
  • Push
  • Pop
  • Clear
  • Close
  • Lock
  • Open
  • Unlock
  • Enqueue
  • Dequeue
  • Activate
  • Deactivate
  • Translate
  • Move
  • Jump
  • Fill
  • Empty
  • Draw
  • Take
  • Give
  • Stash
  • Group
  • Shuffle
  • Mix
  • Sort
  • Merge
  • Inline
  • Validate
  • Check
  • Execute
  • Apply
  • Compose
  • Decompose
  • Decay
  • Break
  • Gather
  • Fuse
  • Grow
  • Rise
  • Drop
  • Fall
  • Pick
  • Select
  • Accept
  • Decline
  • Retire
  • Upgrade
  • Degrade
  • Increase
  • Decrease
  • Stop
  • Continue
  • Pause
  • Resume
  • Process
  • Advance
  • Create
  • Destroy

Maybe, I have put too many of them.

As you can see now – many if not almost all verbs can be used depending on the situation. Using them or finding the matching one shouldn’t be a problem. The problem is on how to combine them or use some of them to describe complex situations or complex executing sequence. The one I have described as an example is the most common one that I haven’t found a good solution for. Personally I am interested in this particular one. But having some way/approach (not a formula like Object + Action + …) to define/come up with method/function names can be very useful.

Main question here is how do you name a method as the one described in the example? It might seem to be a duplicate of this question – Meaningful concise method naming guidelines – I can clarify and update my question if that is going to be required.

I’m writing an application that needs to log error/ exception messages but should still continue execution if it not a fatal error

I’m writing an application that needs to log error/ exception messages but should still continue execution if the error is not a fatal error. I was thinking of making a method that returns a Task but calling this method as a fire and forget and not wait for response from the method. What is the recommendation, is this a good approach?

For a processor running at 50 MIPS, what is the average execution time per instruction?

I have a practice test question. I am given only the MIPS with 4 choices of the average execution time.

How is this calculated? Don’t I need other data? I know that MIPS = (number of instructions / execution time) / 1 million.

For a processor running at 50 MIPS, what is the average execution time per instruction?

a) 20ns
b) 50ns
c) 2μs
d) 5μs