Manjaro vs Xubuntu?

Thinking about trying out something new for a change and switching to Manjaro as my main OS. I am getting a new laptop around Christmas and in my research I am looking not only at the hardware but the software I wish to power the beast. I got hooked on linux because I use an Acer C720 Chromebook as my main laptop these days. I found that ChromeOS was awesome for most things but I really needed more power, so I installed GalliumOS which is based on Xubuntu. Using it as my daily OS has made me realize why I fell in love with Linux in the first place when I was a kid. However…I’ve been hearing about Manjaro these past few days and am getting interested in trying a new ecosystem out with the Arch platform over the Ubuntu….so we will see where this goes.

Simple steps…but so much fun.

Worked on the application I am building for my day job a little more today. I am finding that I have a lot to learn about basics of python. Particularly working with parsing string data.  So far this project has been a lot of fun because I am learning a lot about strip, split and join string operations. It’s actually pretty mind blowing that I can take a word document and with a few lines of code build a data structure, in this case a dictionary which will likely end up a Json object.  I’m having a great time working with data in this manner and I’m actually considering going through a data science course to pick up some more concepts.

Also, just the prospect of saving myself time in my day job is giving me a lot more ambition.

I am also seeing that I’ve got to adopt more DRY principles in my code, but I’m currently just trying to hack this thing together. I feel like I can refactor the code once I have a working prototype.

Building stuff…working with docx in Python…parsing data

I work professionally as a field case manager in the workers compensation realm. This isn’t a bad job, it’s a lot of travel and paperwork. I find myself constantly entering data into word documents and spreadsheets to track my billing etc. The company I work for is small and we don’t have a software package to make things any easier on us. I’ve been looking for something that will help me break into software development as my main source of income and as you’ve read, I am still learning a lot of the basics. I’ve got ideas on how to grow my knowledge and one of those is to build actual working projects. Projects need to solve a problem for someone, so why not start by solving my own problems?

My job involves receiving a ton of emails and the main source of information initially is sent to me in a word file. I’ve been playing around with writing a script that will take a docx file and parse it. These intial files are always the same as they are apparently based on a template that someone in our main office enters data into. The idea is to parse the data out into a database and start building a web application that I can use to track my activities and generate reports and billing documents from the app, rather than having to spend hours sifting through my emails and copying data. I can have my application send the emails and log the data in a report/billing document.

Seems easy enough, so…thats the plan. I’ve been using an app I found for Linux called Pencil to work up some wireframes of the screens so I can have a picture in my mind of what this will look like. More details to come…

Starting now with this library: http://python-docx.readthedocs.io

To get the data out of the initial documents…and will incorporate this into my actual flask application somehow.

Family Tree solved…

I sat down this morning and took another look at the check.io What is wrong with this family quest…and it really racked my brain. But…I got it finally. Here is the code:

def is_family(tree):
    source = tree[0][0]
    fam = {}
    for i in range(len(tree)):
        if tree[i][0] not in fam.keys():
            fam.update({tree[i][0]: []})
        if tree[i][0] in fam.keys():
            children = fam.get(tree[i][0])
            children.append(tree[i][1])
            fam[tree[i][0]] = children
 
 
    # build a list of all children and fathers
    children = []
    fathers = [n for n in fam.keys()]
    for father in fathers:
        for i in range(len(fam.get(father))):
            children.append(fam[father][i])
 
        # find the source
        if father not in children:
                source = father
 
        if father in fam[father]:
            return False  # cannot be your own father!
 
        for i in range(len(fam[father])):
            if fam[father][i] in fathers:
                if fam[fam[father][i]][0] == father:
                    return False  # you cannot be your fathers father.

        if father != source:
            if father in fam[source]:
                for i in range(len(fam[father])):
                    if fam[father][i] in fam[source]:
                        return False  # cannot be a father to your brother
 
        if father not in children and father != source:
            return False  # No strangers in the family...
 
    return True

Family Tree Check.io

From the site:

You have a list of family relationships between father and son. Every element on this list has two elements. The first is the father’s name, the second is a son’s name. All names in the family are unique. Check if the family tree is correct. There are no strangers in the family tree. All connections in the family are natural.

Input: list of lists. Every element has two strings. List has at least one element

Output: bool. Is family tree correct

