I need your help my friend Peter North

Status
Not open for further replies.
Does being in sales make people think they are entitled to more? Do they think it entitles them to disrespect the people who support them? I'm a manager for crying out loud, you don't waltz into my office and demand that I make changes to policy and domain settings just because it will make your life slightly more enjoyable. This is ESPECIALLY the case when what you happen to be asking me to do is make an exception on the firewall so you can play games on www.pogo.com, without having to tell your manager about it so if someone high-up finds out it's all my fault.

Plus, don't come talking to me as if you're my dearest friend, it insults both of us. You don't know me, and I don't know you, so don't me call friend, buddy, pal, "brotha" or especially "son". If you don't know my name that's fine, I probably don't know yours, go ahead and politely ask me, I'm good with honesty.

F'ing clowns.
 
Is this a rant thread?

Before I begin, I want to tell you a little about my background. My first experience with a computer when when a friend let me use a spare account he had on a PDP-10 mainframe at Western Michigan University back in the early 1970's. He was taking computer science and learning the FORTRAN computer language. I was asking, "But what can you DO with a computer?" so he showed me the BASIC language and how I could write simple programs.

Thing was, it quickly became apparent that the computer science students were indoctrinated to believe that BASIC was just a beginner's language (after all, the "B" in BASIC stands for "Beginner's", doesn't it?) and couldn't be used to do anything useful. The problem was that I don't think the students had been given the full BASIC command list. Even on those early days, the BASIC was fairly powerful and I wrote a couple of programs that did things that my friend had believed simply could not be done in BASIC (because his professors had led him to believe that FORTRAN was the language of the future, and that BASIC couldn't do much of anything. Anyone still using FORTRAN?).

Anyway, for some reason there were only two computer languages that ever really "clicked" with the way my brain is wired - BASIC and Z-80 assembly language, as used on the old Radio Shack TRS-80's. C was always totally incomprehensible to me, and most other high level languages don't do much for me either. The other thing that I picked up on to some degree was the old DOS batch files, which were in many ways rather similar to today's Linux shell scripts. I wouldn't call myself an "expert programmer" in any of those languages ("expert programmers" write things like operating systems and word processing programs) but I could do most of the simple tasks I wanted to do.

