better living through python

An adventure in programming and recovery.

A year in review

January 06, 2012

 

New Year’s resolutions are nice.  They help you get excited for another year.  You get to review and possibly revise your priorities.  However, I think people don’t do nearly enough of reviewing the awesome things they did the year before.  Celebrating what’s already happened.  In some ways, New Year’s resolutions are exciting because they get you excited for making changes in your life.  Changes that possibly didn’t occur the previous year.  What if everyone also took the time to review what they accomplished and what they were proud of.  It almost feels like that needs to happen first before any re-establishment of this years priorities can occur.

What did I do this past year?  I challenged my perceptions about the world, and myself.  I started out the year by asking myself if I wanted to work in a job that made me extremely unhappy, where I felt like I was being disrespected and degraded.  I realized that I didn’t want to.  

So I changed my life.  I quit my job and started working full-time with Robey on FlamingLunchbox.  I started learning how to program.  I started a blog, which I’ve now written over 180 entries for.  I’ve learned how to use graphic editing programs (mainly Inkscape and Gimp).  I learned how to do HTML, CSS some Javascript and to understand a little jQuery.  I helped to create and market a Kickstarter project, which was later fully funded.  

I am now a partner in a small business.  I’ve learned about how to set up a business, and some of the steps necessary to maintain it.  By no means an expert, but at least I’m starting to get an idea as to how much work it really is, and how satisfying it can be when you make it work.  

I also gained the opportunity to start translating.  I’ve wanted to find a way to incorporate German back into my daily life, and I was very, very lucky to get this.  I feel like my brains on fire, and that my brain is now consequently a phoenix so that I don’t totally loose all brain power.

Regarding my personal life I would say I’ve learned more about forgiveness.  That is a continuous and hard lesson to work on, but it’s made my heart much happier.  I’ve learned how important a good friend can be.  I’ve also learned how to fish, crochet a pineapple pattern, and I’ve canned more food this year than I ever had previously.

What have you done?      
   

 

The Bamboo Capture. Wait....what are you talking about?

December 30, 2011
As I mentioned earlier in the week, Robey purchased me a Bamboo Capture.  What this is, is a little flat tablet shaped device with a stylus.  It allows you to use the stylus as you would a mouse, for either simple movements or for more detailed and focused artwork.  I don’t consider myself able when it comes to drawing.  In all actuality I’m horrible.  So if this makes me a more capable artist, well hell.  I don’t think you could get a better recommendation than that.     
As you can see from the image you have a rectangular tablet, with buttons on the left.  Those buttons act as the button on your mouse, however your stylus also has a toggle button along where your thumb rests.  The toggle button allows for easy click and drag when necessary.  
 
The software that comes with the device has this neat little option for handwriting recognition.  Unfortunately I’m still not used to it enough to finish going though the identification process.  When using my Capture my handwriting looks like a 7 year old’s.  This is mostly due to the fact that I learned to write always resting the side of my hand while using my fore finger and thumb for most of the pressure on the pencil.  As part of awesomeness of this technology is that the pad is ultra sensitive to pressure, the side of my hand totally messes with the recognition on the pad.  You can simply hold the stylus above the pad, but that is still an unnatural feeling for me.  
 
I’ve thought about trying it out with gaming.  I’m a little worried however that I’m so used to mouse/keyboard combinations that the change would be quite a bit of work.  BUT, I’m still going to try it.  I think it might be interesting to see how it works using a pen to play a little Tower Defense.

 

Risk it all

December 30, 2011

 

One of the interesting things I’ve found about the Internet is that there are two different camps out there.  There is a group of people who say they support start-ups or indie gaming businesses (which I would argue are different entities altogether) and actually support them.  Then there is the group that says they support them, but any time they see someone who is learning and may not know what they are doing yet, they have a tendency to be a total jerk.  

I’m not posting this because of personal negative comments I’ve gotten, as many might believe.  I’ve just started to realize how many people out there are afraid of the typical Internet response to anything.  They are afraid of judgement, and thus they don’t act, they don’t try.  They prevent themselves from doing something due to fear, even if it’s something simple like dancing like a maniac in a small area just because they want to dance.  

