Interesting tutorial

Need help with C, C++, perl, python, etc?

Interesting tutorial

Postby cuckooflew » 2020-05-13 22:49

Was digging around in some of my grandfathers old files, and I found a link to this tutorial, and am enjoying it , so decided to share it Probably others may have seen it before, but for those that have not:
https://www.cs.miami.edu/home/schulz/CSC322.pdf
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Interesting tutorial

Postby No_windows » 2020-05-14 03:56

This is a first for me..... a person showing off a grandparents computer artifact as opposed to something found in the physical world (shelf, tool box, or desk). This further illustrates something I've been thinking about lately... that time marches on.
No_windows
 
Posts: 505
Joined: 2015-08-05 03:03

Re: Interesting tutorial

Postby cuckooflew » 2020-05-14 04:48

Yea, and things change, I suppose it is a form of evolution in some ways, maybe this should go into "offtopic", seems that the topic took a quick left turn now, and is not really programming. My grand father also used to often talk about the days when they did not even have Television yet,and how fast things started changing when computers and other technology started becoming a reality, rather then just science fiction.... But think a little more on this one:
computer artefact (my spell checker said artifact was wrong, but says both spellings are correctas opposed to something found in the physical world (shelf, tool box, or desk).

Is a computer not physical,? And is it not as much part of the physical world, including the desk that his computer is on, the shelf above the computer, and the tool box that is outside in the storage shed,...something to think about.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Interesting tutorial

Postby None1975 » 2020-05-14 09:33

Thank you for the link. Very valuable. I read it with pleasure.
OS: Debian 10.3 Buster / WM: xmonad
Debian Wiki | DontBreakDebian, My config files on github
User avatar
None1975
 
Posts: 1019
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: Interesting tutorial

Postby LE_746F6D617A7A69 » 2020-05-14 13:41

I must admit that this tutorial is just great :)

–Recent LINUX kernel: 2.4 million LOC (1.4 million for driver, 0.4 millionarchitecture-dependent stuff (16 ports)
–Windows 2000: Estimates range from 29 million to 65 million LOC, supportsjust 1.5 architecures

...so many years have passed, and nothing have changed in this aspect... :lol:

You don’t have to grow a beard
to become a world-class UNIX hacker. . .
. . . but it does seem to help!

Linus is not a nice guy... - probably because he didn't grow a beard... (EDIT: You have to see that pdf page to understand :) )

This should be printed with big gold letters:
In assignments (and in live) use comments wisely
–Do explain important ideas, like i.e. what a function or program does
–Do explain clever tricks (if needed)
–Do not repeat things obvious from the program code anyways


...and this is no longer true:
By intention, int is the fastest datatype available on any given C implementation

Not only because now we have amd64, MMX, SSE, AVX, but also because new CPUs have efficient instruction pipelines and clever caching algorithms, so in most cases there's no difference in performance between char (int8_t), int16_t and int32_t. On Intel CPUs (starting from Haswell?) in some cases operations performed on the int8_t are almost 2x faster than on int32_t.

Anyway, I would buy a beer for Mr Schulz If I would met him ;)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 340
Joined: 2020-05-03 14:16

Re: Interesting tutorial

Postby No_windows » 2020-05-14 22:00

cuckooflew wrote:Is a computer not physical,? And is it not as much part of the physical world, including the desk that his computer is on, the shelf above the computer, and the tool box that is outside in the storage shed,...something to think about.


You didn't share the physical computer, desk, or shelf. You shared the 1's and 0's on the hard drive, which are not part of the physical world. Surely you recognize the difference between the physical and the digital? I pointed that out since I took it to be a bit of a milestone, or change in the way of the world.
No_windows
 
Posts: 505
Joined: 2015-08-05 03:03

Re: Interesting tutorial

Postby arzgi » 2020-05-15 01:52

LE_746F6D617A7A69 wrote:Linus is not a nice guy... -


Linus started at anger management course, I think it was last year.

Have not heard, if he completed it, but at least it has not been in the news that he would have been kicked out. :mrgreen:
arzgi
 
Posts: 639
Joined: 2008-02-21 17:03
Location: Finland

Re: Interesting tutorial

Postby cuckooflew » 2020-08-13 17:39

Ahh, Ok, well I see I all ready started this topic, but then dropped it,...back to the tutorial, I love it, it is simple, and a great start , so here is the first lesson:
ffrom: https://www.cs.miami.edu/home/schulz/CSC322.pdf
A First C ProgramConsider the following C program
Code: Select all
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Hello World!\n");
return EXITSUCCESS;
}
Assume that it is stored in a file calledhello.cin the current working directory.
Then:
$gcc -o hello hello.c(Note: Compiles without warning or error)
$./hello
Hello World


