Go to advanced search

by woodystanford
Wed Mar 08, 2017 10:25 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, let's talk about how DAEMON1 works...what its purpose is...how you can incorporate it into your projects. Its a generic server "wrapper" program. Its made to modify, OK. It just has working stubs in it for you to put your own code, your own commands, and is designed to be readily understandable ...
by woodystanford
Wed Mar 08, 2017 10:08 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, had a chance to work with DAEMON1 a bit. Here is what I wanted to show you is how to turn your R-PI or Beagle into an IOT "server" that can run across both LAN and WAN (ie. the Internet) with the incorporation of some standard old-school server components. ************************** * BIG BOOKMA...
by woodystanford
Fri Mar 03, 2017 6:15 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

Here is one that WILL work on an R-Pi that illustrates the principle. Here is another powerful example of how a correctly set up background process can fetch a web page for you. Using URL_encode() you can even invoke specific scripts on a remote host via HTTP and HTTPS protocol using CURL (available...
by woodystanford
Fri Mar 03, 2017 5:48 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

OK, here is how you reach into the kernel and pull out the current GPIO configuration on a Beaglebone Black Wireless, with this code programatically in ANSI C. http://beagleboard.org/discuss?place=msg%2Fbeagleboard%2Fd133kscQB38%2FnyB82oCXAQAJ Uses the first bit of code introduced in this thread, in...
by woodystanford
Thu Mar 02, 2017 1:25 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

I am missing something if you are in an embedded enviroment why are you even playing around with C to do this. ... I am not sure where you are going with this but that is how us poor lowly embedded programmers deal with that stuff and you are a long way from your linux daemon in this discussion :-)...
by woodystanford
Mon Feb 27, 2017 6:26 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Re: Learning C in 5 minutes

It takes more than 5 minutes, but Simon Long already did a good job on teaching the basics on C: https://www.raspberrypi.org/magpi/issues/essentials-c-v1/ (well, apart from the void main() ;)) I am impressed. Quickly skimmed this book and it seems really, really good (kind of along the lines of thi...
by woodystanford
Mon Feb 27, 2017 5:58 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Re: Learning C in 5 minutes

Where are we now? Here are the reserved words in C: auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while Ok here are the words you can ignore: auto, const,...
by woodystanford
Mon Feb 27, 2017 5:09 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Re: Learning C in 5 minutes

Anyways, let's talk about language constructs. There are no idiots here so I'll just talk about them: You've heard of loops. We have a few of them for you. FOR Loop for (a=0;a<1000;a++) { [statements here] } This runs the statements in the squiglies 1000 time. Can you figure out why? We use integer ...
by woodystanford
Mon Feb 27, 2017 3:29 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

Until you learn to improve the quality of your own code I strongly suggest you stop trying to teach other people C ! PeterO Quality!?!? I'll have you know old man that this is the real deal. :D ohhhh, I got sumthin for you...I was going to corner ghans with this, but you are getting it now: OK, gha...
by woodystanford
Mon Feb 27, 2017 2:21 am
Forum: Automation, sensing and robotics
Topic: Making a Drone
Replies: 15
Views: 2496

Re: Making a Drone

Hey, anyone know anything about these babies? Talk to me. :D http://ep.yimg.com/ty/cdn/theshorelinemarket/xeno-xl-205f.pdf I'd love to use them. I got a theory about how proper power managment might be the key to not having them burst into flames. kidding. But has anyone ever used batteries like thi...
by woodystanford
Mon Feb 27, 2017 1:23 am
Forum: Automation, sensing and robotics
Topic: bedroom automation
Replies: 17
Views: 3863

Re: bedroom automation

discussing HVAC I think that HVAC means heating, ventilation and air conditioning, it doesn't usually mean high voltage alternating current. Although HVDC does mean high voltage direct current. Regarding "high voltage": https://en.wikipedia.org/wiki/High_voltage In electric power transmission engin...
by woodystanford
Mon Feb 27, 2017 12:53 am
Forum: Graphics programming
Topic: BMP Out in C
Replies: 25
Views: 5635

Re: BMP Out in C

Whilst it's an accepted approach, it's not necessarily the best approach in most circumstances, I think that is all Peter is saying. As a C programmer of some years (25ish), I've included C files about 5 times. There are usually better/more appropriate ways, and you will avoid future issues like mu...
by woodystanford
Mon Feb 27, 2017 12:27 am
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 21772

Re: How would you ...... in C ?

f1=0; f2=1; while(len(str(f2))<50): f3=f1+f2; f1=f2; f2=f3; print(f2); Idioms...how about this one? What you do here is a "translate" between python and C. You don't even really need to know what is going on either with the algorythm (I mean you have to know something about it), you just translate ...
by woodystanford
Sun Feb 26, 2017 11:42 pm
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 21772

