269 points · by kencausey · 4y ago · 166 comments
Any process you ever enable in code will be pushed to limits you never dreamed possible. This is exactly where discoverability can come into play - someone starts by copying 50 rows and using that to get their job done, and may never realize there are other ways (CSV export, etc).
If code can "recognize" when something like this is being done and provide documentation on other ways, it can help people learn new methods.
Now I'm imaging Clippy popping up when you copy a ludicrous amount of data to the clipboard. "You appear to be using a cludgy method, may I suggest something better?"
Of course, I'm guilty of things like this. I have one excel macro that splits data from a giant stream* (one monolithic CSV, actually) into discrete units, graphs them, and then sorts the graphs for printing. It makes a lot of use of the clipboard, and god help you if you try to copy/paste something while the macro is running.
*Giant enough that at one point it grew to where I overran my Int and had to upgrade some of the code to Longs :V
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Dim intRetval As Integer
' TODO maybe respect some of the properties on Assistant to let the user disable this
If InStr(Target.Formula, "VLOOKUP") = 0 Then
Exit Sub
End If
' TODO is one use really "excessive"?
Assistant.Visible = True
With Assistant.NewBalloon
' TODO I should probably do ".Mode = msoModeModeless" but I don't feel like writing a callback
.Text = "It looks like you're trying to implement a relational database in a spreadsheet."
.Labels(1).Text = "Get professional help"
.Labels(2).Text = "Just let me generate excessive technical debt without help"
.CheckBoxes(1).Text = "Don't show me this tip again"
.Button = msoButtonSetNone
.Animation = msoAnimationGetAttentionMinor
intRetval = .Show
' TODO make the user's choices actually do something
End With
End Sub
You'll need to load Office 97 or some other ancient version in a VM if you want to actually try this, since Microsoft finally killed off Clippit completely in Office 2007.One day, I asked him what it was and he showed me. He was running a series of excel macros that took over 96 hours to run, and fed a critical business process that was worth a few million dollars.
I sat down and took a look at it, and in about 3 days implemented a prototype in SQLite and a small Perl script that ran in about 8 minutes. Basically, it was a series of sql joins and some regex. My colleague, a project manager, literally hugged me and was near tears.
Some devs later took that prototype and refactored it to run on a normal production platform.
checks latest
64mb spreadsheet that amounts to one gigantic, ever slower pivot table.
I feel called out. Maximum number of rows in a VLOOKUP in personal spreadsheet is like an array of 2x1000. In an earlier job, it was 13x39000. Excel automatically increases the range when you add rows in the middle. Then I split my data per year, & it was like 13x5000.
Copy/paste works flawlessly through the VDI into the putty session, so I usually just uuencode my blob, and copy it to destination cluster and uudecode there, instead of uploading the file to the VDI, then pscp to the bastion host, and then scp to the destination cluster. (I know of zmodem, port forwarding and such, none of this is allowed...)
might i introduce you to sed and awk?
Honest question though, as I have no experience with utilities like that: Could those tools together manipulate e.g. the data on the left to the graphs on the right?
I disagree with sibling comments that copy/paste is a hacky solution. It's a very natural one for lots of users and there's no actual fundamental reason not to be able to accommodate it.
This is a "Microsoft refuses to make composable software" problem.
There was a long discussion on memory management before they just stuck a max size on it.
This can get annoying though if the user is deliberately doing something that ends up triggering these messages.
Not me. And that’s not a brag. It is probably not a productive way to think using modern toolsets. But in my world, if you can copy a few things, you should definitely expect someone to copy a shitload of things or at the very least, document clearly and with rich error messages what went wrong.
Likewise, I tend to get nervous when I can’t explicitly handle out of memory conditions, and the problem is I’m a Go programmer. It kind of bothers me that there’s no standard way to deal with that on my end with built-in data structures such as maps and strings. This is probably sheer paranoia because most modern systems have plenty of memory… But it still leaves me uneasy.
Aha, so that's why Word[1] just explicitly asked me if I want to save the current copied image before quitting. It's probably asking before loading something big into memory?.
it has nothing to do with clearing memory.. clearing memory for anticipated use isn't really a thing ever since virtual memory became a thing. (memory isn't prepared for use until after an application actually tries to use it.)
Thanks Raymond! I decided to go the startup route instead of returning to MSFT, but you were an inspiration all the same.
I can take a screenshot of my Firefox with "PrtScn" button (moving a bitmap of the page into the Clipboard), paste it into Microsoft Paint, edit it a bit, and then copy/paste that into my Discord chat screen for commentary.
--------
Yes, Linux / *Nix users have pipes and great text processing tools. Yes, Powershell has interesting objects that can be passed round. But practically speaking? Most of my "inter-process communications" is over this silly "Clipboard" Windows has, and it works way better than it probably should.
We use this so users can attach invoices and other documents they've received through mail to orders in our application. Users typically run Outlook on their laptop/PC, but our application as a published application.
We rely on Excel exposing the data in an XML format on the clipboard to reliably import data from Excel. Same for Open/LibreOffice. Without it it's impossible to handle cells which contain both the quote character and newlines, due to the way Excel formats plaintext.
We don't want to import the whole file, because the users typically only need to import parts of the spreadsheet. This saves us from writing a complex UI to select the data to import.
And FWIW, I've used that with >100k rows of data.
home PC ->
RDP to work laptop at home ->
VNC to work network ->
RDP to work desktop ->
RDP to other VMs and PCs at work
I can copy text or a file or a screen shot at any level and paste at any other level. Pretty amazing.Insanely well engineered. It can perform miracles of computing. It damn well has to.
> I can take a screenshot of my Firefox with "PrtScn" button (moving a bitmap of the page into the Clipboard), paste it into Microsoft Paint, edit it a bit, and then copy/paste that into my Discord chat screen for commentary.
All without you worrying about supported image formats or color space encodings! It is insane! Copy from Firefox and then paste into a program that expects 16bit color and it'll probably work. The clipboard stores data in so many duplicate formats and can convert between so many formats, it is nuts.
This idea has a lot of legs IMO.
It was one of the easiest-to-use calculators I've ever seen. Just enter your webpage to play the game, Ctrl-A (select-all), Ctrl-C (copy), and bam, the Utopia-program would instantly analyze your kingdom and provide advice.
Just all off of the HTML-copy that Clipboard supports.
------------
Windows developers "know" the clipboard is one of the most important inter-process communication structures of the entire system, and have known for years. Its probably one of the Win32 API's biggest advantages, no joke.
The shear amount of creative solutions I've seen from clipboard manipulations is outstanding.
It turns out, more and more applications are locking the clipboard and holding onto the lock inappropriately. Enough that there's a particular telemetry watcher for this condition for MSFT to get an idea on who the guilty parties are.
Everyone has had it happen - I notice it when colleagues are in a rush and send me something they didn't mean to send (because their clipboard didn't update). I don't know who the guilty parties are (since that telemetry is encrypted, and can't be inspected), but I sure hope someone is knocking down some doors to address the problem.
### Starting Party
#
# Cariel Roame
# - Tome of Light 4
# Xyrella
# - Robes of Purity 2
# Rokara
# - Helm of Inspiration 1
# Murky
# - Time to Krill 3
# Millhouse Manastorm
# - Arcane Powder 1
# Deathwing
# - Heart of Unliving 3
#
CO+cmQQSDlN0YXJ0aW5nIFBhcnR5GAEiRQoJCBIQiwEYICAACgkIExDKARgjIAAKCQgLEIgBGAsgAAoLCLgCEOMCGLIEIAAKCAgOEB8YFCAACgsIqgIQygIYkgQgACgA
#
# To use this deck, copy it to your clipboard and create a new deck in HearthstoneIf it's a regular win32 app, then it has access to all your filesystem (except UAC bits), can read and post keystrokes to other windows, and indeed can just straight up inject code into other processes.
The basic APIs were there from the beginning in Windows 1.0, including multiple clipboard formats, application specific formats, and the ability to register for clipboard changes. More standard formats have been added over the years, but it still supports some ancient formats, like Software Arts' Data Interchange Format.
Way back in the 90s, it was possible to put any (+) document inside any sufficiently aware app or document with OLE ("object linking and embedding")
The (+) indicates that there were a lot of terms and conditions applying to this, but you could actually just put an excel spreadsheet in a word document, and it would run a small copy of excel inside word. This is why the original word save format is so horrendous - it's serialized binary objects.
Cool idea though!
I'm not sure why it would be impressive or unusual. The ability to store arbitrary data on the clipboard with metadata that describes what data it is, such as an image file, or an audio file, is very old.
Except its no where near as smooth or universal as in Windows. In Linux, you have to worry about KDE programs vs GNOME programs having different clipboards, for example.
Its also why compatible suites of programs (ie: Adobe) can be so useful when those custom formats come into play. Adobe can copy/paste layers from Photoshop and send them over to other programs. If the photoshop layer isn't understood, it seems to become a Bitmap, which works when I'm on a VBulletin forum over in Firefox land.
---------
Copy/paste works on files / file-managers, images, text, HTML. Yes, any OS could do the same thing, but they largely don't in my experience.
I am no sure where you get this idea. The clipboard is an X11 shared resource and any program taking control of it removes what any other had on it before.
> Its also why compatible suites of programs (ie: Adobe) can be so useful when those custom formats come into play. Adobe can copy/paste layers from Photoshop and send them over to other programs. If the photoshop layer isn't understood, it seems to become a Bitmap, which works when I'm on a VBulletin forum over in Firefox land.
The same exists on X11, programs can define custom metadata and define a hierarchy of different metadata and associated data on the clipboard and any application can decide for itself which formats it understands and which it does not.
I've personally built software that puts images on clipboards, and falls back with uris to that image if direct images not be supported by whatever reads it.
I don't worry about this on linux because it's not the case.
I suppose if I were on windows I would have to worry about legacy programs that only understand UCS-2 not being able to talk to modern programs that only understand UTF-8.
>Its also why compatible suites of programs (ie: Adobe) can be so useful when those custom formats come into play. Adobe can copy/paste layers from Photoshop and send them over to other programs. If the photoshop layer isn't understood, it seems to become a Bitmap, which works when I'm on a VBulletin forum over in Firefox land.
I'm able to paste images from GIMP, Krita, and Thunar into forums just fine.
Selecting text and middle clicking is so much faster than ctrl+c, ctrl+v. Having the two separate, allows you to essentially copy two separate things at once, and paste them separately, which is great for filling out forms.
Also, KDE provides an absolute gem of a clipboard manager, which stores all recent copies in to a list, from which entries can be browsed in order to recopy some text that you may have copied a while ago. IDK where you got the idea that Gnome apps have a different clipboard, as I have never experienced that. Maybe that is an old thing? Definitely not how it is now, thats for sure.
Copy/paste works on files / file-managers, images, text and HTML. This is not a Windows only experience. In fact, the clipboard manager even has little file icons, and image previews, for copied objects.
But even if old, it's still notable that such an old concept/technology works so well, and there are few newer inter-process communication methods that work as reliably or with as good UX!
Who invented the "clipboard", Xerox PARC? No, wikipedia just credits two individuals, Pentti Kanerva and Larry Tesler .
For example, copying from Excel can output:
- to a table (when copied into word)
- to rich text when copied into Wordpad
- to plain text when copied into Notepad
- and even an image when copied into Paint.
All without having to select the desired type at the source.
Another under-appreciated Windows feature is how they implement drag-and-drop apps. When you drag a file into an app icon, it just stuffs the file path into the command line arguments and runs the app. In contrast, though MacOS introduced drag-and-drop, actually implementing it in System 7 was a huge complex chore.
It does instant rectangular selection, then pops up a simple editor which you can then copy/paste anywhere you'd like.
I have Win+Shift+S bound to a mouse chord, as well as copy and paste, so I can actually paste an arbitrary rectangle of my screen without touching the keyboard.
If I used arch or some other power user linux, I suspect I would have to jump through quite a few hoops to get this experience setup as nicely. But as someone who daily drives both a linux distribution and a windows distribution, I see no notable differences in clipboard functionality.
Something similar is available in the more modern Windows 'snipping tool' feature (win-shift-s) but without the tablet magic.
https://devblogs.microsoft.com/oldnewthing/20220609-00/?p=10...
That, somehow, seems like the wrong conclusion. Why not try to solve the problem of Excel taking longer than 30 seconds to export a RTF table?
Thankfully, that can't happen :). XLSX has a row limit of 1,048,576 rows.
In all seriousness, I don't have an answer for you other than that the developer that's looking to shove >1M excel rows around should find a better solution than the clipboard. I've done more than my fair share of work pushing excel spreadsheets around (and I've even worked on Excel add-ins). There are plenty of performant ways of accessing large volumes of Excel data, none of them involve the clipboard. Most of them even work on non-Windows platforms.
The arbitrary row & column limits in Excel (XLS was pretty small, XLSX is quite a bit bigger, but still arbitrary) are annoying and I cannot begin to tell you how many hours over the years I've wasted due to this limitation or Excel silently truncating large CSV files on import.
As a tech user, you quickly learn to fall in love with "paste as raw text", which skips all that and just give you text data.
'6K rows, 300ms to insert into page on paper (console.time(1); console.timeEnd(1)), but in reality browser freezes for 3 seconds (1.8s style, 900ms layout, 300ms update tree). Freezing goes away with position: absolute, but it still takes 3 seconds to show up after .appendChild. I tried replacing Table with Flex divs, even worse speed.'
I imagine I could make Chrome hang for more than 30 seconds with plain old HTML Tables :)
I guess I'm impatient... how does one go about this?
wild.