Design Con 2015
Breaking News
Comments
Newest First | Oldest First | Threaded View
<<   <   Page 3 / 8   >   >>
Max The Magnificent
User Rank
Blogger
Re: Carriage-return Linefeed
Max The Magnificent   1/16/2014 11:33:18 AM
NO RATINGS
@DrSnake: ...It gets all over.

Whenever I use WD40, it certainly seems to get all over me! :-)

DrSnake
User Rank
Rookie
Re: Carriage-return Linefeed
DrSnake   1/15/2014 10:32:52 PM
NO RATINGS
One of the recomended uses of WD40. Open the ribbon cartrige and spray the top of the ribbon. It gets all over.

David Ashton
User Rank
Blogger
Re: Working!
David Ashton   1/14/2014 2:47:39 PM
NO RATINGS
@FlyByPC...I have heard about FreeBASIC and might give it a try sometime.   I used GWBasic here as it was from about the right era for the program.  FreeBASIC says on its website that it is very compatible with QuickBASIC which I worked with a bit.   I'll put FreeBASIC on my ever-growing list of things to do.  I need to win the lotto and retire so I can get time for all the interesting stuff... :-)

FlyByPC
User Rank
Rookie
Re: Working!
FlyByPC   1/14/2014 2:30:50 PM
NO RATINGS
It's nice that GWBASIC is still available, but you ought to check out FreeBASIC. It can be set to accept old-school GWBASIC syntax, but has a lot more modern capabilities, as well -- arrays of up to 2GB or so, high-resolution graphics in true color, user-defined types, and structured programming (functions, subroutines, etc.) 

I use FreeBASIC with FBIDE: http://fbide.freebasic.net/ 

 

Stargzer
User Rank
CEO
Re: PROGRAM
Stargzer   1/13/2014 2:57:32 PM
NO RATINGS

@betajet:  "Thank you for contributing this week's dose of nostalgia."

You're welcome!  When I'm not reading SciFi I'm reading history.

@betajet:  "A Pascal semicolon is a statement separator.  You put it between statements.  Thou shalt never place a semicolon in front of "else".  In contrast, a C semicolon is a statement terminator."

Coming from a PL/I background I probably thought of it as a terminator, thinking of "else" as a separate statement (line).   My brief encounter with Pascal was 30-some-odd years ago. 

I try to write code so I can follow it a later time (somewhat self-documenting), using indenting.  I would write: if (x >= 0) y = x; else y = -x; in two lines as:

if (x >= 0) y = x;
else y = -x;" 

I can see how if you read the Pascal statement from left-to-right it's almost a complete sentence, not broken down into separate steps like above:

if x >= 0 then y:= x else y:= -x

but, "OTOH, in C you can write "y = x >= 0? x: -x;" is great for compact syntax and saving space back when disk space was dear.  But hey, it was written by system programmers looking for something between assembler and a high level language.  I hope to learn it and play with it some day (I like the bit where you can stuff in some assembler or machine code in-line; a hacker's dream (from the original def of hacker). 

 

Max The Magnificent
User Rank
Blogger
Re: Carriage-return Linefeed
Max The Magnificent   1/13/2014 2:49:59 PM
NO RATINGS
@Stargzer: If it's not returning, I'm not sure what the problem is.

If you type characters you can see them on the paper (very faint because the ribbon is 30 years old -- I iave to pick up a new one when I get round to it) -- but when you hit the return key, the carriage returrns but there's no line feed, which there shoudl be when you are manually typing on the keyboard. 

betajet
User Rank
CEO
a? b: c
betajet   1/13/2014 1:59:09 PM
NO RATINGS
The Betajet wrote: in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

Flurmy wrote: Yuk! That's exactly what I try to avoid like hell.  As you said, chacun a son goût, but I think I'm in good company.  MISRA and alike strictly forbid mumbo jumbo like this.

