Showing posts with label Tech Tuesdays. Show all posts
Showing posts with label Tech Tuesdays. Show all posts

Tuesday, October 14, 2014

TECH TUESDAYS - PYTHON FOR EVERYONE, CHAPTER 1




It's been a while since I blogged. Not that I haven't wanted to, but life gets in the way, and I've been busy with practicing the viola and brushing up on an old skill, which I really haven't used since college. Programming. Now, that you've all had a chance to recover from "Playing the Violin and How to Avoid It", this seems like the perfect time to resurrect "Tech Tuesdays" which for some god-awful reason has more hits than any of my other gibberish. Probably because those posts contain actual information and not the usual deranged ravings of my half-assed weltenschauung. To that end, and to kind of kill two birds with one stone, I've decided to chronicle my recent foray into Python programming, which I am taking from Dr. Chuck I Forget (Severance), at the University of Michigan, a place where I spent many happy years, learning the viola and discovering how to be an Anarchist (not really), so my education there was not completely for naught.

Anyway, it seemed only natural to take up programming again, as I thoroughly enjoyed it the first time around. Maybe this time, it'll stick.


Apropos of nothing, here's this magnificent white lion to look at!

This class started with the ceremonial loading of Notepad++ and trying to configure it, working off of old screen shots and playing "Guess the menu item" via the instructions given me. Once that was done, I downloaded and installed Python v. 2.7.8 and then, in my typical fashion, proceeded to try and run a simple program. -_- This was akin to trying to communicate with a cow via using an IBM Selectric. Nothing happened. I typically skip all the verbiage in programming books and run right to the appendices. In this case, I overlooked a crucial step, when using the "Start" > "Command" in Windows. I SHOULD have been looking for the Command.exe that comes as a standard part of all Windows versions, yet I was going directly to the Python.exe file and it was unable to find the simple program we had been given to try out our brand-new installs of Python.

Once that was sorted out, I typed within the Python command line, at the chevrons >>>:

     x = 1
     x = x + 1
     print x

This gave me 2, which let me know that I had installed Python correctly, or that it was running correctly, or that the sun hadn't exploded and the earth was melting. Whatever I did, it worked and happiness reigned. 

The professor teaching this course is a huge proponent of open-source coding and sharing of information. We are allowed and encouraged to use the text that is provided with the course. The link can be found here: PYTHON FOR EVERYONE and I encourage those of you who are interested and still reading this to get the documentation and follow along at home. 

I've zipped through the first chapter, and am on to the second. I'm rather behind at this point, due to playing in the symphony and my initial fumbling around on my desktop, which is the norm for me. I'll get caught up and finish the course. Never having dealt with Python before, I'm seeing a lot of weird syntax and whatnot, but Dr. Chuck assures us all that it isn't going to make much sense in the beginning. It does to me, in a Boolean sort of way, but I understand computers and how they work and think; I'll worry about the details as we go along. 


He's a terrible programmer, but wondrous to look at!

So, here are the answers and results that I came up with for Chapter 1, and I'll update as we go. I'm also doing #ROW80, although the poor people there probably think I've died, or have given up on me. #NaNoWriMo is next month and I am writing a sequel to "Music of the Spheres", or more Undead Alien Underground Railroad happenings are to come. On to Beethoven's Fifth Symphony and Rossini's "Thieving Magpie" overture. Peace out.



PYTHON FOR EVERYONE

Chapter 1 Exercises

1.1. What is the function of secondary memory in a computer. The function of the secondary memory in a computer is to (C) store information for the long term -- even beyond a power cycle.

1.2. What is a program? A program is a set or series of instructions directing the computer to execute a series of actions at your behest.

1.3. What is the difference between a compiler and an interpreter? A compiler is used to translate an entire program into machine language. An interpreter is used to execute a program in a high-level language by translating it one line at a time.

1.4. Which of the following contains "machine code"? a) The Python interpreter. The Python source file is the file written by the programmer.

1.5. What is wrong with the following code:
       >>> primt 'Hello world!'
File "<stdin>", line 1
primt 'Hello world!'
ˆ
SyntaxError: invalid syntax
>>> 
The instruction 'print' is spelled 'primt' yielding a syntax error

1.6. Where in the computer is a variable such as "X" stored after the following Python line finishes? Depends; if written in an editor, "X" is contained in the file, which is stored in the main memory. If that file is saved to secondary memory, it is there as well. If it is just part of a small program that was typed into the interface, it is lost on re-boot.

1.7. What will the following program print out:
x = 43
x = x + 1
print x
44

1.8. Explain each of the following using an example of a human capability: (1) Central Processing Unit or CPU. The brain. (2) Main Memory. Again, the brain. The hard drive of the computer. (3) Secondary Memory. A notebook, a grocery list. Anything outside the body used to store ancillary information. In terms of the computer, a portable disk drive or a thumb drive, cloud drive. (4) Input Device. Eyes, ears, mouth. Keyboard, mouse, touchscreen (interface) (5) Output device. Mouth, hands (for writing, signing). Printer, speakers, screen. (I add computer correlations, because I have Asperger, and I don’t allow for wiggle room – deal with it.)

