Thursday, June 28, 2012

SVN - Restore a Deleted File

1. Get the Svn version that matches the file deletion
Go to the deleted file directory and

>> svn log --verbose

------------------------------------------------------------------------
r23332 | niteshk | 2012-06-28 11:33:14 +0530 (Thu, 28 Jun 2012) | 1 line
Changed paths:
   D /crap/branches/Crap.java
   M /crap/branches/adc.java

deleting Crap file
----------------------------------

revision # 23332 is the revision version corresponding to the deletion of Crap.java
Choose any earlier verision, just intelligent guess, that could have contained the file

Lets choose a verison earlier = 2332

>>
svn update -r 2331 Crap.java
 
This command fails to do the expected, so lets try another one.
 
>>
svn copy -r 2331  https://{URL}/Crap.java . 

This too fails !!

So the final one. Add revision version to the Url

>>
svn copy -r 98 https://{URL}/Crap.java@2331
 
 

Friday, March 9, 2012

Threads fundamentals

1. What is meeaning of Concurrent access by multiple threads
Since only one thread is actively running at any point of time , so what' the meaning of concurrent access or simultaneous access ?

Ans :
Threads store method variable on a local stack.Global object reside on heap bu the reference to the global objects are again stored in the stack.
So when two or more threads have the same-state-stack ( that means stack having same values for the all the local and global variables ) at any given cpu snippet , then it can be said to be a concurrency probelm.

Local method variables are just OK, they dont affect or create a concurrent problem. It's the global references that are in a risk of having a inconsistent state.