I have the following case in gerrit,
(master)O---C1---C2---C4
\
C3
Now there are two files F1 and F2 that are common files in C1 and C2 commits but different contents. Also there is other file F3 that is common in C1 and C3 commits.
Now these changes have not yet been reviewed. Now this has resulted in merge conflict. How can I resolve this ?
Related
Need some help on this cause I'm getting an issue
I've this three columns (Time, R1 and R2) and I'm trying to count the mismatches between R1 and R2 but for each month (on the time column)
I already used a formula but I'm having an issue to add 1.
https://docs.google.com/spreadsheets/d/1bVP79Gbd14lO6xunu2K9POT7y55yrXegD-cTF70Fb4k/edit#gid=0 (the spreadsheet with the values)
=iferror(if(EOMONTH($A64,0)=$A64,SUMPRODUCT(month(Database!$C$2:$C) = month($A64),--(Database!G$2:G <> Database!H$2:H)),""),"Error")
This part "month(Database!$C$4:$C) = month($A5)" is where I compare the information of the months, ( but I'm having an issue cause cause "month(Database!$C$4:$C)" only retrieves 4 that is the month of april)
This part "(Database!G$4:G <> Database!H$4:H)" is where I compare the columns R1 and R2
The part "EOMONTH($A5,0)=$A5" is where I take the month to based myself
Time R1 R2
2020-04-30 BA BU
2020-04-30 BU BA
2020-04-29 BA BU
2020-04-29 BU BA
2020-04-28 BA BU
2020-04-28 AA BA
2020-04-25 AA BA
2020-04-22 BU BA
2020-04-19 AA BU
2020-04-19 AA BA
2020-03-27 BA AA
2020-03-27 BA AA
2020-03-26 BU AA
2020-03-18 BA AA
2020-03-18 AA BU
Approach
In order to validate the answer I created a test Spreadsheet from a copy of your. In this sheet I created two support columns, one which contains the month number: MONTH($A1) and the other one a flag if the two values R1 and R2 are different: IF($B1=$C1,"",1).
In this way I can use this two support structure to validate the numbers obtained by the formula which didn't use any. I will use a much simpler formula this time to compute the sum =SUMIF(D:D,month(<DATE_VALUE>),E:E).
I will link here the test sheet. As you can see the values are the same as the ones obtained by the formula. So, I can confirm that if you are expecting different results, your database is not consistent.
In conclusion the formula: if(EOMONTH($A64,0)=$A64,SUMPRODUCT(month(Database!$C$2:$C) = month($A64),--(Database!G$2:G <> Database!H$2:H)),"") is working correctly.
We have done KMeans clustering with k=3 Clusters on dataset having 4 features, and have plotted the Centroid coordinates of each cluster with the input features. We want to focus on a cluster and try to figure out which feature is contributing more to a particular cluster with respect to other features. We do the same for other clusters too.
For e.g. lets assume we have clusters c1 c2 c3 with features f1 f2 f3 and f4. The centroids for the clusters are for e.g.
C1 C2 C3 respectively with corresponding features f1 f2 f3 f4
f1 f2 f3 f4
C1 -2.02746249 2.10961828 -0.57917217 1.687631
C2 0.63967987 -0.55768793 0.76387423 0.265274
C3 -0.38727624 0.18714381 -1.27291271 -1.273105
Can we infer that for cluster 1 since the centroid for f2 (feature2) is highest so can that be considered as the most significant/contributing feature for that particular cluster, similarly for cluster 2 centroid for f3(feature3) is highest so can that be considered as the important feature for cluster 2.
I have a variable list in my Makefile like that:
varglob := a1 a2 a3 a4 a5 a6
I want to create a new variable from varglob but eliminate some specific elements for example "a3".
I thought about foreach but my problem is that I don't know how I test with ifneq inside the foreach. So I tried to use shell like that:
varglobelim := $(foreach y, $(varglob), $(shell if [$(y) != "a3"]; then echo $y;fi))
But this solution doesn't success. I get an empty message.
Is there any other suggestions?
filter-out is your friend here:
varglob := a1 a2 a3 a4 a5 a6 b7 b8 b-whatever
has-no-ticket := a3 b% # a3 and all the b's didn't pay the ride
varglobelim := $(filter-out $(has-no-ticket),$(varglob))
I'm currently starting a new language (PROLOG) and I came across with a few issues.
I'm developing a simple board game in which I'm required to print the board. I've developed a PrintBoard and initialBoard predicate (as shown below), and I want to be able to run it from the main predicate, just like so:
printBoard([Head|Tail]) :-
printRow(Head),
printBoard(Tail).
printBoard([]).
printRow([Head|Tail]) :-
write(Head),
write(' '),
printRow(Tail).
printRow([]) :- nl.
initialBoard(Board) :- Board = ([
['b0','b0','b0','b0','b1'],
['b0','b0','b0','b0','b0'],
['b0','b0','b0','b0','b0'],
['b0','b0','b0','b0','b0'],
['b2','b0','b0','b0','b0']
]).
main :- Board = initialBoard(Board), printBoard(Board).
By typing main. in the SICStus PROLOG, the program should output the following:
b0 b0 b0 b0 b1
b0 b0 b0 b0 b0
b0 b0 b0 b0 b0
b0 b0 b0 b0 b0
b2 b0 b0 b0 b0
But, instead, it returns nothing. (Returns no).
The only way it seems to work is by inserting the whole list all over again as the variable, just like so:
main :- printBoard(<insert whole list here>).
Even though I'm looking to run it as:
main :- printBoard(initialBoard(Board)).
The portion of code above works, if main is passed the Board argument, but is it possible without passing it?
Functional code:
main(Board) :- printBoard(initialBoard(Board)).
I have a number of text files I'm looking to send to different destinations depending on whether or not the file contains Cyrillic characters using a batch script. For example:
All Files are located in C:\mydocs. The script will be monitoring this file.
File one: contains all English characters > copy to C:\mydocs\English\
File two: Contains some Cyrillic characters > copy to C\mydocs\Contains_Cyrillic\
Is this possible?
It depends on how your text file is encoded. If the file is unicode, then I'm not sure how to test.
But if the file is extended ascii (1 byte per character), then the meaning of bytes > decimal 127 is dependent on the code page. You can't really tell if the file contains Cyrillic, but you can tell if it contains a byte >127 which is likely to be a non-English character.
The following script should work on Windows XP and later - no need to download anything.
It first creates a file that is >= the length of your file, consisting only of the character "A". Then it uses FC to do a binary comparison and pipes the result to FINDSTR which looks for a value >= 0x80. If one is found, then it returns ERRORLEVEL 1, else it returns ERRORLEVEL 0.
#echo off
call :HasExtendedASCII %1 && (echo English) || echo Not English
exit /b
:HasExtendedASCII
setlocal enableDelayedExpansion
set "tempFile=%temp%\dummyFile%random%.txt"
<nul set /p "=A" >"!tempFile!"
set /a dummySize=1
for /l %%N in (1 1 32) do if !dummySize! lss %~z1 (set /a dummySize*=2 & type "!tempFile!" >>"!tempFile!")
fc /b "!tempFile!" %1|findstr /re " [89ABCDEF][0123456789ABCDEF]" >nul&& set rtn=1 || set rtn=0
del "!tempFile!"
exit /b %rtn%
This is not so easy as the cmd works only over the extended ascii table.
Here is a file that contains the cyrillic alphabet printed with type command:
тхЁЄ·єшюярёфЇуїщъыч№Ўцсэьў∙°■╫▐┘╪▀┬┼╨╥┌╙╚╬╧└╤─╘├╒╔╩╦╟▄╓╞┴═╠ (bulgarian cyrillic- may differs with russian , mongolian and etc...)
unfortunately FINDSTR command does not work well with these.
BUT IF the only specaial characters that these files contains are cyrillic may be there's a chance :-).You can check the cyrillic characters by their HEX codes.There's a certutil command that you can use to encode a file to hex , or dump it to hex.Not win xp native but it can be downloaded from microsoft.com .Here are the hex codes:
ff e2 e5 f0 f2 fa f3 e8 ee ef e0 f1 e4 f4 e3 f5
e9 ea eb e7 fc f6 e6 e1 ed ec f7 f9 f8 fe d7 de
d9 d8 df c2 c5 d0 d2 da d3 c8 ce cf c0 d1 c4 d4
c3 d5 c9 ca cb c7 dc d6 c6 c1 cd cc
and here's the code:
#echo off
certutil -dump my.cirillyc.file | findstr /r ""ff" "e2" "e5" "f0" "f2" "fa" "f3" "e8" "ee" "ef" "e0" "f1" "e4" "f4" "e3" "f5" "e9" "ea" "eb" "e7" "fc" "f6" "e6" "e1" "ed" "ec" "f7" "f9" "f8" "fe" "d7" "de" "d9" "d8" "df" "c2" "c5" "d0" "d2" "da" "d3" "c8" "ce" "cf" "c0" "d1" "c4" "d4" "" "c3" "d5" "c9" "ca" "cb" "c7" "dc" "d6" "c6" "c1" "cd" "cc""
if %errorlevel% EQU 0 (
copy my.cirillyc.file C\mydocs\Contains_Cyrillic\
)
May not work so properly if you file contains some of ╓╞┴═╠... symbols but should be ok in the more cases.To traverse all files in a directory you can surround the this with for /f loop