Well, I learned LISP before I learned C.  LISP's fundamental conditional operator is COND, which is an extended version of "a? b: c".  LISP is a great language for reasoning about programs, and proving that they work.  (For best results, use equivalent mathematical notations rather than lots of parentheses.)  "a? b: c" is also a great notation for writing multiplexers in Verilog.

I'm puzzled that some people don't like "a? b: c", but I accept that some people would rather write Basic or Fortran :-)

Flurmy
User Rank
Rookie
Scrap paper
Flurmy   1/13/2014 2:50:51 AM
NO RATINGS
betajet: in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

Yuk! That's exactly what I try to avoid like hell.
As you said, chacun a son goût, but I think I'm in good company.
MISRA and alike strictly forbid mumbo jumbo like this.

If their program got into a loop (but not a hard Sys) and printed one character and a page feed continuously, well, there would be a pile of scrap paper.

I worked on a CDC6600 via punched cards and batch processing.
When, hours later, I went to pick up the result of my program I met a friend who told me: "Ha, ha, ha! Someone printed a pile of paper so high full of numbers! Ha, ha, ha!"
Surprise: someone was... me!
I mistakenly swapped the job control cards, putting the "load and run" before the "link" one. obviously the "program" crashed violating the memory fence and I got the dump of the whole memory in octal (each location was 60 bits, i.e. 20 octal digits)...

herbissimus
User Rank
Rookie
Re: scanner?
herbissimus   1/10/2014 8:56:30 PM
NO RATINGS
one only needs a single led and the array of photodetectors, just spread the light into a plane. the rows of holes passing by do the rest.

sorry, this was already suggested earlier. p.s. i have manuals and tty which has been resting unmaintained since 1977.

betajet
User Rank
CEO
Re: PROGRAM
betajet   1/10/2014 7:55:20 PM
NO RATINGS
Thank you for contributing this week's dose of nostalgia.

Dr. Wirth intended Pascal as a language for teaching good programming practices.  I still think it's a terrific first programming language.  OTOH, Modula-2 was intended as a serious programming language.

Teaching a programming language isn't easy, particularly if you haven't mastered it.  Not understanding semicolons in Pascal is pretty lame.  A Pascal semicolon is a statement separator.  You put it between statements.  Thou shalt never place a semicolon in front of "else".  In contrast, a C semicolon is a statement terminator.  It also converts an expression like "x = 3" into a statement like "x = 3;"  Go ahead an put a semicolon in front of "else".  Go ahead and write "if (x >= 0) y = x; else y = -x;"  So what it it's ever so much uglier than "if x >= 0 then y:= x else y:= -x".  OTOH, in C you can write "y = x >= 0? x: -x;" which much nicer than Pascal.

While FORTH is something of a write-only language, it does make a nice intermediate language and is dirt simple.  But APL is the epitome of the write-only language.

<<   <   Page 3 / 8   >   >>


Flash Poll
Top Comments of the Week
Like Us on Facebook
EE Times on Twitter
EE Times Twitter Feed

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Max Maxfield

Analog Faceplate Design Decisions: Art or Science?
Max Maxfield
12 comments
My degree is in Control Engineering -- a core of math with "surrounding subjects" of electronics, mechanics, and hydraulics and fluidics. The only official programming I did as part of ...

Jolt Judges and Andrew Binstock

Jolt Awards: The Best Books
Jolt Judges and Andrew Binstock
1 Comment
As we do every year, Dr. Dobb's recognizes the best books of the last 12 months via the Jolt Awards -- our cycle of product awards given out every two months in each of six categories. No ...

Engineering Investigations

Air Conditioner Falls From Window, Still Works
Engineering Investigations
3 comments
It's autumn in New England. The leaves are turning to red, orange, and gold, my roses are in their second bloom, and it's time to remove the air conditioner from the window. On September ...

David Blaza

The Other Tesla
David Blaza
5 comments
I find myself going to Kickstarter and Indiegogo on a regular basis these days because they have become real innovation marketplaces. As far as I'm concerned, this is where a lot of cool ...