I’ve had some difficulty with this…and I realized I am probably severely overcomplicating this…

def is_family(tree):
    fam = {}
    for i in range(len(tree)):
        if tree[i][0] not in fam.keys():
            fam.update({tree[i][0]: []})
        if tree[i][0] in fam.keys():
            children = fam.get(tree[i][0])
            children.append(tree[i][1])
            fam[tree[i][0]] = children
    print(fam)

    source =tree[0][0]

    fathers = [name for name in fam.keys()]
    for name in fathers:
        # father for self?
        if name in fam[name]:
            return False
        if len(fathers) > 1:
            for i in range(len(fathers)):
                # parse the children
                for c in range(len(fam[fathers[i]])):
                    # stranger
                    if fam[fathers[i]][c] not in fam[source]:
                        return False
                    if fam[fathers[i]][c] in fam.keys():
                        # father to brother
                        print(fam[fam[fathers[i]][c]][0])
                        if fam[fam[fathers[i]][c]][0] in fam[fathers[i]]:
                            return False
                        # Father for Father
                        if fathers[i] in fam[fam[fathers[i]][c]]:
                            return False

    return True

So my first thought was to make a dictionary to hold  {father: children}, but accessing that got really confusing and honestly even after a run trying it…i cant get it right. It fails on this assert:

    assert is_family([
        ['Logan', 'Mike'],
        ['Logan', 'Jack'],
        ['Mike', 'Alexander']
    ]) == True, 'Grandfather'

I;ve got a fairly easy work day tomorrow so I think I will walk through it from scratch…maybe even ditch the dictionary concept all together….anyway…working on learning new stuff and growing. Just wanted to document it.

Checkio again…

Thank God for Check.io. I had a bit of an issue this morning looking for a challenge and not having any projects in which I could embark, I decided to work on a check.io puzzle. I started Brackets, and honestly it has been pretty challenging for me. I had it solved all but 1 test case… so I had to rethink my entire strategy…for some reason I am in some sort of funk right now trying to get my head on straight. I read something discouraging earlier about “older” folks trying to get starting in coding as a career. I guess I am not even really trying to start a “career”, I’d definitely like to supplement my income, and work on this stuff as a hobby. Problem is at some point you run out of projects to work on…so I have to keep things fresh. Checkio has been a great way to keep me thinking and challenged and also learning new concepts that I may not encounter with a web development project.

Video 2

I’ve definitely got to get some better equipment and work on my presentation some…but here is another video.

This one I go through taking a bootstrap theme and applying a flask backend to it.

Website is coming along as well: https://www.flaskcasts.com

 

Git

Gotta keep my tradition up. So today I added delete functionality to the flaskcasts site. Was easy. My issue mainly has been getting used to using Git to deploy and make changes to the site in production.

I use Pycharm and pay for the professional version. It’s amazing…but I was being lazy and used their git functionality that is built in. I was getting really confused on how to do everything correctly.  I am really inspired by Corey Schafer on Youtube. He has a great video…here it is:

Google Assistant blog post…

I’m on a mission to write a blog post every day about what I’m learning with python and web development in general. It’s been really hard to keep up with it that idea was to keep this going for at least 66 days so I can stay focused on my goal of learning as much about Python and flask web development as possible.

 

I truly have the desire to become someone who is recognizable in this field and not necessarily for a Fame purposes or reasons but mostly because I just want to be able to do this professionally. I just spent 12 hours in a car driving from my day job and a lot of days is good some days like today or not so good but I have to stay focused and I have to keep my mind on the prize.

 

I had a couple of ideas what I’m wanting to try to do with my flask at side is work on some tutorials and maybe even go through a freelance website and dig through some projects and see what people are requesting and looking for. So today I was on upwork and I found a project where a guys looking for someone to Cody flask microservices site that will take ancestry.com file and spit out Json objects. He was only paying like $35 for the project but it would be fun to try even though I’m not really capable or ready to bid on a project I’d like to try and test the waters and see what I can do so I think I’m going to pick that up and make a video about it and maybe even do multiple videos on projects freelance projects and and you trying to sift through those projects to find ideas for things that help you learn more about programming in general.

 

So to get started I think my first thing is going to be a flat file Blog then I’m going to add some functionality to that blog and just keep kind of working at it building things up and hopefully it’ll help other people and I can grow my knowledge around all these.