theweaselking: (Default)
[personal profile] theweaselking
I can't believe I just said that.

But it's true.

Left, Right, Len, and Instr are a poor substitute for s/search/replace

(no subject)

Date: 2007-03-21 10:14 pm (UTC)
From: [identity profile] goblinpaladin.livejournal.com
sed means 'but' in Latin. You managed to confuse me.

Congratulations!

(no subject)

Date: 2007-03-22 12:21 am (UTC)
From: [identity profile] theweaselking.livejournal.com
Sed is a unix command that allows very powerful string editing. In this case, I wanted to find all instances of a certain phrase in a string of text, and delete them. With sed, this is a trivial task. Without sed in Windows Script Host, it was an annoying series of commands to find the location of the start of the phrase, cut out everything before the phrase, cut out everything after the phrase, stick those two together, and discard the phrase.

(no subject)

Date: 2007-03-22 12:33 am (UTC)
From: [identity profile] goblinpaladin.livejournal.com
Ugh. The only thing I know about coding is that it keeps my computer running when it doesn't crash it. And something about semicolons. Nonetheless, I can feel your pain in those few sentences.

(no subject)

Date: 2007-03-21 11:08 pm (UTC)
From: [identity profile] mhoye.livejournal.com
Er... replace()?

(no subject)

Date: 2007-03-22 12:21 am (UTC)
From: [identity profile] theweaselking.livejournal.com
Couldn't make it work. Couldn't find an example with it working. Hated the nonhelpful error messages enough that I did the 10 lines of other code needed to replace() it.

(no subject)

Date: 2007-03-21 11:56 pm (UTC)
From: [identity profile] mrbankies.livejournal.com
I can't believe you said that either. I'm a trifle more familiar with awk, but in either case I loathe regular expressions almost as much as I loathe APL. Both are immensely powerful but dreadfully obtuse.

(no subject)

Date: 2007-03-22 01:08 am (UTC)
From: [identity profile] jsbowden.livejournal.com
RegEx's RULE THE FUCKING WORLD!

(no subject)

Date: 2007-03-22 02:57 am (UTC)
From: [identity profile] theweaselking.livejournal.com
Unless you have to decode them because they're not working right and the idiot who wrote them didn't comment them.

In that case, they're dirty class traitors who should be shot pour encourager les autres.

(no subject)

Date: 2007-03-22 01:31 pm (UTC)
jerril: A cartoon head with caucasian skin, brown hair, and glasses. (Default)
From: [personal profile] jerril
Overall, I'm siding with jsbowden here, but I still agree about commenting them. If only a little note saying what the original programmer was TRYING to accomplish, so you can totally rewrite it if necessary.

After all, apparently not all humans come with an innate comprehension of regexes preinstalled. ;)

(no subject)

Date: 2007-03-22 02:50 pm (UTC)
From: [identity profile] ironphoenix.livejournal.com
I'm
Too sexy for vi
Too sexy for vi
Too sexy a guy

And I'm
Too sexy for emacs
Too sexy for emacs
It's just used by hacks

--Right Sed Fred

(no subject)

Date: 2007-03-22 02:53 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
vi is a text editor written by people who think interfaces - any interface at all - is for wimps and communists.

emacs is vi but not only are interfaces for wimps and communists, but everything needs to be fetishistically included in a single program, because of a crippling fear of ever starting anything but emacs from the command line.

(no subject)

Date: 2007-03-22 02:55 pm (UTC)
From: [identity profile] ironphoenix.livejournal.com
vi is also about as easy to exit as East Germany was in 1980.

coming soon: emacsOS. It was only 12 more lines of code!

(no subject)

Date: 2007-03-22 02:59 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Oh, come on, what's nonintuitive about ESC-:q!-ENTER? That's ALWAYS what I try first when I'm in a program that has NO INDICATION AT ALL OF HOW ANYTHING WORKS.

(I hate sed, too. I just want it for it's search/replace functions.)

Profile

theweaselking: (Default)theweaselking
Page generated Feb. 6th, 2026 03:17 am