Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts
Thursday, August 3, 2017
--- Cool lectures for computer enthusiasts ---
2016
The best computer science video courses I have been able to find online are the Harvard courses presented by David J. Malan, a clear and entertaining presenter.
Intensive Introduction to Computer Science (https://cs50.harvard.edu/weeks)
Understanding Computers and the Internet
(See Academic Earth's Computer Science Courses on http://academicearth.org/computer-science/)
There are also many more open courses available at Academic Earth.
The University of Washington also presents a History of Computing course with instructors Ed Lazowska, Steve Maurer, and Geoff Voelker which could not be more in-depth with guest speakers who are the history of computing. In addition to video lectures, the course is loaded with graphic slides and other materials. It is available here:
http://courses.cs.washington.edu/courses/csep590a/06au/
(The above websites were accessed 7/30/2017)
Sunday, July 16, 2017
--- Crosstabulation ---
2016
Until I figured out how to create stub and banner tables with LibreOffice pivot tables, I was considering making a tabling routine for DANSYSX but that would be redundant, so my focus for crosstabulation became just the 2-way and 3-way statistics programs. Since they are involved and, from scratch, it will give me a chance to talk about my structured approach to developing Calc routines.
XTab is a big (!) matrix function, but it's a sequential function, meaning that it has many procedures that are completed before the next process is started. My first task is to outline the processes with comments. A comment in LibreOffice Basic begins with a single apostrophe. Here, I include a header:
FUNCTION XTab(optional InMat,optional InType, optional CellCont as string,
_)
(It's not complete, because I'll be adding parameters as different procedures require them.) Then, comes a descriptive comment:
'Performs a complete analysis on crosstabulation data
'from a raw data table or a crosstabulation of data.
'The input is the data and the output is a matrix containing
'a stub-and-banner table of cell data followed by
'a table of statistics. InType=1 (Crosstab), 2 (raw data)
'CellCont is a binary string designated data to be displayed in
'cells of output: 10 places: counts, exp counts, row%, column%,
'Total%, residuals, stand. residuals, adj, residuals, chi square,
'likelihood chi square, odds, compare column proportions (Bonferroni).
and a declarations and initialization section:
'Declarations and initialization. If InMat isn't specified,
'InMat=MatArray1. If InType isn't specified, InType=1 (crosstab).
'If CellCont isn't specified, CellCont="100000000000"
DIM OutMat(), Xi(), Yj(), OutR as integer, OutC as integer
DIM I AS INTEGER, J AS INTEGER, K AS INTEGER, L AS INTEGER
That will also grow as I add code. I'll declare other variables in alphabetical order, inserting each as I use them, so I can keep up with names that I've used. Double declarations and accidentally using the same variable for multiple purposes without knowing it can be major headaches.
Then, I know that I'll have to crosstabulate data if a raw data table is fed to the function, so I annotate that section:
'Crosstabulation, if needed.
Redim OutMat(), Xi(1,2), Yj(1,2)
Thinking ahead, I know I'll have to redimension the output matrix when I know what the stub-and-banner part of the display will look like. Everything below that will be pretty straightforward and I can add size as I finish each section. Each section is independent of the ones below it, so I can test each one as I finish it. I have a test data on the Report sheet of DANSYSX that I will use to progressively test each section.
The final section will just display the OutMat matrix which, by that time, will already be constructed by the procedures I have coded. OutMat is a convention I use for all macros that display a matrix.
I will have the crosstabulation saved in MatArray3, just to increase it's utility and make it compatible with the matrix functions I've programmed for DANSYS and DANSYSX.
I use a lot of spreadsheet functions in the program and that's a little tricky. The topic isn't covered in the programming guide, but you can find information online.
To use a spreadsheet function in a Basic routine, you must first declare an object variable to hold the function. You only have to declare it once since you can't use more than one spreadsheet function at a time. I use the same name, svc, and declare it as an object variable:
DIM svc AS OBJECT
Then the variable has to be set as a function variable. That only has to be done once, also.
svc=createUnoService("com.sun.star.sheet.FunctionAccess")
Uno is the object manipulation language used by LibreOffice. This statement invokes a Uno service called FunctionAccess.
After the variable is set, it can be used to call spreadsheet functions such as :
PCS=svc.CallFunction("CHIDIST",Array(CSQW,dfCS))
This statement calls the CHIDIST spreadsheet function. CHIDIST evaluates a chi square value at a specified degrees of freedom value. The CallFunction method for a function variable requires the name of the function as a string (in quotes) followed by the information to be transferred to the function in an array. The function requires a value and degrees of freedom (if you look the function up in the Calc Function Wizard, you can see the structure of the function) to be passed as an array. Even if you pass an array to a spreadsheet function, you have to use the Array statement followed by the name of the array in parentheses. You can see that here:
XMIN=SVC.CALLFUNCTION("MIN",ARRAY(Eij))
in a statement that finds the minimum value in the array Eij.
To get the return value, a variable, PCS, is set equal to the function variable.
One of the aggravating things about LibreOffice Basic is you can't return a matrix like this, which is why I went about programming a complete matrix language for DANSYS.
Displaying the results is easy. I just set the function to the output matrix, like:
XTab=OutMat.
There was some debugging that had to be done, but you can see the final product when I post DANSYSX in the Therian Timeline, here:
http://www.theriantimeline.com/excursions/labbooks
Note: DANSYSX version 1.0 is available now on the timeline.
Tuesday, May 16, 2017
--- Computer Bookshelf ---
2016
First, if you get new software, download the documentation for it, especially the user guide and tutorials. If the home site for the software doesn't have tutorials, search on the web for the software's name plus "tutorial". In my experience, the best way to learn how to use a program is to play with it, but it helps to have some guided examples to run through.
Here are some other books I like:
Musciano, Chuck (1988) HTML: The Definitive Guide, 3rd edition. O'Reilly and Associates. Actually, the definitive guide, and you know you're going to want to spruce up a webpage one day.
Verschuuren, Gerard (2008) Excel 2007 for Scientists and Engineers. Holy Macro! Books, Uniontown, OH. It's for Excel users, but most of it is also applicable for general spreadsheet use, and you know how much I like spreadsheets.
Wikibooks.org (2013) Basic Computing Using Windows. Ditto the other Wikibook, and this one can be downloaded at: https://en.wikibooks.org/wiki/Basic_Computing_Using_Windows
Wikibooks.org (2013) Computers for Beginners. This wikibook, from Wikipedia, is a good guide for people who have never used a computer before and it can be downloaded for free at: https://en.wikibooks.org/wiki/Computers_for_Beginners
Tuesday, May 2, 2017
--- Computer software ---
2016
There are a few software packages that I like and a few sites that also make me happy and entertain me. I've already talked about a few in the article, "Open Source and Freeware." Here are a few more.
I have a soft spot (somewhere in my head, I'm sure.) for the old fashion Windows Help files and you can still compose your own with ShalomHelp. But you'll have a hard time connecting your help files to anything. Just use ShalomHelp to read them. Anyway, ShalomHelp is available at several download sites such as Softonic (http://shalom-help-maker-shm.en.softonic.com). Be careful with these download sites. Some are not monitored very well and you are liable to pick up something you don't want. Also, many of them try to sneak in some extra software with the one you're downloading so be sure and read the information on the installers carefully.
Except for "riders" (those extra programs that get snuck in), I've never had any problems with Softonic, Tucows, or CNET. That doesn't mean they never have corrupted software - it just means I've never had a problem with them.
Python is my current favorite non-LibreOffice Basic programming language. It's both fun and powerful, which is why it's also popular. It gives you constant feedback while you compose. If you type in 5+7, it will immediately return 12. The caveat is that older versions of Python are not necessarily compatible with current versions so, if you're going to use a textbook or user guide to learn Python, make sure the text goes with the version of Python that you have. Here's their site:
https://www.python.org
Since I'm a statistician, Free Statistics would reasonably be one of my favorite software venues. This site offers a lot of surprisingly powerful free, open source, and limited edition statistics software at:
http://freestatistics.altervista.org
Wednesday, April 26, 2017
--- Using computers ---
2016
Long ago, in the late 60s, my brother was a computer technician in the Air Force. That gave me my first deep exposure to computers because I got to look through his training materials and he got permission to show us around what was then the Southeastern Defense installation. Back then, the Southeastern Defense computer was stored in a three and a half story, air-conditioned block house. The block house was air conditioned because the computer was made of vacuum tubes that would explode in the Southeastern summer if they were not kept cool. The computer could be programmed using assembly language but a lot of work was still done in machine code - all 1s and 0s.
Later, in the seventies, I took computer courses at Auburn University and even programmed as a work study student using strange languages like APL, PL-1, FORTRAN, and (Yuck!) COBOL. The computer I used was scattered across the campus. I programmed using punch cards (look it up!) but there was a new medium - paper tape that could be punched and kept in a roll until the code was compiled. A favorite program for up and coming programmers was a few lines that would make the tape punching machine spit out a prodigious pile of paper tape before an administrator could shut it off.
Back then, I would punch lines of code on paper card and carry the deck over to the computer department where I would wait a couple of days until they compiled the code. Hopefully the printout would say what I wanted it to say instead of ERROR.
In the 80s, I worked for Radio Shack and sold TRS-80 personal computers and Color Computers. My first personal computer was a 256K (that's a whopping 256 kilobytes of random access memory) Color Computer with a printer and, for external storage, a tape recorder. There were modules available that could be plugged into the side of the computer. I had an early spreadsheet and (my favorite) a synthesizer that I could program to play four-part harmonies. Some of my original pieces (now available for listening or download on the Therian Timeline) were composed on that computer. 256K - laugh if you want but that computer was more powerful than the Southeastern defense computer my brother worked on. I could program in BASIC!. A new thing at that time was a sorta cool thing called the Internet.
To that point, a computer user was also a computer programmer. Then, user friendly computer programs began coming out and, today, many, if not most computer users have no experience in programming.
When I finally began my professional life in Selma, Alabama, I was equipped with a computer with a few megabytes of RAM, a CRT monitor, and Windows 3.0. I had a job search program which always included Brain Surgeon in the list of possible jobs. I was trying to complete a Masters research project and the work computer couldn't handle my data set. By the time I retired in 2013, I had graduated to a Windows XP machine. I couldn't upgrade further because the program I had built over the 20 years in Selma to process my client information would not work on later versions of Microsoft Office. They had dropped the Visual Basic macro language I was using to program.
I have graduated now to a 581 Gigabyte computer with a Terabyte external hard drive and four CPUs, and a telephone (a telephone, mind you!) with 3.74 gigabytes of RAM and 29.71 gigabytes of internal memory.
And I still get impatient waiting the few minutes it takes for my computer to finish doing what it's doing.
The Yale-New Haven Teacher's Instiute (http://www.yale.edu/ynhti/) has a quaint module called "Computing" from 1981 (That's about the time I was buying my first computer). You might want to read it - it has historical interest.
But, although they used BASIC then, I still use a version of BASIC to program. The Basic that's used as a macro language for OpenOffice and LIbreOffice is both more and less powerful than the BASIC I learned as a first programming language. It's more powerful because it is able to access and manipulate just about all the objects that make up the LibreOffice productivity suite. It's less powerful because the programming part of the language is only a subset of BASIC. For instance, it doesn't have the Data....Read structure that allows BASIC to load tables of data from strings of data contained in the code. I missed that so badly that I ended up programming a couple of functions to do approximately the same thing. "Real" programmers today use languages like Python, C, Java, and Drupal.
Not long ago, a striking shift occurred in the world. Suddenly, paper was not the preferred medium for storage. Before, even with computers, you printed a text and put it on a shelf or in a filing cabinet. Now, people save everything on digital media and, if they want to send something to someone else, they send an electronic file. And there is something called a cloud in which you can save all your stuff on the Internet, in cyberspace.
I often say that my father saw more change in his lifetime than was seen in the entire history of mankind before him. I have seen more change in my lifetime than has been seen in the entire history of mankind before me. My nephew has seen more change in his lifetime than has been seen in the entire history of mankind before him. It's daunting.
When I started to college, students were required to know how to use the greatest portable ever - the (nope, not the graphing calculator) slide rule. Now students have to be effective with a calculator that does logarithms, calculus, and graphs functions. When I started to college, a four function calculator (add, subtract, multiply, and divide) was just coming down to below a hundred dollars. I still like slide rules. They don't require batteries or the sun - but now they're antiques so they cost over a hundred dollars.
Another change.....do you know what an analog computer is? Twenty years ago, analog computers were a thing.
Saturday, January 28, 2017
--- 2017 endurance hike ---
Socrates advised, "Know thyself."
That's what endurance hikes are about.
In the early days of computers, when they were huge assemblages of vacuum tubes, the U.S. security system ran two systems in parallel. If one went down the other came up. If one needed maintenance, the other was on line.
The way they kept them running was by doing scheduled stress tests. They would shoot a high voltage through one of the systems and any vacuum tube getting ready to fail would blow out and, then, the technicians would replace all the blown out tube.
That's sorta an endurance hike for old computers.
Not that I'm looking to metaphorically blow out any tubes, but the physical, mental, emotional, and spiritual stresses that I expose myself to allow me to recognize any "weak spots". If my hip starts aching, I look for ways to change my gait so that it stops and I incorporate that into my regular hiking gait.
Much of my learning isn't conscious. Many think that we learn only with our brains. I suppose that, since most of our communication equipment is concentrated in our heads, there's a temptation to think that the "real us" resides in our heads. That's quite wrong. We live, think, and learn in our bodies. A lot of data processing goes on outside our brains - in our spinal cord, various nerve bundles called "plexuses" throughout our bodies, and even in individual nerve cells. When organisms invade our bodies, chemical changes happen that allow us to recognize the invaders and deal with them, After that, we "have their number" and we keep it - be become immune to the specific organism.
When I moved to Denver, my body had to adapt to the lower humidity and oxygen lean air. It has learned to conserve water and more efficiently take oxygen from the air around me.
When I began my job offshore as a welder helper, I went two weeks unable to grasp things. I had to hold a drinking glass with two hands. The heavy buffing and grinding tools I had to use really worked on my hands.
I did develop muscles in my arms, but mostly, my body, quite unconsciously, learned economies of motion that allowed me to handle my tools without overburdening myself.
So I decided to walk out to Waterton Canyon as my 2017 endurance hike. I'm glad I pulled the date back to January 26, because I noticed that Denver Water, who manages the canyon, was planning to close the lands during the week starting early February for some months.
I was still working out glitches in my use of duct tape to prevent plantar blisters and a hike a couple of days before had left me with blisters along the tops of my big and little toes. Those are not nearly as debilitating as the plantar blisters used to be, but I still needed to work on it. The tape would literally pull strips of skin off my foot at the edges.
So I planned to wake up at 4:00 the morning of January 26, get ready, and walk down to the local Steak and Shake for breakfast before hitting the trail. I also decided to take the train most of the way down to the canyon - to Mineral Station. I wanted to spend most of the day in the canyon and maybe take in some of the Colorado Trail at the top before walking the South Platte River Trail back. Forecasts looked great - cold and a little overcast.
(Mineral Station)
Mineral Station was quite a lot further from the Canyon that I expected. In fact, it was a 14.5 kilometer (9 mile) hike. Chatfield State Park is bigger than Bear Creek Lakes park and much more grueling. Once you get over Mount Carbon in Bear Creek Lake Park, the rest of the trail is easy, Chatfield is all up and down. And Chatfield Dam is a 147 foot rise that you have to address.
(Chatfield Reservoir dam)
I was pretty well worn down before I reached the canyon so I decided not to hike the whole thing and I only took about a third of the trail. It was till spectacular and well worth the pain. I walked about 3 kilometers (1.9 miles) into the canyon, up to the Highline Canal diversion dam. Here are some pictures.
(pictures of Waterton Canyon)
Denver was built on the banks of the South Platte River and it is the major waterway. Also, the HIghline Canal zigzags all over the Denver region. A National Landmark Trail, the Highline was completed in 1883 as an irrigation canal. Today, the major use is the trail that parallels the waterway.
Both the river and the canal run out of the Rockies through Waterton Canyon. The canal is feed by the river at a diversion dam before running through a tunnel in the mountain to the other side, then there are feedpipes that catch other waters in the canyon and run them into the canal.
(pictures of the Highline)
I was already exhausted and in pain when I turned around and headed out of the canyon - another 22.5 kilometers (14 miles) and a train ride back home. And what did I get out of it?
Well, Waterton Canyon was spectacular and it was the first time I had seen bighorn sheep. Through it all, the bane of my hiking life was gone - no plantar blisters! I had figured out how to keep the duct tape that was wrapped aound the balls of my feet preventing the plantar blisters from literally ripping off strips of flesh from the sides of my feet. I had placed bandaids under the tape at the base of my big and little toes. The toe bandages on all my big and little toes kept them safe from how my boots broke over my toes somy busted left foot came through the ordeal very well. I managed my knee and hip joints and spine with precision. I had to focus on my pacing and breathing, especially during the trip back. On the 45 kilometer (28 mile) hike, I fine tuned my body and learned just about everything I needed to know about how to keep going after most of my reserves had expired. I think it was worth it all.
But, that said, this was probably my last endurance hike. I want to shift my focus to the rest of the world, the one outside myself, so I will be doing more technical hikes in he future, but many of those will be as grueling as the endurance hikes.
Labels:
adaptation,
Chatfield State Park,
Colorado Trail,
computers,
Denver Water,
duct tape,
endurance hike,
immunity,
joints,
learning,
Mineral Station,
plantar blister,
stress test,
thinking,
Waterton Canyon
Subscribe to:
Posts (Atom)