MacBook, defective by design banner

title:
Put the knife down and take a green herb, dude.


descrip:

One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com

Using 89% of the same design the blog had in 2001.

FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white.

As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green.

x

MarkUpDown is the best Markdown editor for professionals on Windows 10.

It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support.

Features you won't find anywhere else include...

You've wasted more than $15 of your time looking for a great Markdown editor.

Stop looking. MarkUpDown is the app you're looking for.

Learn more or head over to the 'Store now!

Friday, June 21, 2019

I know, I know, TextWrangler isnโ€™t supported any more and Iโ€™ll have to swap to BBEdit in 10.15.
This is still cool, though. Itโ€™s a built-in diff tool! I use WinMerge when I need to compare two files kinda ad hoc on Windows (kdiff3 for โ€œrealโ€ diffs on macOS and Windows), but didnโ€™t have a similar tool for macOS.

Except I did.

1. Open two documents (in my case, style.css in both the original and modified parent theme) that youโ€™d like to compare
2. Click View > Show Files or type CMD + 0. This will open a sidebar with all opened documents.
3. Highlight the 2 files you want to compare in the Documents drawer, right click on them and select the option โ€˜Compareโ€˜.

Labels: , , , , ,


posted by ruffin at 6/21/2019 12:24:00 PM
Tuesday, August 15, 2017

Ran into this question about diffing blocks of text on StackOverflow yesterday after KDiff3 and WinMerge both went crazy trying to diff a file where I'd simply mostly just grouped and, therefore, rearranged lots of methods. Seems like an easy issue, but as that question points out...

Is there a diff-like algorithm that handles moving block of lines? - Stack Overflow:

But it falls down when blocks of text are moved within the file.

Suppose you have the following two files, a.txt and b.txt (imagine that they're both hundreds of lines long rather than just 6):

a.txt   b.txt
-----   -----
1       4
2       5
3       6
4       1
5       2
6       3

diff a.txt b.txt shows this:

$ diff a.txt b.txt 
1,3d0
< 1
< 2
< 3
6a4,6
> 1
> 2
> 3

That really is painful, when it should be a reasonably easy process.

Now I've tried to write my own diff engine before in my usual bullheaded, straight-ahead style, not worrying about efficiency until after something's working. It's not easy. But what you can say is that if you take it as your primary mission to find block movements, it's a lot easier. Enter wikEd diff Online Tool - Cacycle, "The Only JavaScript Diff Library for Visual Inline Text Comparisons With Block Move Highlighting and Character/Word-Based Resolution".

Results are pretty good, both for the simplest case from the SO question, to real-world code.

wikEd example using example from SO question

(The green highlight is for grouping a block, but by default it ignores/doesn't highlight any moved blocks, which is nice when you're diffing code like I mentioned before...)

Now I have to resist the desire to put this into a full-fledged UWP app whose goal is to be a diff tool. There are smarter things to write on my own time. Please realize this, self.

Labels: , ,


posted by ruffin at 8/15/2017 10:02:00 AM
Monday, December 10, 2012

Chapter๏ฟฝ5.๏ฟฝQuestions and Answers:
5.2. Why did I release it under GPL?

I'm using GPL programs for a very long time now and learned very much by having a look at many of the sources. Hence this is my "Thank You" to all programmers that also did so or will do the same.

Man, tell you what, kdiff3 is good.  I'd started using it at the end of my last job with git, and have been using it a few days now with TFS and Visual Studio.  I'm nearly hooked.

The only squabble I have is that I can't figure out how to manually make edits during a 3-way merge without hitting ctrl-v first.  But if I ctrl-v anything, even an empty string, I can start typing.

I think I followed these instructions to set kdiff3 up with TFS & Visual Studio.  I've got issues with the interface in three-way merge tools in general, but if you ignore that for now, kdiff3 is perfect.  And F/free too.

Labels: , , ,


posted by ruffin at 12/10/2012 12:49:00 PM
Wednesday, August 01, 2012

This python script is awesome.

I wanted to be able to line up several versions of the same file line by line through time to see what had changed from one version to the next commit... and the commit after that, and the commit after... Those kinds of changes are hard to eyeball with the standard git log -p, which just spits it all out like it's on a giant roll of dot matrix printer paper.

This python script calls git and displays the last N number of revisions in vimdiff... which is awesome. Admittedly it's all command-line stuff, though you could change to make it gvim if you wanted, I'd imagine, and it's stuck in vim, whose diff is a little, well, stodgy, but all in all, a perfect fix to a bothersome problem.

There's some room to improve, (I added...

if N > 4:
COMMAND = 'vim -O'

... already, and will probably add a --range option to let you pick the 3rd through 7th versions of a file, eg)

but this is a great tool for visualizing files stored in git.

Labels: , ,


posted by ruffin at 8/01/2012 11:01:00 AM
Monday, March 12, 2012

I've been trying to set up git on Windows.  It's a pain for me for some reason.  Lots of stuff not there by default (I'm using the MINGW32 hosted version) that does seem to be in the Mac package.

Now I just have to figure out how to link to git difftool.  /sigh

Core Dump: Quick and Dirty : Vimdiff Tutorial:
Keyboard Shortcuts:

do - Get changes from other window into the current window.

dp - Put the changes from current window into the other window.

]c - Jump to the next change.

[c - Jump to the previous change.

Ctrl W+ Ctrl W - Switch to the other split window.

Labels: , ,


posted by ruffin at 3/12/2012 09:43:00 AM

<< Older | Newer >>


Support freedom
All posts can be accessed here:


Just the last year o' posts:

URLs I want to remember:
* Atari 2600 programming on your Mac
* joel on software (tip pt)
* Professional links: resume, github, paltry StackOverflow * Regular Expression Introduction (copy)
* The hex editor whose name I forget
* JSONLint to pretty-ify JSON
* Using CommonDialog in VB 6 * Free zip utils
* git repo mapped drive setup * Regex Tester
* Read the bits about the zone * Find column in sql server db by name
* Giant ASCII Textifier in Stick Figures (in Ivrit) * Quick intro to Javascript
* Don't [over-]sweat "micro-optimization" * Parsing str's in VB6
* .ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture); (src) * Break on a Lenovo T430: Fn+Alt+B
email if ya gotta, RSS if ya wanna RSS, (?_?), ยข, & ? if you're keypadless


Powered by Blogger etree.org Curmudgeon Gamer badge
The postings on this site are [usually] my own and do not necessarily reflect the views of any employer, past or present, or other entity.