Tuesday, May 31, 2016

Visions of the Future; part 2; You Don't Really Need a Debugger

So, I've learned enough about VBA to write a few subroutines with variables. A subroutine is what the programmers, or coders, call one little part of a program. These little subroutines were excel macros. 
I didn't know what a macro was for a long time. A long long time. I would read the word "macro" and immediately think of "macrobes", a scientific sounding term in the CS Lewis space trilogy that I don't think has a title for the whole trilogy. A "macro-title", you could call it, like "Lord of the Rings". I quite enjoyed the Lewis series, most of it, even the religious elements; because he reworked Sunday school stuff into fun science fiction elements.  Unfortunately the Sunday school stuff took over the series in the end. Much like the Microsoft part takes over and ruins all the cool stuff that Microsoft almost develops. There, I brought it all back. It was no digression after all. Macrobes, cool, "Macros" why called so?  
But eventually I learned what macros are and had lots of fun recording macros and looking at the code - You can record a macro in excel or word, and then go look at the automatically generated script in the Visual Basic editor. You can find the Visual Basic editor by employing super secret hacker methodology, going into the excel or word options menu and clicking an option in one of the menus. You'll immediately know when you go into the visual basic editor because you go from the newfangled ribbon layout of the later versions of excel to a layout looks like Windows 3.11. I think they've probably kept the old-timey look of the editor because the only people that use it are my age, and we don't like things to change. 
The editor is fun because not only can you look at the generated script, you can change it just as easily as you can rewrite an email. And you can add things to the macros or subroutines  like variables, which I learned from the Dummies book. I'm just old enough to admit that I found the dummies book helpful, and just young enough to feel embarrassed when I admit it. 
And Ive learned just enough about variables to write some macros that Ive used at work, but read just enough online to know that my coding is incredibly lazy and sloppy and jury-rigged. I constantly attempt macros based on ideas I have that are always slightly beyond my actual programming abilities, which due to extreme mental laziness I consistently overestimate. So whenever I have trouble with public variables, which I always do, I just slop the data into some corner cells somewhere in an unnamed sheet that I may later delete because I've forgotten about the slop and end up wondering what the hell happened to my previously kind of working macro until I go back and rework some lines and accomplish nothing or make everything worse until I remember the slop data and think I can just use a public variable and it doesn't work so I redo the slop sheet and put a note to myself not to delete them and delete the note later when I find copies of the same file in two folders and keep the newer one without checking the change history. And I write bad comments that I never understand later, during the long debugging/utilization process.  And I do not practice good file management/ organization techniques.  So I have grown very accustomed to the "Send Error Report?" Message box. It's one of the most reliable results in my macros. 
Having achieved this level of VBA knowledge, wherein I am constantly in "debug" mode in the Visual Basic editor, I decided to try web programming, the glamour child of the programming world; using html, css, JavaScript, all three coding languages with no debug mode at all, just a stab in the dark guessing game. I wanted to have a neat website, you see.  So where my bad programming with VBA results in error messages and yellow highlighted lines, the inept JavaScript programming results in a blank. It just doesn't do anything, and I end up looking through my handiwork in total confusion, looking for semi-colons and curly brackets, as illustrated in this week's pic:

Please note that I couldn't remember the names of any real laptop making companies nor what the back parts of a computer look like. 
After finally getting the script to do something, I have to get it to do what I actually envisioned it to do, which means inserting an endless series of "alert" boxes in an effort to pinpoint the parts where the written code has diverged from my inner vision. My inner vision can swing right by brackets and misspelled variables without a trip up, this is one of the marvelous things human brains can do. We can run a preposterously illogical program in our heads, we can compile almost anything, no matter how sloppy it's written. 
I easily picked up JavaScript from free iPhone apps, because it's comparatively easy if you know a little C.  It uses C type script, which Ive learned from a beginners guide that my wife got me, that I didn't think would be useful but thought would be fun and it turned out both. When I say easily picked up, of course, I mean just enough to write web pages that do things that are somewhat related to what I wanted them to do like the shadow of a cone is related to the taste of ice cream. Still making the hand shadows and waiting for that sweet taste of functionality