1.9. How do you fix a “Syntax Error”? Correct the speeling. :D

Tuesday, March 11, 2014

TECH TUESDAYS - EASY STEPS FOR A CLEAN APP INSTALLATION

courtesy of: Sky-roxorz-815

 A true computer geek's dream. Scramble-o-translator, anime and Base 2 inference; it doesn't get any better than this!

No, this isn't a real Microsoft error message, although it makes as much sense as many of them that I've seen. Strings of numbers, cow-faces and fractured computer-jargon spit out by a hard-wired processor trying to make sense of some idiot coding created by the current Mongol-Horde School method, or Tilt-A-Whirl, where everyone code and compiles and uploads to a "cloud". Which used to be a "WAN" and then turned into a bunch of servers tied together. Now, your iPad can write code and upload it to a "Cloud" where other idiots are busily writing code on Atari 64s or in Linux on Quad Cores or in OS/2 on home-built farms and somehow, it sort of works, if you don't mind glitches, Do Loops, getting disconnected and losing your files, or having them turned into Frankendocs. It's a wonder the translators work. Ah, technology! Ain't she grand! And when I get tired of trying to unsnarl some of Google's finer messes, just so I can write a goddamned post, I can step away from the 21st century and back to the 19th century and play Richard Strauss on my viola. That at least, still works!

The reason I have to write this here post and all my other posts in Fire Fox, as opposed to Chrome now, is that I refuse to use the "Chrome Drive" to upload my pictures. It's a fucking hassle and I have a stock base of pictures that I use. I would ditch Chrome altogether, except that there's this whole social media thing going on, called Twitter and Twitter don't do FF, and so on. Nobody plays with FF very well anymore, so I write my posts here, just so I can add my pictures; call me a Luddite, but it's another stupid step I don't need. I did the Picasa thing and I'm tired of jumping through Chrome's and by extension, Google's hoops. I had an issue with my profile for 6 weeks. Their solution? DISABLE AVG!!!!!! GOOGLE, ARE YOU OUT OF YOUR FUCKING MIND?!?!??!?

I haunted their forums, tried a variety of all of their fixes and finally hit on the correct fix for multiple profiles, and guess what? I AIN'T TELLIN' THE BASTARDS A THING! IT'S MY SECRET!! NYAH, NYAH, NYAH!! It had nothing to do with deleting my users folder or any of the thousand other variations on that tune and DISABLING AVG DIDN'T WORK, EITHER! So, bite me, Google!

But, what I really wanted to talk about today was how to download an application that you would like to use and that you know is safe. There is a correct and simple way to do this, and I'm going to walk you through the process for a nifty little gem called MoffCalc. They have just released v2.0 and we'll use that. I've used their free version for years, and it's far superior to Microsoft's Calculator, because it has a "tape" that displays, and that is the sole reason that it's a better thing than Microsoft's version. It is also scalable, so for people with impaired vision (like moi) can make the thing huge, so that I don't have to guess at the numbers. 

Anyway, to start, make sure you are logged in as ADMINISTRATOR on your Windows account and that you have UAC privileges turned on.


1.  Go to "Start" in the lower left-hand corner, click on "Control Panel" and "All Control Panel Items" then "User Accounts" to make sure you're account has full Administrator privileges.

2. Go to the website, to download the program you want to install, if need be. I went to the MoffCalc website, found here


It's gotten popular since I first started using it, and now, with this newest version, you can purchase a license for v2.0 for 19.99! But the free version is wonderful.


You can even download and try both; I selected the second one, as I have the first. 

3. Go ahead and save the file to your download folder or on your desktop.


4. Now, go to our old friend "Task Manager" by right-mouse clicking on your Task Bar, or using <Ctrl> + <Alt> + <Del> and choosing "Task Manager" from the list given. Close any unnecessary programs. While this is not crucial for MoffCalc, it should be done out of habit for any program you install, as it lessens the chance of corrupting any common, or *.dll files.

 
5. Find your selected download, and highlight, do a right-mouse click on it and before opening, or running, SCAN with AVG, or MALWAREBYTES. Again, MoffCalc is a trusted site, but so is JAVA and it has a storied history of Trojan-infested downloads, so always protect yourself and do this. If you're still unsure after the scan, don't run the installation.


Clicking on the Setup icon will launch the Wizard. It will set it up and give you the choice to "register" or pay, or try free for 30 days.

 
That's all there is to it! I love the fact that it has a tape like this:


so that you can go scroll back up the tape and check your work!

March 21st is looming! Come and join us this Thursday night, March 13, at 8 pm, EDT on Twitter, #AZChat! @DamyantiG is hosting for the A-to-Z Challenge Chat and we'll all be there to answer your questions!