With FlamingLunchbox I know that Robey and I have made mistakes along the way.  We’ve done our best to do well, to research, and try to make the best decisions.  But, lets face it, if you’re starting something on your own, in a field that doesn’t have a local community college course (or even one that does), you’re going to mess up.  You’re not always going to get it right.  The difference between making it, or at least giving it your best, is by continuing to try even when you make mistakes, are criticized and doubt yourself.
 

I guess what I wanted to start by talking about all of this was that there are so many people out there who supposedly purport to nourish start-up growth.  But what they really do is they choose to only support those who already half know what they’re doing.  Those who are already halfway there, they’re the safe bet.  But that’s not what a small business America is supposed to be about.  What will make a start-up community truly flourish is when people stop caring whether or not the particular start-up may know what they’re doing, but really you should look more towards the passion and effort they exude.  Give people a chance to make something of themselves, even if they have to stumble.  Don’t give up on them.  

People can crash and burn when attempting something great, but they’re not a failure.    Failure is when you don’t even try.  Be willing to crash, be willing to risk yourself entirely.  Most people I know still have parents/family/and friends to fall back on if the worst happens.  We don’t live in a third world country.  

There is no reason

that we can’t attempt to do something great with our lives,

if we really want to.       

 

Quick update on our doings and goings

December 28, 2011

 

It’s been a bit since my last full on blog entry.  Working translation every week is still a bit draining as I do my 4 or 5 hours in the mornings.  Then I allow my afternoon/evenings to be devoted to normal work.  I shouldn’t really be drinking coffee this late in the day, but once the sun goes down I find it difficult to concentrate otherwise.

Lately life has been very stressful for the FlamingLunchbox crew.  Holidays have a tendency to do that, it seems.  Visiting family, not actually able to focus on work for a while, both accentuate normal stresses beyond regular levels simply from the change.  In total we were unable to work for about 5 days.  As we left with some still unfinished projects hanging over our heads, it was perhaps a bit less relaxing than it ought to have been.  It’s difficult when you hope to get particular goals finished by a certain trip date, and unexpected complications crop up.  

To help us to continue to strive and be productive we have defined a couple of New Years resolutions for the upcoming year.  The best part is the moment we returned home we started working on them.  We’ve instituted a work-schedule.  We have to be at our desks at 8 am, even if the work we do is crap for that first hour.  We must stop all work at 7pm.  That makes us focus more on actually getting work done during the time we’ve allotted ourselves.

I briefly discussed that we had started running on a regular basis together.  Breaks always tend to mess with your routine, and it did so with ours.  However we are back, and we started running again today.  We’re only running a mile, but we make sure to do almost every day of the week.  Our New Years resolution is to run everyday, at least a mile and work up as we want to.  It’s not a long distance, and we’re not necessarily pushing hard, but there is something to say about completing a short run each day.  When you look back at what you did, you can always say to yourself...I ran...and then you can smile.

Our last mutual New Years resolution, is to do all of our dishes every evening before we retire for the night.  This may not seem like a lot to those of you who own a microwave or dishwasher, but we have neither.  This means many pots to clean by hand.  If we both simply make sure it happens each night it won’t feel like as much of a chore anymore.  This was greatly inspired by Robey’s parents, as they really have a system down when it comes to cleaning their kitchen each evening.  

I feel like a lot of my own stress was coming from continuously feeling like I wasn’t getting enough done, that the house never seemed clean, and I was never working enough to stay fit.  Add on to that my worry-wart tendencies and I’ve got cancerous sores everywhere....you get the picture.  Cutting it down to three categories that both Robey and I can work on together is going to help us both make the changes we want.  Working from home it’s very difficult to separate your job and play sometimes.  It’s even more difficult when parts of your job is to play.  Oi!

 

Happy Belated Holidays all!

December 27, 2011

 

I’ve been out of town over the weekend with family and friends celebrating the holidays, getting gifts and generally enjoying myself.  Robey purchased me a Bamboo Capture for Christmas.  I’m excited to try it out and see how it can help me with my design work, and general business tasks. Expect updates and notes about it to come.

Regular blog posts resume tomorrow along with more programming.  Although I will be taking a bit of time off again here shortly, as the New Year is my birthday. :)

 

iPhone versus Android icon design requirements

December 21, 2011

 

