Searching mismatched changes between Perforce branches - perforce

There are four branches in Perforce depot: B1, B2, B3 and B4.
Let's think B1 as main (core, trunk).
B2 and B3 could contain changes which must be included into B1 but missed by some reasons.
B4 is target branch which is already created from B1 but because of missed B2 and B3 changes in B1 is not full.
The goal is to build list of files (not make merge!) which were not propagated from B2 and B3 to B1 (one list) and which were not propagated from B1 to B4

Here's an example. It's small, but hopefully it's enough to give you the idea.
C:\Users\Bryan\perforce\client>mkdir B1
C:\Users\Bryan\perforce\client>cd B1
C:\Users\Bryan\perforce\client\B1>vim f1 f2
C:\Users\Bryan\perforce\client\B1>p4 add f1 f2
//depot/B1/f1#1 - opened for add
//depot/B1/f2#1 - opened for add
C:\Users\Bryan\perforce\client\B1>p4 submit -d add_B1
Submitting change 15.
Locking 2 files ...
add //depot/B1/f1#1
add //depot/B1/f2#1
Change 15 submitted.
C:\Users\Bryan\perforce\client\B1>p4 populate //depot/B1/... //depot/B2/...
2 files branched (change 16).
C:\Users\Bryan\perforce\client\B1>p4 populate //depot/B1/... //depot/B3/...
2 files branched (change 17).
C:\Users\Bryan\perforce\client\B1>p4 edit B1/f1
B1/f1 - file(s) not on client.
C:\Users\Bryan\perforce\client\B1>p4 sync
//depot/B2/f1#1 - added as c:\Users\Bryan\perforce\client\B2\f1
//depot/B2/f2#1 - added as c:\Users\Bryan\perforce\client\B2\f2
//depot/B3/f1#1 - added as c:\Users\Bryan\perforce\client\B3\f1
//depot/B3/f2#1 - added as c:\Users\Bryan\perforce\client\B3\f2
C:\Users\Bryan\perforce\client\B1>cd ..\
C:\Users\Bryan\perforce\client>p4 edit B2\f1
//depot/B2/f1#1 - opened for edit
C:\Users\Bryan\perforce\client>vim B2\f1
C:\Users\Bryan\perforce\client>p4 submit -d add_to_B2
Submitting change 18.
Locking 1 files ...
edit //depot/B2/f1#2
Change 18 submitted.
C:\Users\Bryan\perforce\client>p4 edit B3/f2
//depot/B3/f2#1 - opened for edit
C:\Users\Bryan\perforce\client>vim B3\f2
C:\Users\Bryan\perforce\client>p4 submit -d insert_to_B3
Submitting change 19.
Locking 1 files ...
edit //depot/B3/f2#2
Change 19 submitted.
C:\Users\Bryan\perforce\client>p4 populate //depot/B1/... //depot/B4/...
2 files branched (change 20).
C:\Users\Bryan\perforce\client>p4 integrate -n //depot/B2/... //depot/B1/...
//depot/B1/f1#1 - integrate from //depot/B2/f1#2
C:\Users\Bryan\perforce\client>p4 integrate -n //depot/B3/... //depot/B1/...
//depot/B1/f2#1 - integrate from //depot/B3/f2#2
C:\Users\Bryan\perforce\client>p4 integrate -n //depot/B2/... //depot/B4/...
//depot/B4/f1#1 - sync/integrate from //depot/B2/f1#2
C:\Users\Bryan\perforce\client>p4 integrate -n //depot/B3/... //depot/B4/...
//depot/B4/f2#1 - sync/integrate from //depot/B3/f2#2

Related

Dynamic rolling correlation excel

