Is it a lost cause?

This Linux system boots into full GUI in 8 seconds thanks to SSD...:)

--
Those who want slavery should have the grace to name it by its proper  
name. They must face the full meaning of that which they are advocating  
or condoning; the full, exact, specific meaning of collectivism, of its  
logical implications, of the principles upon which it is based, and of  
the ultimate consequences to which these principles will lead. They must  
face it, then decide whether this is what they want or not. 

Ayn Rand.
Reply to
The Natural Philosopher
Loading thread data ...

I'm curios about that.. wonder why...

By hand and I admit its not my finest bit of work, nor an area I have expertiese in, but it works...

Yes, I know and have used awk... However not for about 20 years now... The problem here is that I have 4 or 5 files of what amounts to coordinates and data pertaining to those coordinates. I have to scale the coordinates to bigger squares and and count stuff inside the bigger range and output a file with the larger squares, counts of the stuff inside them and some other stats. It just seemed easier...

You might want to see:

formatting link
to amuse you for a few moments... :)

Cheers,

Gordon

Reply to
Gordon Henderson

That package of RTB was made before the newer /dev/gpiomem interface was added into the kernel and you're right - it's not the best thing to do, however RTB drops root privs. immediately after initialising wiringPi which is essentially the first thing it does in main() after getopt.

It needs to do the getopt thing to work out what way to initialise wiringPi - BCM pins, board pins or wiringPi pins.

After that it's running as the user that called it, so things like file access, creation, etc. work as the calling user.

Check this by running it, then typing in:

x = openOut ("/tmp/testfile1")

then (in another terminal)

ls -l /tmp/testfile

and checking the ownership of the file created.

I'm doing some work on it so will bear that in-mind for the next time I make a package.

Alternatively, if you remove the set uid bit,

sudo chmod 755 /usr/bin/rtb

it will still work, just not initialise wiringPi for GPIO access.

One thing you can't do with /dev/gpiomem is change the internal pull up/down resistors, so if you need that, you need root.

Gordon (Author of wiringPi)

Reply to
Gordon Henderson

Your (desktop?) Linux system might do that today, but the Pi didn't 4 years ago.

Gordon

Reply to
Gordon Henderson

I Expected that to be the case.

& that seems to reduce the issue considerably (I still have minor concerns but those are founded by a healthy dose of paranoia rather than any reasoned argument).

Indeed my comments were meant to be taken constructively.

--
The use of COBOL cripples the mind; its teaching should, therefore, be 
regarded as a criminal offence. 
		-- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number  
5
Reply to
alister

Can't help, I'm afraid since I've never tried to extract sound from my RPi.

Yes, that sounds like something I might also do in C or Java.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

Interestingly, I can read the first example quickly; not the second. I spend more time matching lines in the second example. I guess readability depends on experience.

/BAH

Reply to
jmfbahciv

You have just found the reason that standards manuals limit structured programs to having subroutines no more than 60 lines (=1 page) long whereas GOTO programs can be 20 pages long.

My 'END' statements had a comment saying what it was attached to.

Reply to
Andrew Swallow

That limit would be a problem in my work world :-) I never had problems reading code which spanned more than one page. My programming style would use dispatch tables when entering a module for the first time.

that's nice if it's kept up to date. In my area, it would be out of date with the third programmer. We would put a stand-alone comment at the end of a logical piece of code to indicate the last page of the routine.

After each monitor edit, one of the procedures was to run a TECO macro over the sources to match angle brackets.

/BAH

Reply to
jmfbahciv

I do this too. Often it's a pain in the neck, but occasionally it's useful. IBM PL/I has a nice "nest" compiler option that prints the containing block and group number for each statement, so you can easily visualize the structure.

--
Pete
Reply to
Peter Flass

Often it is easier, though less efficient*, to break deep nesting into subroutine calls, so each level of logic has its own 'block'..

*(static) inline functions can of course be used in C(++) to make the code more readable WITHOUT the overhead of actual subroutines. >
--
All political activity makes complete sense once the proposition that  
all government is basically a self-legalising protection racket, is  
fully understood.
Reply to
The Natural Philosopher

That happens to me, particularly if the code contains a 'switch' statement and contains other stuff such as another 'switch', or conditionals.

That is my solution.

Which is what I do.

--
Using UNIX since v6 (1975)... 

Use the BIG mirror service in the UK: 
 http://www.mirrorservice.org
Reply to
Bob Eager

The nice thing about modern editors is that they'll automatically associate end with the appropriate begin with a simple keystroke and/or highlighting (e.g. with the enhanced vi (vim), when the cursor is over a begin (e.g. { for C), it will highlight the corresponding end (}) and the '%' key will move the cursor between them.

Burroughs BPL language had 'END WHILE', 'END CASE', 'END IF' etc. in the language.

Reply to
Scott Lurndal

"A compiler", perhaps. "The compiler", well you need to be more specific.

In C, a static function has file scope, so it is not eligable to be a target for a call from another compilation unit, so there is no impediment to generating it inline. Although, with gcc, this should only happen if compile time optimization (-O) is requested.

Reply to
Scott Lurndal

If(brexit) { } //endif (brexit) etc etc.

I stick em in the comments otherwise I haven't a clue;)

--
If you tell a lie big enough and keep repeating it, people will  
eventually come to believe it. The lie can be maintained only for such  
time as the State can shield the people from the political, economic  
and/or military consequences of the lie. It thus becomes vitally  
important for the State to use all of its powers to repress dissent, for  
the truth is the mortal enemy of the lie, and thus by extension, the  
truth is the greatest enemy of the State. 

Joseph Goebbels
Reply to
The Natural Philosopher

**gcc=THE compiler :-)
--
If you tell a lie big enough and keep repeating it, people will  
eventually come to believe it. The lie can be maintained only for such  
time as the State can shield the people from the political, economic  
and/or military consequences of the lie. It thus becomes vitally  
important for the State to use all of its powers to repress dissent, for  
the truth is the mortal enemy of the lie, and thus by extension, the  
truth is the greatest enemy of the State. 

Joseph Goebbels
Reply to
The Natural Philosopher

Rather a sweeping statement. It will depend on the compiler. One might say that logically the compiler should always do this, but I can think of situations when I would rather it did not.

I'll leave identification of such a situation as an exercise.

--
Using UNIX since v6 (1975)... 

Use the BIG mirror service in the UK: 
 http://www.mirrorservice.org
Reply to
Bob Eager

A few decades ago, MAINSAIL (MAchine INdependent Stanford Artificial Intelligence Language) allowed an optional string constant after BEGIN and END. If used, the compiler would enforce that the string constants match. That was quite helpful on occasion.

--
Robert Riches 
spamtrap42@jacob21819.net 
(Yes, that is one of my email addresses.)
Reply to
Robert Riches

Alas, no. At least not in the newest full Raspbian from the download page, dist-upgraded.

"2016-05-27"

formatting link

Reply to
A. Dumas

It used to be there... Oh well.

Gordon

Reply to
Gordon Henderson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.