An interesting difference between the iPhone and Android App application process is the difference in icon and logo requirements.  There are some iPhone design requirements (rounded corners, drop shadow and shine) that are automatically applied to your icons once submitted.  Android design requirements are described in much heavier detail, as they have you create your images based on certain specifications first before upload.  They have you implement the drop shadow yourself.  An interesting difference, however, is that Android in ways allows for more flexibility in image type.  Your icons and logos don’t have to be perfect squares when first submitted.  They can be triangles, or hexagons and so forth on.

While the iPhone visual requirements make their product more streamlined, this does enforce very limited amounts of creativity regarding your product image.  Android, on the other hand, allows for extended creativity and a more varying image in the market.

From my understanding the programming languages are also similar in comparison.  iOS seems to be made more for the use of people who are more experienced in graphical design and display, whereas Android allows for much greater flexibility within the code and seems to be directed more towards programmers.    

Suffice it to say, I’m finishing up the adjustments needed to the iPhone/iPod Touch Curvy icon image requirements.  It always amazes me just how much detail there is regarding some aspects of image creation.  

 

 

People are going to judge you, so don’t worry about it

December 20, 2011
The best thing you can do in life is understand that judgement happens.  Worrying about when and if it happens shouldn’t be on your mind.  You should simply recognize it as a fact, and then get back to whatever it was you were doing.
 
Granted, me saying this doesn’t mean I’m the best at implementing it.  In all honesty I have more problems than the average bear in the worry department.  I worry all the time about how my interactions will affect others, or what I can do to make things better if they go awry.  
 
The sheer amount of how much I worry is so large, I am already fairly certain it means I am going to die younger than I should.  I do my best to mitigate it, but it fairly often feels like a losing battle.

How do I let go of the worry that people are going to judge me?  The best thing I’ve learned, is simply to nip the problem in the bud by doing something about it.  Then if I feel I’ve addressed the expected judgement I’m concerned about, if they still respond negatively it doesn’t get to me.  If anything I just feel sorry for the person not realizing I’m doing my best to work with them.

How do you nip it in the bud?  If you’re concerned that someone is going to judge you for something silly, and perhaps chat about thus stuffs with other people, simply communicate with them about it.  Notice I don’t say confront them.  Confrontation is probably the best way to shut someone up and make them not listen to what you’re saying.  

Find a way to ‘suggest’ to them that they may not be correct in their opinion about you.  If you’re concerned someone may not want to be your friend that you would enjoy a friendship with, send them a facebook message or quick email saying that you would enjoy their company at such and such an event.  Do it in a very laid back way, emphasizing that if you don’t see them it will be sad but that you hope to chat with them in the future.  Making it an email or facebook message, versus a tweet, makes it more personal.  It makes the person feel that you take them seriously, that you are interested in getting to know them better.  

Lastly you have to be honest about all of this.  If you are disingenuous about any of it, it will shine through.  If it really matters to you the other person will know.  

 

What prevents someone from interacting in the political scene?

December 19, 2011

 

Earlier last week I was over obsessing about SOPA.  I posted about it on twitter at least 2 to 3 times, and many more on my facebook account.  As always Twitter responds with interest, but those on my facebook account, for the most part, simply ignored it.  Why would someone not want to get involved in this?  At the very least they could sign a petition or call their representative.  

I was really disappointed in the overall amount of interaction.  There are so many people I know to whom the effects of SOPA would be important.  I honestly can’t understand why people wouldn’t at least email their representative.  After thinking about it for a while I came up with two main reasons.  One, they think that interacting with SOPA at all will get them somehow labeled as an Internet pirate.  Two, they don’t want to make the effort.

Number one seems simply....well, for lack of a better word, retarded.  If you don’t support SOPA  it doesn’t make you an Internet Pirate.  That is simply the rhetoric of those who support it.  That’s what THEY want you to think.

Number two, well, I thought the Internet made the second reason pretty much obsolete.  Prior to email and the ‘Interwebs’, interacting in the political scene meant going somewhere to sign a petition, and calling or sending letters to your representative.  Now you can simply see a link to a petition or an automatic email generator and you can take part.  You can make your voice be known at the click of a button.  This cuts down the time and effort drastically, and one would think the increase in political activity would have been fairly noticeable.  

One of the things I always find funny is when people joke about how full their email inbox is.  How much email they get, and how they it just keeps piling up.  An inbox can handle thousands of pieces of email, but should it?  Isn’t letting your email pile up just like piling up unpaid bills?  Half of the paperwork you get mailed is probably just printed copies of online transactions when you paid online.    