I have a financial time series data set. I need to make a rolling window correlation, where I can control the window size, 1 dependent variable and 2 or more independent varaibles. And it needs to be dynamic when updating the data history. I also want to be able to choose the dependent.
I already managed to make the first dynamic correlation, where i changes as I change the constant of the window size
="Data!"&ADRESS($A11;MATCH(B$7;TitleArray;0))&":"&ADRESS($B$1+ROW(Data!$A$1);MATCH(B$$7;TitleArray;0))
The cell now holds an address to the range of the data in the window of the first variable
Data is reffering to my data set.
$A11 is my starting row number of the window. might need to relative?
B$7 is a cell with the name of my dependent variable (I want to know how this corr with several other
variables, but I need to be able shift between, which is the dependent one)
TitleArray is name of a range holding the variable names
$B$1 refers the the constant explaining the size of the window
+ROW(Data!$A$1) makes sure that it adjusts when I add more history
Then I just copied this formula to the next cell in the column next to, replacing B7 with C7
Then, in a new cell I found the corr between the two in this way:
CORRELATION(INDIRECT($o$16);INDIRECT(P16))
Here I made the corr between the dependent and another variable for the set window (I tested it with 24 months).
Can anyone help me get the last steps in order to extend it to show the last corr windows for the remaining history? I suppose it should be rather easy, but I can't seem find the right way. I guess I have to remove some $ signs and then drag it down, but then I will get a lot of rows with adresses follows by correlations. Can it be made in a smarter way?
If any details are missing please let me know
thank you!
A little hard to follow the specifics of your objectives, but here is an approach using OFFSET.
=CORRELATION( OFFSET( Data!$A$1; $A11-1; MATCH($B7;TitleArray;0 )-1; ($B$1+2-$A$11); 1 );
OFFSET( Data!$A$1; $A11-1; MATCH(C7;TitleArray;0 )-1; ($B$1+2-$A$11); 1 ) )
B7 is the name of your dependent variable and C7 would be the independent variable name. As you drag this formula to the right, it would compare B7 to C7, then D7, etc.
NB: my OS is in English, so here is the working version in my machine just in case I errored in translation:
=CORREL( OFFSET( Data!$A$1, $A11-1, MATCH($B7,TitleArray,0 )-1, ($B$1+2-$A$11), 1 ),
OFFSET( Data!$A$1, $A11-1, MATCH(C7,TitleArray,0 )-1, ($B$1+2-$A$11), 1 ) )
With this approach, you can avoid having the helper cells with the formula:
="Data!"&ADDRESS($A11;MATCH(B$7;TitleArray;0))&":"&ADDRESS($B$1+ROW(Data!$A$1);MATCH(B$7;TitleArray;0))

Replacing text on a spreedSheet according to match text x Rows above it

Good day people, this is my first post here. I'm trying to understand what's the logic for this issue i want to fix:
I have a spreedsheet with the sales of clients, each one with a different name. Every Client has under its name a date and to the right the amount of money sold that day. Then after the last day registered there's the word "Total" I need to change every "Total" so that it says "Total Client A" . "Total Client B", ETC, according to which client the "total" belongs to . Example
Client 1
DATE .............Value
2016-05-01 ... $2.500
2016-05-02 ... $2.350
2016-05-03 ... $3.450
Total..............$8.300
Client 2
DATE............Value
2016-05-01.. $2.000
2016-05-02...$2.600
2016-05-03...$2.400
Total..............$7.000
etc etc. So the idea is to have in the above example instead of "Total", Total Client 1, Total Client 2, etc.
CLIENT X, can be any name. It doesn't follow a logic. The only constant is that underneath it there's the cell "DATE"
The file changes each day (adding a new Date with it's respective sale, and the reprocessed total) and i need to process the file daily. The idea is each day to have the file say "Total Client x ",(instead of just "Total") so i can use that file to another process that i have.
Thanks a lot for any help,
Using an array formula, you can add extra criteria also, to tweak.
="TOTAL FOR :" & INDEX($A$1:$A13,MAX(IF(NOT(ISNUMBER($A$1:$A13)*($A$1:$A13<>"")),ROW($B$1:$B13)))‌​,1)
This uses one of my favorite tricks given here.
Assuming your data starts in column A with the first value in A1, and, then assuming your first total was in cell, say A10 (I just need an address to show you what it would look like), you could use the following formula for your total in A10:
="Total " & LOOKUP(2, 1/($A$2:A9="Date"), $A$1:A8)
And you can then copy and paste that exact formula into any other total cell in Excel.
Basically, it says the following:
Start with the word "Total "
Look in cells A2 till the cell directly above me and find the last occurrence of the word "Date" (LOOKUP(2, 1/($A$2:A9="Date"), ...) - See the link above to explain why this works)
Lookup the values of the cells directly above them to know what to bring in (LOOKUP(... ,$A$1:A8)).
Hope that makes sense and does the trick!

MS Excel Forumlae

I have always used Excel for basic forumlae functions. I havnt needed to use advanced forumlae's before to gather information. However, today I do and I have been looking at Google for a while for the answers. Managed to work out a few things I needed. I am trying to do something else now. I will try and describe the situation.
I have two seperate spreadsheets - an old one and a new one. They both have the same columns. However, the newer one has recent up to-date information.
The old document looks something like this:
Column A | Column B | Column C | .... | .... | .... |
Fixed 726495 ........
Stuck 728496 ........
Fixed 274569 ........
Fixed 357697 ........
..... ...... ........
The new document and what I want it to do will look something like this.
Column A | Column B | Column C | .... | .... | .... |
Fixed 726495 ........
Stuck 728496 ........
Fixed 274569 ........
NEW 974865 ........
..... ...... ........
As you can see what the new document has done is compared Column B in both documents and retreived Column A's information to that match. If it doesnt match and cant be found because its new information it will simply say "NEW". all this information is under filters so Im not sure if that makes it more difficult?
Just a background to help. I am working on a new spreadsheet system for checking if patients have already had their operations and if they have I check them in and out retrospectively. All the ones that say fixed shouldnt show up on the newer spreadsheet unless they are "Stuck" which I will have to check later on down the line. Since hospitals at the moment are understaff nurses may not admit and discharge patients properly so I have to go back and remedy the situation.
Use this formula in second workbook in cell A1 and drag it down:
for Ecxel 2007 or later:
=IFERROR(INDEX([Book1.xlsx]Sheet1!$A:$A,MATCH(B1,[Book1.xlsx]Sheet1!$B:$B,0)),"NEW")
for Excel 2003:
=IF(ISERROR(INDEX([Book1.xls]Sheet1!$A:$A,MATCH(B1,[Book1.xls]Sheet1!$B:$B,0))),
"NEW", INDEX([Book1.xls]Sheet1!$A:$A,MATCH(B1,[Book1.xls]Sheet1!$B:$B,0)))

HG: Importing changes from the diff of two repo

How could we manage to import into a hg repo the differences of two repos.
I mean, say we have repo A, A2 and B. I would like to import to repo B(same file structure than A) the differences between A2 and A (A2 is just A with some changes).
I guess we should generate a diff between both directories and use hg import, but how should the diff be generated?
is there a better way to do this?
If B is totally equal to A you can (in B) just pull from A2
If B also differ from A, you can:
pull A from A2 (get additional head in A2 as result)
save diff of heads in A2 into file
import result of previous operation into B
And, BTW, you can streamline your current exotic workflow

Replacing text in excel from a static table

I have a report that is sent to me daily that only supplies IP addresses and would like to create a macro that would look up the address to host conversion from another table (external to the excel sheet report). So that when its executed, the IP address would be replaced with the actual hostname.
Date/Time Detected Source IP Address Destination IP Address
6/19/2013 15:46 172.16.16.40 172.16.4.10
6/19/2013 15:46 172.16.16.40 *
6/19/2013 15:02 172.16.16.40 *
6/19/2013 15:02 172.16.16.40 *
6/19/2013 15:02 172.16.16.40 *
6/19/2013 15:02 172.16.16.40 *
In this example, I would have a table that would have an IP address and Host address (from a dns export table), that I would like to do a replace Source IP with it's hostname from my daily reports. The dns table is static, the daily reports would be populated with a replace IP with hostname from the static dns table.
I created a very simple example of how to do this:
Right now (to make it easier to make the picture) the DNStable is a named range (green background) in the same sheet - but it could be in another sheet/workbook. The VLOOKUP function attempts to find an exact match (fourth argument FALSE means "exact match") between the first argument (the "Source IP Address") and the first column in that table; it returns the value in column 2 if found, or #N/A if not found.
To do the same thing when the DNS lookup is a different file, use the following formula:
=VLOOKUP(B2,DNSlookup.xlsx!DNStable,2, FALSE)
Where the DNSlookup.xlsx file contains a named range DNStable as before:
As long as that file is open in your copy of Excel, you're good - they don't have to be in the same file. Now copy this formula into cell D2, and drag it all the way down. Cool trick: if you select the cell, then double-click the little "dragbox" in the bottom right-hand corner, it will automatically fill all the way down (as many cells as there are cells immediately to the left of it). Try it!
Note - if you now close both the DNS lookup file and this file, and then open it again, you will get a warning about "updating external links". At that point you will see the formula has changed to something like this:
=VLOOKUP(B2,'X:\code\DNSlookup.xlsx'!DNStable,2, FALSE)
As you can see, it's created a link to the location where the other file is kept - but it also kept the value of the last successful lookup.
This ought to work for you.

Resources