Tuesday, May 17, 2016

And another change in direction, I'll shake off you readers yet!

I learned many valuable things during my Year of Moving Constantly (covered in my previous blog series 6 Migrations - link to be updated post post).  The primary lesson: Do not keep more than you can swim with (one hand free). 
I have adhered to this valuable principle in all my efforts to build readership of this blog, and this post is one of many occasions where the enhanced mobility made possible by the light readership of the blog has rewarded this adherence. Yes, I'm changing direction again and starting a new series. No, this does NOT mean I won't EVER return to previous series. Think of this blog as a sort of verbal TV station where they do a LOT of pilots and they still haven't cemented a programming schedule but they never ever do reruns. YEs!
New pilot: Gateway to the Future - a brutally honest account of my personal attempt to learn computer programming, or "coding" as the young people call it. Lingo is important. My journey to VR will include many new terms, like "VR" which stands for "Virtual Reality", which is the future, especially for old people like me, who will be the first old people to be plugged into a VR cable and left to rot on a plastic recliner in a room strongly resembling a closet by our ungrateful children. That's if we're lucky. That's what this quest is all about. I don't mind the thought of living in video games at the end of my life, but I definitely want to be able to hack the system enough to verify that the attendants are changing my diapers and linens. Especially if the attendants are Russian. They might be robots, of course. So much the better, then I will be the secret boss of the living center, controlling everyone's meds and room assignments, scheduling snack time, who gets first dibs on the whirlpool. Obviously I've thought about it a lot. But first, I'll have to learn "coding". Don't say programming online. They'll tear you apart in the forums. It's like admitting you only know Visual Basic (wipes away tears - vicious little bastards). 
Which brings me to the first installment of Gateway to the Future, learning Visual Basic for Applications, which is super easy to do if you have MS Excel, which I do, and you like it, which I do. Excel is the best thing Microsoft ever did. As a matter of fact it might be the only good thing Microsoft ever did. I'm thinking about it, but no sense in wasting too much time...
I've actually taken a few stabs at learning programming in the past, one a long time ago, in high school, in the computer lab, when a friend who was TA'ing in the computer lab and who I played this King Kong banana throwing game with (I was not taking computer lab, I was TA'ing across the hall, don't remember anything about it as I spent all my time in the computer lab or riding around with my friends) showed me how to call up a list of Basic commands from the DOS prompt. I remember the mindless enjoyment I had, typing at the prompt, watching the files and directories whiz by, and then typing DEBUG and something else and suddenly seeing a column of characters and gibberish, all hex numbers, and discovering that I was seeing a text file Character by Character, as it was actually written on the disk itself!  I was amazed , but I was also thinking a lot about girls and dice and sci fi novels at the time, and we didn't have a home computer, and I will totally give up on something, at the drop of a hat, so I never learned more. 
Later, during one of my many spans of unemployed time, I took a stab at learning Visual Basic.Net, which seems to have flickered in and out of existence in the time since then, and I don't really understand what it's for now and can't afford to re-learn and there's so much free stuff to learn that there's no point. I quite enjoyed that experience, to the point that I eventually made a picture viewer for my web page, where people could click through some of my drawings that I'd scanned. But eventually my unemployment ran out and I had to go back to work at various horrible temp jobs and had no time to return to it until now. 
And I discovered that not only could you record macros in Excel, which I had used often and on some rare occasions even for actual work, but it would actually generate VBA code as you recorded and you could edit it!  It was on a par with the time my wife showed me the board editor in Age of Mythology. I was amazed that Microsoft had included something fun in their office software - but of course, it was for Excel. I eventually got a for Dummies book on Excel programming, and midway through that book, I experienced my major insight on computers and my relationship to them: I hated and feared computers for the same reasons I hate and fear air travel; total loss of control.  You are in the maddeningly indifferent hands of others, subject to their soul-sucking security checks; bag probes, password requirements, security questions, long lines, progress bars, enforced bare-footedness (an ancient Assyrian technique for humiliating prisoners), swirly word pictures that don't make a recognizable word!  
The solution? For air travel, to find superman's fortress and steal his green crystal (if you dare run through the gigantic hologram of Marlon Brando, denouncing you in a voice like thunder! - it's just an alarm system, but superman is coming and he is very swift and fast) that is to say there is no solution but the proud highway, meaning road trip. 
But for computers there is a solution, the green crystal is out there and you can steal it from them, we are aged but cunning and I still have a day job thank Christ. Many my age have no net, and face the grim prospect of mass competition with the other career refugees, learning to program in some language they will come to despise in "coding boot camps" with masses of other bewildered old timers, now rendered useless by the creepy millennials in Feel the Bern T-shirts, waving batons (crafted to look like light sabers) and herding us and our children to the vast tent cities accumulating just outside the inner city cosplay-grounds for twenty somethings where they work. 
I will be avoiding the boot-camp type learning system for now, as I prefer to learn at my own pace (think glacier), but I'm not above jumping in if the financial opportunity presents, like an old people scholarship or a bequest. 
Back to the VBA for Excel book, and my quest to learn to learn coding. Upon experiencing the epiphany, I made a goal that I would make a game written in VBA and configure it as an Add-in that anyone with a copy of Excel could install, but since then I resolved on another goal which has put the Excel game on the back burner: To rework the hagenart website with JavaScript. I resolved on this goal because I picked up some JavaScript from a free app, (which I will credit and discuss in time), and JavaScript is fun and maybe I take too readily to quick and easy and I'm tired of all the remarks on Stack overflow. 
Also, with html and JavaScript I'll be able to put actual examples on this blog! Maybe, not sure of the support