What’s the important factor here?  As the means become easier to communicate, so does the communication increase.  That means that instead of people taking their time to write a well thought out letter, or input all the necessary details in a bank statement, you’re getting minute by minute updates.  Thus thousands of emails sitting in your inbox.  But along with those thousands of emails is thousands of easily sortable pieces of information.  We always know when certain emails are worth our time to look at more, or if others are simply notifications.  It’s easy to simply shuttle them off into organization files in your Inbox, keep them Unread, and take care of sections all at once.  

Anyways, yes, you can keep your inbox clean.  Stop trying to convince yourself of otherwise.  Organizing your inbox will do your brain a world of good when you more easily process the information your receiving.  

But, once again, how does this pertain to political interaction?  Just as so many people hesitate to sort their inbox, so many people can’t find it in them to click on a button.  What if these people are trying to scam them into signing something they actually don’t agree with?  Most often people simply feel they don’t know enough to make that decision.  They are simply too busy with other things in their life, and have moved political involvement to the bottom of their ToDo list.  

What does this mean?  What am I trying to get at?  Keep your inbox clean, respond sooner to things, don’t put it off.  If you don’t beat around the bush at doing things, then you’ll actually find you have the time to do the things you want to do, like be happy and crochet.  Or to tell your Representative to vote NO on SOPA.

 

No SOPA!

December 15, 2011

No entry today, I've been much too busy listening to the government proceedings regarding SOPA, and have been unable to do anything else.  If you don't know much about SOPA, you can learn more about it here: Keepthewebopen.

Why does creating a pause effect in Javascipt seem so difficult?

December 14, 2011

 

Lately I’ve had two main goals I’ve been working on for my Science Fiction Tower Power game.  Okay, the name is long, I know.  I’m just going to call it Tower Power from now on in passing.  Continuing on, I’ve had two main goals.  Number one, I’ve been working on creating a drop down menu for people to access when they want to set their difficultly level and problem type.  Secondly I want to create a pause function within the game, so someone can tap the space bar and walk away for a bit and come back without loosing where they are.  

As I’ve mentioned before I want to be able to provide statistics and print outs for my nieces and nephews so they can show the work they’ve done on the site.  In order to do so I need to make sure that they have time to pick out the type of problem they want to do, and the difficultly level.  Once I had almost finished my drop down menu I realized that even though someone could access the menu, the ships were still moving and didn’t stop moving.  Therefore a person would have to select their preferences quickly or else all would be lost.  

This made me realize the need for the second aspect, the need for a pause function within the code.  To start with I have to explain how our javascript creates moving objects on the screen.  You see, in order for objects to seem animated they need to recognize time within the code.  This means you have to import time, and you have keep track of it within a function.  To do this we created a function called tick().  

This function is recursive, which means it calls itself (albeit with a delay).  Thus tick() will continuously keep track of the time.  Tick() also runs a whole lot of other code.  In this code we have to run everything that has to be checked every second the game is running.  Some examples of that are: making the ships move across the screen, whether or not a problem has been solved, if that problem was solved correctly, whether or not the player has won the game.  

In order to pause the game, I had to learn all the places that tick() is called, and learn how to stop it or start it as needed.  I also had to learn how to identify that space bar had been pressed.  Coincidentally, this is the code needed to identify that space bar has been pressed.  

 

$(window).keypress(function(e) {
   if(e.keyCode == 32) {
      YOUR CODE GOES HERE 
   }
});

 


First off jQuery functions are identified by the $ in front of them.  Keypress indicates you’re looking for a key press type event.  Next you must to determine what kind of key you’ve pressed.  Each key on the keyboard is identified by a number, which is referred to as a keyCode here in the code.  To discern the keyCode you can use the jQuery function in their documentation which provides it for you.  The double == is javascript syntax verifying if it equals something.  You’ll sometimes see a triple === in javascript.  This is the javascript syntax verifying equality of both values and object types.  If you hadn’t notice the syntax is very different from python and it definitely took some getting used to.  

Also, to note, it’s 11 days til Christmas....more freaking out is had.

Up Next Time: What to do once you know you’ve pressed the space bar   

 

Links