Caesar Shift Cipher

As late as the night is – I promised myself that I would get in a solid amount of time for coding and found a caesar shift cipher challenge online. The challenge was as follows: You receive a text file with the first line containing two numbers. The first number is the number of lines that are to be performed and the second number is the number-of-shifts in the alphabet. Every line after that contains the sentence that is to be decoded. E.G:

This one was fun! Overall I wouldn’t rank it too difficult – See the python solution below:

def main():
    shift = 0
    alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N"
                ,"O","P","Q","R","S","T","U","V","W","X","Y","Z"]
    answer = ""
    test2 = readFileIn()
    for i in test2:
        if test2.index(i) == 0:
            split = i.split(" ")
            shift = int(split[-1])
        elif test2.index(i) > 0:           
            shiftedAlpha = shiftAlphabet(alphabet, shift)
            charPosArray = getCharPosition(alphabet, shiftedAlpha, i)
            answer = answer + charPosArray+ " "           
    print(answer)
    

def readFileIn():
    fileObject = open("test1.txt", "r")
    fileText = fileObject.read()
    fileArray = fileText.split("\n")
    return(fileArray)


def shiftAlphabet(alpha, shiftNum):
    alphabet = alpha + alpha[:(26-shiftNum)]
    for i in range(26-shiftNum):
        alphabet.pop(0)
    return(alphabet)


def getCharPosition(alpha, shiftedAlpha, readLine):
    intermediate = readLine
    answer = ""
    for c in intermediate:
        for a in alpha:
            if c == a:
               answer = answer + shiftedAlpha[alpha.index(a)]
        if c == " ":
            answer = answer + " "
        if c == ".":
            answer = answer + "."
    return(answer)
   
main()

Small Victories 6_5_18

This day flew by –

Worked from 7:30am – 5:30pm at the office – came home – ate – and proceeded with my studies on the 8051 microprocessor and it’s corresponding assembly coding language. Happy to say that after a 10 hour cram session I feel that I am finally getting the hang of it. The syntax of Assembly is actually quite simple if you understand the architecture of the hardware you are using. To be honest I kind of like it a lot!

The college assignment was to write a for-loop in assembly that would indicate whether a number was prime or not. Register 1 in the 8051 simulator would hold the answer at the end of the program – if r1 = 0X01, then the number was prime. If r1 = 0X00, then the number was composite.

Maybe at some point I’ll start posting videos once I feel I have a better grasp on everything. Until next time.

 

 

Another Late Night 6_4_18

Tonight’s adventure consisted of diving into the inner workings of the 8051 MicroController. This one is beast – and the youtube resources on it are few and far between – I managed to gather enough data to gain somewhat of an idea of what I am doing – Hopefully I can close the knowledge gap by tomorrow as the assignment is due 2 days from now. Also – Managed to reskim over the SQL Database knowledge I studied last night – looking good! I downloaded a glossary of 150 terms, which I intend to flashcard at some point this week. Until next time!

Status So Far 6_3_18

It’s been six months since I have began my computer science journey –

So far I have gained a basic understanding of each of the following coding languages:

Java

Python

I have managed to keep up my training with these two languages by solving math problems on Code Abbey and Project Euler – it’s interesting, I find that with the more I learn the less I know – I am enrolled in a networking course and I have barely scratched the surface in that course as well. Each area of computer science leads down a rabbit hole which branches off into more rabbit holes  – there is certainly no way to master everything! I wonder where will my niche will lie with computer science…. still in the early stages! Too soon to tell!

Taking A New Path

It’s amazing what you can discover about yourself with just a small amount of introspection. Over the past 10 years I have made it a point to go hiking whenever I have the opportunity. Here’s the thing though, I have always hiked the same trail, the Rancho Sierra Vista/Satwiwa trail in Newbury Park, CA. While it is a lovely trail, I realized something as I was getting ready to go this morning; I have fallen into a routine.

