Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Wednesday, December 13, 2017

Starting Out (and pulling my hair out) with Flask

Recently I started learning the Flask web framework.  Mostly because I have been doing a bunch of Python coding and would like that to bleed over a bit into the web development arena.  The need is not really out of anything work-related, its more of a personal project need.

I can say, though, that getting apache and Flask operating together has certainly added a few grey hairs to my head, mostly in frustration.  There are plenty of resources ( if you search the Googles) for setting up Apache web server and Flask, to work together.  But I have to say that, as great as the resources that are out there, are, there are a few (pertinent) details that were left out of most of them that I will now cover.

First, working in a Virtual Environment does not have all of the same settings as not working in one.  If you look at this link, you will see (near the bottom of the document) that there are a couple of things you have to set in your .wsgi file, to specify the load paths for your virtual environment. 
NOTE: It is important to note that that link is the same root site for the Flask link above.  So they definitely have a lot of documentation on their product.

Now, while the above is important, it didn't solve my issue, which is that on a machine remote to where I am running my Flask app and web server, I was not able to go to http://:5000 (the port Flask runs on) and see the page displayed as expected.  Instead I received a typical error page stating that the page could not be loaded.  This got even more frustrating with each new thing that I tried or modified to get it working.  No matter how seemingly possible of a fix, it didn't work.  Until.....

I found a StackOverflow thread about running a Flask app under the Apache web server.  I read the person's question and went through their code (seeing all the similarities) and there it was... a setting that no other site had mentioned.  Not even the video tutorial I was going through.  It was part of my Flask app's __init__.py file and the part in question looks like this:
app.debug = True
app.run(host='0.0.0.0')
The first line is inconsequential and just turns on debug mode.  The second line was 1/2 different from mine, but crucially different.  I had the app.run() that all the tutorial's had mentioned, but I did not have the host='0.0.0.0' portion.  I put it in, started up Flask (by running the __init__.py file) and VOILA!!!  I had the output that I expected to see in my browser. 

Needless to say, it was certainly a learning experience ( as I now have plenty of notes for running a Flask app with Apache).  Now I can get on with my learning of the Framework since the tedious job of getting the web page serving is now out of the way.  Yay!



Wednesday, January 06, 2016

Online Learning - Open Source Society (Computer Science)

Almost a year ago (1/31/2015 to be exact), I posted an article about online learning.  I reviewed a number of online places to take courses and learn a new skill and provided the list. 

In my research around the internet I stumbled across another resource which I have found very valuable.  I am referring to the Open Source Society page on Github.  The OSS has the tag line "Path to a free self-taught education in Computer Science".  This is great for someone similar to myself, who his completely self-taught, or is looking for an inexpensive way to get into the field, starting with Computer Science. 

The courses listed are sourced from several of the places that I reviewed in my previous article (MIT, Stanford, Coursera, Udacity, Edx, etc) and are all Free for the taking/learning.  The nice thing is, you don't have to go searching through and navigating each of the individual sites, the links are all gathered for you there on the OSS page. 

Hopefully this comes in as handy for everyone as it has for me.

Saturday, January 31, 2015

Online Learning For The Self Taught

To begin with, I am a self taught person.  I spend most of my downtime trying to learn or read about something new.  I am always of the mind that I don't know everything and that there is always something that I could be learning.  If you ask my wife, she will tell you that whenever I go someplace, I typically have a book with me, or have my nose in a website trying to learn something.  You should never, ever stop learning.  It keeps your brain young and you on the cutting edge (if that is where you yearn to be).  For my field (I am a Systems Engineer), there are so many changes every day, you can never truly keep up.

Now don't get me wrong, I am not slamming or advising against a formal education.  If you have the opportunity afforded to you to go to college, by all means, go.  You will not regret it and it will benefit you in the long run.  There are some organizations where they require a college degree or they won't even look at you as a candidate (yes, I have run into these).  But, if you are like me and you either don't have the chance, or were not able to finish college, then you will need to seek your knowledge elsewhere, and today that is the online world. 

Online learning takes many shapes.  You can find tutorials on a large number of sites, usually blogs, that will guide you step by step through a particular task or in learning a programming language.  Then there is a slightly older technology called a CBT (Computer Based Training).  You won't run into this much online, but you may find it at large companies that have an internal training department.  You sign up and take courses from their internal learning website.  Its one way, they feed you the information and you write it down.  There may even be a quiz or two. 

Then we get to one of the latest things, the MOOC(Massive Open Online Course) or also referred to as Open Courseware.  This is a system that has now been employed by universities and websites alike, allowing people to take their courses either for free, or for a fee.  Some of these even offer a certificate as proof of passing the course.  

You will find that there are many universities that you have heard of that have MOOC available to the public, but also some you may not have.  A couple of names that stand out are MIT, Stanford, Yale, Johns Hopkins, Harvard, Duke, and the list goes on.   You may find that while the colleges have a page on their site to inform you about their open courseware, their site actually links to something like Coursera, or EDX.

When I first started looking for online resources to learn from, I came across some of the typical "Hey, come here and take our course on ", only to find out that it was either misleading and only gave a very small, a lot to be desired intro, or they got you to a point and they hit you up for money to continue the course.  That really burned when I ran into that.  There are still those today, believe it or not.   I am big into Data Science, and discovered a site called dataquest.io.  I started off with the first lesson or two, but was soon prompted to sign up for their premium service if I wanted to continue.  I was disappointed as there was some aspects of the site that I was interested in, but I just don't have extra funds to pump into something like that at the moment.  I have to keep things on the cheap.  So if you are interested in something like that and have the funds, but all means, check it out.  
So in my further quest, I decided to try and find if anyone had compiled a degree curriculum or syllabus, listing the courses needed to fulfill that degree, with links to said courses.  It took me a bit of searching, but I finally found a couple of links to what I was looking for.  