One of my pages on the Resources for Michigan Telephone Users site shows a very large table of local calling areas covering every exchange in Michigan. The actual data is in a comma-quote delimited file but guess how I create the actual HTML table? A small BASIC program that still runs under the old Microsoft QBASIC, which I have carried from computer to computer as I have upgraded over the years (I think it originally came out in the early 1980's). This may seem silly to some of you but let's say that I need to change ever instance in the data file of "SBC" to "AT - I can whip out a short BASIC program to do it in a few minutes AND I don't have to consult any command reference pages or books to do it.

And that bring me to my point - modern languages may be more powerful but they sure aren't more readable. For example on Linux you can do powerful string replacements using SED but unless you have a memory like an elephant you are going to need to find a reference somewhere (in my case, one written for average people, not Linux experts) that explains all the variations on the command. Actually writing the code may take ten seconds, but trying to figure out what to write may take half an hour (or more, give all the irrelevent pages you will first turn up). With BASIC I know EXACTLY what all the string commands do - it is right there in their name! The thing about programming languages that non-geeks can use is that they are mnemonic.

We all know this but yet somehow it sometimes gets lost on the people who write software. Take the Asterisk PBX - in their configuration files (which, in effect can contain mini-programs) they have an excellent set of commands. The variable syntax takes a little getting used to (and I'm not sure I have it totally figured out yet) but nothing is really that cryptic. It's just that the Asterisk command set is pretty much designed to handle call flow and nothing else - it has little or no math cabability, or ability to read bits of data from files and utilize that data, at least not natively to the Aserisk command set. At least none that I've determined so far.

Let's say you want to do something that SHOULD be simple. For example, here's one possible scenario:

Grab an XML file from http://www.nws.noaa.gov/data/current_obs/KDET.xml (which is local weather observations for the Detroit City Airport, but there are XML files for other cities on that server).

Find the <temp_f> and </temp_f> tags and extract the temperature from between them.

Then, simply say the temperature using the "SayDigits" command.

This SHOULD be easy. But, in my limited experience, both Asterisk and Linux will fight you every step of the way, or at least they do me when I try to do things like this. Linux gives me fits because of its permissions (such as the fact that you can set an environment variable within a shell script, but it can't be seen or used outside that script!) and a few other oddities. Asterisk because it apparently has no way to simply pick up a value from a text file and say it.

In case you haven't guessed from the previous paragraphs, I have no problem in getting Asterisk to spawn a shell script that can extract the proper bit of XML data using SED, and I can get that data written to a file as a text string, no problem - just a couple of shell script lines. But what I cannot figure out is how to get Asterisk to say the contents of that text file!

So now we turn to the high level languages. Asterisk can use programs written in Perl (ugh), PHP (double ugh), and I think one other language I can't recall. Okay, so here's a really dumb question - why don't they include a BASIC interpreter, so that us non-programmers can have a hope of getting something done without totally losing our minds?

Anyway, I'm out on the web searching for a solution to this, and what do I come across but an online chapter of an O'Reilly book called Asterisk-The Future of Telephony, And lo and behold, in Chapter 9 (PDF file), starting on book page 163 and continuing through page 168, there is a script written in PHP that supposedly will grab the XML file, and read not only the temperature, but the wind direction and speed back to the caller. Oh, happy day, all I have to do is carefully copy the code, put it in a PHP file, save it in the agi-bin directory, change the permissions to make sure it's executable (can't forget that!) and call it using something like this:

exten = *199,1,Answer
exten = *199,2,AGI(temperature.php)
exten = *199,3,Hangup


And it SHOULD work. Yes, it SHOULD work, but it doesn't, and how do you debug a thing like this? Meanwhile I am looking at a file that has 180 lines of code (including some comments and whitespace, but not much). Remember, I was able to write a batch file that got the temperature and wrote it to a text file in TWO lines.

Hey, Asterisk developers - how about a "SayDigitsFromFile" command that takes a string from a text file and says the digits (and things like "plus" for + and "minus" for "-"? I know, the great thing about open source code is that anyone can write extensions. The "Catch 22" is that if I knew how to write the extension to the "SayDigits" command, I could probably write those Perl or PHP scripts and wouldn't need the extension.

Now if anyone would like to show me the error of my ways and post a way to do this, PLEASE feel free to leave a comment and/or send me e-mail. In the meantime, I'm tired of spending six hours trying (unsuccessfully) to make Asterisk and Linux do something that it would take me ten minutes (tops) to do if there were a good BASIC interpreter available that could be called and used - or even if you could pass variables from Asterisk to a bash shell script and receive the result back in Asterisk variables.

I know, there probably isn't one person reading this that will agree with me but still I had to say it. Besides, it explains why I haven't been blogging as much this week - if you spend six hours beating yourself bloody, so to speak, trying (and failing) to accomplish something you just KNOW should be easy, that's six hours less you have to do any reading or writing. And since I tend to be just a little obsessive,smile I hate to give up when I think that maybe just one more tweak will make things start working! But at some point, I need to sleep!
 
fly said:
Is this a rant thread?

Before I begin, I want to tell you a little about my background. My first experience with a computer when when a friend let me use a spare account he had on a PDP-10 mainframe at Western Michigan University back in the early 1970's. He was taking computer science and learning the FORTRAN computer language. I was asking, "But what can you DO with a computer?" so he showed me the BASIC language and how I could write simple programs...

I cannot help you, but gladly would if I had the know-how.
 
b_sinning said:
Here is two motorcycles my school built. They are suppose to be pretty damn fast whenever red bull that sposored them puts the motors in.. I'm trying to find a better picture. They look so cool.

redscadmotorcycle.jpg


:drool: I think I need to change ma drawers. What size motors, etc?
 
I should go take some real pictures with them. They are sitting inside the front of Cliifard hall. That is a cool building because they do product design and furniture design. They always have super cool looking furniture.


I got to go to one of my favorite buildings earlier today. Painting and sculpting are taught in a few places on campus but the best art work is always in Alexander Hall. Some days you go in there and see tons of awesome paintings drying or you walk down a hall way and realize that someone had made a stretch of the hall way an art exhibit by transforming it to look like something else. That building always has kids sitting around drawing and painting. I say kids but they are 18-24.
 
Drool-Boy said:
Where the hell did spring go? Two days ago it was in the 80s and I had the AC on in the house, now its 36 fuckin degrees outside. What the fuck?


I KNOW!! and we're supposed to go on an easter egg hunt on saturday!! :rant:
 
It's supposed to be around 60 here all through next Sat! Although we did just get over two weeks of 35 degrees so I'm glad you guys are getting it now.
 
Status
Not open for further replies.