Saturday, March 8, 2014

TECH SATURDAY, BECAUSE ON TUESDAY, STUFF HAPPENED – KILLING AN UNWANTED OR FAILING PROGRAM (THREAD) IN MICROSOFT


Where the Cable Cars really DO go half-way to the stars. . .

A few weeks back, I got my panties in a wad, because some idiot hax0r came up with a terrible scheme to “spoof” the public and buy his stuff, which was worthless and bug-ridden and a security threat. While that in itself was not particularly dangerous, his method for doing so was, and I, being ever alert to such chicanery, decided to start “Tech Tuesdays” for people who aren’t necessarily all that familiar with what’s under the hood of the family time-waster. 


There’s a reason for this; I live in a strange neighborhood, that’s one-half ‘bangers and ‘hos and the other half sweet grannies and their grandkids. Then, there are folks like me, who have, shall we say, “interesting and storied pasts” and live rather comfortably between the two. My business partner is a former DOD employee who mustered out after the start of the second Gulf War. He’s my hardware guru. I have been in the business long enough and traveled the back alleys and by-ways of the computer universe to keep abreast of the threats and oddities and transmogrifications of various software worms, viruses and Trojans to keep the little old grannies and their kiddies safe.

I host a network called “FBI Surveillance Van” for all the would-be internet thieves near me (It's protected by a hexi-decimal cypher, so unless Einstein has been reincarnated as a crackhead, I'm safe) . The CIA is going to be setting up shop soon. I love to keep ‘em guessing. Anyway, after the nasty “spoof” found here, I decided it would be a nice thing if I just put up some simple things for folks to help keep their own systems free of mice, lice, tics and bugs. I can’t help you with Microsoft; it’s a giant bug-patch, all unto itself. I don’t touch Apple. It’s a JAVA nest of Hell and I hate their processors. Call me a Luddite, but I use no smart-phone, however, I’m home most of the time.

Today, I wanted to talk about what happens when something just stops, goes into a business loop, contemplates it's navel, refuses to run, or crash completely, and just sits there, eating up your CPU, or Central Processing Unit. This is where all of the instructions are carried out; the literal brain of your computer. You can have the cleanest, leanest, meanest system in the world and if your Candy Crush Client (why?) seizes up, you are going to sit there until Doomsday, waiting for the bitch to do anything. I don't care of you have an AMD Quad Core or an INTEL hoo-ha processor, that brain is going to churn and churn over some stupid command, caught in an endless, infinite, "do loop"

While not necessarily the fault of the gaming code within Candy Crush, certain outside elements on your system itself, will produce "do loop" results. Or, knowing Candy Crush, it's just shitty programming (again, why?). The one executable command will repeat into infinity, unless you, the weary and aging user, step in to halt the bitch. 

Here are the simple steps for that; I actually used SETI@home for the demonstration, because, they are astronomers, not programmers, and after you make SETI 'snooze', there is no way to halt the client. In my case, I 'snooze' first, because I do NOT want to corrupt my data, so I suspend the operation:



Once I see that red bar to the left of SETI@home v7, I know my work is saved and I can continue.

courtesy: Cracked.com Photoplasty        
Unlike Scotty here; the poor bastard in the Transporter never knew what hit him.

Aight! Fun time over! Now, do a RIGHT mouse click on your Windows task bar at the bottom of your screen, or at the side. You're going to be looking for "Task Manager".


It works in Windows Vista and 7. To get to it in Windows XP, use keyboard strokes <CTRL> + <ALT> + <DEL> at the same time, and select "Task Manager". I don't know nothin' about no Windows 8. Windows 8 looks like a pretend OS. Screw Microsoft. 


Windows Task Manager Processes screen shows all of the "threads" of the applications you are running, or more aptly, not running at the time. Look for your offender and highlight it. Click "End Process".


You will always see this message; if you clicked on something else by mistake, and the process is crucial to the running of your system, Windows will NOT allow the killing of the thread to take place!

Once I "kill" the boinc.exe process, all subordinate processes will die as well. You can do the same with Chrome, or any application, but ALWAYS kill the *.exe. It is a cleaner way to exit the program and you lessen the chance of corrupting any *.dll files or any other subordinate files. 
That's all there is to it. Of course, if it happens continually, shoot me a line, or try closing other programs before running whatever it is that freezes on you. I can't help you with your Candy Crush addiction. Level 70? My, my, my, my, my.

Don't forget! March 21st is the date for the Great Theme Reveal! The A-to-Z Challenge is almost upon us and you don't want to be caught theme-less! Check us out at #teamDamyanti on  the A-to-Z Challenge Blog! I am one of the fabulous Damyanti's assistant's this year, along with my great team members, Vidya Sury, Anna Tan, Samantha Geary-Jones, Guilie Castillo Oriard, Csenge Zalka, and Jemima Pett, who at this very moment has a post about her own Theme Reveal!