Re: How would you ...... in C ?

Anyone care to propose "Round 2" ? PeterO How about: A simple and easily extensible command interpreter. Hold the position of a hypothetical bot in integer variables X and Y. Decode command stings and apply values as increments to X,Y: forward nn back nn left nn right nn Where nn is an integer dist...
by woodystanford
Sun Feb 26, 2017 11:28 pm
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

Hey it ain't done yet, gentlemens... :D I think people should see previous iterations during the development process to reduce their nervousness about taking on bigger projects.

That we are just as big (if not BIGGER) idiots than they are. lol :D
by woodystanford
Sun Feb 26, 2017 11:05 pm
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 21772

Re: How would you ...... in C ?

So.... Given an integer "hours" which is guaranteed to have a value in the range 0 to 23, how would you print it in the form "12 AM", or " 1 PM". ok, how about: #include <stdio.h> main() { int hrs=5; char s[255]; switch(hrs) { case 0: strcpy(s,"12 AM"); break; case 1: strcpy(s,"1 AM"); break; case ...
by woodystanford
Sun Feb 26, 2017 10:30 am
Forum: Graphics programming
Topic: BMP Out in C
Replies: 25
Views: 5635

Re: BMP Out in C

My problem is that I find that once you show newbies "a simpler" way to do something they will keep doing it that way forever, especially if you tell them the proper way to do it is too hard for them. :roll: It's much better to put a little of your time and effort up front into showing and explaini...
by woodystanford
Sun Feb 26, 2017 10:17 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Re: Learning C in 5 minutes

J: Might as well say: -2147483648 to 2147483647 for the Pi - and any normal modern computer. W: I will have you know sir *faux arrogance* that that is a "long integer" in C. A C integer is only -32K<=x<=32K and the unsigned version is 0<=x<=64K. "Longs" are defined with "long". And J is correct. J: ...
by woodystanford
Sun Feb 26, 2017 9:12 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Re: Learning C in 5 minutes

OK, you programmed your first C program in about 5 minutes. Coolness. How about input? How do I get something in from the keyboard. Enter function scanf()...I guess the opposite of printf. Here is how scanf works. I want you to cut and paste this code into a new text file (let's call it test2.c). #i...
by woodystanford
Sun Feb 26, 2017 8:47 am
Forum: C/C++
Topic: Learning C in 5 minutes
Replies: 49
Views: 6497

Learning C in 5 minutes

OK, listen up. Python people been saying they want to know C/C++. I'll have you a C programmer in 5 minutes (maybe a little longer...ten minutes). If you are Windows, I want you to download (its free) MinGW and install it. It has the GNU C compiler aka "GCC" in it...THE compiler. If you are on UN*X ...
by woodystanford
Sun Feb 26, 2017 5:32 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

DAEMON1: Server Daemon Framework Code

************************************************ * * BIGGGGG BOOKMARK HERE!!! * ************************************************ Here is DEAMON1. I cut out all of the daemon and connectivity stuff out of the database I was referring to earlier and put it into a single file. For newbies and intermedi...
by woodystanford
Sun Feb 26, 2017 3:08 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Re: Invoking Service Daemons from Woody's "Private Reserve"

Here is the actual code that does what this thread is talking about: //run this server as a system daemon daemon(1,0); //same directories, but no output (only to HTML out) Now as you know this is quite an esoteric issue. You will notice that its a single statement (ANSI C). If you need output from i...
by woodystanford
Sun Feb 26, 2017 12:40 am
Forum: Automation, sensing and robotics
Topic: Making a Drone
Replies: 15
Views: 2496

From my private reserve - Daemons

OK, how do you code a process so it runs in the background. Highly recommended reading on service/daemons. Distilled specifically for all of you. No BS, no fluff, filler or additives:

viewtopic.php?f=33&t=175567

Oh YOU will likey. Oh yes...oh yes. ^ ^
by woodystanford
Sun Feb 26, 2017 12:32 am
Forum: C/C++
Topic: Invoking Service Daemons from Woody's "Private Reserve" mmm
Replies: 38
Views: 4651

Invoking Service Daemons from Woody's "Private Reserve" mmm

OK, here's the code people have been bugging me about. How to formally fork a service-type daemon so it runs in the background (complete with other control code as an example). Kind of ignore the first 3 lines as we will talk about them later. This actually comes from an optimized prototype for an a...
by woodystanford
Sun Feb 26, 2017 12:05 am
Forum: Automation, sensing and robotics
Topic: Making a Drone
Replies: 15
Views: 2496

Re: Making a Drone

OK, here is the graphics support used in the simulator. Something called graph.c, you might have heard about it that it only has one function: writebmp. Non-real time graphics support (can be viewed in browser).

viewtopic.php?f=67&t=175498

Go to advanced search