diff

Why does php datetime diff depend on time zones?

六月ゝ 毕业季﹏ 提交于 2019-11-28 08:05:03
问题 See the following code: function printDiff($tz) { $d1 = new DateTime("2015-06-01", new DateTimeZone($tz)); $d2 = new DateTime("2015-07-01", new DateTimeZone($tz)); $diff = $d1->diff($d2); print($diff->format("Year: %Y Month: %M Day: %D"). PHP_EOL); } printDiff("UTC"); printDiff("Australia/Melbourne"); The result is: Year: 00 Month: 01 Day: 00 Year: 00 Month: 00 Day: 30 Questions: How can the difference between the same day of two adjacent months (1st of June and July) be different than 1

syntax aware diff tools? [closed]

自作多情 提交于 2019-11-28 07:29:41
Are there any (ideally GUI) diff tools that are aware of syntax? As an example of the kind of thing I'm looking for, I keep finding that my current tool miss aligns repetitive code: Foo = { 'hello': 'world', | Foo = { 'hello': 'world', 'goodnight': 'moon' | 'goodnight': 'moon' } < < Bar = { 'picture': 1000, < } | } I'd like a tool that would try and make matching braces on one side align with matching braces on the other. Edit: I'm looking for a tool that can automatically spot that condition and correct it's alignment. Not GUI based, but completely syntax driven: my company's Smart

How do I integrate Beyond Compare with ClearCase?

对着背影说爱祢 提交于 2019-11-28 06:52:23
I would like to integrate Beyond Compare with ClearCase so that I can use it for diffing and merging files, instead of the awful tools provided by ClearCase. Does anyone have instructions for performing this integration? VonC As mentioned in my previous answer , just modify the map file located in: # up to ClearCase 7.0 c:\program files\rational\ClearCase\lib\mgrs or # ClearCase 7.1 and more c:\program files\IBM\RationalSDLC\ClearCase\lib\mgrs Each map line has 3 parts: the CC filetype, the CC action, and the application. In your case, find the section in the map file for text_file_delta file

How to set patience as default git diff algorithm

て烟熏妆下的殇ゞ 提交于 2019-11-28 06:42:42
In .git/config I tried: [diff] patience = true But no luck Do I have to do: git diff --patience git show --patience HEAD etc., every time? Since Git 1.8.2 , Git will use diff.algorithm : git config --global diff.algorithm patience It took a few iterations: [PATCH v3 0/3] Rework git-diff algorithm selection [PATCH v2 0/3] Rework git-diff algorithm selection [PATCH 0/3] Rework git-diff algorithm selection [PATCH] diff: Introduce diff.algorithm variable . [PATCH] config: Introduce --patience config variable In lieu of a config-based answer, you could set an alias in your .gitconfig like so:

Show git diff, ignoring file permission changes?

邮差的信 提交于 2019-11-28 06:17:25
I have run several chmod in my live server. Right now when I do a git diff there, I see lots of old mode 100644 new mode 100755 I have also changed some files there. But I would just git diff just to show the changes on the files, ignoring the file permissions changes. How can I do that? BTW, I don't want GIT to ignore those file permissions changes. Actually I want to commit them, I just want git diff to not show them for a very specific moment. This will tell git to ignore permissions: git config core.filemode false to filter them in result of diff but not ignore them git filter-branch -f -

Java library for free-text diff [closed]

冷暖自知 提交于 2019-11-28 05:58:38
I need to match up two almost-the-same long freetext strings; i.e., to find index-to-index correspondences wherever possible. Because this is freetext, the comparison should not be line-based as in code diffing. Any suggestions for Java libraries? A simple example (In real life , of course, there would not be extra whitespace to line things up, and there may be more complex challenges like entire clauses moved around.) The quick brown fox jumped over the lazy dog. |||||||||| ||||||||||||||||||||| ||||| The quick yellow fox jumped over the well-bred dog. Joshua Fox This one might be good Diff

Diff between two dataframes in pandas

我只是一个虾纸丫 提交于 2019-11-28 05:52:47
问题 I have two dataframes both of which have the same basic schema. (4 date fields, a couple of string fields, and 4-5 float fields). Call them df1 and df2 . What I want to do is basically get a "diff" of the two - where I get back all rows that are not shared between the two dataframes (not in the set intersection). Note, the two dataframes need not be the same length. I tried using pandas.merge(how='outer') but I was not sure what column to pass in as the 'key' as there really isn't one and the

How to read .rej files, i.e

两盒软妹~` 提交于 2019-11-28 05:51:46
I'm having trouble applying a patch to my source tree, and it's not the usual -p stripping problem. patch is able to find the file to patch. Specifically, my question is how to read / interpret the .rej files patch creates when it fails on a few hunks. Most discussions of patch / diff I have seen don't include this. Bodo Thiesen A simple example: $ echo -e "line 1\nline 2\nline 3" > a $ sed -e 's/2/b/' <a >b $ sed -e 's/2/c/' <a >c $ diff a b > ab.diff $ patch c < ab.diff $ cat c.rej *************** *** 2 - line 2 --- 2 ----- + line b As you can see: The old file contains line 2 and the new

How can I diff 2 SQLite files?

血红的双手。 提交于 2019-11-28 04:43:54
Using SQLite-manager (in its XUL form) on a Mac. How can I diff a SQLite file from one submitted by someone else on the team, and incorporate his changes? Thanks. I believe you could use the following, in combination: $ diff sqlite-file-1.sql sqlite-file-2.sql > sqlite-patch.diff $ patch -p0 sqlite-file-1.sql sqlite-patch.diff I hope that works for you. Otherwise, I highly suggest consulting the man-pages: $ man diff $ man patch EDIT: Alright, here's the whole walk-through. First, dump the databases: $ sqlite test1.sql .dump > test1.sql.txt $ sqlite test2.sql .dump > test2.sql.txt Next,

Is there a way to diff files from C++?

谁说我不能喝 提交于 2019-11-28 04:31:44
I'm looking for a C or C++ diff library. I know I can use the Unix diff tool in combination with system or exec , but I really want a library. It would be handy if the library could perform patches as well, like the Unix patch tool. Matt Fichman I think I've found a good solution, finally: The DTL - Diff Template Library --- Tutorial It supports patch. I had to type "diff.cpp" into Google to find it. Hopefully it works! It seems like the Google Diff, Match and Patch libraries are what you need. This is an implementation of a "solution to SES/LCS with the Hirschberg linear space refinement as