Search found 1963 matches

by penpen
19 May 2023 11:06
Forum: DOS Batch Forum
Topic: For/in/do question relating to Registry Backup (XP)
Replies: 4
Views: 3145

Re: For/in/do question relating to Registry Backup (XP)

How can I get this above "export" code to work, I cannot see where the error is? My WinXP (not the newest version of WinXP) doesn't support the "/y"-switch. Once removed, it seem to work fine. What would I use in terms of code to "Import" or to restore the resultant backed up registry? The opposite...
by penpen
03 May 2023 18:30
Forum: DOS Batch Forum
Topic: Notepad bug
Replies: 10
Views: 7506

Re: Notepad bug

At least under win10 notepad by default tries to guess the encoding (using whatever algorithm). In your and jebs example, notepad indeed guesses wrong and assumes UTF16-LE. But opening both explicitely in ANSI-encoding works fine. So i won't call that behaviour a bug, at least under win10, though un...
by penpen
03 May 2023 17:51
Forum: DOS Batch Forum
Topic: Just made batch functions functions Deconcatenate,GetLastElement and GetNthElement
Replies: 2
Views: 3085

Re: Just made batch functions functions Deconcatenate,GetLastElement and GetNthElement

Are there inputs that will make them choke that shouldn't ? I currently don't have much time, so i only done a quick test of typical poison characters "&()[]{}^=;!'+,`~". Work: set "TestVar=HKEY_CURRENT_USER/EUDC/666/myteststring" set "TestVar=HKEY_CURRENT_USER(EUDC/666/myteststring" set "TestVar=H...
by penpen
30 Apr 2023 19:36
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

I found an error, which was shifting the wrong value: ::buggy set /a "%4.index1=(%4.b1<<2) + (%4.g1<<1) + (%4.r1), %4.r1=(%4.r1+(%4.isDarkGray<<1))<<6, %4.g1=(%4.g1+(%4.isDarkGray<<1))<<6, %4.b1=(%4.b1+(%4.isDarkGray<<1))<<6" ::bugfixed: set /a "%4.index1=(%4.b1<<2) + (%4.g1<<1) + (%4.r1), %4.r1=((%...
by penpen
29 Apr 2023 17:01
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

I'm not sure which values i should see as an error, so i don't know what to search for. Maybe you could give me the pixel(s), the error(s) and what you would like to see instead (i changed the main loop, so you could mark that pixel with a red X): set /A "pixel.x=0, pixel.y=0, image.width=102" set "...
by penpen
28 Apr 2023 15:46
Forum: DOS Batch Forum
Topic: Batch file deletion
Replies: 2
Views: 2569

Re: Batch file deletion

Ad hoc i can't see a statement or command that XP would not support, or use differently than the newer versions. The only potential risks of incompatability i see are: - The usage of the localization dependend variables "date" and "time" (so it could happen on all windows versions). - External execu...
by penpen
28 Apr 2023 15:19
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

But wouldn't it have been better to average the three colors i.e. (R + G + B) /3 ? The idea behind RGB is, that components agree on the color produced. It doesn't match how humans experience color, though the result is somewhat acceptable. Would "L" be the brightness/lightness? English is not my mo...
by penpen
27 Apr 2023 17:20
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

Can you explain what you did here? :: set /a "%4.MIN3=-((%22-%11)>>32)*(-((%33-%22)>>32)*%3 - ((%22-%33)>>32)*%2) - ((%11-%22)>>32)*(-((%33-%11)>>32)*%3 - ((%11-%33)>>32)*%1)" :: set /a "%4.MAX3=-((%22-%11)>>32)*(-((%33-%11)>>32)*%1 - ((%11-%33)>>32)*%3) - ((%11-%22)>>32)*(-((%33-%22)>>32)*%2 - ((%...
by penpen
26 Apr 2023 07:51
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

As said above, i assumed linear distances of the colors in RGB-space: The main advantage is, it is easy to compute, because color distances are just euclidean distances over the coordinates of the RGB colors. The main issue is, that human perception of color is everything but linear. Typically that ...
by penpen
25 Apr 2023 18:19
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

I've replaced the grayscale algorithm, the (unoptimized - but hopefully bug-free) result is the following mapping function: :toColorTable R G B return var :: part 1 (sloppy is sufficient) set /a "%4.r1= -(-(%1>>6)>>2), %4.g1= -(-(%2>>6)>>2), %4.b1= -(-(%3>>6)>>2), %4.isDarkGray=%4.r1*%4.g1*%4.b1" se...
by penpen
24 Apr 2023 18:03
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

Ok, i somehow missed the fact, that the difference between 0 and 95 isn't 40... :oops: . Your solution already finds the best color match; however this is my try: :: color function style set /A "%4=(((%1)-35)/40+((%1-48)>>8)-((%1-74)>>8))*36 + (((%2)-35)/40+((%2-48)>>8)-((%2-74)>>8))*6 + (((%3)-35)/...
by penpen
23 Apr 2023 12:45
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

I'm not sure what you mean, the above computations should return an index (i) for the indexed color (r_i, g_i, b_i) with the minimal error to the given color value (r, g, b) - at least for any system, that uses the above colour table predefined by Microsoft: - The formular for (2) should return the ...
by penpen
23 Apr 2023 05:54
Forum: DOS Batch Forum
Topic: 256 colors in virtual terminal escape sequence
Replies: 41
Views: 41193

Re: 256 colors in virtual terminal escape sequence

The color map (at least on my pc) is piecewise linear. 1) Indices 0x00 - 0x0F contain the most non-linear part: ( 0, 0, 0), (128, 0, 0), ( 0, 128, 0), (128, 128, 0), ( 0, 0, 128), (128, 0, 128), ( 0, 128, 128), (192, 192, 192), (128, 128, 128), (255, 0, 0), ( 0, 255, 0), (255, 255, 0), ( 0, 0, 255),...
by penpen
03 Apr 2023 16:39
Forum: DOS Batch Forum
Topic: Batch multiple UP calls from Main Batch not works!?
Replies: 4
Views: 2714

Re: Batch multiple UP calls from Main Batch not works!?

I assume the error is caused by using the wrong environment variable named "Aufruf:" instead of "Aufruf", like you did in "Linie2.bat":

Code: Select all

:: Linie2.bat
set /p Aufruf="Aufruf:"
:: versus
set /p Aufruf:="Aufruf:"

penpen
by penpen
03 Apr 2023 16:13
Forum: DOS Batch Forum
Topic: Parallax background, and overlapping images properly
Replies: 14
Views: 15955

Re: Parallax background, and overlapping images properly

If i remember correct, then you can find those in the Templates for Parallax zip-file IcarusLives linked somewhere above, but under a diffferent name:
- "template1.ppm" is "cloud1.ppm"
- "template2.ppm" is "mountain1.ppm"
- "template3.ppm"should contain another mountain version.


penpen