How to find who has checked in last on VSS? - visual-sourcesafe

Is there any way to know about the user who has checked in last items on VSS?
We've shared folder on our server(other than VSS server) where we keep internal project copies. But recently someone has replaced it with some invalid copy. As there isn;t any way of finding who has done this job, I looked for some trace of information that may help in finding the user who has done this; and I found VSS control meta data file in project folder?
It has following piece of information:
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
}
Is this of any help for tracing out the same version on VSS?
thanks in advance,
Kapil

Or look into the journal.txt in your vss database folder

Related

How to find and delete duplicate Outlook emails in file explorer with PowerShell?

Please forgive me, I have little experience with PowerShell, but I know in theory what i need to do.
I have been given a list of 21,000 outlook emails and told to delete duplicates. The server uploaded these incorrectly somehow.The subject of the emails is a randomly generate string so is unique. I need to delete duplicates based on email size and manually opening the email to check that the content is the same. Rather than eyeballing them and comparing them manually which will take me approximately 25 years lol, does anyone know how to do this in PowerShell?
E.g. traverse through Outlook files line by line. IF one file size matches the previous, open both emails. AND Compare first line of email with both emails. IF they both match in terms of file size and content,delete one email. Surely this wouldn't be too difficult to do? Please help me, I cannot fathom looking at 21k emails!!
I've got powershell open and I navigated to the directory which hosts the 21k outlook emails. Please can someone help me? I know i am going to need some sort of loop in there and for 21k files it isn't going to be quick, but eyeballing them and doing it manually will take MUCH MUCH longer, the thought of manually doing it is giving me shivers...
Thanks! Much appreciated!
I am in powershell and navigated to the directory which hosts the 21k emails. I now need to find out how to traverse through line by line, find matching sizes and compare content, IF both are true then delete one file. I am not a programmer and I don't want to mess up by randomly winging it.
I'm not sure I understood everything but this might help you:
$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNamespace("MAPI")
$Folder = $Namespace.GetDefaultFolder(6) # 6 is the index for the Inbox folder
$Emails = $Folder.Items
$Emails.Sort("[ReceivedTime]", $true)
$PreviousEmail = $null
foreach ($Email in $Emails) {
if ($PreviousEmail -ne $null -and $Email.Subject -eq $PreviousEmail.Subject -and $Email.ReceivedTime -eq $PreviousEmail.ReceivedTime) {
Write-Host "Deleting duplicate email with Subject:" $Email.Subject "and Received Time:" $Email.ReceivedTime
$Email.Delete()
}
$PreviousEmail = $Email
}
To run this tho, you need to change the directory to the outlook file locations. You can use "cd C:\PATH" or "Set-Location C:\PATH".
Eg:
cd C:\Users\MyUserName\Documents\Outlook\
Give it a try and let me know if works or it errors out. You might need to adjust some lines, I don't have outlook on my PC to test.
Also please do a backup/copy of the folder before running the script, in case it does delete emails it shouldn't.

Android v10/api29 - cannot write file to internal storage documents

When I want to write a file to the internal storage/Documents, I don't see any file that was created.
Also the path that it returns looks a bit weird.
"/data/user/0/com.companyname.writeexternaldocs/files/temp.txt"
Because I'm working on Android v10/api29 I have to use the mediastore
string fileName = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "temp.txt");
File.WriteAllText(fileName, "Some text?");
bool doesExist = File.Exists(fileName);
But when I look at this folder on my android device the temp file is not there. Can anybody point me to the right direction?
Thanks in advance

Delete a TestSet in ALM using OTA

So, I'm SLOWLY working my way to having a painful manual process automated in ALM using OTA. My current struggle is deleting a test set. It just doesn't do anything - no error, no deletion, nothing. It's like the line of code isn't even there. Although, it's definitely doing something cause ALM is working funky now.
I've tried different things: Delete, RemoveNode. Any advice is appreciated.
Set qcConnection = QCutil.QCConnection
Set tsFolder = qcconnection.TestSetTreeManager.NodeById(224)
Set tstestList = tsFolder.FindTestSets("", False, "")
If tstestList is Nothing Then
print "No manual tests present", vbOK
Else
For i = 1 to tstestList.Count
Set temp = tstestList.Item(i)
if temp.TestSetFolder.father.name = strMonth then
qcconnection.TSTestFactory.RemoveItem(temp.id)
end if
Next
End If
It seems you use a wrong factory - you need to use TestSetFactory instead of TSTestFactory

