|
I've been very entertained by this:
For those of you that aren't halfway in the ground yet (you kids will all die in The Water Wars) the EGA Graphics Adapter was a circa 1987 display adapter for PCs with a 16-color palette selectable from 64 possible colors.
My graphics library allows you to deal with input and output data in any pixel format you want, even EGA.
I've been rendering SVGs to EGA as a sort of anachronistic attempt at avoiding responsibility and it is very gratifying somehow. Makes me want to listen to some Bengals or something.
AMD Ryzen Logo 32-bit color[^]
AMD Ryzen Logo EGA 4-bit palette[^]
Tiger 32-bit color[^]
Tiger EGA 4-bit palette[^]
What's surprising is how faithfully it represents the images even though I'm not adjusting the palette from the default 16 colors (EGA has 64, which i can use)
It's so easy to to mess with EGA
I've got this mess:
using pal_t = ega_palette<rgba_pixel<32>,false>;
pal_t pal;
using pixel_t = typename pal_t::pixel_type;
I can add any pixel format I like. So I've just been fiddling, which I guess is the downside of making my code so almost hopelessly flexible.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Every time I go to get a haircut (which is rare) I think about getting my mullet back. But I get talked down from that ledge.
|
|
|
|
|
So I need to replace an old file import.
The file is simple, it looks like:
40241018Some comment 123... Where the first two characters is some ID, the next two is the year, next two month, next two day, next 16 a comment, next three a price, etc...
That's not the exact file, but you get the idea, fixed width fields.
Nothing fancy and usually very easy to read.
Now the database has the following columns.
ID BIGINT
DATE CHAR(8)
STATUS CHAR(1)
FIELD01 CHAR(2)
FIELD02 CHAR(2)
FIELD03 CHAR(2)
FIELD04 CHAR(2)
FIELD05 CHAR(16)
FIELD06 CHAR(3)
...
Now let's just ignore all the uppercases, CHAR data types and the CHAR(8) for date...
Naming the fields FIELDXX is a pain because now you'll never know what the data represents, but this may have been done for "flexibility"???
The real horror is the code.
It gets the table structure of the database, skips the first three fields (because they're not part of the import), reads the length of the next field, takes that many chars and places it in the table
That means if you change the field length or even field order in the database your import will fail.
Also, if the file changes in even the slightest way you'll have to change your database schema.
This was probably the hardest way to make this work and for sure the most tightly coupled
Why do people do this?
|
|
|
|
|
They do it because if work were easy it wouldn't be work, would it?
*hides*
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I would also obfuscate my data import like this to prevent from illegal use
|
|
|
|
|
I just discovered that VsDevCmd.bat turns echo off!
|
|
|
|
|
I remember there was this email client (in a text mode terminal) that didn't mask passwords. I have no recollection what it was called, this was about a century ago. People used to cover the screen with one hand to hide it as they typed. Everyone thought it hilarious, but this would've come in handy at the time.
|
|
|
|
|
I've used ECHO OFF in many a batch file during my DOS days.
Not only that, @ECHO OFF would also suppress the ECHO OFF command itself. It kept the output very clean...but ultimately (and this is probably what you're getting at) it doesn't belong in environments where you're debugging and want to see the output of everything.
But once I got my batch files going, they would all start that way. I don't know why I was so obsessed with keeping the output to a minimum. Probably because I wrote batch files to automate things for non-technical people, and seeing anything at all would cause panic among them.
I don't miss batch files. Despite its idiocratic syntax sins, I still like PowerShell.
|
|
|
|
|
Yes, and if a batch file turns off echo it should turn it the back on again at the end.
|
|
|
|
|
n00bs: Copy & paste using your mouse
Average users: Ctrl + C & Ctrl + V
Pros: Ctrl + C C C C C C & Ctrl + V
I just found this and it's funny because it's true.
The few times I don't spam C is the times I have to go back and do it again
|
|
|
|
|
Sometimes Pros: Ctrl + C instead of Ctrl + V
Very confident that they're pressing Ctrl + V.
|
|
|
|
|
This happens to me all the time, and then I curse the person that decided copy and paste shortcuts needed to be right next to each other.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Ugh, hate it when that happens.
That means you've got to go all the way back to whatever it was you were Cing
|
|
|
|
|
Does anyone remember Ctrl+Insert and Ctrl+Delete and Ctrl+Shift+Insert ? I came very late to the usage of Ctrl+X/C/V.
|
|
|
|
|
I have the same experience.
For a while there were many places that CTRL+C CTRL+V didn't work.
Linux terminal, for example still doesn't like CTRL+V paste.
However, CTRL+INSERT SHIFT+INSERT work there with no problem.
|
|
|
|
|
Long before CTRL+C/CTRL+V were used for cut/paste, Unix terminals were using CTRL+C to send SIGINT and CTRL+V was being used as "quote next char" (e.g. CTRL+C CTRL+C would add a char(0x03) to the input stream. Both gnome-terminal and QT Konsole support CTRL+SHIFT+C/CTRL+SHIFT+V to cut/paste, though.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
I use those all the time.
|
|
|
|
|
Yes; they still work, along with shift-delete for cut (instead of Ctrl-X).
|
|
|
|
|
I probably learned those combos before Ctrl-X/C/V and forgot all about them.
One habit I can't break out of (and should) is that I hold down the Shift key when deleting files from Explorer so they immediately get deleted, as opposed to being sent to the recycle bin.
And I regret the habit. It's extremely rare, but there have been a few occasions where I wished I could've just gone to the recycle bin to undo the delete. And no, Ctrl-Z can't undo a permanent file delete that was done with Shift-Del.
Fortunately I tend to have backups.
|
|
|
|
|
dandy72 wrote: And I regret the habit.
Ah, then I am not the only one.
|
|
|
|
|
Coming from DOS -> Win3.1 -> 95, I hated having stuff sent to the recycle bin, since whenever I saw the icon with papers in it, I had to obsessively follow up with the command to empty it. Every. Single. Time.
The instant I realized Shift bypassed the recycle bin, I immediately started using it.
Thanks, Windows 95. Can you believe that was nearly 30 years ago already?
|
|
|
|
|
I simply disable the "recycle bin". First thing with a new Windows install. Done.
I also hide the desktop icons so I never have to see the stupid thing.
|
|
|
|
|
OMG, I seriously thought I was the only one who took the habit of hitting Ctrl-C twice because every once in a while my first attempt seemed to get dropped...
|
|
|
|
|
Twice? Those are rookie numbers
|
|
|
|
|
I do not CTRL+C, I do CTRL+X and CTRL+V just behind + CTRL+V where I have to.
With CTRL+X you see that it worked before pasting.
I.E. here when I report spammers, if there are several, I open all in new tabs, and go:
CTRL+X, Shift+TAB, CTRL+V, SHIFT+TAB, CTRL+F4, F6, CTRL+X...
When I used CTRL+C before I always had issues, since I use CTRL+X I clearly see if the adress bar gets empty or not.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|