Tuesday, May 10, 2016

The Unbearable Lightness of My College Experience; A Scientific Treatise

This post marks a departure from the sloppy, narcissistic solipsism  of the previous posts in this series. Actually "this series" is over. I have begun a new series. So this post actually marks a new series, not a change in the current series. I will however be using pages from the current sketchbook, the same sketchbook that I used for the recently ended series, as graphical scientific illustrations for the new series. Just to make it clear to my readership, or mother, that I haven't given up on my resolution to do two drawings a week for the whole year. 
New series: A scientific study of my life, beginning with college and going back, like a paleontologist, digging down through layers of dirt to find older and older fossils. What a miserable job that must be, digging and sifting through the dirt, looking for bone-shaped rocks. You can tell how miserable it is by the toys they give kids to promote the science: Shovels, sieves, and tooth brushes. The etchings look fun though. 
And speaking of fun: The Marriott Library. My primary college residence, or my primary hangout while in college. For most of my collegiate years I resided in my parents' basement, and did not experience a great deal of the magic and excitement of the college years that you see in movies. I wish I could say that I devoted that socially muted time to intensive study, to the maintenance of 20+ hours of bio-engineering and applied mathematics classes, but obviously I can't, or I wouldn't have built up to it.  
I spent a lot of my freshman year in the Marriott, with my face buried in textbooks, sleeping. I did discover the abnormal psych section in one corner of the fourth floor, and spent a good portion of waking time reading the kinkier case histories. I also enjoyed finding a study desk by a window where I could watch people walking on the sidewalks outside, or, as depicted here, I particularly treasured the rare days I found an empty desk around the edge of the atrium, with the marvelous view of the people wandering the lower floor card catalogs and or pretending to study at the other desks. 

But that was freshman year. Utah is a commuter college in a fairly populated area, which, I've been given to understand, offers a more impersonal, or less iconographic, college experience than the small town university. A part of me enjoyed the bleak solitude of afternoons on campus, but I'd seen enough frat-centered college movies to know that I was missing something.  I believe advertising agencies are built around this strangely suggestible facet of the human mind; that an artificial image of life, pretended to be lived by attractive and well dressed people in a setting far from one's life, or possibly any real person's life, can instill a powerful desire to imitation. They call it "following your dream" in America. It almost always ends in disappointment, but the small minority of success stories are the people with the free time available to write books about it. 
Forgot my original point again, but that doesn't matter.  Whatever point I thought I would make was a digression from the more important general purpose of this new blog direction. So I digressed from a digression from the redirection, bringing it all back the new direction. Which is science, meaning charts: