[ / / / / / / / / / / / / / ] [ dir / agatha2 / animu / general / komica / mde / randamu / vg / vichan ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): ea6848d3e3ad866⋯.jpg (402.1 KB, 1920x1074, 320:179, 566d75ab57d81028b728c24847….jpg) (h) (u)

[–]

 No.989871>>990146 >>990235 >>990702 [Watch Thread][Show All Posts]

>professor sends out code template for a project

>^M characters at the end of every line

what in absolute FUCK

 No.989881>>989904 >>990158 >>990213

If you are too retarded to use dos2unix, you should drop out now.


 No.989904

>>989881

This. OP is approaching levels of irony that shouldn't even be possible.


 No.989958

Larper detected


 No.990060

maybe he's angry that the prof uses an inferior os and inferior line endings?


 No.990141>>990146 >>990152 >>990276

Your problem is with ASCII itself. CRLF is the correct ASCII line ending because LF only advances the line and CR only returns to the beginning of the line. Just CR would overwrite characters on the same line and just LF would keep the same horizontal position.

VMS has STREAM (CRLF ending), STREAM_CR (CR ending), STREAM_LF (LF ending), and VARIABLE (two-byte length prefix) types of text files so this wouldn't even be a problem on VMS. UNIX doesn't even have a concept of text files, just sequences of bytes.

https://tools.ietf.org/html/rfc854

         NAME                  CODE         MEANING

NULL (NUL) 0 No Operation
Line Feed (LF) 10 Moves the printer to the
next print line, keeping the
same horizontal position.
Carriage Return (CR) 13 Moves the printer to the left
margin of the current line.

UNIX "translates" it's special line endings to the real CRLF control characters. If you display UNIX "text" on a real terminal or "raw" settings, the next line will begin in the same column as the previous line because that's how the ASCII control characters are defined.

$ stty raw; printf "\r\nAT&T sucks\rUNIX\n but VMS doesn't\r\n"

UNIX sucks
but VMS doesn't

>In another article WD writes:
>|> [of VMS]
>|> I sure hope so. Any o/s which puts file types in the o/s
>|> instead of the program is really creating problems for the
>|> user, and I find that more of a problem than the user
>|> interface. If programs really want a "$ delimited left
>|> handed nybble swapped hexadecimal" file type, let it be
>|> done in the program or shared library, and not at a level
>|> when all user-written file transfer and backup programs
>|> have to deal with it. As my youngest says "yucky-poo!"

Huh? Let's think about this.

Tighter integration of file types to the OS are not a
problem. In my experience, UNIX offers the weakest file
maintenance offerings in the industry, save for MS-DOS. In
using Tandem Guardian and VMS I've found that ultimately,
one could:

* Back up files.

* Transfer files.

* Convert files.

...much more easily and safely than with UNIX. Yes, it was
between Guardian or VMS systems but instead of going into an
"open systems" (whatever THOSE are) snit, read on.

As a result:

* Each RDBMS has its own backup and restore facility of
varying functionality, quality, and effectiveness,
complicating support for sites adopting more than one
RDBMS.

* All existing UNIX backup and restore facilities are highly
dysfunctional compared to similar facilities under the
aforementioned operating systems. They can make only the
grossest assumptions about file contents (back it up or
not, bud?) and thus cause vast redundancy in backups; if
you change a single byte in the file, you back up the
whole thing instead of changed records.

* Transferring files from system to system under UNIX
requires that all layers of functionality be present on
both sides to interpret files of arbitrary form and
content. Embedded file systems ensure that file transfer
is enhanced because the interpretation and manipulation
facilities will be there even if the highest layers
aren't (ie: you can at least decompose the file). Find
me one person who guarantees they can decompose an Oracle
or Ingres file (ie: someone who has a product that will
always do it and guarantees it'll work for all successive
releases of these packages).

Once one strips away the cryptology, the issue is control.
UNIX is an operating system that offers the promise of
ultimate user control (ie: no OS engineer's going to take
<feature> away from ME!), which was a good thing in its
infancy, less good now, where the idiom has caused huge
redundancies between software packages. How many B*Tree
packages do we NEED? I think that I learned factoring in
high school; and that certain file idioms are agreed to in
the industry as Good Ideas. So why not support certain
common denominators in the OS?

Just because you CAN do something in user programs does not
mean it's a terribly good idea to enforce it as policy. If
society ran the same way UNIX does, everyone who owned a car
would be forced to refine their own gasoline from barrels of
crude...


 No.990146>>990213

>>990141

>UNIX sucks

Just fuck off. Everyone knows you're one person even if you pretend otherwise.

The LF linebreak is the most practical one, even on Windows.

Text isn't bound to terminals and only needs a one character line break.

If you want to move around in the terminal you should use those fucking ansi escape codes for it.

>>989871 (OP)

OP, learn regex.


 No.990152

>>990141

VMS is only good if you were raised on VMS. DCL is dogshit


 No.990158>>990172

>>989881

If you're retarded enough to use DOS formatted text files you should kys


 No.990160

>needing carriage return in today's world

Honey, it's just LF now.


 No.990172>>990516

File (hide): f713366f32c6d92⋯.jpg (825.15 KB, 1111x1554, 1111:1554, 88928b4effb9d81d3687fec26b….jpg) (h) (u)

>>990158

You are using one right now, moron

>HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body

https://tools.ietf.org/html/rfc2616#page-16


 No.990213

>>990146

>>989881

I know how to fix it, but how little self-respect and awareness can you have to be a professional and send people this kind of shit?


 No.990235

File (hide): 6fff4668f623f3a⋯.png (102.73 KB, 375x375, 1:1, 1426169438205.png) (h) (u)

>>989871 (OP)

>his text editor doesn't support multistyle newline encodings


 No.990236

None of the text-parsing programs I made even support the concept of carets and lines. The newline characters are nothing more than human-readable delimiters. languages like Java ignore newlines wholesale. I would put C in the same category if it didn't had what's basically a separate language embedded into it that follows different rules and semantics and cares about newlines.


 No.990276>>990299 >>990455

>>990141

>two bytes is better than one

Uh-huh.


 No.990299>>990357 >>990387

>>990276

>two bytes is better than one

This, but unironically.

The two bits will compress well to a single bit in most cases (newlines are very common in a doc so they get prioritized), while removing any possible ambiguity.


 No.990357>>990358 >>990382

>>990299

What ambiguity? Modern software doesn't support carets anymore, not with variable width characters being ubiquitous and default for absolute majority of text applications, and being nonexistent whatsoever for absolute majority of applications without text interface.


 No.990358>>990381

>>990357

>select multi-line text in html document

>copy it

>paste into notepad.exe

<everything is in a single line

Thanks UNIX.


 No.990381

>>990358

Are you retarded?


 No.990382>>990387

>>990357

>What ambiguity?

The one you get when notepad didn't support pure LF line breaks up to a few months ago?


 No.990387>>990448

>>990299

Why waste low valued huffman codes on such a useless sequence? You should be trying to compress away common words and phrases.

>>990382

>ambiguity

That's a funny way of saying MS retardation.


 No.990430

tr -d '\r' < professor_file > output_file

fucking retard


 No.990448>>990560

>>990387

>You should be trying to compress away common words and phrases.

And what's more common than line breaks?

As long as you don't have another 2+ char sequence that is more common than line breaks (and good luck with that), there's no reason not to encode them with 1 char.

Even if you have many common long sequences, the 1 char space is still pretty wide and chances are you'll fit them all in there together with line breaks anyways.

>That's a funny way of saying MS retardation.

While notepad is the most blatant example of CR LF annoyances, it's far from the only one.


 No.990455

>>990276

1.25 bytes is the way to go MIT nigger.


 No.990516

>>990172

No, I'm not, because that's obviously not at all what I'm referring to.


 No.990560

>>990448

the reason notepad matters is because it's installed by default. As soon as you can install your own software, anything is fair game. By your logic, I could write an editor that uses "\r\e\t\a\r\n" as linebreak, and this would be superior:

>it's less ambiguous!

>look at how long that sequence is! clearly that's a much better use of short huffman codes than all the other multibyte sequences in the document


 No.990702>>990723

>>989871 (OP)

>Need to write shell scripts for C programming lab.

>Another student can't run their shell script.

>Tutor and other students are completely clueless.

bash: ./tra.sh: /bin/bash^M: bad interpreter: No such file or directory

Winfag originally made it with notepad.exe!


 No.990723

>>990702

He should have used wordpad.exe




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
27 replies | 2 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / agatha2 / animu / general / komica / mde / randamu / vg / vichan ][ watchlist ]