better living through python

An adventure in programming and recovery.

With a dream of March

February 24, 2012

So yesterday I had a panic attack.  This was definitely different than what I’ve experienced in the past.  I couldn’t breathe, and the room was getting smaller.  I went for a walk to steady my breathing but when I returned the air felt heavy and thick.  As the night wore on things went from something I could handle to worse.  The evening ended with me digging up and talking about old memories that are rather painful to reminisce.  Suffice it to say I’m kind of trying to avoid the day, get some work done, but otherwise not pay attention.  

It’s almost a year to the day since I quit my last job.  A year to the day when I turned in my notice that I wasn’t going to work for a company I felt didn’t respect me.  A year to the day since I was escorted off the premises a day after I had turned in my two weeks notice.  

I’m definitely doing better, but I’ve got a different ball of wax to deal with now.  I’m still dealing with a serious lack in self confidence.  I look at craigslist and I wonder if I could successfully do a job at a grocery store without getting poor reviews.  However that only happens when I’m low, and the stress eats at me.  

But this is not all the time, it has only been stronger of late.  My hopes are for a March that shines and allows me some respite from my woes.  One that allows me to find a calm center so I can watch my garden grow.  

     

Writing through...

February 22, 2012

Often the only thing I find solace in are the words that find their way onto the page.  The words on my page, the words that I write.  Sometimes when my emotions overwhelm me I yearn for a laptop and a quite corner where I can tap away and cry in solitude.  Despite friendships and relationships I believe we all have lonely days when average actions compel us to trust no one.  When it feels that there is only the push and wrenching of others who want, yearn, or prey on your peace.  

What was I thinking with self pity...more like self gratitude.  Recognizing the depth of our own wealth of emotions and realizing how much we’ve gone through.  We all experience pain and loss, exuberance and gaiety.  How can I judge a man, a man learning to be a man as I learn to be a woman, differently than I do myself?  How can I judge a child who doesn’t want to go to school when I myself have days of depression that keep me from working.  Days when my mind seems forever clouded and weary, not wishing for anything but the short distraction of my fairy tales.  How have I any right to say anything to him?

One thing I realized today was that no matter what happens in the future, writing as I do now has changed my life.  Writing has helped me not only to recognize my short comings, but it allows me to search my soul.  I know that my writings probably bore others.  I am probably telling just a bit too much about my depressions and negative feelings.  But I can’t stop.  Something inside me tells me that others must feel this way too.  I know that I’m not alone.  I’m not the only one who fights these thoughts and emotions.  I’m not a bad person for feeling this way, I simply question myself.  If I don’t share it, then I feel like I’m giving up on others who feel the same way I do.  I would be giving up on being honest to myself and the world.  If I don’t do this then the unknown ‘others’ have control over me, and I will succumb to my own fear.  

A little icon creation...and imaginative depletion

February 21, 2012

I have absolutely no idea what my new icon for pythonliving/betterlivingthroughpython should be.  I’ve been creating and throwing away so many different ideas I’m starting to get a bit sick of it all.  I’ve got a good idea how I want my blog to look, I just need an icon to match...

I’ve been pursuing blogs and viewing anything I can get my hands on.  The problem isn’t that I can’t find things I like, or things that aren’t (quote) “hip”.  The problem is that I’m looking for something that looks different and new.  Something not like everyone else but still interesting.  Something that will keep them on the page.  Something that hasn’t been done before.  Which of course means that if I find it it’s been done before.

That will continue to be my work for tomorrow (plus tons of translation).

What have I been up to lately?

February 20, 2012

In all honesty, mostly feeling sorry for myself.  I’ve been hit on and off with smaller bouts of depression over the past two weeks.  Luckily I’ve been able to continue with work for the most part, but the depression is starting to get a tad oppressive.  

I’ve had some family stressors as well, and those have been livening things up a bit.  Mainly it’s all about an almost teenage boy (my nephew).  He’s very important to me and some of the things that happened lately had to happen, and they weren’t pretty.  It’s also seemed of late, that so many of my friends’ lives are drastically changing.  Changing in ways that make me sad, even though the changes are conscious decisions and not injured limbs or otherwise uncontrolled occurrences.  

I mentioned recently that I’ve been reading a fair amount.  Let me rephrase that, I’ve been reading a ridiculous amount.  David Eddings and Brandon Sanderson have been my companions of late, as they’ve aided my escape from reality.  My neck and shoulders are sore from the constant poses I use when reading books in either our chairs or in the bed.  My feet are constantly annoyed at that clammy feeling you get when they sweat inside your bedsheets.

All of this depression and self loathing has made me quite sick of myself.  The fact that I recognize my bad habits doesn’t help any either.  I stress eat, and it’s been happening.  I’m keeping it in check, but it’s horribly demoralizing to know that one of the bad habits you have which seems to combat stress so well is one that makes you fat.  So I’ve been consuming peppermint tea and taking baths more than normal to try to let the stress melt away.  It’s ‘kind of‘ working.  

I don’t really know what a weekend feels like anymore because I almost never get two days in a row when I don’t feel like I need to be working.  Even on the days I take as my ‘weekend’  I feel like I’m doing something wrong and so I still stress about it all day long.  Humorous how my recent blog entries about recovery and learning how to understand ones self have borne an entry about self loathing and depression.  I long for an escape from these feelings and yet I have full control over my life.  I have full control over the actions that make me feel this way, but I continue to be a flake.  I continue to self-degrade while day-dreaming.  I continue to eat more than necessary, anything to make these feelings go away.  But the stories, they seem to be my only solace.  And so I return back to my adventure novels, and I escape from reality for just a little bit more.

What does it mean to be 'recovered?'

February 17, 2012

 

Have I recovered from the harassment and bullying I feel I experienced at my former employer?  What does recovered, or recovery, mean?

Definition: to regain strength, composure, balance, or the like...
Medical Definition: the person has developed a personal sense of hope and empowerment that wasn’t there before.  
*these are approx. definitions found from various online sources.

I don’t know if ‘recovery’ can be so easily defined.  I know what I used to feel at my old job.  I constantly felt powerless to stop what was happening.  For a while everyday I would get ready for work and be frightened at the things I would be made to feel or experience.  I was scared of the pain and hurt and humiliation I felt when coming to work.  The distrust and embarrassment that occurred.  The nights when I would come home and simply cry and talk all night about how much I hated it there.  How I couldn’t believe that someone would treat me like this.  How small I felt.  How I didn’t feel like I could do anything to make it better.  I would try but then it would just make things worse.  When I would go to hang out with my friends and still feel my heart pull and clench because of stress.  When I couldn’t focus on anything except how to make things better at work.  

In order to have hope I think you need to have control of the stress and pain in your life.  I think the stress is gone.  Being self employed I feel more empowered now that I have full control of my job at FlamingLunchbox.  I know what I’m not doing, and there is only so much I know or can do.  That helps a lot, but I still feel fear and humiliation anytime I think I’m doing things wrong.  Once that starts happening my brain just stops processing, and I slow down to a crawl productivity wise.  

The pain is NOT gone.  I can smile at people from the old job when I seem them in stores, but afterwards I feel humiliated and embarrassed and worry about what they think of me.  Of what everyone may have said about me.  About the lies my old boss told about me.  About the horrible person they might think I am.  Then I walk away quickly because I don’t want to hear it, I don’t want to try to explain.  I don’t want to know.   

I don’t know if that’s the best reaction, but it’s what I can handle right now.  Some days if I think about my old boss all it makes me want to do is be violent.  But my anger has nowhere to go, so I cry.  Then I cry because she still has power over me.  

So, no, I guess I haven’t ‘recovered.’

Up Next Time: What have I been up to lately?

 

A stress induced argument combined with a dash of increased self awareness

February 16, 2012
I’m coming up on my year anniversary, when I quit my first job without having another ‘real’ one to go to.  The day when I started learning to program and stopped working for ‘the man’.  As it gets closer I’ve started thinking more about my experiences with my last job that lead up to where I am now.  Why am I where I am.

More interestingly I’ve started realizing that sometimes during arguments or times of other extreme emotions I’ve noticed that I will randomly start thinking about situations where I felt belittled by my old boss.  Last night during a stress-induced argument (also known as an argument where the original reason is so mundane you are embarrassed to think you even argued about it afterwards), I started thinking about my original 3 month review.  

Instead of writing out what happened during that review (which is what I did just a few minutes ago but decided that too much information was well....too much), I’ll get to the point.  I started thinking about a situation from my old job that angered me.  A situation that hurt me and made me feel less capable as a person.  I started thinking all of this…during the middle of an argument about getting under the covers too fast.

All this did was make me angrier than I should have been.  All it did was increase my frustration.  I did my best to remove it from my thoughts and not let it effect a stress related argument but I still know it crept in.  How could it not have?

I am still angry.  I am still hurt at what happened because I still question my abilities relentlessly.  I still have self-worth issues, and problems with feeling capable of getting things done.  Not even just getting them done, but getting them done well.  I am still affected by thoughts of whether or not I am actually doing a good enough job, if I’m actually good at anything...

Am I so petty that until I’m getting ridiculous amounts of positive reinforcement (in that I am capable of getting things done), that I will not be able to believe in myself?  Is it this or simply other life stressors that are getting me down?  What is making my recovery so difficult?  What does it mean to be ‘recovered’?  

Up Next Time: What does it mean to be ‘recovered’?

 

Creating an ics file, continued

February 13, 2012

 

Continuing on from my last entry...the first thing I do in this section of the code is set the time.  I do that by using my lessthanten() function and calling the schedule variable as I did last time.  I use this method to create the hour, minutes, and seconds variables.  Then I create newtime which is simply the end time of the soccer game.  To do that I add 3,000,000 milliseconds, basically 50 minutes, which I then adjust with Date() to change my time in milliseconds to something more manageable.

function createics (schedule) { ….

 //setting time

  var hour = lessthanten(schedule[i].datetime.getHours());

  var minutes = lessthanten(schedule[i].datetime.getMinutes());

  var seconds = lessthanten(schedule[i].datetime.getSeconds());

  var newtime = schedule[i].datetime.getTime() + (50*60*1000);

  newtime = new Date(newtime);

  var endhour = lessthanten(newtime.getHours());

  var endminutes = lessthanten(newtime.getMinutes());

  var dtstart = "DTSTART:" + basicdate + "T" + hour + minutes + seconds;

  var dtend = "DTEND:" + basicdate + "T" + endhour + endminutes + seconds;

  ...//Other strings

   }

finalics += "END:VCALENDAR";

return finalics

};


Then I set the endhour and endminutes.  Like with the date (discussed in my last entry), I simply concatenate the items together to get my DTSTART and DTEND times.  This is a basic abbreviation where DTSTART is date/time start and respectively DTEND is date/time end.  The format for date and time entry for ics files is the date, followed by a T to indicate time and then the time.  So I grab my basicdate that created last entry, tack it on to the beginning of these variables, input a T for time, and then concatenate the rest of the information on the end.

Up Next Time: End of ics file creation

 

Creating an ics file for calendar import

February 11, 2012

 

Creating an ics file is very similar to a csv file.  The main differences are in formatting, which are easily addressed.  In order to gather all of my data together and concatenate it appropriately, I created a function as with createcsv(), and called it createics().

The basic reason for this function is to create the necessary information for an ics calendar file, and return it so that it can easily be saved in ics format.  An ics file is very similar to the csv file, they just have different patterns in which the information is presented.  In an ics file you present a small bit of information and then ‘enter’ down to the next row.  A single calendar event in an ics file takes up 5 to 10 lines depending on how detailed the information is.  A csv calendar file will have the entire event take up one line, with commas separating the information.

function createics (schedule) {

 var finalics = "";

 var icsfilestart = "BEGIN:VCALENDAR" + "\n" + "VERSION:2.0" + "\n" + "PRODID:-//create ics file for use in mySam on Corvallis Sports Park website//EN" + "\n" + "CALSCALE:GREGORIAN" + "\n" + "X-WR-TIMEZONE;VALUE=TEXT:US/Pacific" + "\n";

 finalics += icsfilestart;

 for (var i = 0; i < schedule.length; i += 1){

   //adjusting time from dictionary 'schedule'

   //setting date

   var month = lessthanten(schedule[i].datetime.getMonth() + 1);

   var date = lessthanten(schedule[i].datetime.getDate());

   var year = schedule[i].datetime.getFullYear().toString();

   var basicdate = year + month + date;

   var dtstamp = "DTSTAMPT:" + year + month + date + "T" + "000000";

   ….. //setting time

    }

 finalics += "END:VCALENDAR";

 return finalics

};


To begin with I create an empty string called finalics.  This string will be the value returned from the function.  For all ics files, you have to start them out with the text outlines in the variable I call icefilestart.  This identifies that it is the beginning of a calendar event and provides other necessary information the file needs.  Then I add it to the finalics variable.  

After that I start my for loop.  This loop goes through all the information in schedule, going through each event on the CSP website just as the createcsv() function does.  As shown in my entry Issues and edits of code thus far, I’ve figured out ways to make my code much more compact.  This section show above used to be three times this size.  That made it difficult to read even if it was all simple code.  

Using my lessthanten() function, and by accessing schedule, using getMonth(), getDate(), getFullYear(), and toString() I’ve create my variables month, date, and year.  Then I concatenate them together to make my basicdate variable.  Then I integrate basicdate with the ics calendar formatting and create the dtstamp variable.  

Up next time: Creating an ics file, continued
    

 

What your reading choices could be saying about you, and why it doesn't matter

February 09, 2012

 

I had a thought the other day, and I’m sure many have thought of this before.  Why is it that sometimes certain books call out to you more than others?  How do we choose the books that we read?  Lately I’ve been seriously consuming fantasy novels.  This is because I’ve been trying to move away from simply watching TV shows all the time.  I still crochet half the time while watching TV, but I watch nonetheless.  I was starting to feel...well.....boring.

So to quiet this feeling I decided to move on to books, and boy have I.  I’ve read almost 10 books in the past three to four weeks.  Granted, that means I’ve been doing little else.  The house is clean, I’ve been crocheting every once in a while, running, playing soccer and work, but once that is all done I start reading.  

Anyways, back to the thought I had.  I realized that try as I might to read books that quote “Make me classier”, or “Read books that teach me vocabulary that will help with the GRE” I just couldn't.  They were too stressful.  Robey and I love what were doing, but we definitely aren’t making a whole lot of money, thus we have high money stresses.  What else?  Other normal life stresses can always play a role like not having health insurance.  Also having student loan “sharks” starting their phone overtures begging to empty our bank accounts.  All of this adds up.  Once complete we’re both a jumble of nerves.  

So my thought; how stressful you’re life is can heavily effect your reading choices.  Why do I choose fantasy?  It’s true that some fantasy can be heavy reading.  Some is quite involved and littered with intense vocabulary.  However it’s the focus and the overlying themes that really gets me sucked in.  So many fantasy novels start with the person who has no idea how special they are.  The person that finds out there is something amazing about them.  Then they train and they work, and in about 5-6 hours they often topple kingdoms.  They change their entire lives.  Often they start at the bottom of the chain and move to becoming someone that matters.  A person who might have had issues in the beginning, but one who slowly and rather easily overcomes them.

So many of the more intense books (especially ones including the main character going through serious self reflection), are ones I have difficulty getting into.  I am going through enough self reflection on my own.  I need the books I read to show me hope.  I need them to show me that hard work pays off.  One that shows a seemingly simple person beating the odds and becoming something powerful.  One that, even with some people dying and lots of fighting, can show that change is possible.  

I guess what bugs me about this realization is that many people judge you on the type of books you read.  If you read the more intense and self-reflective books, you’re probably more often judged to be a ‘classy reader’.   Being a ‘classy reader’ in many ways can also be a judgement of a person’s ‘station’ or ‘class.’  

This reminds me of something my Uncle Gene once said, “Keeping your mind active is more important than the type of books you read.”  That’s an approximate quote because we were all busily munching away on oysters or something at the time and I don’t remember much else.  But the point is this; The kind of books you chose doesn’t matter.  It’s simply important that you keep reading.  

Understanding what you choose is important because it can help you to realize why you’re choosing the books you do.  If the books you chose are making you happy and content, then they are serving their purpose.  Don’t change because you think you’re not reading something ‘mentally stimulating’ enough.  Don’t change because you want people to think higher of you.  You pick the books you do for a reason.  Let them make you happy.

Up Next Time: Creating an ics file for calendar import

 

Issues and edits of code thus far

February 08, 2012

 

As I discussed previously, as I’ve been posting these blogs I’ve found errors in my code.  Mostly they are syntax issues, as I posted without running it (I know, I’m a horrible person).  Another is a sign of something that I still have to work on, remembering where to return information from a function.

Edits on entry: Some simple functions to adjust my time formatting

Here I posted that a lessthanten() function that would not have returned any information.  This is because I placed the return inside of my if block instead of outside it.  Thus instead of this code:

        function lessthanten (x) {

if (x < 10){

 x = "0" + x;

return x;

};

        };

The code should look like this:

        function lessthanten (x) {

if (x < 10){

 x = "0" + x;

};

return x;

        };

The other problems I had with my code, was realizing that my adjusthour() function wouldn’t work the way I wanted to with python syntax.  Almost every language returns information differently from their functions.  My problem came from not understanding how to return multiple pieces of information in javascript.  I originally wrote my return statement in the adjusthour() function to look like this:

function adjusthour (hour) {

...

 return hour, ampm;

};


You can’t use simple comma separation when returning in javascript, you must return a list instead.  This meant I also had to adjust how I called on the information returned from this function.  Thus my return from the function actually looks like this:

function adjusthour (hour) {

...

 return [hour, ampm];

};


Then to call on the information I had to refer to the variable I assigned, and then designate the position in the list I was accessing.  This is shown below using hours as an example:

   var hour = schedule[i].datetime.getHours();
   hourampm = adjusthour(hour);
   hour = lessthanten(hourampm[0]);

As you can see I had to refer to the position within the hourampm list in order to access the hour I created therein.  I also realized, during this process, that there was an even easier way to write some of my repeating code.  For example, when accessing the minutes data I could have made the following two lines of code:

   var minutes = schedule[i].datetime.getMinutes();
   minutes = lessthanten(minutes);  

into simply this:

   var minutes = lessthanten(schedule[i].datetime.getMinutes());  

Thus ends my recent code-realizations.

Up Next Time: What your reading choices could be saying about you

 

Links