The one reality that has become abundantly clear as I have hit full-blown adulthood (and the day to day grind) is that the world tends to seem a bit smaller, and things aren’t as interesting as they used to be. Sometimes we get so caught up in our day to day routines that we occasionally forget what it means to be curious. I know I’m not the only one who has felt this way, I have many friends who have accomplished everything the world told them to accomplish. They have full time careers, are living on their own, and are completely independent (A feat that is becoming less common for people in their early to mid 20s). Now that we’ve all made here the thing that comes to mind is “what now?”. Even for those of us who can afford the occasional international excursion from time to time, that still leaves the rest of the year to fill with various activities. If we live for the weekends, that only accounts for about 21% of the year – the rest of which consists of work, household chores, a drink with a friend, a trip to the gym or the movies, etc. So where am I going with this?

While I’ve never really been one for new years resolutions I have decided to make one for 2017 – to make this year as interesting as I can. From the big things to the small.

To tie it all together – I decided this morning to find a  new trail to hike rather than the one I had taken hundreds of times before. Not much to my surprise it was actually great! I was ultimately greeted with a plethora of new sites, smells, and sounds. While it was not an extreme step out of my comfort zone or routine it felt nice to change it up a bit. So ultimately I am aiming to apply this same type of thought process to other areas of my life. There are hundreds of forks in the road that we come across each day, but they can be easy to miss if you’re only looking down the path you know.

Until Shortly,

~Michael Tocco

(below are a couple of photos from today’s hike)

FitBit Fitness Mayhem

So it has been three days since my initial fitness post where I outlined my goals for 2017. After doing some math it looks like in order to hit my goal of 6.2 million steps for the year  I will need to average 17,000 steps per day, or just around 10 miles per day. Friday I managed to run a total of 25k steps and Saturday (yesterday) I did 21k steps. While reaching 17,000 steps in a day isn’t a particularly difficult challenge, it does require enough conscious effort that it can easily fall by the wayside. Between full time work and full time school in the evenings (both environments where one sits) I will have to constantly remind myself to carve out enough time each day so that I may continually reach my goal. I guess that ultimately that’s where the challenge will lay.

Until Shortly,

~Michael Tocco

Fitness Log

So I’m thinking of devoting a portion of this blog to my fitness activities. With the amount of work that the average working class American puts in it is easy for fitness and well being to fall by the wayside. I know that this has been the case with me. Currently I work 40 hours a week and attend full time college at night so that leaves me with little free time. That being said, I have always been a sucker for badge and achievement based games, which is why last year in April I invested in a Fitbit Charge to log my steps throughout the day. Looking at the stats from 2016, I took a total of 3,192,676 steps. A lot of those days were very physically intensive, and one day I actually got the highest available “daily achievement” with Fitbit, The Olympian Sandals achievement. In order to get this achievement one has to walk 100,000 steps in day which is about 50 miles. It took me from 4am to midnight to get, and although I was quite sore the next day, it was totally worth it. So the goal for this year, 2017, is to double my total from last year. That is about 6.2 million steps. While I know it will take a lot discipline, I think I can do it. I would like to further add to this goal, by stating that I aim to achieve the Olympian Sandals (100k steps in a day) badge two more times this year. I remember that before last year, it was a struggle for me to run for more than 15 minutes at time. In 2016 I managed to get myself to a point where I could run a 7 mile hour. While that is not incredibly impressive, it sure beats where I was at in 2015. So to break it down:

2017 Fitness Goals:

6.2 Million Steps

2x Olympian Sandals Badge

and Fucking insanity!

Until Shortly,

Michael Tocco

img_5420

img_5421

screen-shot-2017-01-13-at-3-46-25-pm

AppleUprising Productions

Hello all and welcome to my website – http://www.appleuprising.com

For about eight years now I have operated under the Username appleuprising and I have yet to do much with it. I’ve had a few successful youtube productions but haven’t really branched out past that. It is how ever a new year, 2017, and as the world continues to grow and evolve so must I and so must everyone else! That is why starting this year I am going to try a bunch of new things and see what sticks. In an ever growing population, the need for creativity and new ideas is huge. We as a whole face many challenges in terms of the environment, the economy, the state of healthcare, and many other issues. There’s a lot of room for thinking and trying new things, we just have to be willing to step out of our comfort zones and do it. Regardless of the actions we choose to take or choose not to take, time will continue to pass and changes (good or bad) will occur. I am going to use this blog along with my youtube channel to contribute something, I don’t know what that is yet, but all one needs to embark on a journey is to choose a direction and start walking. So here we are. Until shortly,

~Michael Tocco