Counting number of files from folder on Windows Phone

I have a folder with a number of .wav files inside. I need to dynamically count these files in order to generate the sound in a random way. I need this dynamically, so I don't need to update code everytime I update the sound folder with another sound.
I searched how to do it, but could only found examples for Windows. Here's the code I came up with:
string path = string.Format("/Sound/{0}", sourceSound);
return Directory.GetFiles(path, ".wav").Length;
I tried running it, but VS gives me the error:
"Unable to step. The code is currently unavailable."
Is there anything I'm doing wrong, or any other case how can we count the number of files inside a folder?
Thanks.
Try
using (var myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
var i = myIsolatedStorage.GetFileNames("*.wav").Length;
}
For some reason I couldn't make the example Vitalii gave me work. I was never able to get the count of files I have in the volder.
Looking over the internet, I stumbled upon this link:
confused about resources and GetManifestResourceNames()
The answer Zack gave on this thread, gave the insight I needed to make my App work.
I used Embedded Resource to find all the count of files I needed and, then, play the with a SoundEffectInstance.
The following link helped on this:
http://matthiasshapiro.com/2011/01/10/embedding-a-sound-file-in-windows-phone-7-app-silverlight/
Here's how I managed to make it work:
soundCount = GetSoundCount();
private int GetSoundCount()
{
return Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(name => name.Contains(sourceImg)).Count();
}
With these few lines I managed to get the exact number of files I have in my App.
To make the sound play, I used the second link as an example and produced the code below:
if(soundInstance != null)
soundInstance.Stop();
this.soundInstance = SetNextSource();
soundInstance.Play();
private SoundEffectInstance SetNextSource()
{
Random random = new Random();
Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream(string.Format("Assembly Name.Folder.{0}.{1}.wav", SubFolder, FileName + random.Next(soundCount)));
SoundEffect se = SoundEffect.FromStream(stream);
return se.CreateInstance();
}
Well after a few days o research finally managed to make it work.
Hope this thread helps people facing the same problem I did.
Thanks.

Check if a key exists in the Windows Registry with VB.NET

In VB.NET I can create a key in the Windows Registry like this:
My.Computer.Registry.CurrentUser.CreateSubKey("TestKey")
And I can check if a value exists within a key like this:
If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\MyKey", _
"TestValue", Nothing) Is Nothing Then
MsgBox("Value does not exist.")
Else
MsgBox("Value exist.")
End If
But how can I check if a key with a specific name exists in the Registry?
One way is to use the Registry.OpenSubKey method
If Microsoft.Win32.Registry.LocalMachine.OpenSubKey("TestKey") Is Nothing Then
' Key doesn't exist
Else
' Key existed
End If
However I would advise that you do not take this path. The OpenSubKey method returning Nothing means that the key didn't exist at some point in the past. By the time the method returns another operation in another program may have caused the key to be created.
Instead of checking for the key existence and creating it after the fact, I would go straight to CreateSubKey.
I use this code. It’s simple, easy, and it works on HKEY_CURRENT_USER\Software\YourAppSettings.
Code:
string[] kyes=Registry.CurrentUser.OpenSubKey(#"Software\YourAppSettings").GetValueNames();
if (!kyes.Contains("keytoknowIfExist"))
{
}
Thanks for the information - this helped me a lot! I did notice while I am in the Visual Studio development module however, the settings were being saved under Computer\HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Elementary\Backup - not the same as the finished Installed Software. I am using ie. SaveSetting("Elementary", "Backup", "BackupFile", bdbname)
Since I didn't know exactly where my settings would be saved in the registry once my product was completed, I tried this and it worked perfect for me. I didn't have to know the exact location, which was helpful.
If GetSetting("Elementary", "Backup", "BackupFile", Nothing) <> Nothing Then
DeleteSetting("Elementary", "Backup", "BackupFile")
bdbname = ""
End If
Anyway, hope it helps someone in the future...

Resources