The first one I found was that of a Bachelor's level curriculum in Computer Science.  This was great, exactly what I was looking for.  What was better, was that that page was already updated to include a link to their Intensive Bachelor's level curriculum in Computer Science.  This was fantastic.  I looked through both lists and was amazed to find such a complete curriculum list, compiled and with links.  

While I was blown away by what I had found, I wanted more.  I still have an interest in Data Science.  There has to be something out there to satisfy that need, and there was.  I bring you, the curriculum for the Open Source Masters in Data Science.  This filled a void, and a big one.  This had an awesome set of courses and links to books as well.  

As you can see, I was able to find 3 different resource that provided me a full curriculum, with links to courses.  All that's left now is to take the courses.  Ah, to have that much time available.  If you do, that's awesome, have at it.  I, unfortunately, only have so much time, but I do my best.

In all of my perusing of the internet learning resources, I have come across a few and made some notes on them.  I provide those for you below, with some of my comments on each.  

Online Learning Sites

- All free
- Beginner learning tracks
- git (source control), web dev, iOS, misc electives, ruby, javascript
- Also has screencasts giving overview or tutorial on specific topics  (ie:  they have a 4 part screen cast on docker)

- Computer related
- courses are free to take
 - You can get a certificate for some courses, but that costs money

- A large number of courses in a bunch of different categories
- free
- all link to free courses at schools that have the courses online

- Tons of courses
- Free
- Not always current teachings, but within a few years.  Material still quite valid.

- large array of courses
- math
- languages
- computer science
- web development
- all free

- tons of courses
- all free
- great for kids

- 10K free, online courses

- Lots of topics
- Degree related studies
- Free

- Lots of topics
- Free

- Lots of courses
- Free
- Large array of topics

- Free
- All technology based

- Costs $$
- Technology based

- Free
- Each topic shows places on the web to learn

- Laern to code
- Free
- A few different tracks

- College
- Free online courses

- Free
- Online Educational courses in a variety of topics

- Course software offered by from multiple online sources

- DevOps approach
- Free

- Learn data science in your browser
- Misleading initially.  You can only take a few 'missions' for free, but then are required to pay a subscription of $35 or more a month to continue.

- Online curriculum
- Lists where to take courses
- Lists resources for online learning
- Also lists book price, if available



Well, that is the list which I have compiled thus far.  Its not complete by any stretch, but instead is meant more as a taste of what you can find via your favorite search engine.  There are so very many sites that you can find, hopefully you will find the courses that are right for you and further your knowledge.  

So go forth, and learn ( and have fun doing it ).  Master your craft and be the best that you can be.

Not to be all cheezy, but I leave you with a quote from the movie "Drumline":

"And if you don't have the honor and discipline to learn you craft... then quite frankly Devon, you don't deserve to be here."   - Dr. Lee to Devon Miles

















Thursday, December 20, 2007

Adding to the Repetoire

I have been playing around with Perl for about 1 1/2 to 2 years. The last (almost) 8 months of that time has been actually doing it for a living and not on my own, outside of work. The work experience that I have gained in invaluable, but having a job as a Perl developer has also allowed me to delve much farther into the Perl world than if I hadn't had the job. Heck, even having a job AS a developer was absolutely beneficial to my development as a developer.

In the past 8 months my knowledge of Perl has grown from semi-beginner hobby coder, to, in my very modest opinion, a moderately intermediate Perl developer. I have a solid grounding in the Perl basics as well as insight enough to know how to find out about modules, which ones to use and how to use them.

That isn't all though. Back in May of this year(2007), I joined up on the the scripts development forum and only after 3 months on the forum, helping out others and learning all that I could, I was submitted to the membership to become a Moderator. On my birthday I was fully promoted to moderator of the Perl form on the scripts. I have since taken on moderation duties in several other forums (about 9 forums in all right now), but maintain Perl as my "home" forum.

As you can see from the above background, I have gotten myself to a slightly comfortable place in my Perl career. Not at all to a point where I will stop learning, but instead, to a point where I feel comfortable enough about my knowledge that I can now take on learning another language.

There was a toss up as to which language to learn next. I was trying to decide between Ruby, which is extremely popular, Python, again, extremely popular and from what I had heard and read, easy to learn, and something like C#. I know, why C#, its a Micro$oft language? Well, it may be, but you can code C# with the Mono project on Linux and its somewhat interesting.

I thought about it for a little while, trying to decide. C# was actually ousted from the lineup first. I had done some VB at one point and even touched some Java in one of my college courses and I wasn't all that plussed by it. So, that truly helped me make that decision.

Ruby is a very interesting programming language itself. It was touted as powerful and quite popular. Plus, the added benefit of Rails for making web development with Ruby much quicker.

Well, I had to decide, so I chose Python. I didn't have an overwhelming reason why, its just that it appealed, almost called, to me. I liked that everyone said it was pretty easy to learn and the user base was growning steadily. Besides, that would leave me with Ruby as the next one to learn.

So, for almost a week now I have been trudging along at a steady pace through one of my Python books, learning the basic ins and outs. So far, they were right, it is easy to pick up, but I am not going to count my chickens yet. I will give myself some time to get a lot more into the language, but I am quite confident that I will have a similar love for Python that I do for Perl. If that is the case, then I will be a doubly happy person.
 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.