You should have some tools installed, before trying it :
https://packages.debian.org/buster/build-essential
Actually I think that will have all you need, if more are needed, maybe some one can tell us.
Code: Select all
parrot$ ./hello
HELLO WORLD
parrot$   
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Interesting tutorial

Postby trinidad » 2020-08-14 10:59

You didn't share the physical computer, desk, or shelf. You shared the 1's and 0's on the hard drive, which are not part of the physical world. Surely you recognize the difference between the physical and the digital? I pointed that out since I took it to be a bit of a milestone, or change in the way of the world.


Your idea is representative of the kind of categorical dualism that permeates the human meta-narrative. Everything in the cosmos (universe) is cosmic (physical). Arguing for differentiation like the one you are making is one of the reasons people have difficulty thinking clearly. The cosmos is a monism and thinking about that deeply will help clear your head. Suggested reading: Donald Davidson.

TC
You can't believe your eyes if your imagination is out of focus.
trinidad
 
Posts: 134
Joined: 2016-08-04 14:58

Re: Interesting tutorial

Postby LE_746F6D617A7A69 » 2020-08-14 12:07

Isn't that monism just a higher abstraction layer for dualism? I mean something like HAL (Hardware Abstraction Layer)? :mrgreen:
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 340
Joined: 2020-05-03 14:16

Re: Interesting tutorial

Postby Head_on_a_Stick » 2020-08-16 13:05

trinidad wrote:Everything in the cosmos (universe) is cosmic (physical).

What about dark energy? That accounts for ~70% of the observable universe and it's not physical at all. And don't get me started on dreams :mrgreen:
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12480
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Interesting tutorial

Postby trinidad » 2020-08-16 14:34

What about dark energy? That accounts for ~70% of the observable universe and it's not physical at all. And don't get me started on dreams


Mental differentiation and distinction is physical as well, just yet to have a completely defined nature, and human mentality may never be adequately defined, but that doesn't mean it is unlikely to be something physical. The opposite is true. What humans most often define as not physical is more than likely to be physical. It can be argued that humans cannot be aware of anything that is not physical given that they are a physical something that is a situation of thinking intrinsic to what seems to be an ordered physical universe.

TC
You can't believe your eyes if your imagination is out of focus.
trinidad
 
Posts: 134
Joined: 2016-08-04 14:58

Re: Interesting tutorial

Postby cuckooflew » 2020-08-16 14:37

I can see this is going to really be a interesting tutorial indeed.
... Here is the first home work assignment, actually for the "teachers" , and yes I am serious, but it is for fun, as well. Any way, can anyone give a simple example that requires input, and then gives out put, to add to the "hello world", EG:
We now, know how to get output, using: the printf command,
Code: Select all
printf("Hello World!\n");

And we want to add, a request for input, "please enter your name",
then a response, more output, "hello <name> welcome ", please hit enter to exit,
the enter key then closes it with a "thank you ".
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
cuckooflew
 
Posts: 683
Joined: 2018-05-10 19:34
Location: Some where out west

Re: Interesting tutorial

Postby Head_on_a_Stick » 2020-08-16 14:39

trinidad wrote:It can be argued that humans cannot be aware of anything that is not physical given that they are a physical something that is a situation of thinking intrinsic to what seems to be an ordered physical universe

Well the evidence for the existence of dark energy is derived from the observed expansion rates of the universe (as measured from type Ia supernovae) so non-physical entities can be detected indirectly.

Anyway this is all rather off-topic so we should probably stop :)

EDIT: s/matter/energy/
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12480
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Interesting tutorial

Postby Head_on_a_Stick » 2020-08-16 14:57

cuckooflew wrote:We now, know how to get output, using: the printf command,
Code: Select all
printf("Hello World!\n");

And we want to add, a request for input, "please enter your name",
then a response, more output, "hello <name> welcome ", please hit enter to exit,
the enter key then closes it with a "thank you ".

How about
Code: Select all
#!/bin/sh
echo 'Please enter your name'
IFS= read -r reply
echo "Hello $reply, welcome. Please hit enter to exit."
while true; do
   IFS= read -r key
   case "$key" in
      "") echo 'Thank you'
         exit 0
         ;;
      *) echo 'Please hit enter to exit...'
         ;;
   esac
done
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12480
Joined: 2014-06-01 17:46
Location: /dev/chair

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable