better living through python

An adventure in programming and recovery.

Reflections on 'The Cathedral and the Bazaar'

May 10, 2011

 

In The Cathedral and the Bazaar by Eric S. Raymond, he states that, “...an interesting point about the hacker culture.  It consciously distrusts and despises egotism and ego-based motivations; self-promotion tends to be mercilessly criticized, even when the community might appear to have something to gain from it.” (p.107).  

I find this quote to be incredibly interesting.  The hacker culture of the time (in the 90’s I believe), he later discusses, had developed into a gift based culture.  One where the sharing of knowledge and code increases your reputation.  Such cultures can only exist when most basic needs have been met.  Upon reflection, and thinking on many other aspects of modern culture, why are there not more gift based cultures?  We have smaller aspects of them riddling American culture.  For those that celebrate Christmas/Holiday season and share gifts with others do you not also feel that ‘better gifts = better reputation’?  Or what about those who must buy things for others, like drinks and food.  The giving is part of increasing your reputation, almost like giving your time for ‘worthy’ causes.  Your friend who always buys you a beer, is it because they are your friend only, or is part of it because they know the rewards of providing those gifts for others.  Not only does it make them feel better, but it also increases the gift culture reputation.  

Why is it that so many folks in poverty are ashamed to let others help them.  They fight it, and run from it.  They want to do it on their own terms, because in some ways they feel a loss in reputation and personal worth when they can no longer provide for themselves.  Think on it.  If you buy a meal, someone who has money to purchase their own dinner anyways, you’re just doing them a favor.  One they’ll likely return later down the line.  If you buy a poor person a meal, they will feel they owe you, even if you’re just doing it because you want to and don’t expect anything back.  They still have this intrinsic need to return the favor, despite lacking in ability to do so.  

I would argue that the gift culture of ‘hackerdom’ specifies a group of people.  As much as I hate to say this, and as much as I love the aspects and beliefs of open source culture, I know that so many of the intrinsic values of this culture come from people who have had all basic needs met.  These needs have been met so much, that they have the time and space to learn to program.  How many people in severe poverty have the time to sit and learn to program?  How many have the mental capacity, based on life stresses that might be making it more difficult?  

By this I mean mental capacity in a way most favorable only.  Those in severely impoverished situations tend to have many things stressing them, not just their finances.  They are just as intellectually capable as the next to learn to do these things, but if you do not have the time to allow yourself to be stressed more by learning than other life aspects, then it will always be an incredibly difficult thing to accomplish.  In other words, the hacker culture will almost always be rife with those who come from well-off enough families that they were able to spend time teaching/learning to do these things, writing code.  Hackers are a culture in their own.  Not many can touch them.  They are dedicated, driven individuals.  Intelligent and with strong abilities to decipher.  I am definitely not one of the culture.  And by my statements I do not wish to insinuate aspirations of being one.  I am happy as I am.  However in consideration with the abilities of today’s youth, it begins to show even more the true extent of the riches of certain parts of the world.  A large population of hacker culture indicates a large population of well off individuals with time enough to fix other peoples (and their own) technical problems.  It makes me think that unless a person has these stresses removed, that their education will always have less potential value which make it less possible to reach their full potential.  If you want to allow those from impoverished situations the same possibilities in life as those from more well to-do families, then we need to find a way to remove the stresses from their lives, and that while the student is pursuing their education all basic living needs must be met.  

Please note that my statements are entirely of my own opinion.

 

My Failures

May 05, 2011

 

There was a blogger, Emilie Wapnick (Puttylike), who declared a ‘Failure Week’.  A week when everyone could post or blog about their failures.  Well, I’ve already missed ‘Failure Week’, but I’m going to blog about it anyways.  I think it will help me towards self enlightenment (which in my mind means learning to be okay with being wrong).

I like lists, so I’ll do this in a list:
  1. In 5th grade I didn’t win an art contest.  Those who won, were allowed to take part in helping to paint the new reading room at the public library.  I was never a very good artist, and they had said that the winners wouldn’t just be people who were good at art, but also those who tried hard and worked well with other people.  I had been sitting at a table with one of the more difficult people to work with in our class, and I tried my best to be patient and calm the entire time.  I worked my hardest on that drawing; I wanted to win so much.  I didn’t win.  I was so angry and hurt that I took it out on the two girls who did win by writing obscenities on the bathroom stall wall in permanent pen.  After lunch I felt so ashamed by my actions, when everyone was talking about it, that I had my mother pick me home sick from school.  I fessed up about it on the way home to my mother, and we told the Principal the next day.  This experience was a failure in dealing with my anger, and it still lives with me to this day.
  2. I remember in high school not getting into a program to go to Germany as an exchange student.  I was so horrified because I was afraid that I wouldn’t get to go abroad because our family didn’t have much money and I was afraid we wouldn’t be able to afford it otherwise.  We ended up finding the money for me to take part in a program through AFS so that I could go.  It wasn’t AFS, but many experiences happened to me through my host family that year that were mentally damaging.  I always feel like this was a failure, because if I had gotten into the other program perhaps I could have been spared the grief I suffered.   
  3. At the end of high school my Grandmother (the only one I was connected with) was dying of lung cancer.  The last conversation I had with her concluded with her begging me to believe in Jesus.  I lied, and said I would.  No matter how much I knew I didn’t have any other choice, I will always regret lying to my grandmother.  I feel like I betrayed her.
  4. During college I found out through one of my professors that the rest of the department thought I was a flake.  This had happened due to some miscommunication regarding a student worker position over the past summer (at least as far as I know), and I tried desperately to talk with the head of the department to smooth things over.  It didn’t really work, as I had already been judged, so thus decided not to pursue graduate school at the time.  I remember drinking a bottle of red wine while sitting in the tub talking to my best friend over the phone, trying to process what had happened.    
  5. Getting a DUI (Driving under the Influence) during college felt like a massive failure at the time, but I’m not sure how truly bad it was.  I blew a .09 (I had had two drinks that evening).  No one was hurt.  Oregon has this ‘Diversion’ aspect where you can supposedly wipe your one and only DUI by going through a variety of activities.  I went through the course and would have been let go at the end for good work (being sober, etc.) but stupidly listed having a Welsh beer as celebration for ending my Medieval Welsh course.  I ended up taking another 3 months in a women’s ‘support’ type group regarding addiction..  That was, honestly, one of the most enlightening things in my life.  Despite others perhaps labeling or judging me for it now, I find that experience will make my life richer and more understanding of others for years to come.
  6. Losing one of my best friends, a fellow french horn player and writer, whom I miss so very much today.  He won’t talk to me anymore.  I think that I will always be extremely saddened by losing that friendship, and will always regret it.      
  7. I had a dog once, her name was Iza.  I had always wanted one, and I was finally in a position to get one, raise it, and take care of it.  My failure here was in not taking care of her enough to prevent her from getting hit by a car.  My failure here is not having enough money to get the surgery she needed.  I will always feel that my putting her down was a personal failure.    
  8. My latest, but definitely not the most extraordinary, was choosing to resign from my most recent position.  I was definitely not going to be a happy person if I stayed.  But, having to go through everything I did was the hardest.  I continuously felt like a failure at that position, and it makes me sad to think of how much it truly demoralized me.  I was a sad little lurking hulk of emoticons ready to vomit nails back at people.  It was a failure that I didn’t speak up sooner about how I felt I was treated.  It was a failure I didn’t leave earlier and save myself the pain.
These are, of course, only the most important and impacting of the failures in my life.  I’ve surely done other things, however they seem less consequential, less worthy of note.  Each one of these items reawakens my sorrow and anguish.  To even finish the entry I’ve had to take a couple of breaks, so I could finish.  

This has been cathartic, talking about all of this.  However I think I must needs bake and fry away my tears (yes, the improper grammar is on purpose here), with some tasty sausage and pancakes, else I will while away my time in deep thought of the things I ought to have done.                

 

Processing

May 04, 2011

 

Today I filed for unemployment.  

That was painful.  I had been avoiding it for a good while simply because of the fear of possibly having to interact with my former employers.  As they still have to review my application, I know that it’s a possibility.  I don’t want to talk to them ever again.  They hurt me.  I’m finally able to smile without concern.  I’m able to be happy again, and not feel that I’m totally incapable of doing anything well.  

For so long I had this horrid self worth that followed me around.  I consistently felt like the bottom of the pile.  I was barely better than the gum on the bottom of a shoe.  I’m slowly crawling out of that pile.  In part this blog is an example of just how much self reflection and work it’s taking to get out.  I can’t even imagine what it would have been like if I had stayed any longer in that horrid environment.  I’m scared to think of it.  

Touching letters with their stationary and reading their names.  Glancing through my old emails.  Each time I handled another piece I felt my heart tighten and my shoulders rise as if to prepare for a hit.  Thinking of it now makes me want to cry from utter anger and frustration.  

I am never going to let someone make me feel that way about myself again.



 
   

 

Locations to enhance creativity...any further suggestions?

May 03, 2011

 

Woot is now a norm for my weekly activities.  Adding more and more to the list of what I do each day/week to keep myself busy/involved/creative.

1. Write and post a Blog
2. Tweet Tweet
3. Interact with other Blogs/Twitter’s Tweeting Volks
4. Create and enter the weekly Woot.com T-shirt Derby
5. Learn more about Android/Application Advertising
6. Learn to Program
7. Update the website when needed
8. Make updates to blog as needed
9. Create a Webcomic

Honestly, it may seem like not much, but it’s quite a change to go from production type work, to creative work that requires a larger amount of contemplation.  Probably assumed, it’s true, but nevertheless something I have to remind myself of consistently.

Does anyone else have suggestions on random weekly contests based on creativity that I might enter?  

 

Python Lesson

May 02, 2011
One of the things I’ve found difficulty in understanding, whilst learning to program, is how the ‘for blank in range (): loop works.  
 
Okay, let me stop and restart.  
 
A loop, in programming, is a piece of code that will run in a loop until it spits out the information you want.  So, think about it like this.  You tell the program, ‘I want to know how many 6, 9, or 20 packs of Mcnuggets I need to buy, to purchase 55 Mcnuggets.”  You see, this person has 11 kids, all eating 5 nuggets each, and only wants to worry about how many packs he buys.  If ONLY he had a program that could just do the calculations for him!!!
 
Well, here it is:

def Mcnugget(n):
for sixpack in range (0, n/6 + 1):
for ninepack in range (0, (n - 6*sixpack)/9 + 1):
nuggets = n - (6*sixpack + 9*ninepack)
twentypack = nuggets/20
print sixpack, ninepack, twentypack
if twentypack*20 + 6*sixpack + 9*ninepack == n:
return (sixpack, ninepack, twentypack)
return (None, None, None)  
 
for n in range (55, 56):
print n
print Mcnugget(n)
 
This piece of code, by the way it’s put together, will show you the loop it goes through.  When I run this piece of code (in other words, I tell the computer I want it to go through my code and hit enter), I get this information in response:

$ python Practice.py
55
0 0 2
0 1 2
0 2 1
0 3 1
0 4 0
0 5 0
0 6 0
1 0 2
1 1 2
(1, 1, 2)
 
Look at the second line, it’s telling you that it’s testing the number 55.  All the following lines show the computer (or interpreter) going through the different combinations of Mcnugget packs.  The first line (0, 0, 2) is testing whether 2 twenty packs is equal to 55.  2 twenty packs, or 40 Mcnuggets, is not 55, so the computer will go through the code again.  Each line below the 55, is grouped like this: # of six-packs, # of nine-packs, # of twenty-packs.  So if you looked at the last line, you can see the computer (interpreter) returned with an answer of 1 six pack, 1 nine pack and 2 twenty-packs of Mcnuggets.  With that combination, you can buy 55 Mcnuggets.  This does not mean that support buying fast food, however I am currently sitting across from McDonald's and am starving, so I may make a side trip here soon...    
 
Alright, so that may not make a ton of sense.  It was one of the difficult things that I had to learn, this learning how different looping mechanisms work inside of each other.  I’ll try to explain this by showing you a basic combination of ‘for’ loops.  

for x in range (4):
for y in range (5):
print x, y
 
The code is actually saying, “for each x in range (4): and for each y in range (5):”  
 
X is every number between 0 and 3 (this is because Python is a ‘zero indexed’ language, meaning that all ranges start on zero, and go from there.  In other words, if you ask for a range (4), it’s going to go from 0 to 3).  
 Y is then, subsequently, every number between 0 and 4.  Let’s run a simple ‘for’ loop:

for x in range (4):
print x

If you did this, you would get this range of numbers printed back out at you:

0
1
2
3

However for the loop inside the loop you’re comparing two different ranges.  Going back to the original piece of code, we see that one loop is inside the other loop (or nested).  

for x in range (4):
for y in range (5):
print x, y

Running this code, you get this in response:

0 0
0 1
0 2
0 3
0 4
1 0
1 1
1 2
1 3
1 4
2 0
2 1
2 2
2 3
2 4
3 0
3 1
3 2
3 3
3 4
4 0
4 1
4 2
4 3
4 4

Sorry for show the whole thing, but you get the idea.  This concept, as simple as it seems, is really helpful once you fully understand it.  Think about how much you could compare in order to get the desired combination you needed?  Or any number of other things.

Anyways, there is your little python tutorial for the day (or Python Tut, whatever works).

 

Contemplations of a serious nature

April 29, 2011

 

Some days I can look outside a coffee shop window, and see dreary grey staring me down.  It tells me my hair’s too flat, and my belly too big.  The caffeine talks to me.  It says, “I’m not as strong as I used to be, am I?”

The Vitamin D I take floods my system like a placebo, thus I sit lacking the needed side-effect and stare back at the grey skies.  Fantastic Indie music rains down from the ceiling, increasing the glumness of an Oregon April afternoon.  What is it about indie music that increases my depression some days.  

Did I mention that I stayed up last night crying?

I stayed up all night thinking about escape.  Then I started thinking about suicide, and it started to freak me out.  Over and over again in my head I would think about packing up my backpack and going boxcar hopping.  That or simply disappearing into the local hills coming down only to get food once in a while.  

Have I explained that I’m suffering from depression?  Well, yes, in one of my previous entries I mentioned it, and then wrote this little article about how to keep it from making me productive.  But then yesterday I thought, what do I really want to do with myself that I think will make me happy.  What am I passionate about?  

What am I passionate about anyways?  What can I do that anyone else can’t do better.  All anyone writes about is how it doesn’t matter what others do, and if it’s been done before, because you still need to create.  When my ego shrinks and my feelings become minute imaging anything positive is difficult.  Thinking that my creations make a difference is so incredibly difficult that I curl into a ball and start to bawl.

I am not writing this because I want my friends or family to call me frantically.  I am writing this to show that I contemplated escape.  That such contemplations lead me to thinking about suicide, which is why I ended up on some suicide prevention websites.  Perhaps if more people were willing to talk about contemplating escape or suicide, then such contemplations would be less unacceptable socially to discuss.  Then more people would seek help instead of being afraid to even mention it.  I’ve had several friends attempt suicide.  They are good friends, and luckily they have all survived.  If I don’t talk about this, and be open about it, then I will only sink further into my own internal grief.  

 

Programming In Python Lesson 1

April 28, 2011
The other day I was working on a simple piece of code that would allow me to print something like this:

First Line
 
 
 
Second Line

I know, this looks incredibly basic for those incredibly advanced programmers), but it’s where I’m at.

I wanted to create a piece of code that would allow me to indicate how many spaces I wanted in between the “First Line” and the “Second Line”.  To do so I decided to create a function.  A function, in programming lingo, is a named sequence of statements that preforms a desired operation.  In other words you create a definition for a term like a dictionary creates a definition for a word.  However for programming, this definition doesn’t just sit there on the page or in your mind, like word definitions in dictionaries will do, it does something.  Creating a function is like defining a verb.  You explain the action the word is to take.  “Beating” as in beating a egg, has a certain action prescribed to it.  Here you have the same.  

Below you’ll seem my bit of code.

def newline (x):
y = 0
while x > y:
y = y + 1
print
x = int(raw_input("Please enter in a number:"))
print "First Line"
newline(x)
print "Second Line"

 “Def” is the keyword for definition.  In the first line you can see that I am defining “newline,” which is the name of my function.  The subsequent indented statements are the parameters, or requirements, that I’ve attributed to the action the function ‘newline’ is to take.  The x in that first line of the definition, inside the parenthesis, is the variable.  

While reading this function’s definition, you can see that y must be equal to zero in the beginning.  The while statement creates a loop, so that I can continue to process information until I get the result I’m looking for.  Then, all the while x (my variable) is greater than y I will be doing two other things.  The first is adding 1 to the value of y.  The second is ‘print’ or printing.  This ‘print’ is a keyword, which is a term used in python to issue certain actions.  In that way it’s like a function.  ‘print’ will print a new line.  Sometimes you can choose to put information in this new line, or as with this function, you can choose to enter in nothing.  Therefore ‘print’ satisfies my first wish from this program.  It creates a new blank line.  Now on to the looping mechanism while.

Starting at the beginning of this definition we once again see that y is equal to zero.  So, as shown by the second and third line, as long as x is greater than y then I will be adding 1 to the value of y.  So, starting from the beginning of the function we have this:
  1. The first time I go through this loop y will be equal to zero.  
  2. Then I add 1 to zero.  
  3. The second time I go through it y will be equal to one, then I add 1 to 1.  
  4. The third time y would be equal to 2, and so on.  Anyways, you get the gist of that part.
The last part of the function says simply print, in other words print creates a new line or blank line.  In a way it acts the way pressing the ‘enter’ button does in a Word document.        

def newline (x):
y = 0
while x > y:
y = y + 1
print
x = int(raw_input("Please enter in a number:"))
print "First Line"
newline(x)
print "Second Line"

Once I’ve defined my function I have to write up my final pieces of code.  You can see the code highlighted above.  That is the code that actually runs something.  First I define “x”.  The ‘int’ means I want anything the person puts in to be an integer (or a number that can do number related things).  The second “raw_input” indicates that I want the user to be able to interact with the program, and that in doing so they will input something.  The last is my question I ask the user, “Please enter in a number.”

The last pieces of code ‘print’ simply asks for it to print the string “First Line.”  Then I run the function newline, where I ask the user to input a number.  The number given will determine the amount of empty lines inputted.  

First Line
 
 
 
Second Line

The example above uses the code I have been explaining.  Here the variable x was replaced with the number 3, therefore giving it 3 empty lines of space until “Second Line” was printed.  

Alright, that’s all from me today.  Off to some Curvy madness.   

 

Gimp vs Inkscape

April 27, 2011

 

I’ve found stark differences between Inkscape and Gimp, the two different graphics editing programs that I’m learning.  First off Gimp is more pixel focused, and therefore more helpful in adjusting photographs.  Inkscape is for vector graphics, and is better in terms of scaling (going from an image 128 by 128 pixels, to 500 by 500, back down, and so on).  Therefore for shapes and vectors, it’s the preferred open-source option from what I can tell.  

Gimp, as I’ve read, has been around for years.  I’ve personally found it’s easier to begin using without tutorials, in comparison with Inkscape.  This is partially due to the similarity in organization.  For someone who was used to MS Paint, I’ve found that Gimp seems to organize their different alteration items in the same manner.  Therefore, if you don’t want to read tutorials, Gimp would be the program to start with.  I emphasize this as I’ve found the Gimp tutorials to be difficult to follow.  This particular comment is specific to the tutorials on their website.  Those tutorials make assumptions on where different commands are, and what different things do, assumptions in knowledge types that I don’t currently possess.  It made me do a lot of head scratching, at one point making me worried I had lice...      

Luckily that wasn’t the case.

Now for the other program, Inkscape.  Honestly, for those who like quick key combos on the keyboard, Inkscape tutorials are amazing.  They list it all out along with giving you tons of great simple ways to make your work easier to do.  It’s well put together, and much easier to follow.  It doesn’t have as many pre-created filters as Gimp however, and that is kinda a bummer.  Well, at least at first.  I am quickly falling in love with Inkscape and would recommend it to anyone who wants an open source program to use in computer graphics creation.  However the best combination is using both.  Start with creating your image in Inkscape, export it to a .png, and then edit it further if needed (along with applying various pre-made filters) in Gimp.  Gimp has many more options when it comes to exporting and saving in various file types, which is why I tend to do final editing within it.

One last note.  These were the two main open source graphics editing programs that I’ve found.  I’m always looking for new open source graphics editing programs, as I find it simply intriguing.  Please let me know if you’re aware of any out there I can take a look at.  

      

 

Research = computer games?

April 26, 2011

 

After a week of feeling like utter desolation I’m starting to roll again.  Nothing is better than a bunch of great people offering to meet up for coffee/lunch/because they care.  Not worrying to remind me of how great they think I am, because it’s so intrinsic for them, but simply stating that they want to be here to support me.  It was a wonderful feeling, and I would like to dedicate this post to my friends, who are quite amazing and make my life so great.

I’m now at a point, in helping get this business started, that I’ve done most of the work.  Now I simply have tons of learning to do.  I’ve redone the FlamingLunchbox website, created my blog and done most of the research in order to determine the advertising agencies (aka AdSense, Admob and whatnot else).   In other words, I’ve completed most of the ‘work’ work.  Now it’s all reading and writing.  At least, until a new product is published, which should be soon.  Then it’s all roller-coasters and octopus rides until we get a handle on it all.    

A day riddled with Inkscape tutorials, blogging, perhaps a Tweet or two, and some readings for the MIT course.  It sounds like fun.  This all, of course, shall also be accompanied with physical training, playing the women’s intermediate game, and perhaps some Magicka later tonight? :)

It’s not my fault, Robey purchased it and calls it “research”.

 

She-Ra

April 25, 2011

 

I keep listing that I am the modern She-Ra stereotype.  Perhaps I am more a person who aspires to be one.  And that, in and of itself, states that I am one.

Modern She-Ra Stereotype:
A woman who recognizes her failings, but does not let them hinder her from living life.  A woman who allows herself to need others, and knows that her relations with other people are what make her life more complete.  A woman who aspires to be more than she is, everyday.  A woman who is physically and mentally capable of amazing feats and attempts them consistently.  Someone who can work with others collectively, with passion, to solve problems.  A woman who can be either humble or proud of her accomplishments.    
         

… On another note,
Some days my own self pity makes me sick.
I hate people who are infatuated with their own self pity because they remind me of myself.

 

Links